A2A Protocol API Reference
Complete API documentation for the Agent-to-Agent (A2A) Protocol implementation
Overview
The Agent-to-Agent (A2A) Protocol API provides standardized communication between AI agents using JSON-RPC 2.0 over HTTP/HTTPS. This reference covers all available endpoints, methods, and implementation details for integrating with A2A-compatible agents.
Official Protocol: Based on Google’s A2A specification available at google.github.io/A2A. All endpoints follow JSON-RPC 2.0 standards for maximum interoperability.
Base URL Structure
All A2A endpoints follow this URL pattern:
Where:
{base_url}
is your Evo AI server URL (e.g.,http://localhost:8000
){agent_id}
is the unique identifier of the target agent
Authentication
API Key Authentication
Header: x-api-key
Standard API key authentication for secure agent access.
Core Methods
The A2A Protocol supports the following core methods:
Method | Purpose | Type |
---|---|---|
message/send | Send synchronous messages | HTTP Request |
message/stream | Send streaming messages | Server-Sent Events |
tasks/get | Get task status | HTTP Request |
tasks/cancel | Cancel running task | HTTP Request |
tasks/pushNotificationConfig/set | Configure webhooks | HTTP Request |
tasks/pushNotificationConfig/get | Get webhook config | HTTP Request |
tasks/resubscribe | Resubscribe to task | HTTP Request |
agent/authenticatedExtendedCard | Get agent metadata | HTTP Request |
Request Structure
All A2A requests follow the JSON-RPC 2.0 format:
Required Fields
Response Structure
A2A responses follow JSON-RPC 2.0 success/error patterns:
Success Response
Error Response
Task Lifecycle States
submitted
Task received and queued for processing
working
Task is currently being processed
completed
Task completed successfully
failed
Task failed during processing
Multi-turn Conversations
A2A supports multi-turn conversations using contextId
:
- First message: Send without
contextId
- Response: Server returns
contextId
in result - Subsequent messages: Include
contextId
in params - Context preservation: Server maintains conversation history
File Upload Support
A2A supports file uploads via Base64 encoding in message parts:
File Encoding: Use Base64 encoding without the data:mime/type;base64,
header.
Only include the pure Base64 content in the bytes
field.
Streaming with Server-Sent Events
For message/stream
method, responses are delivered via Server-Sent Events:
Push Notifications (Webhooks)
Configure webhooks for asynchronous task notifications:
Set Webhook Configuration
Webhook Payload
Your webhook endpoint will receive:
Error Codes
Code | Description | Resolution |
---|---|---|
-32700 | Parse error | Check JSON syntax |
-32600 | Invalid request | Verify JSON-RPC 2.0 format |
-32601 | Method not found | Check method name spelling |
-32602 | Invalid params | Verify parameter structure |
-32603 | Internal error | Server-side issue, retry later |
-32000 | Agent error | Agent-specific error, check message |
Rate Limiting
Testing Your Integration
Interactive A2A Lab
Use our interactive testing environment to experiment with A2A methods and see real-time responses.
Next Steps
Message Endpoints
Learn about synchronous and streaming message methods
Task Management
Explore task lifecycle and management operations
Agent Metadata
Get agent information and capabilities
Webhook Configuration
Set up push notifications for asynchronous updates
Ready to integrate? Start with the message/send endpoint for basic agent communication.