Submit a report
curl --request POST \
--url https://api.onkernel.com/reports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"evidence": "Booking confirmation appeared",
"result": "succeeded"
},
"task_id": "<string>",
"type": "task.result",
"occurred_at": "2023-11-07T05:31:56Z",
"schema_version": 2,
"session_id": "<string>"
}
'import requests
url = "https://api.onkernel.com/reports"
payload = {
"data": {
"evidence": "Booking confirmation appeared",
"result": "succeeded"
},
"task_id": "<string>",
"type": "task.result",
"occurred_at": "2023-11-07T05:31:56Z",
"schema_version": 2,
"session_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: {evidence: 'Booking confirmation appeared', result: 'succeeded'},
task_id: '<string>',
type: 'task.result',
occurred_at: '2023-11-07T05:31:56Z',
schema_version: 2,
session_id: '<string>'
})
};
fetch('https://api.onkernel.com/reports', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.onkernel.com/reports",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'evidence' => 'Booking confirmation appeared',
'result' => 'succeeded'
],
'task_id' => '<string>',
'type' => 'task.result',
'occurred_at' => '2023-11-07T05:31:56Z',
'schema_version' => 2,
'session_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.onkernel.com/reports"
payload := strings.NewReader("{\n \"data\": {\n \"evidence\": \"Booking confirmation appeared\",\n \"result\": \"succeeded\"\n },\n \"task_id\": \"<string>\",\n \"type\": \"task.result\",\n \"occurred_at\": \"2023-11-07T05:31:56Z\",\n \"schema_version\": 2,\n \"session_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.onkernel.com/reports")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"evidence\": \"Booking confirmation appeared\",\n \"result\": \"succeeded\"\n },\n \"task_id\": \"<string>\",\n \"type\": \"task.result\",\n \"occurred_at\": \"2023-11-07T05:31:56Z\",\n \"schema_version\": 2,\n \"session_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onkernel.com/reports")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"evidence\": \"Booking confirmation appeared\",\n \"result\": \"succeeded\"\n },\n \"task_id\": \"<string>\",\n \"type\": \"task.result\",\n \"occurred_at\": \"2023-11-07T05:31:56Z\",\n \"schema_version\": 2,\n \"session_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"data": {},
"id": "<string>",
"occurred_at": "2023-11-07T05:31:56Z",
"schema_version": 123,
"task_id": "<string>",
"type": "task.result",
"session_id": "<string>"
}{
"created_at": "2023-11-07T05:31:56Z",
"data": {},
"id": "<string>",
"occurred_at": "2023-11-07T05:31:56Z",
"schema_version": 123,
"task_id": "<string>",
"type": "task.result",
"session_id": "<string>"
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
},
"unsupported_fields": [
"<string>"
]
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
},
"unsupported_fields": [
"<string>"
]
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
},
"unsupported_fields": [
"<string>"
]
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
},
"unsupported_fields": [
"<string>"
]
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
},
"unsupported_fields": [
"<string>"
]
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
},
"unsupported_fields": [
"<string>"
]
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
},
"unsupported_fields": [
"<string>"
]
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
},
"unsupported_fields": [
"<string>"
]
}Reports
Submit a report
Submit a typed report against a task. The data is validated against the report type’s schema; a validation failure returns 400 with one detail per invalid field. A task can have at most 500 reports.
POST
/
reports
Submit a report
curl --request POST \
--url https://api.onkernel.com/reports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"evidence": "Booking confirmation appeared",
"result": "succeeded"
},
"task_id": "<string>",
"type": "task.result",
"occurred_at": "2023-11-07T05:31:56Z",
"schema_version": 2,
"session_id": "<string>"
}
'import requests
url = "https://api.onkernel.com/reports"
payload = {
"data": {
"evidence": "Booking confirmation appeared",
"result": "succeeded"
},
"task_id": "<string>",
"type": "task.result",
"occurred_at": "2023-11-07T05:31:56Z",
"schema_version": 2,
"session_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: {evidence: 'Booking confirmation appeared', result: 'succeeded'},
task_id: '<string>',
type: 'task.result',
occurred_at: '2023-11-07T05:31:56Z',
schema_version: 2,
session_id: '<string>'
})
};
fetch('https://api.onkernel.com/reports', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.onkernel.com/reports",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'evidence' => 'Booking confirmation appeared',
'result' => 'succeeded'
],
'task_id' => '<string>',
'type' => 'task.result',
'occurred_at' => '2023-11-07T05:31:56Z',
'schema_version' => 2,
'session_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.onkernel.com/reports"
payload := strings.NewReader("{\n \"data\": {\n \"evidence\": \"Booking confirmation appeared\",\n \"result\": \"succeeded\"\n },\n \"task_id\": \"<string>\",\n \"type\": \"task.result\",\n \"occurred_at\": \"2023-11-07T05:31:56Z\",\n \"schema_version\": 2,\n \"session_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.onkernel.com/reports")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"evidence\": \"Booking confirmation appeared\",\n \"result\": \"succeeded\"\n },\n \"task_id\": \"<string>\",\n \"type\": \"task.result\",\n \"occurred_at\": \"2023-11-07T05:31:56Z\",\n \"schema_version\": 2,\n \"session_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onkernel.com/reports")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"evidence\": \"Booking confirmation appeared\",\n \"result\": \"succeeded\"\n },\n \"task_id\": \"<string>\",\n \"type\": \"task.result\",\n \"occurred_at\": \"2023-11-07T05:31:56Z\",\n \"schema_version\": 2,\n \"session_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"data": {},
"id": "<string>",
"occurred_at": "2023-11-07T05:31:56Z",
"schema_version": 123,
"task_id": "<string>",
"type": "task.result",
"session_id": "<string>"
}{
"created_at": "2023-11-07T05:31:56Z",
"data": {},
"id": "<string>",
"occurred_at": "2023-11-07T05:31:56Z",
"schema_version": 123,
"task_id": "<string>",
"type": "task.result",
"session_id": "<string>"
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
},
"unsupported_fields": [
"<string>"
]
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
},
"unsupported_fields": [
"<string>"
]
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
},
"unsupported_fields": [
"<string>"
]
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
},
"unsupported_fields": [
"<string>"
]
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
},
"unsupported_fields": [
"<string>"
]
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
},
"unsupported_fields": [
"<string>"
]
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
},
"unsupported_fields": [
"<string>"
]
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
},
"unsupported_fields": [
"<string>"
]
}Authorizations
Headers
Makes retrying the create safe. A retry with the same key and the same request returns the record the first call created, with status 200, instead of creating another. Reusing a key with a different request returns 422. Keys are scoped to the project and do not expire. The Kernel SDKs send a key automatically and reuse it when they retry.
Required string length:
1 - 255Body
application/json
Request body for submitting a report.
Response
Report previously submitted with the same Idempotency-Key and request
A typed, schema-validated report an agent submitted against a task. Reports are immutable.