Push an event into a task from a hook callback
curl --request POST \
--url https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents/{agentId}/tasks/{taskId}/events \
--header 'Content-Type: application/json' \
--header 'X-Hook-Token: <api-key>' \
--data '
{
"event": "task.output.delta"
}
'const options = {
method: 'POST',
headers: {'X-Hook-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({event: 'task.output.delta'})
};
fetch('https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents/{agentId}/tasks/{taskId}/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents/{agentId}/tasks/{taskId}/events"
payload = { "event": "task.output.delta" }
headers = {
"X-Hook-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"ok": true,
"taskId": "<string>",
"event": "<string>",
"seq": 123
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}Tasks
Push an event into a task from a hook callback
Callback used by async and stream hook targets (the
callback.url they receive) to forward incremental updates to the
client that started the task. The event is broadcast to the task’s
SSE/WebSocket subscribers; task.status and task.output.completed
are persisted, task.output.delta is not.
Authenticated with the callback token from callback.token, sent in
X-Hook-Token (or Authorization: Bearer cbt_...).
POST
/
v1
/
agents
/
{agentId}
/
tasks
/
{taskId}
/
events
Push an event into a task from a hook callback
curl --request POST \
--url https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents/{agentId}/tasks/{taskId}/events \
--header 'Content-Type: application/json' \
--header 'X-Hook-Token: <api-key>' \
--data '
{
"event": "task.output.delta"
}
'const options = {
method: 'POST',
headers: {'X-Hook-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({event: 'task.output.delta'})
};
fetch('https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents/{agentId}/tasks/{taskId}/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents/{agentId}/tasks/{taskId}/events"
payload = { "event": "task.output.delta" }
headers = {
"X-Hook-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"ok": true,
"taskId": "<string>",
"event": "<string>",
"seq": 123
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}Authorizations
Short-lived callback token (cbt_...) minted for one hook
invocation and delivered to the hook target in callback.token.
Authorization: Bearer cbt_... is also accepted.
Path Parameters
Maximum string length:
64Maximum string length:
128Body
application/json
Was this page helpful?