Skip to Content
A2A Public APIInvoking Agents

Invoking Agents

POST /v1/a2a/invoke

Invoke an agent using JSON-RPC 2.0 SendMessage:

curl -X POST https://api.cendriix.ai/v1/a2a/invoke \ -H "Authorization: DPoP $ACCESS_TOKEN" \ -H "DPoP: $DPOP_PROOF" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "jsonrpc": "2.0", "method": "a2a.sendMessage", "params": { "agentId": "code-reviewer", "message": { "role": "user", "parts": [{ "text": "Review PR #42 for security issues" }] } } }'

Request format

interface InvokeRequest { jsonrpc: '2.0'; method: 'a2a.sendMessage'; params: { agentId: string; // Agent slug or UUID sessionId?: string; // Group messages in a session message: { role: 'user'; parts: A2aPart[]; // Content parts (text, data, url, raw) }; skillIds?: string[]; // Scope to specific skills configuration?: { acceptedOutputModes?: string[]; taskPushNotificationConfig?: { url: string; headers?: Record<string, string>; }; historyLength?: number; returnImmediately?: boolean; }; }; }

Response format

interface InvokeResponse { jsonrpc: '2.0'; result: { task: { id: string; agentId: string; status: A2aTaskState; artifacts: A2aArtifact[]; messages: A2aMessage[]; createdAt: string; updatedAt: string; }; }; }

For long-running tasks, the response returns immediately with status: 'SUBMITTED'. Poll via GET /v1/a2a/tasks/:id or subscribe via SSE streaming.

Content parts

Each message contains one or more parts. Exactly one content field must be set per part:

FieldTypeUse case
textstringPlain text or markdown content
dataunknownStructured JSON payload
urlstringURL reference (file, webpage, API endpoint)
rawstringBase64-encoded binary data

Additional fields: metadata, filename, mediaType.

Task states

SUBMITTED → WORKING → COMPLETED → FAILED → CANCELED → REJECTED → INPUT_REQUIRED → AUTH_REQUIRED
StateTerminalDescription
SUBMITTEDNoTask received, queued for execution
WORKINGNoAgent actively processing
INPUT_REQUIREDNoAgent paused, waiting for additional input
AUTH_REQUIREDNoAgent paused, waiting for auth action
COMPLETEDYesTask finished successfully
FAILEDYesTask failed with error
CANCELEDYesTask canceled by client
REJECTEDYesTask rejected (unauthorized, invalid, or quota exceeded)

Idempotency

Include an Idempotency-Key header with a unique value (UUID recommended). If a request is retried within 24 hours with the same key, the original result is returned instead of re-executing.

Last updated on