Skip to main content

A2a registration API

This page documents the 1 gateway endpoint tagged a2a_registration in the gateway's OpenAPI document. Every example targets a gateway on http://localhost:4000 and authenticates with the SPANWAY_API_KEY environment variable, which holds the master key or a virtual key that has access to the route. Request and response fields are taken from the schema the running gateway publishes at /openapi.json, and the same document is bundled with this site as openapi.json.

MethodPathSummary
POST/v1/a2a/discoverFetch an upstream agent's card

Endpoints​

POST /v1/a2a/discover​

Fetch an upstream agent's card

Fetch the upstream agent's well-known card so the UI can show the admin which skills/capabilities the agent exposes.

Proxy admins only, so other keys cannot use the gateway to reach internal addresses. The Admin UI calls it while an admin registers an agent.

Example:

curl -X POST "http://localhost:4000/v1/a2a/discover" \
-H "Authorization: Bearer <admin_key>" \
-H "Content-Type: application/json" \
-d '{"url": "https://upstream-agent.example.com"}'

Request body (application/json, schema DiscoverAgentRequest):

FieldTypeRequiredDescription
discovery_modeDiscoveryModeNoHow to locate the upstream card. well_known_fallback for pure A2A agents (try standard paths); langgraph_platform for LangGraph Platform deployments where the card is shared across assistants and disambiguated by
paramsobject or nullNoMode-specific parameters. langgraph_platform requires {'assistant_id': &lt;id&gt;}. well_known_fallback ignores this.
urlstringYesBase URL of the upstream agent. Behavior depends on discovery_mode: well_known_fallback (default) tries /.well-known/agent-card.json, /.well-known/agent.json, /agent.json under this URL in order; ``langgraph_plat

Example request:

curl -X POST "http://localhost:4000/v1/a2a/discover" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://agent.example.com"
}'

Responses:

StatusDescriptionBody
200Successful responseapplication/json DiscoverAgentResponse
400Could not fetch agent card from https://agent.example.com (mode=well_known_fallback). Last error: HTTP 404 or langgraph_platform discovery requires params.assistant_idapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ErrorDetail
403Only proxy admins can discover agent cards. Your role=internal_userapplication/json ErrorDetail
422A field failed validation and the detail names itapplication/json ErrorDetail
500Discovery failed. The gateway log has the cause.application/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
agent_cardobjectYesAgent Card
urlstringYesUrl