API7 Docs

Create A2A Agent

POST /a2a_agents

POST /a2a_agents

Interactive request editor loads with JavaScript.

Authorization

BearerAdminToken
AuthorizationBearer <token>

Organization-scoped admin token. Read operations require a valid token, and write operations require a token with write permission.

In: header

Request Body

application/json

Register an organization-scoped A2A agent and select the environments allowed to expose it.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "$AISIX_CP/a2a_agents" \  -H "Authorization: Bearer $AISIX_TOKEN" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "url": "http://example.com"  }'

Created

{
  "a2a_agent": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
    "name": "string",
    "url": "http://example.com",
    "protocol_version": "1.0",
    "auth_type": "none",
    "timeout_ms": 1,
    "enabled": true,
    "allowed_environments": [
      "2f8fd63c-350f-4e43-9e38-47af879eaada"
    ],
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  }
}
Complete operation details and schema variants

POST /a2a_agents

Create A2A Agent

Register an upstream A2A agent and expose it to the allowed environments.

Parameters

Request body

Content type: application/json

  • name (string, required): Organization-unique name used as the URL path segment. May contain letters, digits, _, ., and -, but cannot start or end with a separator character.

  • url (string, required): Upstream A2A agent URL.

  • protocol_version (string, optional): A2A wire-format version. Defaults to 1.0 when omitted.

  • auth_type (string, optional): Authentication mode used when AISIX connects to the upstream agent. Defaults to none when omitted.

  • secret (string, optional): The credential — a bearer token or an API key depending on auth_type; write-only (envelope-encrypted on the server, never returned). Required for bearer / api_key; must be absent/empty when auth_type is none.

  • timeout_ms (integer, optional): Per-request timeout in milliseconds.

  • enabled (boolean, optional): Whether the agent is dispatched to the data plane.

  • allowed_environments (array, optional): Environments this agent is exposed to. Empty or null values expose it to no environment.

Responses

  • 201: Created

  • a2a_agent (object, required): An upstream A2A (Agent-to-Agent) agent registered at the organization level and exposed to the environments listed in allowed_environments. The secret (bearer token or API key depending on auth_type) is write-only and never appears in this view.

  • a2a_agent.id (string, required): A2A agent ID.

  • a2a_agent.org_id (string, required): Organization ID that owns this A2A agent.

  • a2a_agent.name (string, required): Organization-unique name used as the URL path segment the agent is exposed under. Names may contain letters, digits, _, ., and -, but cannot start or end with a separator character.

  • a2a_agent.url (string, required): Upstream A2A agent URL.

  • a2a_agent.protocol_version (string, required): A2A wire-format version pinned for this agent.

  • a2a_agent.auth_type (string, required): How AISIX authenticates to the upstream agent. none = no credential; bearer = a bearer token supplied as secret; api_key = an API key supplied as secret and sent as the x-api-key header.

  • a2a_agent.timeout_ms (integer, optional): Per-request timeout in milliseconds. AISIX applies its default when this value is unset.

  • a2a_agent.enabled (boolean, required): Whether the agent is dispatched to the data plane.

  • a2a_agent.allowed_environments (array, required): Environment UUIDs this agent is projected to. Empty array = projected to no environment.

  • a2a_agent.created_at (string, required): Time when the A2A agent was created.

  • a2a_agent.updated_at (string, required): Time when the A2A agent was last updated.

  • 400: Request body or parameters failed validation.

  • error (object, required): Error details.

  • error.code (string, required): Machine-readable identifier. Examples: UNAUTHENTICATED, INVALID_REQUEST, MASTER_KEY_UNSET, INTERNAL.

  • error.message (string, required): Human-readable explanation; safe to surface to operators.

  • 401: Missing or invalid bearer. Response fields (application/json): identical to POST /a2a_agents, response 400 above.

  • 403: Authenticated request is not permitted. Response fields (application/json): identical to POST /a2a_agents, response 400 above.

  • 409: Request conflicts with current resource state. Response fields (application/json): identical to POST /a2a_agents, response 400 above.

cURL

curl -X POST '$AISIX_CP/a2a_agents' -H 'Authorization: Bearer $AISIX_TOKEN'