Skip to main content

API reference

The canonical machine-readable contract is openapi.yaml.

Base URL​

https://giant-tree-edge-staging.giant-tree.workers.dev

Authentication types​

CallerCredential
Door REST/MCP/A2ABearer door token
Tenant consolegt_console HttpOnly cookie
Platform adminX-Admin-Key or gt_platform cookie
SCIMBearer SCIM token

Door tokens are scoped to a tenant, door, surface and set of scopes.

Error shape​

{
"error": {
"code": "not_entitled",
"message": "You cannot use this door.",
"retryable": false,
"retry_after_ms": null,
"request_id": "req_..."
},
"next_step": "Ask a tenant admin for access.",
"tracking_id": "trk_..."
}

Always include request_id when contacting support.

Health and discovery​

GET /health
GET /.well-known/jwks.json
GET /.well-known/oauth-protected-resource/{tenant}/{door}
GET /.well-known/agent-card.json

Example​

curl https://YOUR_HOST/health

Sessions​

POST /v1/tenants/{tenant}/doors/{door}/sessions
Authorization: Bearer <door-token>
Content-Type: application/json

{}

Response:

{
"session_id": "s_...",
"tenant_id": "acme",
"door_id": "support",
"status": "open",
"expires_at": "..."
}

Route​

POST /v1/tenants/{tenant}/doors/{door}/route
curl -X POST \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-d '{"message":"show my open tickets"}' \
https://YOUR_HOST/v1/tenants/acme/doors/support/route

Response candidates include agent ID, score, confidence and next step.

Ask​

POST /v1/tenants/{tenant}/doors/{door}/ask
Idempotency-Key: <unique-key>
curl -X POST \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"message":"hello","agent_id":"support-agent"}' \
https://YOUR_HOST/v1/tenants/acme/doors/support/ask

Idempotency-Key is required. Reusing it with a different body returns idempotency_conflict. Reusing it with the same body replays the stored result.

Common statuses:

  • completed
  • running
  • auth_required
  • awaiting_approval
  • no_access
  • outcome_unknown
  • failed

Actions​

POST /v1/tenants/{tenant}/doors/{door}/sessions/{sessionId}/actions
GET /v1/tenants/{tenant}/doors/{door}/sessions/{sessionId}/actions/{actionId}
POST /v1/tenants/{tenant}/doors/{door}/sessions/{sessionId}/actions/{actionId}/pause
POST /v1/tenants/{tenant}/doors/{door}/sessions/{sessionId}/actions/{actionId}/resume
POST /v1/tenants/{tenant}/doors/{door}/sessions/{sessionId}/actions/{actionId}/cancel

Actions require Idempotency-Key. wait_ms: 0 runs in the background.

Fan-out​

POST /v1/tenants/{tenant}/doors/{door}/fanouts
GET /v1/tenants/{tenant}/doors/{door}/fanouts/{fanoutId}
POST /v1/tenants/{tenant}/doors/{door}/fanouts/{fanoutId}/cancel

Fan-out is off by default and bounded by door configuration and trial limits.

MCP​

POST /mcp/{tenant}/{door}
curl -X POST \
-H "Authorization: Bearer $MCP_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' \
https://YOUR_HOST/mcp/acme/support

Supported tools include:

  • route_request
  • ask_agent
  • ask_agents
  • create_action
  • get_action
  • cancel_action
  • get_fanout
  • cancel_fanout
  • get_session

A2A​

POST /a2a/{tenant}/{door}
curl -X POST \
-H "Authorization: Bearer $A2A_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"message/send","params":{"message":{"role":"user","parts":[{"text":"hello"}]}}}' \
https://YOUR_HOST/a2a/acme/support

Delegated OAuth​

Agent OAuth uses an authorization-code flow with PKCE. After a call returns auth_required with an auth_url:

  1. Open auth_url.
  2. Complete the provider login.
  3. The provider redirects to /oauth/callback.
  4. Retry the ask with a new idempotency key.

The token is stored per tenant, agent and principal.

Console APIs​

Connectors​

GET /console/api/connectors
POST /console/api/connectors/definitions
PATCH /console/api/connectors/definitions/{key}/{version}
DELETE /console/api/connectors/definitions/{key}/{version}
POST /console/api/connectors/definitions/{key}/{version}/submit
POST /console/api/connectors/installations
PATCH /console/api/connectors/installations/{id}
PUT /console/api/connectors/installations/{id}/credentials
POST /console/api/connectors/installations/{id}/test
DELETE /console/api/connectors/installations/{id}

Agents and doors​

GET /console/api/agents
POST /console/api/agents
GET /console/api/agents/{id}
PATCH /console/api/agents/{id}
DELETE /console/api/agents/{id}

GET /console/api/doors
POST /console/api/doors
PATCH /console/api/doors/{door}
DELETE /console/api/doors/{door}
POST /console/api/doors/{door}/publish
POST /console/api/doors/{door}/status

Platform​

GET /v1/admin/tenants
POST /v1/admin/tenants/{tenant}/approve
POST /v1/admin/tenants/{tenant}/extend-trial
POST /v1/admin/tenants/{tenant}/suspend
GET /v1/admin/connector-submissions
POST /v1/admin/connector-submissions/{key}/{version}/approve
POST /v1/admin/connector-submissions/{key}/{version}/reject

Rate limits and trial limits​

Trial limits are returned in tenant details. A limit error uses trial_limit_reached with details.limit and a next_step. Per-tenant rate limits return rate_limited with retry_after_ms.