A2A Post
curl --request POST \
--url https://api.example.com/a2a/{assistant_id} \
--header 'Accept: <accept>' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": "<string>",
"params": {
"message": {
"parts": [
{
"kind": "text",
"text": "<string>"
}
],
"messageId": "<string>"
},
"thread": {
"threadId": "<string>"
}
}
}
'import requests
url = "https://api.example.com/a2a/{assistant_id}"
payload = {
"jsonrpc": "2.0",
"id": "<string>",
"params": {
"message": {
"parts": [
{
"kind": "text",
"text": "<string>"
}
],
"messageId": "<string>"
},
"thread": { "threadId": "<string>" }
}
}
headers = {
"Accept": "<accept>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Accept: '<accept>', 'Content-Type': 'application/json'},
body: JSON.stringify({
jsonrpc: '2.0',
id: '<string>',
params: {
message: {parts: [{kind: 'text', text: '<string>'}], messageId: '<string>'},
thread: {threadId: '<string>'}
}
})
};
fetch('https://api.example.com/a2a/{assistant_id}', 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/{assistant_id}",
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([
'jsonrpc' => '2.0',
'id' => '<string>',
'params' => [
'message' => [
'parts' => [
[
'kind' => 'text',
'text' => '<string>'
]
],
'messageId' => '<string>'
],
'thread' => [
'threadId' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Accept: <accept>",
"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/{assistant_id}"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"<string>\",\n \"params\": {\n \"message\": {\n \"parts\": [\n {\n \"kind\": \"text\",\n \"text\": \"<string>\"\n }\n ],\n \"messageId\": \"<string>\"\n },\n \"thread\": {\n \"threadId\": \"<string>\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Accept", "<accept>")
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/{assistant_id}")
.header("Accept", "<accept>")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"<string>\",\n \"params\": {\n \"message\": {\n \"parts\": [\n {\n \"kind\": \"text\",\n \"text\": \"<string>\"\n }\n ],\n \"messageId\": \"<string>\"\n },\n \"thread\": {\n \"threadId\": \"<string>\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/a2a/{assistant_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Accept"] = '<accept>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"jsonrpc\": \"2.0\",\n \"id\": \"<string>\",\n \"params\": {\n \"message\": {\n \"parts\": [\n {\n \"kind\": \"text\",\n \"text\": \"<string>\"\n }\n ],\n \"messageId\": \"<string>\"\n },\n \"thread\": {\n \"threadId\": \"<string>\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": "<string>",
"result": {},
"error": {
"code": 123,
"message": "<string>"
}
}Communicate with an assistant using the Agent-to-Agent Protocol. Sends a JSON-RPC 2.0 message to the assistant.
- Request: Provide an object with
jsonrpc,id,method, and optionalparams. - Response: Returns a JSON-RPC response with task information or error.
Supported Methods:
message/send: Send a message to the assistanttasks/get: Get the status and result of a task
Notes:
- Supports threaded conversations via thread context
- Messages can contain text and data parts
- Tasks run asynchronously and return completion status
POST
/
a2a
/
{assistant_id}
A2A Post
curl --request POST \
--url https://api.example.com/a2a/{assistant_id} \
--header 'Accept: <accept>' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": "<string>",
"params": {
"message": {
"parts": [
{
"kind": "text",
"text": "<string>"
}
],
"messageId": "<string>"
},
"thread": {
"threadId": "<string>"
}
}
}
'import requests
url = "https://api.example.com/a2a/{assistant_id}"
payload = {
"jsonrpc": "2.0",
"id": "<string>",
"params": {
"message": {
"parts": [
{
"kind": "text",
"text": "<string>"
}
],
"messageId": "<string>"
},
"thread": { "threadId": "<string>" }
}
}
headers = {
"Accept": "<accept>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Accept: '<accept>', 'Content-Type': 'application/json'},
body: JSON.stringify({
jsonrpc: '2.0',
id: '<string>',
params: {
message: {parts: [{kind: 'text', text: '<string>'}], messageId: '<string>'},
thread: {threadId: '<string>'}
}
})
};
fetch('https://api.example.com/a2a/{assistant_id}', 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/{assistant_id}",
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([
'jsonrpc' => '2.0',
'id' => '<string>',
'params' => [
'message' => [
'parts' => [
[
'kind' => 'text',
'text' => '<string>'
]
],
'messageId' => '<string>'
],
'thread' => [
'threadId' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Accept: <accept>",
"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/{assistant_id}"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"<string>\",\n \"params\": {\n \"message\": {\n \"parts\": [\n {\n \"kind\": \"text\",\n \"text\": \"<string>\"\n }\n ],\n \"messageId\": \"<string>\"\n },\n \"thread\": {\n \"threadId\": \"<string>\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Accept", "<accept>")
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/{assistant_id}")
.header("Accept", "<accept>")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"<string>\",\n \"params\": {\n \"message\": {\n \"parts\": [\n {\n \"kind\": \"text\",\n \"text\": \"<string>\"\n }\n ],\n \"messageId\": \"<string>\"\n },\n \"thread\": {\n \"threadId\": \"<string>\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/a2a/{assistant_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Accept"] = '<accept>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"jsonrpc\": \"2.0\",\n \"id\": \"<string>\",\n \"params\": {\n \"message\": {\n \"parts\": [\n {\n \"kind\": \"text\",\n \"text\": \"<string>\"\n }\n ],\n \"messageId\": \"<string>\"\n },\n \"thread\": {\n \"threadId\": \"<string>\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": "<string>",
"result": {},
"error": {
"code": 123,
"message": "<string>"
}
}Headers
Must be application/json
Available options:
application/json Path Parameters
The ID of the assistant to communicate with
Body
application/json
JSON-RPC version
Available options:
2.0 Request identifier
The method to invoke
Available options:
message/send, tasks/get Method parameters
- Message Send Parameters
- Task Get Parameters
Show child attributes
Show child attributes
Was this page helpful?
⌘I