POST
/
api
/
v1
/
a2a
/
{agent_id}
curl -X POST "http://localhost:8000/api/v1/a2a/my-agent" \
  -H "Content-Type: application/json" \
  -H "x-api-key: your-api-key" \
  -d '{
    "jsonrpc": "2.0",
    "id": "req-webhook-config",
    "method": "tasks/pushNotificationConfig/set",
    "params": {
      "config": {
        "url": "https://your-server.com/webhook/a2a",
        "headers": {
          "Authorization": "Bearer webhook-token",
          "X-Webhook-Source": "evo-ai"
        },
        "events": ["task.completed", "task.failed"],
        "retryPolicy": {
          "maxRetries": 5,
          "backoffMultiplier": 2.0,
          "initialDelay": 2
        },
        "secret": "your-webhook-secret"
      }
    }
  }'
{
  "jsonrpc": "2.0",
  "result": {
    "configured": true,
    "configId": "webhook-config-123",
    "url": "https://your-server.com/webhook/a2a",
    "events": ["task.completed", "task.failed"]
  },
  "id": "req-webhook-config"
}

Overview

These endpoints allow you to configure push notifications (webhooks) for asynchronous task updates and retrieve detailed agent information for better integration planning.

Push Notifications: Webhooks enable real-time notifications about task status changes, perfect for long-running operations where polling isn’t efficient.


tasks/pushNotificationConfig/set

Configure webhook endpoints to receive push notifications about task status changes.

Request Parameters

jsonrpc
string
required

JSON-RPC version, must be "2.0"

id
string
required

Unique identifier for this request

method
string
required

Must be "tasks/pushNotificationConfig/set"

params
object
required

Webhook configuration parameters

Response

jsonrpc
string

JSON-RPC version, always "2.0"

result
object

Configuration result

Example

curl -X POST "http://localhost:8000/api/v1/a2a/my-agent" \
  -H "Content-Type: application/json" \
  -H "x-api-key: your-api-key" \
  -d '{
    "jsonrpc": "2.0",
    "id": "req-webhook-config",
    "method": "tasks/pushNotificationConfig/set",
    "params": {
      "config": {
        "url": "https://your-server.com/webhook/a2a",
        "headers": {
          "Authorization": "Bearer webhook-token",
          "X-Webhook-Source": "evo-ai"
        },
        "events": ["task.completed", "task.failed"],
        "retryPolicy": {
          "maxRetries": 5,
          "backoffMultiplier": 2.0,
          "initialDelay": 2
        },
        "secret": "your-webhook-secret"
      }
    }
  }'
{
  "jsonrpc": "2.0",
  "result": {
    "configured": true,
    "configId": "webhook-config-123",
    "url": "https://your-server.com/webhook/a2a",
    "events": ["task.completed", "task.failed"]
  },
  "id": "req-webhook-config"
}

tasks/pushNotificationConfig/get

Retrieve current webhook configuration for the agent.

Request Parameters

jsonrpc
string
required

JSON-RPC version, must be "2.0"

id
string
required

Unique identifier for this request

method
string
required

Must be "tasks/pushNotificationConfig/get"

params
object

Optional parameters

Response

jsonrpc
string

JSON-RPC version, always "2.0"

result
object

Current webhook configuration

Example

curl -X POST "http://localhost:8000/api/v1/a2a/my-agent" \
  -H "Content-Type: application/json" \
  -H "x-api-key: your-api-key" \
  -d '{
    "jsonrpc": "2.0",
    "id": "req-get-webhook",
    "method": "tasks/pushNotificationConfig/get",
    "params": {}
  }'
{
  "jsonrpc": "2.0",
  "result": {
    "config": {
      "url": "https://your-server.com/webhook/a2a",
      "events": ["task.completed", "task.failed"],
      "retryPolicy": {
        "maxRetries": 5,
        "backoffMultiplier": 2.0,
        "initialDelay": 2
      },
      "createdAt": "2024-01-15T10:30:00Z",
      "lastUsed": "2024-01-15T11:45:30Z"
    },
    "configId": "webhook-config-123",
    "active": true
  },
  "id": "req-get-webhook"
}

agent/authenticatedExtendedCard

Get detailed information about the agent, including capabilities, supported features, and metadata.

Request Parameters

jsonrpc
string
required

JSON-RPC version, must be "2.0"

id
string
required

Unique identifier for this request

method
string
required

Must be "agent/authenticatedExtendedCard"

params
object

Optional parameters

Response

jsonrpc
string

JSON-RPC version, always "2.0"

result
object

Agent information

Example

curl -X POST "http://localhost:8000/api/v1/a2a/my-agent" \
  -H "Content-Type: application/json" \
  -H "x-api-key: your-api-key" \
  -d '{
    "jsonrpc": "2.0",
    "id": "req-agent-info",
    "method": "agent/authenticatedExtendedCard",
    "params": {
      "includeCapabilities": true,
      "includeMetrics": true
    }
  }'
{
  "jsonrpc": "2.0",
  "result": {
    "agent": {
      "id": "my-agent",
      "name": "Customer Support Assistant",
      "description": "AI agent specialized in customer support and FAQ responses",
      "version": "1.2.0",
      "type": "llm",
      "status": "active"
    },
    "capabilities": {
      "supportedMethods": [
        "message/send",
        "message/stream",
        "tasks/get",
        "tasks/cancel",
        "tasks/pushNotificationConfig/set",
        "tasks/pushNotificationConfig/get",
        "agent/authenticatedExtendedCard"
      ],
      "fileUpload": {
        "supported": true,
        "maxFileSize": 5242880,
        "supportedTypes": [
          "text/plain",
          "application/pdf",
          "image/jpeg",
          "image/png"
        ]
      },
      "streaming": true,
      "multiTurn": true,
      "webhooks": true
    },
    "limits": {
      "requestsPerMinute": 100,
      "concurrentTasks": 10,
      "maxMessageLength": 10000
    },
    "metrics": {
      "totalRequests": 15420,
      "averageResponseTime": 850,
      "successRate": 98.5
    }
  },
  "id": "req-agent-info"
}

Webhook Payload Format

When webhooks are configured, your endpoint will receive POST requests with the following payload structure:

Webhook Request Headers

Content-Type: application/json
X-Webhook-Event: task.completed
X-Webhook-Signature: sha256=<hmac-signature>
X-Webhook-Delivery: <delivery-id>
User-Agent: EvoAI-Webhook/1.0

Webhook Payload

{
  "event": "task.completed",
  "timestamp": "2024-01-15T10:32:15Z",
  "agentId": "my-agent",
  "taskId": "task-123",
  "data": {
    "status": {
      "state": "completed",
      "message": {
        "role": "agent",
        "parts": [
          {
            "type": "text",
            "text": "Task completed successfully"
          }
        ]
      }
    },
    "contextId": "ctx-abc123",
    "duration": 125000,
    "completedAt": "2024-01-15T10:32:15Z"
  },
  "delivery": {
    "attempt": 1,
    "maxAttempts": 5
  }
}

Webhook Events

Webhook Security

Signature Verification

If you provide a secret in your webhook configuration, each webhook request will include an HMAC-SHA256 signature:

const crypto = require('crypto');

function verifyWebhookSignature(payload, signature, secret) {
  const expectedSignature = crypto
    .createHmac('sha256', secret)
    .update(payload, 'utf8')
    .digest('hex');
  
  return `sha256=${expectedSignature}` === signature;
}

// Usage
const isValid = verifyWebhookSignature(
  JSON.stringify(webhookPayload),
  request.headers['x-webhook-signature'],
  'your-webhook-secret'
);

Best Practices