- JSON Schema (JSON Schema 2020-12) — for SDK code generation and validation
- OpenAPI 3.1 YAML — for API documentation and testing
Discovery
DiscoveryDocument
Returned byGET /.well-known/ath.json.
| Field | Type | Required | Description |
|---|---|---|---|
ath_version | string | Yes | Protocol version |
gateway_id | string | Yes | Gateway identifier |
agent_registration_endpoint | string (URI) | Yes | URL for agent registration |
supported_providers | ProviderInfo[] | Yes | Available providers |
ProviderInfo
| Field | Type | Required | Description |
|---|---|---|---|
provider_id | string | Yes | Unique provider identifier |
display_name | string | Yes | Human-readable name |
categories | string[] | No | Provider categories |
available_scopes | string[] | Yes | Scopes that can be requested |
auth_mode | string | Yes | Authentication mode (e.g. "OAUTH2") |
agent_approval_required | boolean | Yes | Whether registration is required |
Registration
AgentRegistrationRequest
Sent toPOST /ath/agents/register.
| Field | Type | Required | Description |
|---|---|---|---|
agent_id | string (URI) | Yes | Agent’s canonical URI |
agent_attestation | string (JWT) | Yes | Signed attestation token |
developer.name | string | Yes | Developer name |
developer.id | string | Yes | Developer identifier |
requested_providers | array | Yes | Providers and scopes to request |
purpose | string | No | Human-readable purpose |
redirect_uris | string[] | No | OAuth callback URIs. If provided, validated by exact-match on authorization. If omitted, user_redirect_uri MUST be rejected |
AgentRegistrationResponse
| Field | Type | Description |
|---|---|---|
client_id | string | Unique registration identifier |
client_secret | string | Secret for token exchange |
agent_status | "approved" | "pending" | "denied" | Registration status |
approved_providers | ProviderApproval[] | Per-provider approval results |
approval_expires | string (ISO 8601) | Expiration timestamp |
ProviderApproval
Authorization
AuthorizationRequest
Sent toPOST /ath/authorize.
| Field | Type | Required | Description |
|---|---|---|---|
client_id | string | Yes | Agent’s client ID |
agent_attestation | string (JWT) | Yes | Fresh attestation token |
provider_id | string | Yes | Provider to authorize |
scopes | string[] | Yes | Scopes to request (within approved set) |
user_redirect_uri | string (URI) | No | Post-consent redirect |
state | string | Yes | CSRF protection state (MUST have ≥128 bits of entropy) |
resource | string (URI) | No | Target resource server (RFC 8707) |
AuthorizationResponse
| Field | Type | Description |
|---|---|---|
authorization_url | string (URI) | OAuth consent URL with PKCE parameters |
ath_session_id | string | Session ID for token exchange |
Token
TokenExchangeRequest
Sent toPOST /ath/token. Requires both client_secret and a fresh agent_attestation for proof-of-possession.
TokenResponse
ScopeIntersection
| Field | Type | Description |
|---|---|---|
agent_approved | string[] | Scopes the service approved for this agent |
user_consented | string[] | Scopes the user consented to |
effective | string[] | The intersection (effective permissions) |
Revocation
TokenRevocationRequest
Sent toPOST /ath/revoke. Requires client authentication per RFC 7009.
Errors
ATHError
All error responses follow this structure:| Code | HTTP Status | Description |
|---|---|---|
INVALID_ATTESTATION | 401 | Agent attestation JWT failed verification |
AGENT_NOT_REGISTERED | 403 | Agent must register before authorizing |
AGENT_UNAPPROVED | 403 | Agent registration was denied |
PROVIDER_NOT_APPROVED | 403 | Agent not approved for this provider |
SCOPE_NOT_APPROVED | 403 | Agent not approved for requested scopes |
SESSION_NOT_FOUND | 400 | OAuth session not found |
SESSION_EXPIRED | 400 | OAuth session has expired |
STATE_MISMATCH | 400 | OAuth state parameter mismatch |
TOKEN_INVALID | 401 | ATH access token is invalid |
TOKEN_EXPIRED | 401 | ATH access token has expired |
TOKEN_REVOKED | 401 | ATH access token has been revoked |
AGENT_IDENTITY_MISMATCH | 403 | Agent ID in request does not match token binding |
PROVIDER_MISMATCH | 403 | Provider in request does not match token binding |
USER_DENIED | 403 | User denied the OAuth consent |
OAUTH_ERROR | 502 | Upstream OAuth provider returned an error |
INTERNAL_ERROR | 500 | Internal server error |