Send a standard A2A JSON-RPC request
const url = 'https://a2a.infiniteaudience.ai/a2a';const options = { method: 'POST', headers: { 'A2A-Version': '1.0', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"jsonrpc":"2.0","id":"example","method":"example","params":{"message":{"messageId":"example","role":"example","parts":[{}]},"metadata":{"skill":"example","campaign_id":"example"},"configuration":{"returnImmediately":true},"id":"example"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://a2a.infiniteaudience.ai/a2a \ --header 'A2A-Version: 1.0' \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "id": "example", "method": "example", "params": { "message": { "messageId": "example", "role": "example", "parts": [ {} ] }, "metadata": { "skill": "example", "campaign_id": "example" }, "configuration": { "returnImmediately": true }, "id": "example" } }'A2A 1.0 JSON-RPC accepts SendMessage, SendStreamingMessage, GetTask, CancelTask, and SubscribeToTask. A2A 0.3 accepts message/send, message/stream, tasks/get, tasks/cancel, and tasks/resubscribe. Streaming methods return server-sent events. For SendMessage, send an advertised skill id as params.metadata.skill; an omitted skill is restricted to general discovery. Requires ‘discovery’ scope for unhinted requests and discovery skills, ‘creator’ scope for matching, audience mutation and delivery skills, or ‘account’ scope for read-only account-info. Task reads and cancellation are restricted to the owning organization. Credit-purchase, portal and organization-administration skills are unavailable on public A2A.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
object
object
object
object
object
Responses
Section titled “Responses”JSON-RPC result/error envelope or SSE stream.
Invalid request — malformed body, missing required attribute, or failed validation. See error and message for details.
object
Stable machine-readable error code (e.g. INVALID_STATUS_TRANSITION, BILLING_INSUFFICIENT_BALANCE). Always present.
Human-readable explanation of the error.
Alternate machine-readable code — present on some endpoints as an alias for error for backward compatibility.
Opaque support/debug identifier when available.
Public action for correcting the request or retrying later.
object
JSON path to the invalid filter field or value.
Examples
{ "error": "Bad Request", "code": "MISSING_SEGMENTS", "message": "segment_ids is required for filter audiences."}Missing or invalid Bearer token. Obtain one via POST /v1/auth/token. When a token was supplied but rejected, code distinguishes TOKEN_EXPIRED (the token’s lifetime has passed — request a new one via POST /v1/auth/token and retry) from TOKEN_INVALID (malformed or revoked — re-authenticate).
object
Stable machine-readable error code (e.g. INVALID_STATUS_TRANSITION, BILLING_INSUFFICIENT_BALANCE). Always present.
Human-readable explanation of the error.
Alternate machine-readable code — present on some endpoints as an alias for error for backward compatibility.
Opaque support/debug identifier when available.
Public action for correcting the request or retrying later.
object
JSON path to the invalid filter field or value.
Examples
{ "error": "Unauthorized: Missing or invalid Authorization header"}{ "error": "Unauthorized", "code": "TOKEN_EXPIRED", "message": "Your session has expired. Please sign in again."}Token is valid but lacks the required scope for this endpoint. Check the endpoint description for the required scope (discovery, purchase, or account).
object
Stable machine-readable error code (e.g. INVALID_STATUS_TRANSITION, BILLING_INSUFFICIENT_BALANCE). Always present.
Human-readable explanation of the error.
Alternate machine-readable code — present on some endpoints as an alias for error for backward compatibility.
Opaque support/debug identifier when available.
Public action for correcting the request or retrying later.
object
JSON path to the invalid filter field or value.
Examples
{ "error": "SCOPE_REQUIRED", "message": "This endpoint requires the creator scope."}