curl --request POST \
--url https://api.example.com/a2a/message/stream \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>",
"params": {
"message": {
"messageId": "<string>",
"parts": [
{
"text": "<string>",
"kind": "text",
"metadata": {}
}
],
"contextId": "<string>",
"extensions": [
"<string>"
],
"kind": "message",
"metadata": {},
"referenceTaskIds": [
"<string>"
],
"taskId": "<string>",
"agentId": "<string>"
},
"configuration": {
"acceptedOutputModes": [
"<string>"
],
"blocking": true,
"historyLength": 123,
"pushNotificationConfig": {
"url": "<string>",
"authentication": {
"schemes": [
"<string>"
],
"credentials": "<string>"
},
"id": "<string>",
"token": "<string>"
}
},
"metadata": {}
},
"jsonrpc": "2.0",
"method": "message/stream"
}
'import requests
url = "https://api.example.com/a2a/message/stream"
payload = {
"id": "<string>",
"params": {
"message": {
"messageId": "<string>",
"parts": [
{
"text": "<string>",
"kind": "text",
"metadata": {}
}
],
"contextId": "<string>",
"extensions": ["<string>"],
"kind": "message",
"metadata": {},
"referenceTaskIds": ["<string>"],
"taskId": "<string>",
"agentId": "<string>"
},
"configuration": {
"acceptedOutputModes": ["<string>"],
"blocking": True,
"historyLength": 123,
"pushNotificationConfig": {
"url": "<string>",
"authentication": {
"schemes": ["<string>"],
"credentials": "<string>"
},
"id": "<string>",
"token": "<string>"
}
},
"metadata": {}
},
"jsonrpc": "2.0",
"method": "message/stream"
}
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({
id: '<string>',
params: {
message: {
messageId: '<string>',
parts: [{text: '<string>', kind: 'text', metadata: {}}],
contextId: '<string>',
extensions: ['<string>'],
kind: 'message',
metadata: {},
referenceTaskIds: ['<string>'],
taskId: '<string>',
agentId: '<string>'
},
configuration: {
acceptedOutputModes: ['<string>'],
blocking: true,
historyLength: 123,
pushNotificationConfig: {
url: '<string>',
authentication: {schemes: ['<string>'], credentials: '<string>'},
id: '<string>',
token: '<string>'
}
},
metadata: {}
},
jsonrpc: '2.0',
method: 'message/stream'
})
};
fetch('https://api.example.com/a2a/message/stream', 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.example.com/a2a/message/stream",
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([
'id' => '<string>',
'params' => [
'message' => [
'messageId' => '<string>',
'parts' => [
[
'text' => '<string>',
'kind' => 'text',
'metadata' => [
]
]
],
'contextId' => '<string>',
'extensions' => [
'<string>'
],
'kind' => 'message',
'metadata' => [
],
'referenceTaskIds' => [
'<string>'
],
'taskId' => '<string>',
'agentId' => '<string>'
],
'configuration' => [
'acceptedOutputModes' => [
'<string>'
],
'blocking' => true,
'historyLength' => 123,
'pushNotificationConfig' => [
'url' => '<string>',
'authentication' => [
'schemes' => [
'<string>'
],
'credentials' => '<string>'
],
'id' => '<string>',
'token' => '<string>'
]
],
'metadata' => [
]
],
'jsonrpc' => '2.0',
'method' => 'message/stream'
]),
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.example.com/a2a/message/stream"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"params\": {\n \"message\": {\n \"messageId\": \"<string>\",\n \"parts\": [\n {\n \"text\": \"<string>\",\n \"kind\": \"text\",\n \"metadata\": {}\n }\n ],\n \"contextId\": \"<string>\",\n \"extensions\": [\n \"<string>\"\n ],\n \"kind\": \"message\",\n \"metadata\": {},\n \"referenceTaskIds\": [\n \"<string>\"\n ],\n \"taskId\": \"<string>\",\n \"agentId\": \"<string>\"\n },\n \"configuration\": {\n \"acceptedOutputModes\": [\n \"<string>\"\n ],\n \"blocking\": true,\n \"historyLength\": 123,\n \"pushNotificationConfig\": {\n \"url\": \"<string>\",\n \"authentication\": {\n \"schemes\": [\n \"<string>\"\n ],\n \"credentials\": \"<string>\"\n },\n \"id\": \"<string>\",\n \"token\": \"<string>\"\n }\n },\n \"metadata\": {}\n },\n \"jsonrpc\": \"2.0\",\n \"method\": \"message/stream\"\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.example.com/a2a/message/stream")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\",\n \"params\": {\n \"message\": {\n \"messageId\": \"<string>\",\n \"parts\": [\n {\n \"text\": \"<string>\",\n \"kind\": \"text\",\n \"metadata\": {}\n }\n ],\n \"contextId\": \"<string>\",\n \"extensions\": [\n \"<string>\"\n ],\n \"kind\": \"message\",\n \"metadata\": {},\n \"referenceTaskIds\": [\n \"<string>\"\n ],\n \"taskId\": \"<string>\",\n \"agentId\": \"<string>\"\n },\n \"configuration\": {\n \"acceptedOutputModes\": [\n \"<string>\"\n ],\n \"blocking\": true,\n \"historyLength\": 123,\n \"pushNotificationConfig\": {\n \"url\": \"<string>\",\n \"authentication\": {\n \"schemes\": [\n \"<string>\"\n ],\n \"credentials\": \"<string>\"\n },\n \"id\": \"<string>\",\n \"token\": \"<string>\"\n }\n },\n \"metadata\": {}\n },\n \"jsonrpc\": \"2.0\",\n \"method\": \"message/stream\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/a2a/message/stream")
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 \"id\": \"<string>\",\n \"params\": {\n \"message\": {\n \"messageId\": \"<string>\",\n \"parts\": [\n {\n \"text\": \"<string>\",\n \"kind\": \"text\",\n \"metadata\": {}\n }\n ],\n \"contextId\": \"<string>\",\n \"extensions\": [\n \"<string>\"\n ],\n \"kind\": \"message\",\n \"metadata\": {},\n \"referenceTaskIds\": [\n \"<string>\"\n ],\n \"taskId\": \"<string>\",\n \"agentId\": \"<string>\"\n },\n \"configuration\": {\n \"acceptedOutputModes\": [\n \"<string>\"\n ],\n \"blocking\": true,\n \"historyLength\": 123,\n \"pushNotificationConfig\": {\n \"url\": \"<string>\",\n \"authentication\": {\n \"schemes\": [\n \"<string>\"\n ],\n \"credentials\": \"<string>\"\n },\n \"id\": \"<string>\",\n \"token\": \"<string>\"\n }\n },\n \"metadata\": {}\n },\n \"jsonrpc\": \"2.0\",\n \"method\": \"message/stream\"\n}"
response = http.request(request)
puts response.read_body"event: TaskStatusUpdateEvent\ndata: {\"jsonrpc\":\"2.0\",\"id\":\"request-123\",\"result\":{\"taskId\":\"task-456\",\"status\":\"working\"}}\n\nevent: Message\ndata: {\"jsonrpc\":\"2.0\",\"id\":\"request-123\",\"result\":{\"messageId\":\"msg-1\",\"role\":\"agent\",\"parts\":[{\"kind\":\"text\",\"text\":\"Response\"}]}}\n\n"{
"detail": "Bad request",
"error_code": "BAD_REQUEST"
}{
"detail": "Unauthenticated access",
"error_code": "UNAUTHENTICATED"
}{
"detail": "Insufficient permissions"
}{
"detail": "Not found",
"error_code": "NOT_FOUND"
}{
"detail": "Internal server error",
"error_code": "INTERNAL_SERVER_ERROR"
}Stream Message
[DEPRECATED] Stream a message to an Agno Agent, Team, or Workflow. The Agent, Team or Workflow is identified via the ‘agentId’ field in params.message or X-Agent-ID header. Optional: Pass user ID via X-User-ID header (recommended) or ‘userId’ in params.message.metadata. Returns real-time updates as Server-Sent Events (SSE).
curl --request POST \
--url https://api.example.com/a2a/message/stream \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>",
"params": {
"message": {
"messageId": "<string>",
"parts": [
{
"text": "<string>",
"kind": "text",
"metadata": {}
}
],
"contextId": "<string>",
"extensions": [
"<string>"
],
"kind": "message",
"metadata": {},
"referenceTaskIds": [
"<string>"
],
"taskId": "<string>",
"agentId": "<string>"
},
"configuration": {
"acceptedOutputModes": [
"<string>"
],
"blocking": true,
"historyLength": 123,
"pushNotificationConfig": {
"url": "<string>",
"authentication": {
"schemes": [
"<string>"
],
"credentials": "<string>"
},
"id": "<string>",
"token": "<string>"
}
},
"metadata": {}
},
"jsonrpc": "2.0",
"method": "message/stream"
}
'import requests
url = "https://api.example.com/a2a/message/stream"
payload = {
"id": "<string>",
"params": {
"message": {
"messageId": "<string>",
"parts": [
{
"text": "<string>",
"kind": "text",
"metadata": {}
}
],
"contextId": "<string>",
"extensions": ["<string>"],
"kind": "message",
"metadata": {},
"referenceTaskIds": ["<string>"],
"taskId": "<string>",
"agentId": "<string>"
},
"configuration": {
"acceptedOutputModes": ["<string>"],
"blocking": True,
"historyLength": 123,
"pushNotificationConfig": {
"url": "<string>",
"authentication": {
"schemes": ["<string>"],
"credentials": "<string>"
},
"id": "<string>",
"token": "<string>"
}
},
"metadata": {}
},
"jsonrpc": "2.0",
"method": "message/stream"
}
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({
id: '<string>',
params: {
message: {
messageId: '<string>',
parts: [{text: '<string>', kind: 'text', metadata: {}}],
contextId: '<string>',
extensions: ['<string>'],
kind: 'message',
metadata: {},
referenceTaskIds: ['<string>'],
taskId: '<string>',
agentId: '<string>'
},
configuration: {
acceptedOutputModes: ['<string>'],
blocking: true,
historyLength: 123,
pushNotificationConfig: {
url: '<string>',
authentication: {schemes: ['<string>'], credentials: '<string>'},
id: '<string>',
token: '<string>'
}
},
metadata: {}
},
jsonrpc: '2.0',
method: 'message/stream'
})
};
fetch('https://api.example.com/a2a/message/stream', 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.example.com/a2a/message/stream",
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([
'id' => '<string>',
'params' => [
'message' => [
'messageId' => '<string>',
'parts' => [
[
'text' => '<string>',
'kind' => 'text',
'metadata' => [
]
]
],
'contextId' => '<string>',
'extensions' => [
'<string>'
],
'kind' => 'message',
'metadata' => [
],
'referenceTaskIds' => [
'<string>'
],
'taskId' => '<string>',
'agentId' => '<string>'
],
'configuration' => [
'acceptedOutputModes' => [
'<string>'
],
'blocking' => true,
'historyLength' => 123,
'pushNotificationConfig' => [
'url' => '<string>',
'authentication' => [
'schemes' => [
'<string>'
],
'credentials' => '<string>'
],
'id' => '<string>',
'token' => '<string>'
]
],
'metadata' => [
]
],
'jsonrpc' => '2.0',
'method' => 'message/stream'
]),
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.example.com/a2a/message/stream"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"params\": {\n \"message\": {\n \"messageId\": \"<string>\",\n \"parts\": [\n {\n \"text\": \"<string>\",\n \"kind\": \"text\",\n \"metadata\": {}\n }\n ],\n \"contextId\": \"<string>\",\n \"extensions\": [\n \"<string>\"\n ],\n \"kind\": \"message\",\n \"metadata\": {},\n \"referenceTaskIds\": [\n \"<string>\"\n ],\n \"taskId\": \"<string>\",\n \"agentId\": \"<string>\"\n },\n \"configuration\": {\n \"acceptedOutputModes\": [\n \"<string>\"\n ],\n \"blocking\": true,\n \"historyLength\": 123,\n \"pushNotificationConfig\": {\n \"url\": \"<string>\",\n \"authentication\": {\n \"schemes\": [\n \"<string>\"\n ],\n \"credentials\": \"<string>\"\n },\n \"id\": \"<string>\",\n \"token\": \"<string>\"\n }\n },\n \"metadata\": {}\n },\n \"jsonrpc\": \"2.0\",\n \"method\": \"message/stream\"\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.example.com/a2a/message/stream")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\",\n \"params\": {\n \"message\": {\n \"messageId\": \"<string>\",\n \"parts\": [\n {\n \"text\": \"<string>\",\n \"kind\": \"text\",\n \"metadata\": {}\n }\n ],\n \"contextId\": \"<string>\",\n \"extensions\": [\n \"<string>\"\n ],\n \"kind\": \"message\",\n \"metadata\": {},\n \"referenceTaskIds\": [\n \"<string>\"\n ],\n \"taskId\": \"<string>\",\n \"agentId\": \"<string>\"\n },\n \"configuration\": {\n \"acceptedOutputModes\": [\n \"<string>\"\n ],\n \"blocking\": true,\n \"historyLength\": 123,\n \"pushNotificationConfig\": {\n \"url\": \"<string>\",\n \"authentication\": {\n \"schemes\": [\n \"<string>\"\n ],\n \"credentials\": \"<string>\"\n },\n \"id\": \"<string>\",\n \"token\": \"<string>\"\n }\n },\n \"metadata\": {}\n },\n \"jsonrpc\": \"2.0\",\n \"method\": \"message/stream\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/a2a/message/stream")
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 \"id\": \"<string>\",\n \"params\": {\n \"message\": {\n \"messageId\": \"<string>\",\n \"parts\": [\n {\n \"text\": \"<string>\",\n \"kind\": \"text\",\n \"metadata\": {}\n }\n ],\n \"contextId\": \"<string>\",\n \"extensions\": [\n \"<string>\"\n ],\n \"kind\": \"message\",\n \"metadata\": {},\n \"referenceTaskIds\": [\n \"<string>\"\n ],\n \"taskId\": \"<string>\",\n \"agentId\": \"<string>\"\n },\n \"configuration\": {\n \"acceptedOutputModes\": [\n \"<string>\"\n ],\n \"blocking\": true,\n \"historyLength\": 123,\n \"pushNotificationConfig\": {\n \"url\": \"<string>\",\n \"authentication\": {\n \"schemes\": [\n \"<string>\"\n ],\n \"credentials\": \"<string>\"\n },\n \"id\": \"<string>\",\n \"token\": \"<string>\"\n }\n },\n \"metadata\": {}\n },\n \"jsonrpc\": \"2.0\",\n \"method\": \"message/stream\"\n}"
response = http.request(request)
puts response.read_body"event: TaskStatusUpdateEvent\ndata: {\"jsonrpc\":\"2.0\",\"id\":\"request-123\",\"result\":{\"taskId\":\"task-456\",\"status\":\"working\"}}\n\nevent: Message\ndata: {\"jsonrpc\":\"2.0\",\"id\":\"request-123\",\"result\":{\"messageId\":\"msg-1\",\"role\":\"agent\",\"parts\":[{\"kind\":\"text\",\"text\":\"Response\"}]}}\n\n"{
"detail": "Bad request",
"error_code": "BAD_REQUEST"
}{
"detail": "Unauthenticated access",
"error_code": "UNAUTHENTICATED"
}{
"detail": "Insufficient permissions"
}{
"detail": "Not found",
"error_code": "NOT_FOUND"
}{
"detail": "Internal server error",
"error_code": "INTERNAL_SERVER_ERROR"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Target agent, team, or workflow ID when params.message.agentId is omitted.
Optional user ID for anonymous attribution. Authenticated requests use the identity from the credential.
Body
Represents a JSON-RPC request for the message/stream method.
Defines the parameters for a request to send a message to an agent. This can be used to create a new task, continue an existing one, or restart a task.
Show child attributes
Show child attributes
"2.0""message/stream"Response
Streaming response with task updates
The response is of type string.
Was this page helpful?