curl --request POST \
--url https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents/{agentId}/messages/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": {
"message_id": "msg-test-2",
"role": "user",
"parts": [
{
"text": "What is 2+2? Reply with just the number."
}
]
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
message: {
message_id: 'msg-test-2',
role: 'user',
parts: [{text: 'What is 2+2? Reply with just the number.'}]
}
})
};
fetch('https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents/{agentId}/messages/send', 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/send"
payload = { "message": {
"message_id": "msg-test-2",
"role": "user",
"parts": [{ "text": "What is 2+2? Reply with just the number." }]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"error": {},
"task": {
"id": "<string>",
"contextId": "<string>",
"status": {
"state": "working",
"timestamp": "<string>",
"message": {}
},
"output": {
"messages": [
{
"message_id": "<string>",
"role": "user",
"contextId": "<string>",
"taskId": "<string>",
"parts": [
{}
]
}
]
},
"usage": {},
"tool_calls": [
{
"name": "<string>",
"arguments": {},
"status": "<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": {}
}Send a message to an agent (A2A, non-streaming)
A2A-compliant message send. The body follows the A2A flat
MessageSendParams shape - a message envelope with
message_id, role, parts[], and an optional contextId.
Parts are discriminated by field presence: TextPart (text),
FilePart (url or raw), DataPart (data).
An always-on rate-limit floor (200/h per user) applies, plus any
agent-configured limit. The HITL approval flow is supported and
will park the task in input-required until resolved through
/v1/agents/{agentId}/tasks/{taskId}/resolve.
Send the x-draft-mode: true header to bypass published_config
resolution and exercise live (draft) configuration - owners and
agent-factory writers only.
curl --request POST \
--url https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents/{agentId}/messages/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": {
"message_id": "msg-test-2",
"role": "user",
"parts": [
{
"text": "What is 2+2? Reply with just the number."
}
]
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
message: {
message_id: 'msg-test-2',
role: 'user',
parts: [{text: 'What is 2+2? Reply with just the number.'}]
}
})
};
fetch('https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents/{agentId}/messages/send', 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/send"
payload = { "message": {
"message_id": "msg-test-2",
"role": "user",
"parts": [{ "text": "What is 2+2? Reply with just the number." }]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"error": {},
"task": {
"id": "<string>",
"contextId": "<string>",
"status": {
"state": "working",
"timestamp": "<string>",
"message": {}
},
"output": {
"messages": [
{
"message_id": "<string>",
"role": "user",
"contextId": "<string>",
"taskId": "<string>",
"parts": [
{}
]
}
]
},
"usage": {},
"tool_calls": [
{
"name": "<string>",
"arguments": {},
"status": "<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 call exercises the agent's live (draft) config
instead of published_config. Reserved for owners/writers.
Path Parameters
64Body
Response
Completed task with the agent's reply.
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Was this page helpful?