curl --request POST \
--url https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents/{agentId}/messages/stream \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": {
"message_id": "<string>",
"contextId": "<string>",
"taskId": "<string>",
"parts": [
{}
]
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
message: {message_id: '<string>', contextId: '<string>', taskId: '<string>', parts: [{}]}
})
};
fetch('https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents/{agentId}/messages/stream', 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}/messages/stream"
payload = { "message": {
"message_id": "<string>",
"contextId": "<string>",
"taskId": "<string>",
"parts": [{}]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)"<string>"{
"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": {}
}Stream an agent reply via SSE (A2A)
A2A-compliant streaming send. The request body uses the same
MessageSendParams shape as messages/send. The response is
delivered as Server-Sent Events (text/event-stream). Each frame is a
data: <json> line; the server emits no native SSE event: field.
Lifecycle frames use {"event":"<name>","data":{...}}.
The lifecycle sequence starts with task.status, emits zero or more
task.output.delta events, and reaches its terminal state with
task.output.completed. Clients must inspect data.status.state on
that event: completed, failed, or input-required.
Frames without an event property are transport frames. Discard only
the literal {"keepAlive": true} frame. The server closes the stream
with a summary frame shaped as
{"error":...,"task":{"status":{"state":...}}}. Inspect that frame:
an early authorization failure is delivered there, with its code in
error.error and HTTP 200 already committed. Never treat HTTP 200 alone
as success.
The x-draft-mode: true header bypasses published_config
resolution. The same HITL approval flow as messages/send
applies - a streaming task may park in input-required until
resolved.
curl --request POST \
--url https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents/{agentId}/messages/stream \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": {
"message_id": "<string>",
"contextId": "<string>",
"taskId": "<string>",
"parts": [
{}
]
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
message: {message_id: '<string>', contextId: '<string>', taskId: '<string>', parts: [{}]}
})
};
fetch('https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents/{agentId}/messages/stream', 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}/messages/stream"
payload = { "message": {
"message_id": "<string>",
"contextId": "<string>",
"taskId": "<string>",
"parts": [{}]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)"<string>"{
"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
User-bound credential carrying an identity: either a session JWT
or a user access token (at:*) generated from the user settings UI.
Send as Authorization: Bearer <token>.
Org API keys (iak_*) are not accepted here - they carry
no user identity. Use the x-prismeai-api-key header instead
(see OrgApiKeyAuth).
Headers
When true, the stream exercises the agent's live (draft)
config instead of published_config. Owners/writers only.
Path Parameters
64Body
Response
Server-Sent Events stream of A2A task lifecycle events.
task.output.completed is the terminal lifecycle event. Its
data.status.state reports whether the task completed, failed,
or requires user input. A transport summary frame follows; inspect
its error and task.status.state fields before closing the stream.
Stream of data: <json> lines. Lifecycle frames use
{"event":"<name>","data":{...}}; the server does not
emit native SSE event: fields. Discard only the literal
{"keepAlive": true} frame. The final summary frame has no
event; inspect error.error for an early authorization
failure and task.status.state for the final task state.
Was this page helpful?