curl --request POST \
--url https://api.recursion.labelbox.com/managed-agents/v1/sessions/{sessionId}/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"actor": "<string>",
"events": [
{
"actor": "<string>",
"content": [
{
"byte_size": 0,
"content": [
{
"byte_size": 0,
"content": "<array>",
"context": "<string>",
"data": "<string>",
"encrypted_content": "<string>",
"height": 0,
"id": "<string>",
"input": {},
"is_error": true,
"media_type": "<string>",
"name": "<string>",
"omitted_bytes": 0,
"payload": true,
"provider": "<string>",
"provider_payload": true,
"redacted": true,
"semantic_hint": "<string>",
"sha256": "<string>",
"signature": "<string>",
"summary": "<array>",
"text": "<string>",
"title": "<string>",
"tool_use_id": "<string>",
"type": "<string>",
"uri": "<string>",
"width": 0
}
],
"context": "<string>",
"data": "<string>",
"encrypted_content": "<string>",
"height": 0,
"id": "<string>",
"input": {},
"is_error": true,
"media_type": "<string>",
"name": "<string>",
"omitted_bytes": 0,
"payload": true,
"provider": "<string>",
"provider_payload": true,
"redacted": true,
"semantic_hint": "<string>",
"sha256": "<string>",
"signature": "<string>",
"summary": [
{
"byte_size": 0,
"content": "<array>",
"context": "<string>",
"data": "<string>",
"encrypted_content": "<string>",
"height": 0,
"id": "<string>",
"input": {},
"is_error": true,
"media_type": "<string>",
"name": "<string>",
"omitted_bytes": 0,
"payload": true,
"provider": "<string>",
"provider_payload": true,
"redacted": true,
"semantic_hint": "<string>",
"sha256": "<string>",
"signature": "<string>",
"summary": "<array>",
"text": "<string>",
"title": "<string>",
"tool_use_id": "<string>",
"type": "<string>",
"uri": "<string>",
"width": 0
}
],
"text": "<string>",
"title": "<string>",
"tool_use_id": "<string>",
"type": "<string>",
"uri": "<string>",
"width": 0
}
],
"handoff_id": "<string>",
"note": "<string>",
"text": "<string>"
}
],
"message": "<string>",
"referenced_session_ids": [
"<string>"
]
}
'import requests
url = "https://api.recursion.labelbox.com/managed-agents/v1/sessions/{sessionId}/events"
payload = {
"actor": "<string>",
"events": [
{
"actor": "<string>",
"content": [
{
"byte_size": 0,
"content": [
{
"byte_size": 0,
"content": "<array>",
"context": "<string>",
"data": "<string>",
"encrypted_content": "<string>",
"height": 0,
"id": "<string>",
"input": {},
"is_error": True,
"media_type": "<string>",
"name": "<string>",
"omitted_bytes": 0,
"payload": True,
"provider": "<string>",
"provider_payload": True,
"redacted": True,
"semantic_hint": "<string>",
"sha256": "<string>",
"signature": "<string>",
"summary": "<array>",
"text": "<string>",
"title": "<string>",
"tool_use_id": "<string>",
"type": "<string>",
"uri": "<string>",
"width": 0
}
],
"context": "<string>",
"data": "<string>",
"encrypted_content": "<string>",
"height": 0,
"id": "<string>",
"input": {},
"is_error": True,
"media_type": "<string>",
"name": "<string>",
"omitted_bytes": 0,
"payload": True,
"provider": "<string>",
"provider_payload": True,
"redacted": True,
"semantic_hint": "<string>",
"sha256": "<string>",
"signature": "<string>",
"summary": [
{
"byte_size": 0,
"content": "<array>",
"context": "<string>",
"data": "<string>",
"encrypted_content": "<string>",
"height": 0,
"id": "<string>",
"input": {},
"is_error": True,
"media_type": "<string>",
"name": "<string>",
"omitted_bytes": 0,
"payload": True,
"provider": "<string>",
"provider_payload": True,
"redacted": True,
"semantic_hint": "<string>",
"sha256": "<string>",
"signature": "<string>",
"summary": "<array>",
"text": "<string>",
"title": "<string>",
"tool_use_id": "<string>",
"type": "<string>",
"uri": "<string>",
"width": 0
}
],
"text": "<string>",
"title": "<string>",
"tool_use_id": "<string>",
"type": "<string>",
"uri": "<string>",
"width": 0
}
],
"handoff_id": "<string>",
"note": "<string>",
"text": "<string>"
}
],
"message": "<string>",
"referenced_session_ids": ["<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({
actor: '<string>',
events: [
{
actor: '<string>',
content: [
{
byte_size: 0,
content: [
{
byte_size: 0,
content: '<array>',
context: '<string>',
data: '<string>',
encrypted_content: '<string>',
height: 0,
id: '<string>',
input: {},
is_error: true,
media_type: '<string>',
name: '<string>',
omitted_bytes: 0,
payload: true,
provider: '<string>',
provider_payload: true,
redacted: true,
semantic_hint: '<string>',
sha256: '<string>',
signature: '<string>',
summary: '<array>',
text: '<string>',
title: '<string>',
tool_use_id: '<string>',
type: '<string>',
uri: '<string>',
width: 0
}
],
context: '<string>',
data: '<string>',
encrypted_content: '<string>',
height: 0,
id: '<string>',
input: {},
is_error: true,
media_type: '<string>',
name: '<string>',
omitted_bytes: 0,
payload: true,
provider: '<string>',
provider_payload: true,
redacted: true,
semantic_hint: '<string>',
sha256: '<string>',
signature: '<string>',
summary: [
{
byte_size: 0,
content: '<array>',
context: '<string>',
data: '<string>',
encrypted_content: '<string>',
height: 0,
id: '<string>',
input: {},
is_error: true,
media_type: '<string>',
name: '<string>',
omitted_bytes: 0,
payload: true,
provider: '<string>',
provider_payload: true,
redacted: true,
semantic_hint: '<string>',
sha256: '<string>',
signature: '<string>',
summary: '<array>',
text: '<string>',
title: '<string>',
tool_use_id: '<string>',
type: '<string>',
uri: '<string>',
width: 0
}
],
text: '<string>',
title: '<string>',
tool_use_id: '<string>',
type: '<string>',
uri: '<string>',
width: 0
}
],
handoff_id: '<string>',
note: '<string>',
text: '<string>'
}
],
message: '<string>',
referenced_session_ids: ['<string>']
})
};
fetch('https://api.recursion.labelbox.com/managed-agents/v1/sessions/{sessionId}/events', 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.recursion.labelbox.com/managed-agents/v1/sessions/{sessionId}/events",
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([
'actor' => '<string>',
'events' => [
[
'actor' => '<string>',
'content' => [
[
'byte_size' => 0,
'content' => [
[
'byte_size' => 0,
'content' => '<array>',
'context' => '<string>',
'data' => '<string>',
'encrypted_content' => '<string>',
'height' => 0,
'id' => '<string>',
'input' => [
],
'is_error' => true,
'media_type' => '<string>',
'name' => '<string>',
'omitted_bytes' => 0,
'payload' => true,
'provider' => '<string>',
'provider_payload' => true,
'redacted' => true,
'semantic_hint' => '<string>',
'sha256' => '<string>',
'signature' => '<string>',
'summary' => '<array>',
'text' => '<string>',
'title' => '<string>',
'tool_use_id' => '<string>',
'type' => '<string>',
'uri' => '<string>',
'width' => 0
]
],
'context' => '<string>',
'data' => '<string>',
'encrypted_content' => '<string>',
'height' => 0,
'id' => '<string>',
'input' => [
],
'is_error' => true,
'media_type' => '<string>',
'name' => '<string>',
'omitted_bytes' => 0,
'payload' => true,
'provider' => '<string>',
'provider_payload' => true,
'redacted' => true,
'semantic_hint' => '<string>',
'sha256' => '<string>',
'signature' => '<string>',
'summary' => [
[
'byte_size' => 0,
'content' => '<array>',
'context' => '<string>',
'data' => '<string>',
'encrypted_content' => '<string>',
'height' => 0,
'id' => '<string>',
'input' => [
],
'is_error' => true,
'media_type' => '<string>',
'name' => '<string>',
'omitted_bytes' => 0,
'payload' => true,
'provider' => '<string>',
'provider_payload' => true,
'redacted' => true,
'semantic_hint' => '<string>',
'sha256' => '<string>',
'signature' => '<string>',
'summary' => '<array>',
'text' => '<string>',
'title' => '<string>',
'tool_use_id' => '<string>',
'type' => '<string>',
'uri' => '<string>',
'width' => 0
]
],
'text' => '<string>',
'title' => '<string>',
'tool_use_id' => '<string>',
'type' => '<string>',
'uri' => '<string>',
'width' => 0
]
],
'handoff_id' => '<string>',
'note' => '<string>',
'text' => '<string>'
]
],
'message' => '<string>',
'referenced_session_ids' => [
'<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.recursion.labelbox.com/managed-agents/v1/sessions/{sessionId}/events"
payload := strings.NewReader("{\n \"actor\": \"<string>\",\n \"events\": [\n {\n \"actor\": \"<string>\",\n \"content\": [\n {\n \"byte_size\": 0,\n \"content\": [\n {\n \"byte_size\": 0,\n \"content\": \"<array>\",\n \"context\": \"<string>\",\n \"data\": \"<string>\",\n \"encrypted_content\": \"<string>\",\n \"height\": 0,\n \"id\": \"<string>\",\n \"input\": {},\n \"is_error\": true,\n \"media_type\": \"<string>\",\n \"name\": \"<string>\",\n \"omitted_bytes\": 0,\n \"payload\": true,\n \"provider\": \"<string>\",\n \"provider_payload\": true,\n \"redacted\": true,\n \"semantic_hint\": \"<string>\",\n \"sha256\": \"<string>\",\n \"signature\": \"<string>\",\n \"summary\": \"<array>\",\n \"text\": \"<string>\",\n \"title\": \"<string>\",\n \"tool_use_id\": \"<string>\",\n \"type\": \"<string>\",\n \"uri\": \"<string>\",\n \"width\": 0\n }\n ],\n \"context\": \"<string>\",\n \"data\": \"<string>\",\n \"encrypted_content\": \"<string>\",\n \"height\": 0,\n \"id\": \"<string>\",\n \"input\": {},\n \"is_error\": true,\n \"media_type\": \"<string>\",\n \"name\": \"<string>\",\n \"omitted_bytes\": 0,\n \"payload\": true,\n \"provider\": \"<string>\",\n \"provider_payload\": true,\n \"redacted\": true,\n \"semantic_hint\": \"<string>\",\n \"sha256\": \"<string>\",\n \"signature\": \"<string>\",\n \"summary\": [\n {\n \"byte_size\": 0,\n \"content\": \"<array>\",\n \"context\": \"<string>\",\n \"data\": \"<string>\",\n \"encrypted_content\": \"<string>\",\n \"height\": 0,\n \"id\": \"<string>\",\n \"input\": {},\n \"is_error\": true,\n \"media_type\": \"<string>\",\n \"name\": \"<string>\",\n \"omitted_bytes\": 0,\n \"payload\": true,\n \"provider\": \"<string>\",\n \"provider_payload\": true,\n \"redacted\": true,\n \"semantic_hint\": \"<string>\",\n \"sha256\": \"<string>\",\n \"signature\": \"<string>\",\n \"summary\": \"<array>\",\n \"text\": \"<string>\",\n \"title\": \"<string>\",\n \"tool_use_id\": \"<string>\",\n \"type\": \"<string>\",\n \"uri\": \"<string>\",\n \"width\": 0\n }\n ],\n \"text\": \"<string>\",\n \"title\": \"<string>\",\n \"tool_use_id\": \"<string>\",\n \"type\": \"<string>\",\n \"uri\": \"<string>\",\n \"width\": 0\n }\n ],\n \"handoff_id\": \"<string>\",\n \"note\": \"<string>\",\n \"text\": \"<string>\"\n }\n ],\n \"message\": \"<string>\",\n \"referenced_session_ids\": [\n \"<string>\"\n ]\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.recursion.labelbox.com/managed-agents/v1/sessions/{sessionId}/events")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"actor\": \"<string>\",\n \"events\": [\n {\n \"actor\": \"<string>\",\n \"content\": [\n {\n \"byte_size\": 0,\n \"content\": [\n {\n \"byte_size\": 0,\n \"content\": \"<array>\",\n \"context\": \"<string>\",\n \"data\": \"<string>\",\n \"encrypted_content\": \"<string>\",\n \"height\": 0,\n \"id\": \"<string>\",\n \"input\": {},\n \"is_error\": true,\n \"media_type\": \"<string>\",\n \"name\": \"<string>\",\n \"omitted_bytes\": 0,\n \"payload\": true,\n \"provider\": \"<string>\",\n \"provider_payload\": true,\n \"redacted\": true,\n \"semantic_hint\": \"<string>\",\n \"sha256\": \"<string>\",\n \"signature\": \"<string>\",\n \"summary\": \"<array>\",\n \"text\": \"<string>\",\n \"title\": \"<string>\",\n \"tool_use_id\": \"<string>\",\n \"type\": \"<string>\",\n \"uri\": \"<string>\",\n \"width\": 0\n }\n ],\n \"context\": \"<string>\",\n \"data\": \"<string>\",\n \"encrypted_content\": \"<string>\",\n \"height\": 0,\n \"id\": \"<string>\",\n \"input\": {},\n \"is_error\": true,\n \"media_type\": \"<string>\",\n \"name\": \"<string>\",\n \"omitted_bytes\": 0,\n \"payload\": true,\n \"provider\": \"<string>\",\n \"provider_payload\": true,\n \"redacted\": true,\n \"semantic_hint\": \"<string>\",\n \"sha256\": \"<string>\",\n \"signature\": \"<string>\",\n \"summary\": [\n {\n \"byte_size\": 0,\n \"content\": \"<array>\",\n \"context\": \"<string>\",\n \"data\": \"<string>\",\n \"encrypted_content\": \"<string>\",\n \"height\": 0,\n \"id\": \"<string>\",\n \"input\": {},\n \"is_error\": true,\n \"media_type\": \"<string>\",\n \"name\": \"<string>\",\n \"omitted_bytes\": 0,\n \"payload\": true,\n \"provider\": \"<string>\",\n \"provider_payload\": true,\n \"redacted\": true,\n \"semantic_hint\": \"<string>\",\n \"sha256\": \"<string>\",\n \"signature\": \"<string>\",\n \"summary\": \"<array>\",\n \"text\": \"<string>\",\n \"title\": \"<string>\",\n \"tool_use_id\": \"<string>\",\n \"type\": \"<string>\",\n \"uri\": \"<string>\",\n \"width\": 0\n }\n ],\n \"text\": \"<string>\",\n \"title\": \"<string>\",\n \"tool_use_id\": \"<string>\",\n \"type\": \"<string>\",\n \"uri\": \"<string>\",\n \"width\": 0\n }\n ],\n \"handoff_id\": \"<string>\",\n \"note\": \"<string>\",\n \"text\": \"<string>\"\n }\n ],\n \"message\": \"<string>\",\n \"referenced_session_ids\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.recursion.labelbox.com/managed-agents/v1/sessions/{sessionId}/events")
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 \"actor\": \"<string>\",\n \"events\": [\n {\n \"actor\": \"<string>\",\n \"content\": [\n {\n \"byte_size\": 0,\n \"content\": [\n {\n \"byte_size\": 0,\n \"content\": \"<array>\",\n \"context\": \"<string>\",\n \"data\": \"<string>\",\n \"encrypted_content\": \"<string>\",\n \"height\": 0,\n \"id\": \"<string>\",\n \"input\": {},\n \"is_error\": true,\n \"media_type\": \"<string>\",\n \"name\": \"<string>\",\n \"omitted_bytes\": 0,\n \"payload\": true,\n \"provider\": \"<string>\",\n \"provider_payload\": true,\n \"redacted\": true,\n \"semantic_hint\": \"<string>\",\n \"sha256\": \"<string>\",\n \"signature\": \"<string>\",\n \"summary\": \"<array>\",\n \"text\": \"<string>\",\n \"title\": \"<string>\",\n \"tool_use_id\": \"<string>\",\n \"type\": \"<string>\",\n \"uri\": \"<string>\",\n \"width\": 0\n }\n ],\n \"context\": \"<string>\",\n \"data\": \"<string>\",\n \"encrypted_content\": \"<string>\",\n \"height\": 0,\n \"id\": \"<string>\",\n \"input\": {},\n \"is_error\": true,\n \"media_type\": \"<string>\",\n \"name\": \"<string>\",\n \"omitted_bytes\": 0,\n \"payload\": true,\n \"provider\": \"<string>\",\n \"provider_payload\": true,\n \"redacted\": true,\n \"semantic_hint\": \"<string>\",\n \"sha256\": \"<string>\",\n \"signature\": \"<string>\",\n \"summary\": [\n {\n \"byte_size\": 0,\n \"content\": \"<array>\",\n \"context\": \"<string>\",\n \"data\": \"<string>\",\n \"encrypted_content\": \"<string>\",\n \"height\": 0,\n \"id\": \"<string>\",\n \"input\": {},\n \"is_error\": true,\n \"media_type\": \"<string>\",\n \"name\": \"<string>\",\n \"omitted_bytes\": 0,\n \"payload\": true,\n \"provider\": \"<string>\",\n \"provider_payload\": true,\n \"redacted\": true,\n \"semantic_hint\": \"<string>\",\n \"sha256\": \"<string>\",\n \"signature\": \"<string>\",\n \"summary\": \"<array>\",\n \"text\": \"<string>\",\n \"title\": \"<string>\",\n \"tool_use_id\": \"<string>\",\n \"type\": \"<string>\",\n \"uri\": \"<string>\",\n \"width\": 0\n }\n ],\n \"text\": \"<string>\",\n \"title\": \"<string>\",\n \"tool_use_id\": \"<string>\",\n \"type\": \"<string>\",\n \"uri\": \"<string>\",\n \"width\": 0\n }\n ],\n \"handoff_id\": \"<string>\",\n \"note\": \"<string>\",\n \"text\": \"<string>\"\n }\n ],\n \"message\": \"<string>\",\n \"referenced_session_ids\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"delivery_state": "stored",
"events_accepted": 0,
"ok": true
}{
"code": "invalid_json",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "unauthorized",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "forbidden",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "not_found",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "conflict",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "payload_too_large",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "unsupported_media_type",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "handoff_access_unsupported",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "rate_limit_exceeded",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "internal_error",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "bad_gateway",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "content_store_unavailable",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "gateway_timeout",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}Append user/system events to a session
curl --request POST \
--url https://api.recursion.labelbox.com/managed-agents/v1/sessions/{sessionId}/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"actor": "<string>",
"events": [
{
"actor": "<string>",
"content": [
{
"byte_size": 0,
"content": [
{
"byte_size": 0,
"content": "<array>",
"context": "<string>",
"data": "<string>",
"encrypted_content": "<string>",
"height": 0,
"id": "<string>",
"input": {},
"is_error": true,
"media_type": "<string>",
"name": "<string>",
"omitted_bytes": 0,
"payload": true,
"provider": "<string>",
"provider_payload": true,
"redacted": true,
"semantic_hint": "<string>",
"sha256": "<string>",
"signature": "<string>",
"summary": "<array>",
"text": "<string>",
"title": "<string>",
"tool_use_id": "<string>",
"type": "<string>",
"uri": "<string>",
"width": 0
}
],
"context": "<string>",
"data": "<string>",
"encrypted_content": "<string>",
"height": 0,
"id": "<string>",
"input": {},
"is_error": true,
"media_type": "<string>",
"name": "<string>",
"omitted_bytes": 0,
"payload": true,
"provider": "<string>",
"provider_payload": true,
"redacted": true,
"semantic_hint": "<string>",
"sha256": "<string>",
"signature": "<string>",
"summary": [
{
"byte_size": 0,
"content": "<array>",
"context": "<string>",
"data": "<string>",
"encrypted_content": "<string>",
"height": 0,
"id": "<string>",
"input": {},
"is_error": true,
"media_type": "<string>",
"name": "<string>",
"omitted_bytes": 0,
"payload": true,
"provider": "<string>",
"provider_payload": true,
"redacted": true,
"semantic_hint": "<string>",
"sha256": "<string>",
"signature": "<string>",
"summary": "<array>",
"text": "<string>",
"title": "<string>",
"tool_use_id": "<string>",
"type": "<string>",
"uri": "<string>",
"width": 0
}
],
"text": "<string>",
"title": "<string>",
"tool_use_id": "<string>",
"type": "<string>",
"uri": "<string>",
"width": 0
}
],
"handoff_id": "<string>",
"note": "<string>",
"text": "<string>"
}
],
"message": "<string>",
"referenced_session_ids": [
"<string>"
]
}
'import requests
url = "https://api.recursion.labelbox.com/managed-agents/v1/sessions/{sessionId}/events"
payload = {
"actor": "<string>",
"events": [
{
"actor": "<string>",
"content": [
{
"byte_size": 0,
"content": [
{
"byte_size": 0,
"content": "<array>",
"context": "<string>",
"data": "<string>",
"encrypted_content": "<string>",
"height": 0,
"id": "<string>",
"input": {},
"is_error": True,
"media_type": "<string>",
"name": "<string>",
"omitted_bytes": 0,
"payload": True,
"provider": "<string>",
"provider_payload": True,
"redacted": True,
"semantic_hint": "<string>",
"sha256": "<string>",
"signature": "<string>",
"summary": "<array>",
"text": "<string>",
"title": "<string>",
"tool_use_id": "<string>",
"type": "<string>",
"uri": "<string>",
"width": 0
}
],
"context": "<string>",
"data": "<string>",
"encrypted_content": "<string>",
"height": 0,
"id": "<string>",
"input": {},
"is_error": True,
"media_type": "<string>",
"name": "<string>",
"omitted_bytes": 0,
"payload": True,
"provider": "<string>",
"provider_payload": True,
"redacted": True,
"semantic_hint": "<string>",
"sha256": "<string>",
"signature": "<string>",
"summary": [
{
"byte_size": 0,
"content": "<array>",
"context": "<string>",
"data": "<string>",
"encrypted_content": "<string>",
"height": 0,
"id": "<string>",
"input": {},
"is_error": True,
"media_type": "<string>",
"name": "<string>",
"omitted_bytes": 0,
"payload": True,
"provider": "<string>",
"provider_payload": True,
"redacted": True,
"semantic_hint": "<string>",
"sha256": "<string>",
"signature": "<string>",
"summary": "<array>",
"text": "<string>",
"title": "<string>",
"tool_use_id": "<string>",
"type": "<string>",
"uri": "<string>",
"width": 0
}
],
"text": "<string>",
"title": "<string>",
"tool_use_id": "<string>",
"type": "<string>",
"uri": "<string>",
"width": 0
}
],
"handoff_id": "<string>",
"note": "<string>",
"text": "<string>"
}
],
"message": "<string>",
"referenced_session_ids": ["<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({
actor: '<string>',
events: [
{
actor: '<string>',
content: [
{
byte_size: 0,
content: [
{
byte_size: 0,
content: '<array>',
context: '<string>',
data: '<string>',
encrypted_content: '<string>',
height: 0,
id: '<string>',
input: {},
is_error: true,
media_type: '<string>',
name: '<string>',
omitted_bytes: 0,
payload: true,
provider: '<string>',
provider_payload: true,
redacted: true,
semantic_hint: '<string>',
sha256: '<string>',
signature: '<string>',
summary: '<array>',
text: '<string>',
title: '<string>',
tool_use_id: '<string>',
type: '<string>',
uri: '<string>',
width: 0
}
],
context: '<string>',
data: '<string>',
encrypted_content: '<string>',
height: 0,
id: '<string>',
input: {},
is_error: true,
media_type: '<string>',
name: '<string>',
omitted_bytes: 0,
payload: true,
provider: '<string>',
provider_payload: true,
redacted: true,
semantic_hint: '<string>',
sha256: '<string>',
signature: '<string>',
summary: [
{
byte_size: 0,
content: '<array>',
context: '<string>',
data: '<string>',
encrypted_content: '<string>',
height: 0,
id: '<string>',
input: {},
is_error: true,
media_type: '<string>',
name: '<string>',
omitted_bytes: 0,
payload: true,
provider: '<string>',
provider_payload: true,
redacted: true,
semantic_hint: '<string>',
sha256: '<string>',
signature: '<string>',
summary: '<array>',
text: '<string>',
title: '<string>',
tool_use_id: '<string>',
type: '<string>',
uri: '<string>',
width: 0
}
],
text: '<string>',
title: '<string>',
tool_use_id: '<string>',
type: '<string>',
uri: '<string>',
width: 0
}
],
handoff_id: '<string>',
note: '<string>',
text: '<string>'
}
],
message: '<string>',
referenced_session_ids: ['<string>']
})
};
fetch('https://api.recursion.labelbox.com/managed-agents/v1/sessions/{sessionId}/events', 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.recursion.labelbox.com/managed-agents/v1/sessions/{sessionId}/events",
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([
'actor' => '<string>',
'events' => [
[
'actor' => '<string>',
'content' => [
[
'byte_size' => 0,
'content' => [
[
'byte_size' => 0,
'content' => '<array>',
'context' => '<string>',
'data' => '<string>',
'encrypted_content' => '<string>',
'height' => 0,
'id' => '<string>',
'input' => [
],
'is_error' => true,
'media_type' => '<string>',
'name' => '<string>',
'omitted_bytes' => 0,
'payload' => true,
'provider' => '<string>',
'provider_payload' => true,
'redacted' => true,
'semantic_hint' => '<string>',
'sha256' => '<string>',
'signature' => '<string>',
'summary' => '<array>',
'text' => '<string>',
'title' => '<string>',
'tool_use_id' => '<string>',
'type' => '<string>',
'uri' => '<string>',
'width' => 0
]
],
'context' => '<string>',
'data' => '<string>',
'encrypted_content' => '<string>',
'height' => 0,
'id' => '<string>',
'input' => [
],
'is_error' => true,
'media_type' => '<string>',
'name' => '<string>',
'omitted_bytes' => 0,
'payload' => true,
'provider' => '<string>',
'provider_payload' => true,
'redacted' => true,
'semantic_hint' => '<string>',
'sha256' => '<string>',
'signature' => '<string>',
'summary' => [
[
'byte_size' => 0,
'content' => '<array>',
'context' => '<string>',
'data' => '<string>',
'encrypted_content' => '<string>',
'height' => 0,
'id' => '<string>',
'input' => [
],
'is_error' => true,
'media_type' => '<string>',
'name' => '<string>',
'omitted_bytes' => 0,
'payload' => true,
'provider' => '<string>',
'provider_payload' => true,
'redacted' => true,
'semantic_hint' => '<string>',
'sha256' => '<string>',
'signature' => '<string>',
'summary' => '<array>',
'text' => '<string>',
'title' => '<string>',
'tool_use_id' => '<string>',
'type' => '<string>',
'uri' => '<string>',
'width' => 0
]
],
'text' => '<string>',
'title' => '<string>',
'tool_use_id' => '<string>',
'type' => '<string>',
'uri' => '<string>',
'width' => 0
]
],
'handoff_id' => '<string>',
'note' => '<string>',
'text' => '<string>'
]
],
'message' => '<string>',
'referenced_session_ids' => [
'<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.recursion.labelbox.com/managed-agents/v1/sessions/{sessionId}/events"
payload := strings.NewReader("{\n \"actor\": \"<string>\",\n \"events\": [\n {\n \"actor\": \"<string>\",\n \"content\": [\n {\n \"byte_size\": 0,\n \"content\": [\n {\n \"byte_size\": 0,\n \"content\": \"<array>\",\n \"context\": \"<string>\",\n \"data\": \"<string>\",\n \"encrypted_content\": \"<string>\",\n \"height\": 0,\n \"id\": \"<string>\",\n \"input\": {},\n \"is_error\": true,\n \"media_type\": \"<string>\",\n \"name\": \"<string>\",\n \"omitted_bytes\": 0,\n \"payload\": true,\n \"provider\": \"<string>\",\n \"provider_payload\": true,\n \"redacted\": true,\n \"semantic_hint\": \"<string>\",\n \"sha256\": \"<string>\",\n \"signature\": \"<string>\",\n \"summary\": \"<array>\",\n \"text\": \"<string>\",\n \"title\": \"<string>\",\n \"tool_use_id\": \"<string>\",\n \"type\": \"<string>\",\n \"uri\": \"<string>\",\n \"width\": 0\n }\n ],\n \"context\": \"<string>\",\n \"data\": \"<string>\",\n \"encrypted_content\": \"<string>\",\n \"height\": 0,\n \"id\": \"<string>\",\n \"input\": {},\n \"is_error\": true,\n \"media_type\": \"<string>\",\n \"name\": \"<string>\",\n \"omitted_bytes\": 0,\n \"payload\": true,\n \"provider\": \"<string>\",\n \"provider_payload\": true,\n \"redacted\": true,\n \"semantic_hint\": \"<string>\",\n \"sha256\": \"<string>\",\n \"signature\": \"<string>\",\n \"summary\": [\n {\n \"byte_size\": 0,\n \"content\": \"<array>\",\n \"context\": \"<string>\",\n \"data\": \"<string>\",\n \"encrypted_content\": \"<string>\",\n \"height\": 0,\n \"id\": \"<string>\",\n \"input\": {},\n \"is_error\": true,\n \"media_type\": \"<string>\",\n \"name\": \"<string>\",\n \"omitted_bytes\": 0,\n \"payload\": true,\n \"provider\": \"<string>\",\n \"provider_payload\": true,\n \"redacted\": true,\n \"semantic_hint\": \"<string>\",\n \"sha256\": \"<string>\",\n \"signature\": \"<string>\",\n \"summary\": \"<array>\",\n \"text\": \"<string>\",\n \"title\": \"<string>\",\n \"tool_use_id\": \"<string>\",\n \"type\": \"<string>\",\n \"uri\": \"<string>\",\n \"width\": 0\n }\n ],\n \"text\": \"<string>\",\n \"title\": \"<string>\",\n \"tool_use_id\": \"<string>\",\n \"type\": \"<string>\",\n \"uri\": \"<string>\",\n \"width\": 0\n }\n ],\n \"handoff_id\": \"<string>\",\n \"note\": \"<string>\",\n \"text\": \"<string>\"\n }\n ],\n \"message\": \"<string>\",\n \"referenced_session_ids\": [\n \"<string>\"\n ]\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.recursion.labelbox.com/managed-agents/v1/sessions/{sessionId}/events")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"actor\": \"<string>\",\n \"events\": [\n {\n \"actor\": \"<string>\",\n \"content\": [\n {\n \"byte_size\": 0,\n \"content\": [\n {\n \"byte_size\": 0,\n \"content\": \"<array>\",\n \"context\": \"<string>\",\n \"data\": \"<string>\",\n \"encrypted_content\": \"<string>\",\n \"height\": 0,\n \"id\": \"<string>\",\n \"input\": {},\n \"is_error\": true,\n \"media_type\": \"<string>\",\n \"name\": \"<string>\",\n \"omitted_bytes\": 0,\n \"payload\": true,\n \"provider\": \"<string>\",\n \"provider_payload\": true,\n \"redacted\": true,\n \"semantic_hint\": \"<string>\",\n \"sha256\": \"<string>\",\n \"signature\": \"<string>\",\n \"summary\": \"<array>\",\n \"text\": \"<string>\",\n \"title\": \"<string>\",\n \"tool_use_id\": \"<string>\",\n \"type\": \"<string>\",\n \"uri\": \"<string>\",\n \"width\": 0\n }\n ],\n \"context\": \"<string>\",\n \"data\": \"<string>\",\n \"encrypted_content\": \"<string>\",\n \"height\": 0,\n \"id\": \"<string>\",\n \"input\": {},\n \"is_error\": true,\n \"media_type\": \"<string>\",\n \"name\": \"<string>\",\n \"omitted_bytes\": 0,\n \"payload\": true,\n \"provider\": \"<string>\",\n \"provider_payload\": true,\n \"redacted\": true,\n \"semantic_hint\": \"<string>\",\n \"sha256\": \"<string>\",\n \"signature\": \"<string>\",\n \"summary\": [\n {\n \"byte_size\": 0,\n \"content\": \"<array>\",\n \"context\": \"<string>\",\n \"data\": \"<string>\",\n \"encrypted_content\": \"<string>\",\n \"height\": 0,\n \"id\": \"<string>\",\n \"input\": {},\n \"is_error\": true,\n \"media_type\": \"<string>\",\n \"name\": \"<string>\",\n \"omitted_bytes\": 0,\n \"payload\": true,\n \"provider\": \"<string>\",\n \"provider_payload\": true,\n \"redacted\": true,\n \"semantic_hint\": \"<string>\",\n \"sha256\": \"<string>\",\n \"signature\": \"<string>\",\n \"summary\": \"<array>\",\n \"text\": \"<string>\",\n \"title\": \"<string>\",\n \"tool_use_id\": \"<string>\",\n \"type\": \"<string>\",\n \"uri\": \"<string>\",\n \"width\": 0\n }\n ],\n \"text\": \"<string>\",\n \"title\": \"<string>\",\n \"tool_use_id\": \"<string>\",\n \"type\": \"<string>\",\n \"uri\": \"<string>\",\n \"width\": 0\n }\n ],\n \"handoff_id\": \"<string>\",\n \"note\": \"<string>\",\n \"text\": \"<string>\"\n }\n ],\n \"message\": \"<string>\",\n \"referenced_session_ids\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.recursion.labelbox.com/managed-agents/v1/sessions/{sessionId}/events")
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 \"actor\": \"<string>\",\n \"events\": [\n {\n \"actor\": \"<string>\",\n \"content\": [\n {\n \"byte_size\": 0,\n \"content\": [\n {\n \"byte_size\": 0,\n \"content\": \"<array>\",\n \"context\": \"<string>\",\n \"data\": \"<string>\",\n \"encrypted_content\": \"<string>\",\n \"height\": 0,\n \"id\": \"<string>\",\n \"input\": {},\n \"is_error\": true,\n \"media_type\": \"<string>\",\n \"name\": \"<string>\",\n \"omitted_bytes\": 0,\n \"payload\": true,\n \"provider\": \"<string>\",\n \"provider_payload\": true,\n \"redacted\": true,\n \"semantic_hint\": \"<string>\",\n \"sha256\": \"<string>\",\n \"signature\": \"<string>\",\n \"summary\": \"<array>\",\n \"text\": \"<string>\",\n \"title\": \"<string>\",\n \"tool_use_id\": \"<string>\",\n \"type\": \"<string>\",\n \"uri\": \"<string>\",\n \"width\": 0\n }\n ],\n \"context\": \"<string>\",\n \"data\": \"<string>\",\n \"encrypted_content\": \"<string>\",\n \"height\": 0,\n \"id\": \"<string>\",\n \"input\": {},\n \"is_error\": true,\n \"media_type\": \"<string>\",\n \"name\": \"<string>\",\n \"omitted_bytes\": 0,\n \"payload\": true,\n \"provider\": \"<string>\",\n \"provider_payload\": true,\n \"redacted\": true,\n \"semantic_hint\": \"<string>\",\n \"sha256\": \"<string>\",\n \"signature\": \"<string>\",\n \"summary\": [\n {\n \"byte_size\": 0,\n \"content\": \"<array>\",\n \"context\": \"<string>\",\n \"data\": \"<string>\",\n \"encrypted_content\": \"<string>\",\n \"height\": 0,\n \"id\": \"<string>\",\n \"input\": {},\n \"is_error\": true,\n \"media_type\": \"<string>\",\n \"name\": \"<string>\",\n \"omitted_bytes\": 0,\n \"payload\": true,\n \"provider\": \"<string>\",\n \"provider_payload\": true,\n \"redacted\": true,\n \"semantic_hint\": \"<string>\",\n \"sha256\": \"<string>\",\n \"signature\": \"<string>\",\n \"summary\": \"<array>\",\n \"text\": \"<string>\",\n \"title\": \"<string>\",\n \"tool_use_id\": \"<string>\",\n \"type\": \"<string>\",\n \"uri\": \"<string>\",\n \"width\": 0\n }\n ],\n \"text\": \"<string>\",\n \"title\": \"<string>\",\n \"tool_use_id\": \"<string>\",\n \"type\": \"<string>\",\n \"uri\": \"<string>\",\n \"width\": 0\n }\n ],\n \"handoff_id\": \"<string>\",\n \"note\": \"<string>\",\n \"text\": \"<string>\"\n }\n ],\n \"message\": \"<string>\",\n \"referenced_session_ids\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"delivery_state": "stored",
"events_accepted": 0,
"ok": true
}{
"code": "invalid_json",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "unauthorized",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "forbidden",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "not_found",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "conflict",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "payload_too_large",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "unsupported_media_type",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "handoff_access_unsupported",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "rate_limit_exceeded",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "internal_error",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "bad_gateway",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "content_store_unavailable",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "gateway_timeout",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}Authorizations
A Recursion API key, created in the console under API keys.
Headers
Replay-protection key in an organization-wide namespace shared by keyed mutations. It must contain 1 to 256 visible ASCII characters and be sent as exactly one header value. Request identity is the exact HTTP method, escaped path, raw query, and raw body bytes. For the legacy automation-run route only, the historical fingerprint ignores top-level JSON formatting and object-key order and removes the retired top-level idempotency_key field. The same request replays the original successful response; any different request returns 409 idempotency_conflict, and an active matching request returns 409 idempotency_in_progress. Completed receipts are retained for approximately 24 hours, pending claims may be reclaimed after approximately 1 hour, and no deduplication is guaranteed after expiry.
1 - 256^[!-~]+$Optional tenant consistency check. When present, it must name the tenant bound to the API key, including when x-organization-id is default.
1Organization in which to act. Required for a tenant-scoped API key. Optional for an organization-scoped key, where it must name that same organization. The value may be an organization id or default.
1Path Parameters
Session id (UUID) as returned by managedAgentsStartSession or managedAgentsListSessions.
Body
Request body of POST /managed-agents/v1/sessions/{sessionId}/events. It has two mutually exclusive forms and events wins: send message for the common case of one plain-text user turn, or send events as ordered typed turns with provider-shaped content. An empty events array yields exactly one user turn built from message, which must not be empty or only whitespace. The handoff_resolved control form rejects all message and referenced-session fields. The response acknowledges durable acceptance of the turn, not the agent's reply.
Who the turn is attributed to. Defaults to human:api when omitted.
Typed events to append instead of message. When present, message and the top-level actor are ignored.
Show child attributes
Show child attributes
Plain-text message to append as a single user turn. Used only when events is empty, and then required: a message that is empty or only whitespace is refused with 400.
Prior sessions this session may read from this turn on, by session id, added to any it already has. Each id is authorized under your own scope and grants read access to the whole tree containing it; one you cannot read refuses the whole request with 404 and delivers no message. The grant is recorded before the message, so the turn it starts is the first one that can use it.
10Response
Shared response body of POST /managed-agents/v1/sessions/{sessionId}/events and POST /managed-agents/v1/sessions/{sessionId}/interrupt-and-send. It acknowledges durable acceptance of the turn, never the agent's reply: read the reply by listing events or streaming. Compare events_accepted against what was sent to detect silently dropped entries, and read delivery_state to learn whether an agent is actually going to act on them. events_accepted counts canonical events rather than requests, so interrupt-and-send reports 2 for its single instruction: the stop and the message that follows it.
Shared response body of POST /managed-agents/v1/sessions/{sessionId}/events and POST /managed-agents/v1/sessions/{sessionId}/interrupt-and-send. It acknowledges durable acceptance of the turn, never the agent's reply: read the reply by listing events or streaming. Compare events_accepted against what was sent to detect silently dropped entries, and read delivery_state to learn whether an agent is actually going to act on them. events_accepted counts canonical events rather than requests, so interrupt-and-send reports 2 for its single instruction: the stop and the message that follows it.
How the accepted events reached a reader. queued: the agent was mid-turn, so the input is waiting outside the transcript and the next turn boundary will read it; interrupt to bring that forward. signaled: the running session was woken and will act on them. resumed: the session had already finished, so it resumed to act on them. stored: appended to the timeline with nothing running to act on them yet.
stored, signaled, resumed, queued How many canonical events were written or queued. This counts the inputs actually derived from the body, not its length: a plain message body yields 1, and a typed user.message with no content is dropped, so this can be lower than the events array sent.
-9007199254740991 <= x <= 9007199254740991Always true. Every event in the request was durably accepted; any partial or total failure is an HTTP error instead, so this field never reports false.