A2A agents
Register a remote A2A agent
Registers a remote agent that speaks the A2A protocol. Its Agent Card is fetched from inside the serverless sandbox on a best-effort basis: when the fetch fails the record is still stored, with an empty cardSummary (fetchedAt 0) that marks it as not connected; the reason is available from GET /a2a-agents//card. Registration creates exactly one read-only tool row (source “a2a”) that can be attached to agents and skills. Credentials are not accepted here — an oAuth2, basic or customHeader agent references a Cognigy Connection by referenceId.
POST
/
a2a-agents
Register a remote A2A agent
curl --request POST \
--url https://api-trial.cognigy.ai/v1/a2a-agents \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"agentBaseUrl": "https://agent.example.com",
"name": "Travel Agent",
"projectId": "507f1f77bcf86cd799439011",
"agentCardPath": ".well-known/agent-card.json",
"authConnectionReferenceId": "550e8400-e29b-41d4-a716-446655440000",
"authForDiscovery": false,
"authType": "none",
"executionMode": "blocking",
"maxAutonomousTurns": 4,
"skillFilter": {
"mode": "none",
"skillIds": [
"book-flight"
]
},
"taskTimeoutSeconds": 60,
"timeoutSeconds": 12
}
'import requests
url = "https://api-trial.cognigy.ai/v1/a2a-agents"
payload = {
"agentBaseUrl": "https://agent.example.com",
"name": "Travel Agent",
"projectId": "507f1f77bcf86cd799439011",
"agentCardPath": ".well-known/agent-card.json",
"authConnectionReferenceId": "550e8400-e29b-41d4-a716-446655440000",
"authForDiscovery": False,
"authType": "none",
"executionMode": "blocking",
"maxAutonomousTurns": 4,
"skillFilter": {
"mode": "none",
"skillIds": ["book-flight"]
},
"taskTimeoutSeconds": 60,
"timeoutSeconds": 12
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agentBaseUrl: 'https://agent.example.com',
name: 'Travel Agent',
projectId: '507f1f77bcf86cd799439011',
agentCardPath: '.well-known/agent-card.json',
authConnectionReferenceId: '550e8400-e29b-41d4-a716-446655440000',
authForDiscovery: false,
authType: 'none',
executionMode: 'blocking',
maxAutonomousTurns: 4,
skillFilter: {mode: 'none', skillIds: ['book-flight']},
taskTimeoutSeconds: 60,
timeoutSeconds: 12
})
};
fetch('https://api-trial.cognigy.ai/v1/a2a-agents', 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-trial.cognigy.ai/v1/a2a-agents",
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([
'agentBaseUrl' => 'https://agent.example.com',
'name' => 'Travel Agent',
'projectId' => '507f1f77bcf86cd799439011',
'agentCardPath' => '.well-known/agent-card.json',
'authConnectionReferenceId' => '550e8400-e29b-41d4-a716-446655440000',
'authForDiscovery' => false,
'authType' => 'none',
'executionMode' => 'blocking',
'maxAutonomousTurns' => 4,
'skillFilter' => [
'mode' => 'none',
'skillIds' => [
'book-flight'
]
],
'taskTimeoutSeconds' => 60,
'timeoutSeconds' => 12
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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-trial.cognigy.ai/v1/a2a-agents"
payload := strings.NewReader("{\n \"agentBaseUrl\": \"https://agent.example.com\",\n \"name\": \"Travel Agent\",\n \"projectId\": \"507f1f77bcf86cd799439011\",\n \"agentCardPath\": \".well-known/agent-card.json\",\n \"authConnectionReferenceId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"authForDiscovery\": false,\n \"authType\": \"none\",\n \"executionMode\": \"blocking\",\n \"maxAutonomousTurns\": 4,\n \"skillFilter\": {\n \"mode\": \"none\",\n \"skillIds\": [\n \"book-flight\"\n ]\n },\n \"taskTimeoutSeconds\": 60,\n \"timeoutSeconds\": 12\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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-trial.cognigy.ai/v1/a2a-agents")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agentBaseUrl\": \"https://agent.example.com\",\n \"name\": \"Travel Agent\",\n \"projectId\": \"507f1f77bcf86cd799439011\",\n \"agentCardPath\": \".well-known/agent-card.json\",\n \"authConnectionReferenceId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"authForDiscovery\": false,\n \"authType\": \"none\",\n \"executionMode\": \"blocking\",\n \"maxAutonomousTurns\": 4,\n \"skillFilter\": {\n \"mode\": \"none\",\n \"skillIds\": [\n \"book-flight\"\n ]\n },\n \"taskTimeoutSeconds\": 60,\n \"timeoutSeconds\": 12\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-trial.cognigy.ai/v1/a2a-agents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agentBaseUrl\": \"https://agent.example.com\",\n \"name\": \"Travel Agent\",\n \"projectId\": \"507f1f77bcf86cd799439011\",\n \"agentCardPath\": \".well-known/agent-card.json\",\n \"authConnectionReferenceId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"authForDiscovery\": false,\n \"authType\": \"none\",\n \"executionMode\": \"blocking\",\n \"maxAutonomousTurns\": 4,\n \"skillFilter\": {\n \"mode\": \"none\",\n \"skillIds\": [\n \"book-flight\"\n ]\n },\n \"taskTimeoutSeconds\": 60,\n \"timeoutSeconds\": 12\n}"
response = http.request(request)
puts response.read_body{
"agentBaseUrl": "<string>",
"agentCardPath": "<string>",
"authConnectionReferenceId": "<string>",
"authForDiscovery": true,
"authType": "none",
"cardSummary": {
"description": "<string>",
"extended": true,
"fetchedAt": 123,
"interfaceUrl": "<string>",
"name": "<string>",
"protocolVersion": "0.3",
"sha256": "<string>",
"skills": [
{
"description": "<string>",
"examples": [
"<string>"
],
"id": "<string>",
"name": "<string>",
"tags": [
"<string>"
]
}
],
"streaming": true
},
"createdAt": 123,
"createdBy": "507f1f77bcf86cd799439011",
"executionMode": "blocking",
"id": "507f1f77bcf86cd799439011",
"lastChangedAt": 123,
"lastChangedBy": "507f1f77bcf86cd799439011",
"maxAutonomousTurns": 4,
"name": "<string>",
"organisationId": "507f1f77bcf86cd799439011",
"projectId": "507f1f77bcf86cd799439011",
"referenceId": "550e8400-e29b-41d4-a716-446655440000",
"skillFilter": {
"mode": "none",
"skillIds": [
"<string>"
]
},
"taskTimeoutSeconds": 60,
"timeoutSeconds": 12,
"tool": {
"id": "507f1f77bcf86cd799439011",
"referenceId": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"code": "reserved_tool_name",
"detail": "request body validation failed",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
],
"instance": "/v1/{resource}",
"status": 400,
"title": "Bad Request",
"traceId": "api--a4d2f126-bec4-4544-a049-7c0cf08524ed",
"type": "about:blank"
}{
"detail": "access denied: insufficient permissions",
"instance": "/v1/{resource}/{id}",
"status": 403,
"title": "Forbidden",
"traceId": "api--a4d2f126-bec4-4544-a049-7c0cf08524ed",
"type": "about:blank"
}{
"detail": "a resource with this identifier already exists",
"instance": "/v1/{resource}",
"status": 409,
"title": "Conflict",
"traceId": "api--a4d2f126-bec4-4544-a049-7c0cf08524ed",
"type": "about:blank"
}{
"detail": "internal server error",
"instance": "/v1/{resource}",
"status": 500,
"title": "Internal Server Error",
"traceId": "api--a4d2f126-bec4-4544-a049-7c0cf08524ed",
"type": "about:blank"
}Body
application/json
A2A agent data
Response
Created
⌘I
Register a remote A2A agent
curl --request POST \
--url https://api-trial.cognigy.ai/v1/a2a-agents \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"agentBaseUrl": "https://agent.example.com",
"name": "Travel Agent",
"projectId": "507f1f77bcf86cd799439011",
"agentCardPath": ".well-known/agent-card.json",
"authConnectionReferenceId": "550e8400-e29b-41d4-a716-446655440000",
"authForDiscovery": false,
"authType": "none",
"executionMode": "blocking",
"maxAutonomousTurns": 4,
"skillFilter": {
"mode": "none",
"skillIds": [
"book-flight"
]
},
"taskTimeoutSeconds": 60,
"timeoutSeconds": 12
}
'import requests
url = "https://api-trial.cognigy.ai/v1/a2a-agents"
payload = {
"agentBaseUrl": "https://agent.example.com",
"name": "Travel Agent",
"projectId": "507f1f77bcf86cd799439011",
"agentCardPath": ".well-known/agent-card.json",
"authConnectionReferenceId": "550e8400-e29b-41d4-a716-446655440000",
"authForDiscovery": False,
"authType": "none",
"executionMode": "blocking",
"maxAutonomousTurns": 4,
"skillFilter": {
"mode": "none",
"skillIds": ["book-flight"]
},
"taskTimeoutSeconds": 60,
"timeoutSeconds": 12
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agentBaseUrl: 'https://agent.example.com',
name: 'Travel Agent',
projectId: '507f1f77bcf86cd799439011',
agentCardPath: '.well-known/agent-card.json',
authConnectionReferenceId: '550e8400-e29b-41d4-a716-446655440000',
authForDiscovery: false,
authType: 'none',
executionMode: 'blocking',
maxAutonomousTurns: 4,
skillFilter: {mode: 'none', skillIds: ['book-flight']},
taskTimeoutSeconds: 60,
timeoutSeconds: 12
})
};
fetch('https://api-trial.cognigy.ai/v1/a2a-agents', 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-trial.cognigy.ai/v1/a2a-agents",
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([
'agentBaseUrl' => 'https://agent.example.com',
'name' => 'Travel Agent',
'projectId' => '507f1f77bcf86cd799439011',
'agentCardPath' => '.well-known/agent-card.json',
'authConnectionReferenceId' => '550e8400-e29b-41d4-a716-446655440000',
'authForDiscovery' => false,
'authType' => 'none',
'executionMode' => 'blocking',
'maxAutonomousTurns' => 4,
'skillFilter' => [
'mode' => 'none',
'skillIds' => [
'book-flight'
]
],
'taskTimeoutSeconds' => 60,
'timeoutSeconds' => 12
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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-trial.cognigy.ai/v1/a2a-agents"
payload := strings.NewReader("{\n \"agentBaseUrl\": \"https://agent.example.com\",\n \"name\": \"Travel Agent\",\n \"projectId\": \"507f1f77bcf86cd799439011\",\n \"agentCardPath\": \".well-known/agent-card.json\",\n \"authConnectionReferenceId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"authForDiscovery\": false,\n \"authType\": \"none\",\n \"executionMode\": \"blocking\",\n \"maxAutonomousTurns\": 4,\n \"skillFilter\": {\n \"mode\": \"none\",\n \"skillIds\": [\n \"book-flight\"\n ]\n },\n \"taskTimeoutSeconds\": 60,\n \"timeoutSeconds\": 12\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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-trial.cognigy.ai/v1/a2a-agents")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agentBaseUrl\": \"https://agent.example.com\",\n \"name\": \"Travel Agent\",\n \"projectId\": \"507f1f77bcf86cd799439011\",\n \"agentCardPath\": \".well-known/agent-card.json\",\n \"authConnectionReferenceId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"authForDiscovery\": false,\n \"authType\": \"none\",\n \"executionMode\": \"blocking\",\n \"maxAutonomousTurns\": 4,\n \"skillFilter\": {\n \"mode\": \"none\",\n \"skillIds\": [\n \"book-flight\"\n ]\n },\n \"taskTimeoutSeconds\": 60,\n \"timeoutSeconds\": 12\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-trial.cognigy.ai/v1/a2a-agents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agentBaseUrl\": \"https://agent.example.com\",\n \"name\": \"Travel Agent\",\n \"projectId\": \"507f1f77bcf86cd799439011\",\n \"agentCardPath\": \".well-known/agent-card.json\",\n \"authConnectionReferenceId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"authForDiscovery\": false,\n \"authType\": \"none\",\n \"executionMode\": \"blocking\",\n \"maxAutonomousTurns\": 4,\n \"skillFilter\": {\n \"mode\": \"none\",\n \"skillIds\": [\n \"book-flight\"\n ]\n },\n \"taskTimeoutSeconds\": 60,\n \"timeoutSeconds\": 12\n}"
response = http.request(request)
puts response.read_body{
"agentBaseUrl": "<string>",
"agentCardPath": "<string>",
"authConnectionReferenceId": "<string>",
"authForDiscovery": true,
"authType": "none",
"cardSummary": {
"description": "<string>",
"extended": true,
"fetchedAt": 123,
"interfaceUrl": "<string>",
"name": "<string>",
"protocolVersion": "0.3",
"sha256": "<string>",
"skills": [
{
"description": "<string>",
"examples": [
"<string>"
],
"id": "<string>",
"name": "<string>",
"tags": [
"<string>"
]
}
],
"streaming": true
},
"createdAt": 123,
"createdBy": "507f1f77bcf86cd799439011",
"executionMode": "blocking",
"id": "507f1f77bcf86cd799439011",
"lastChangedAt": 123,
"lastChangedBy": "507f1f77bcf86cd799439011",
"maxAutonomousTurns": 4,
"name": "<string>",
"organisationId": "507f1f77bcf86cd799439011",
"projectId": "507f1f77bcf86cd799439011",
"referenceId": "550e8400-e29b-41d4-a716-446655440000",
"skillFilter": {
"mode": "none",
"skillIds": [
"<string>"
]
},
"taskTimeoutSeconds": 60,
"timeoutSeconds": 12,
"tool": {
"id": "507f1f77bcf86cd799439011",
"referenceId": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"code": "reserved_tool_name",
"detail": "request body validation failed",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
],
"instance": "/v1/{resource}",
"status": 400,
"title": "Bad Request",
"traceId": "api--a4d2f126-bec4-4544-a049-7c0cf08524ed",
"type": "about:blank"
}{
"detail": "access denied: insufficient permissions",
"instance": "/v1/{resource}/{id}",
"status": 403,
"title": "Forbidden",
"traceId": "api--a4d2f126-bec4-4544-a049-7c0cf08524ed",
"type": "about:blank"
}{
"detail": "a resource with this identifier already exists",
"instance": "/v1/{resource}",
"status": 409,
"title": "Conflict",
"traceId": "api--a4d2f126-bec4-4544-a049-7c0cf08524ed",
"type": "about:blank"
}{
"detail": "internal server error",
"instance": "/v1/{resource}",
"status": 500,
"title": "Internal Server Error",
"traceId": "api--a4d2f126-bec4-4544-a049-7c0cf08524ed",
"type": "about:blank"
}