Allows users to manage delegated access to third-party OAuth2 services:
View their user information
List agents they have granted access to
Review detailed agent information and available services
View and manage grants for specific agents
Grant, update, or revoke delegated access to third-party services
View third-party services with OAuth2 session status
Initiate OAuth2 authorization flows with third-party services (GitHub, Google, etc.)
Terminate OAuth2 sessions and view affected agents
Implements RFC 6749 (OAuth2) and RFC 8414 (OAuth2 Server Metadata) for delegated authorization code flow:
All API endpoints (except /health and /.well-known/oauth-authorization-server) require authentication via:
Pre-authentication: Reverse proxy (e.g., oauth2-proxy, nginx) validates the user
Principal Header: Principal extracted from X-Remote-User header (configurable)
Session Cookie: Session-based authentication established after pre-auth
The X-Remote-User header is set by the upstream authentication proxy and contains
the user's principal identifier (typically email address or UUID).
CORS is enabled for all /api/* routes on the end-user server to support browser-based
single-page applications. OAuth2 endpoints are also publicly accessible as required by RFC 6749.
Success responses: Most endpoints wrap data in a {"data": ...} envelope
Error responses: Follow format {"error": "code", "message": "description"}
OAuth2 responses: Follow RFC 6749 format (no data envelope)
Date/Time format: ISO 8601 (RFC3339) format, e.g., 2025-12-19T10:30:00Z
This API follows the Zalando RESTful API Guidelines with emphasis on:
Resource-oriented design
Consistent error handling
Clear HTTP status code semantics
Comprehensive validation messages
By default, every HTTP response from this API includes the additive W3C
traceresponse response header.
<trace-id> field is the request correlation identifier operators can use to find matching logs.request_context.trace.response_enabled.Returns the current health status of the end-user HTTP server.
This endpoint does not require authentication and is intended for:
Status Codes:
200 OK: Server is healthy and accepting requests503 Service Unavailable: Server is starting, shutting down, or unhealthyHealth States:
healthy: Server is operational and processing requests normallystarting: Server is initializing (binding to port, setting up routes)shutting_down: Graceful shutdown in progress, completing in-flight requestsunhealthy: Server encountered an error and requires restartIn proxy and hybrid OAuth2 modes, the response may also include component-level health in components. The upstream_jwks component reports healthy or degraded without changing the top-level server lifecycle status.
{- "status": "healthy",
- "timestamp": "2025-12-19T10:30:00Z",
- "uptime_seconds": 3600
}Returns information about the currently authenticated user.
The user information includes:
The principal is extracted from the X-Remote-User header set by the upstream authentication proxy (oauth2-proxy, nginx, etc.).
Use Cases:
{- "data": {
- "principal": "user@example.com",
- "displayName": "Jane Doe",
}
}Returns a list of all agents to which the current user has granted access.
Each agent delegation includes:
Response Characteristics:
Use Cases:
{- "data": [
- {
- "agentId": "550e8400-e29b-41d4-a716-446655440000",
- "displayName": "Data Analysis Assistant",
- "activeGrantCount": 3,
- "lastModifiedAt": "2025-12-17T14:30:00Z",
- "expiresAt": null
}, - {
- "agentId": "660e8400-e29b-41d4-a716-446655440001",
- "displayName": "Document Processor",
- "activeGrantCount": 2,
- "lastModifiedAt": "2025-12-16T09:15:00Z",
- "expiresAt": "2026-01-15T00:00:00Z"
}
]
}Returns detailed information about a specific agent and all available third-party OAuth2 services that can be delegated to that agent.
Agent Detail Includes:
Service Information Includes:
require_all_scopes requirement, this is the sorted, deduplicated union from this agent's assigned Permission Sets that cover that service.Use Cases:
| agent-id required | string <uuid> Example: 550e8400-e29b-41d4-a716-446655440000 Unique agent identifier (UUID format). The agent ID identifies a specific agent in the system. Agents are registered in the identity broker and represent AI assistants or automated systems that require delegated access to user resources. |
| session_token | string non-empty Example: session_token=eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0... JWE authorization session token for all agent modes (local, proxy, CIMD). When present, the response includes authorization context extracted from the decrypted token (agent_id, principal, original_url). For CIMD agents, also includes CIMD metadata (client_id_url, redirect_uri, verified_domain, requested_scopes, logo_uri). Present whenever the user arrived via an OAuth2 authorization redirect. |
{- "data": {
- "agent": {
- "agentId": "550e8400-e29b-41d4-a716-446655440000",
- "displayName": "Data Analysis Assistant",
- "description": "Analyzes datasets and generates insights using advanced algorithms",
}, - "services": [
- {
- "serviceId": "11111111-1111-1111-1111-111111111111",
- "serviceName": "Google Drive",
- "requirementType": "mandatory",
- "requiredScopes": [
- {
- "name": "read:files",
- "description": "Read files from your Google Drive"
}, - {
- "name": "write:files",
- "description": "Create and update files in your Google Drive"
}
], - "connectionStatus": "connected"
}, - {
- "serviceId": "22222222-2222-2222-2222-222222222222",
- "serviceName": "GitHub",
- "requirementType": "optional",
- "requiredScopes": [
- {
- "name": "read:repos",
- "description": "Read access to repositories"
}, - {
- "name": "write:repos",
- "description": "Write access to repositories"
}
], - "connectionStatus": "not_connected"
}
]
}
}Returns all active grants the authenticated user has granted to the specified agent.
Grant Information Includes:
Response Characteristics:
Use Cases:
| agent-id required | string <uuid> Example: 550e8400-e29b-41d4-a716-446655440000 Unique agent identifier (UUID format). The agent ID identifies a specific agent in the system. Agents are registered in the identity broker and represent AI assistants or automated systems that require delegated access to user resources. |
{- "data": [
- {
- "id": "770e8400-e29b-41d4-a716-446655440002",
- "principal": "user@example.com",
- "agent_id": "550e8400-e29b-41d4-a716-446655440000",
- "valid_until": "2026-06-01T00:00:00Z",
- "granted_permission_sets": {
- "770e8400-e29b-41d4-a716-446655440001": [
- "880e8400-e29b-41d4-a716-446655440010",
- "880e8400-e29b-41d4-a716-446655440011"
], - "770e8400-e29b-41d4-a716-446655440002": [
- "880e8400-e29b-41d4-a716-446655440012"
]
}, - "created_at": "2025-12-18T10:00:00Z",
- "updated_at": "2025-12-18T10:00:00Z"
}
]
}Creates a new grant or updates an existing grant for the specified agent.
Upsert Semantics:
One grant per user-agent pair
Subsequent POSTs update the existing grant
Previous granted permission sets are replaced (not merged)
Grant Expiration:
valid_until is optional (omit for indefinite grant)Revocation (Special Case):
Submit empty granted_permission_sets object to revoke
Returns 204 No Content on successful revocation
Deletes the grant entirely
Session-Based Consent (FR-029):
session_token query parameter to resume an OAuth2 authorization flow after consentredirect_url field containing the original authorization URL (with original state, redirect_uri, PKCE, and client_id parameters intact)redirect_url using window.location.href to resume the OAuth2 flow400 Bad Request with error code session_expired if the token is invalid or expired400 Bad Request if the session agent does not match the agent in the URL path403 Forbidden if the session principal does not match the authenticated userStandalone Consent Management:
session_token are treated as direct consent-management operations (not authorization resumption)redirect_url field)Validation:
400 Bad Request with details if validation failsUse Cases:
| agent-id required | string <uuid> Example: 550e8400-e29b-41d4-a716-446655440000 Unique agent identifier (UUID format). The agent ID identifies a specific agent in the system. Agents are registered in the identity broker and represent AI assistants or automated systems that require delegated access to user resources. |
| session_token | string JWE authorization session token (FR-029). When present, the grant endpoint decrypts the token to resolve the redirect target. Returns 400 if the token is invalid or expired; 400 if the session agent does not match the requested agent; 403 if the session principal does not match the authenticated caller. |
Grant request with delegated services and optional expiration
required | object Map of permission sets to grant to the agent. Keys are permission set UUIDs, values are arrays of service UUIDs included in each permission set grant. Special Case: Empty object
|
| valid_until | string or null <date-time> Optional grant expiration (ISO 8601 format). Validation:
Behavior:
|
{- "granted_permission_sets": {
- "770e8400-e29b-41d4-a716-446655440001": [
- "880e8400-e29b-41d4-a716-446655440010",
- "880e8400-e29b-41d4-a716-446655440011"
], - "770e8400-e29b-41d4-a716-446655440002": [
- "880e8400-e29b-41d4-a716-446655440012"
]
}
}{- "data": {
- "id": "770e8400-e29b-41d4-a716-446655440002",
- "principal": "user@example.com",
- "agent_id": "550e8400-e29b-41d4-a716-446655440000",
- "valid_until": null,
- "granted_permission_sets": {
- "770e8400-e29b-41d4-a716-446655440001": [
- "880e8400-e29b-41d4-a716-446655440010",
- "880e8400-e29b-41d4-a716-446655440011"
], - "770e8400-e29b-41d4-a716-446655440002": [
- "880e8400-e29b-41d4-a716-446655440012"
]
}, - "created_at": "2025-12-19T10:00:00Z",
- "updated_at": "2025-12-19T10:00:00Z"
}
}Permanently deletes the authenticated user's grant for the specified agent. After revocation, the agent can no longer perform token exchanges on behalf of the user.
Important: This action only removes the delegation grant. Connected OAuth2 sessions (e.g., GitHub, Google) remain active and are NOT terminated by this action. Users may manage OAuth2 sessions separately.
Idempotency: Non-idempotent — returns 404 if no grant exists. To silently
revoke if a grant exists, use POST /api/consent/agents/{agent-id}/grants with
an empty granted_permission_sets object.
Security: Only the grant owner may revoke. The principal is derived from the
X-Remote-User authentication header. Cross-user revocation is not possible —
grants are scoped to the authenticated principal.
| agent-id required | string <uuid> Example: 550e8400-e29b-41d4-a716-446655440000 Unique agent identifier (UUID format). The agent ID identifies a specific agent in the system. Agents are registered in the identity broker and represent AI assistants or automated systems that require delegated access to user resources. |
{- "error": "bad request",
- "message": "agent ID is required"
}Initiates an OAuth2 authorization code flow. The broker validates the agent, checks consent, and either redirects to the upstream OAuth2 authorization server or issues an authorization code directly (local/hybrid mode).
client_id semantics:
In proxy mode the client_id MUST be the agent's internal UUID (agent.id).
In local/hybrid mode the client_id may also be an HTTPS URL identifying a
Client ID Metadata Document (CIMD) when CIMD is enabled.
Local/Hybrid Mode: When the broker acts as its own OAuth2 authorization server:
redirect_urisredirect_uri with code and statecode_challenge and code_challenge_methodProxy Mode: When proxying to an upstream OAuth2 server:
Error Handling (RFC 6749 §4.1.2.1):
Direct JSON responses (no redirect — RFC 6749 §4.1.2.1):
invalid_client (400): client_id is not a valid UUID OR no agent with that UUID existsinvalid_redirect_uri (400): redirect_uri not registered on the agentinvalid_request (400): Missing PKCE parametersunsupported_response_type (400): response_type is not codeserver_error (500): Internal infrastructure failureRedirect responses (error appended to redirect_uri as query params; redirect_uri has been validated):
invalid_scope: Requested scope exceeds the agent's allowed_scopesaccess_denied: User explicitly denied consentserver_error: Proxy mode — agent has no upstream client_id configured| client_id required | string <uuid> Example: client_id=a1b2c3d4-e5f6-7890-abcd-ef1234567890 The internal agent identifier (UUID) registered with the identity broker. This MUST be the agent's |
| response_type required | string Value: "code" OAuth2 response type. Must be "code" for authorization code flow. |
| redirect_uri required | string <uri> Callback URI to redirect to after authorization. Must be pre-registered. |
| state | string Opaque value used to maintain state between request and callback (CSRF protection). |
| scope | string Space-delimited list of requested OAuth2 scopes. |
| code_challenge | string PKCE code challenge (RFC 7636). SHA256 hash of code_verifier, base64url-encoded. |
| code_challenge_method | string Value: "S256" PKCE code challenge method. Must be "S256". |
{- "error": "invalid_client",
- "error_description": "client_id must be a valid agent UUID"
}Exchange a token for another token, or obtain a token directly. This endpoint supports three grant types:
Authenticate the agent directly using broker-issued client credentials and obtain an access token. Used when the broker acts as an OAuth2 authorization server.
grant_type: client_credentialsclient_id: Agent UUID (agent.id)client_secret: Broker-issued client secretscope: (optional) Space-delimited requested scopesExchange an authorization code for an access token. Supports PKCE for public clients.
grant_type: authorization_codeclient_id: Agent UUID (agent.id)client_secret: Broker-issued client secretcode: Authorization code from /oauth2/authorizeredirect_uri: Must match the URI used in the authorization requestcode_verifier: (optional) PKCE code verifier (RFC 7636)Exchange an authorization code for an access token via the upstream OAuth2 server.
This is the standard OAuth2 authorization code flow used for initial user consent. The
broker forwards form fields, including client_secret when supplied, in the request body
and forwards only the validated form Content-Type request header. It does not forward
credential headers such as Authorization, cookies, or proxy identity headers. The broker
returns only Content-Type, Cache-Control, Pragma, and WWW-Authenticate from upstream
responses. It never returns upstream cookies or arbitrary response headers.
Exchange a token issued by the Upstream OAuth2 Server for a third-party OAuth2 token stored in the token vault.
The token exchange flow:
Authentication for Token Exchange:
Resource Discovery:
User Grant Verification:
Mints a locally issued access token representing a subject user and attributing the acting
party with the standard act claim. Available only in local mode; proxy and hybrid
reject it.
The routing-only oauth2_authorization_server.impersonation.audience_prefix activates
impersonation only when exactly one request audience is
<audience_prefix>/<canonical lower-case AgentID UUID or canonical_id>. Both forms resolve
the same registered target agent, which supplies minted UUID agent_id and local-token CEL
agent.*. A signed client assertion is the privileged-client identity for authorization and
audit only. The routing audience is never copied into issued aud; the existing local
token_claims_expression emits aud or leaves it absent exactly as normal local issuance
does. Activation precedes the third-party mandatory-resource check.
grant_type: urn:ietf:params:oauth:grant-type:token-exchangeaudience: one <audience_prefix>/<canonical lower-case AgentID UUID or canonical_id> URIclient_assertion_type: urn:ietf:params:oauth:client-assertion-type:jwt-bearerclient_assertion: signed JWT authenticating the privileged clientactor_token_type: urn:ietf:params:oauth:token-type:jwtactor_token: signed JWT identifying the actorsubject_token_type: urn:ietf:params:oauth:token-type:jwt; a matching rule's
verification: none selects the unsigned-subject profilesubject_token: signed subject JWT, or, for a matching verification: none rule, an
unsigned alg:none JWTrequested_token_type: optional; when present MUST equal the access-token typeresource is rejected with invalid_request. An optional scope requests values from the
resolved target agent's allowed_scopes; an empty target allow-list is unrestricted, and
offline and offline_access are always permitted refresh-token scopes. An out-of-list
non-reserved value returns invalid_scope. The normal local JWT and response carry non-empty granted scope.
Signed credentials are validated for signature, issuer, audience, expiry, and not-before
before a CEL authorization predicate decides the request. Bare suffixes and suffixes matching
neither identifier form return invalid_request; a well-formed UUID or canonical-ID suffix
whose target is unknown returns invalid_target.
No-match precedence is access_denied > invalid_request > invalid_client.
After a rule authorizes the request, the broker requires an active user delegation for the
extracted subject and target agent. A missing or expired delegation returns 403 access_denied
with the existing RFC 6749 error_uri response member set to the authenticated user's
target-agent consent page. The response intentionally does not distinguish a missing delegation
from an expired one. An unverified subject has no exemption; a delegation lookup failure returns
500 server_error without error_uri.
Form-encoded request bodies larger than 256 KiB are rejected with the documented HTTP 400 invalid_request response before token-form parsing.
| grant_type required | string Enum: "urn:ietf:params:oauth:grant-type:token-exchange" "authorization_code" "client_credentials" The OAuth2 grant type:
|
| client_id | string In proxy mode: the agent's internal UUID ( |
| client_secret | string Broker-issued client secret (for client_credentials in local/hybrid mode, and for confidential-client authorization_code exchanges) or upstream OAuth2 client secret (proxy mode). Optional for public authorization_code clients in local/hybrid mode. |
| code | string Authorization code received from the /oauth2/authorize endpoint. Required for authorization_code grant type. |
| redirect_uri | string <uri> Redirect URI used in the original authorization request. Required for authorization_code grant type. Must match the URI used in the authorization request exactly. |
| code_verifier | string PKCE code verifier (RFC 7636). Required if code_challenge was provided in the authorization request. |
| subject_token | string For third-party token exchange, a JWT from which the broker extracts the user
principal and agent identifier. For user impersonation, a signed subject JWT or,
only when a matching rule declares |
| subject_token_type | string Type of the subject_token.
|
| actor_token | string Signed JWT identifying the acting party for user impersonation. Required for the
impersonation flow. Its validated issuer and extracted identity surface as
|
| actor_token_type | string Value: "urn:ietf:params:oauth:token-type:jwt" Type of the actor_token. MUST be the RFC 8693 JWT token type. Required for the impersonation flow. |
| requested_token_type | string Value: "urn:ietf:params:oauth:token-type:access_token" Optional for the impersonation flow. When present it MUST equal the access-token
type; any other value is rejected with |
| resource | string <uri> Required for third-party token exchange. It must match a protected_resource on a ThirdpartyOAuth2Service and is normalized by removing trailing slashes before matching. It MUST be absent for audience-activated user impersonation. |
| client_assertion_type | string Value: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer" The client authentication method. Must be JWT bearer. Required for token-exchange grant type. |
| client_assertion | string Signed JWT authenticating the privileged client. Third-party token exchange validates it against the configured client-assertion issuer; user impersonation validates it against a trusted issuer in the matching impersonation rule. Required for token-exchange grant type. |
| scope | string Optional literal-space-separated scope request. For user impersonation, every non-reserved value must be permitted by the resolved target agent's |
| audience | string <uri> Optional token-exchange audience. For local impersonation it must be exactly one
|
grant_type=client_credentials&client_id=550e8400-e29b-41d4-a716-446655440000&client_secret=brk_sec_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6&scope=openid%20profile
{- "access_token": "ghu_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
- "token_type": "Bearer",
- "issued_token_type": "urn:ietf:params:oauth:token-type:access_token",
- "expires_in": 3600
}Returns the broker's aggregated public signing keys in JWK Set format (RFC 7517).
Clients use this single endpoint to verify any token the broker asks them to trust, regardless of operating mode. Only public key material is included — private keys are never exposed.
Mode-dependent content:
local mode: returns only the broker's locally-generated signing keys.proxy mode: republishes the upstream authorization server's public keys verbatim.hybrid mode: returns the union of local signing keys and upstream keys in a
single JWKS document. If any kid appears in both sets, the endpoint returns 500.Availability: Served in all three modes (local, proxy, hybrid). Returns
503 if the upstream JWKS is unavailable (proxy/hybrid modes). Returns 500 if a
duplicate kid is detected across local and upstream key sets (hybrid mode).
Caching: Responses include Cache-Control: public, max-age=300 to allow
clients to cache the key set for 5 minutes. Clients should respect this header
and implement key rotation by periodically refreshing the JWKS.
Key Rotation: When signing keys are rotated, the new key appears in the JWKS immediately. Previous keys remain in the set until removed by an admin.
{- "keys": [
- {
- "kty": "EC",
- "crv": "P-256",
- "kid": "key-2025-12-19-001",
- "use": "sig",
- "alg": "ES256",
- "x": "f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU",
- "y": "x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0"
}
]
}Returns the broker's OAuth2 authorization server metadata as defined in RFC 8414. This enables dynamic client discovery of the broker's OAuth2 capabilities and endpoints.
Mode-specific behavior:
proxy mode: issuer is the broker's own public URL. jwks_uri points to the
broker's /oauth2/jwks.json endpoint, which republishes upstream keys.local mode: issuer is the broker's own public URL. jwks_uri points to the
broker's /oauth2/jwks.json endpoint, which serves locally-generated signing keys.hybrid mode: issuer is the broker's public URL. jwks_uri points to the
broker's /oauth2/jwks.json endpoint (union of local and upstream keys). The
metadata reflects the union of capabilities for both proxy and local grant types.Caching: Responses include Cache-Control: public, max-age=3600 to allow
clients to cache metadata for 1 hour.
No Authentication: This endpoint is publicly accessible as required by RFC 8414.
{- "response_types_supported": [
- "code"
], - "grant_types_supported": [
- "authorization_code",
- "client_credentials",
- "urn:ietf:params:oauth:grant-type:token-exchange"
], - "token_endpoint_auth_methods_supported": [
- "client_secret_post"
], - "code_challenge_methods_supported": [
- "S256"
], - "scopes_supported": [
- "openid",
- "profile",
- "email"
]
}Returns a list of all configured third-party OAuth2 services along with the current user's session status for each service.
For services where the user has an active session, includes:
{- "data": [
- {
- "service": {
- "id": "550e8400-e29b-41d4-a716-446655440000",
- "display_name": "GitHub",
- "description": "GitHub OAuth2 integration",
- "scopes": [
- {
- "scope_value": "repo",
- "description": "Full control of private repositories"
}, - {
- "scope_value": "user:email",
- "description": "Access user email addresses"
}
]
}, - "session": {
- "session_id": "660e8400-e29b-41d4-a716-446655440001",
- "initiated_at": "2025-12-20T10:30:00Z",
- "access_token_expires_at": "2025-12-20T11:30:00Z",
- "refresh_token_expires_at": "2026-01-20T10:30:00Z",
- "is_expired": false,
- "has_refresh_token": true,
- "scope": [
- "repo",
- "user:email"
], - "dependent_agent_count": 3,
- "tokens_encrypted": true
}
}, - {
- "service": {
- "id": "550e8400-e29b-41d4-a716-446655440002",
- "display_name": "Google Workspace",
- "description": "Google OAuth2 integration",
- "scopes": [
- {
- "scope_value": "calendar.readonly",
- "description": "Read calendar events"
}
]
}, - "session": null
}
]
}Initiates an OAuth2 authorization code flow with PKCE for the specified third-party service. Redirects the user to the third-party's authorization endpoint.
PKCE applies to every service; the authorization-code exchange presents a client credential only for confidential services.
The flow:
The redirect_uri parameter must match the host of the incoming request (same-origin validation).
| serviceId required | string <uuid> Example: 550e8400-e29b-41d4-a716-446655440000 UUID of the third-party OAuth2 service |
| redirect_uri required | string <uri> Example: redirect_uri=https://broker.example.com/sessions URI to redirect user after OAuth2 flow completes. Must match the host of the incoming request (same-origin validation). |
{- "error": "invalid_redirect_uri",
- "message": "redirect_uri must match the host of the request"
}Processes the OAuth2 callback after user authorization at the third-party.
PKCE applies to every service; the authorization-code exchange presents a client credential only for confidential services.
Validates:
On success:
On error:
| serviceId required | string <uuid> UUID of the third-party OAuth2 service |
| code required | string OAuth2 authorization code from third-party |
| state required | string JWE state token (must match token from authorize request) |
| error | string Example: error=access_denied OAuth2 error code from third-party (if authorization failed) |
| error_description | string Example: error_description=The user denied the request OAuth2 error description from third-party |
{- "error": "invalid_state",
- "message": "State token validation failed"
}Returns detailed information about the user's session with a third-party service, including only agents with grants owned by the authenticated session principal that depend on this session. Used to populate the session card and termination warning dialog.
| serviceId required | string <uuid> UUID of the third-party OAuth2 service |
{- "data": {
- "session": {
- "session_id": "660e8400-e29b-41d4-a716-446655440001",
- "initiated_at": "2025-12-20T10:30:00Z",
- "access_token_expires_at": "2025-12-20T11:30:00Z",
- "refresh_token_expires_at": "2026-01-20T10:30:00Z",
- "is_expired": false,
- "has_refresh_token": true,
- "scope": [
- "repo",
- "user:email"
], - "dependent_agent_count": 2,
- "tokens_encrypted": true
}, - "dependent_agents": [
- {
- "agent_id": "770e8400-e29b-41d4-a716-446655440000",
- "display_name": "Code Assistant"
}, - {
- "agent_id": "770e8400-e29b-41d4-a716-446655440001",
- "display_name": "PR Reviewer"
}
]
}
}Terminates the user's session with a third-party service by deleting stored tokens. Returns information about affected agents for the confirmation dialog shown before this request.
Note: This does not revoke tokens at the third-party service.
Agents that were using this session will detect the missing session and request re-authentication.
| serviceId required | string <uuid> UUID of the third-party OAuth2 service |
{- "data": {
- "terminated": true,
- "affected_agents": 3
}
}Forces an immediate OAuth2 access-token refresh for the user's session with a third-party service, using the stored refresh token via the RFC 6749 refresh_token grant. Unlike the transparent refresh performed during token exchange, this refreshes even when the current access token has not yet expired. Requires a stored, non-expired refresh token.
| serviceId required | string <uuid> UUID of the third-party OAuth2 service |
{- "data": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "service_id": "641e839f-864e-4cce-98f9-40f6cbb3e9e0",
- "service_display_name": "string",
- "token_type": "string",
- "scope": [
- "string"
], - "initiated_at": "2019-08-24T14:15:22Z",
- "is_expired": true,
- "access_token_expired": true,
- "has_refresh_token": true,
- "refresh_token_expires_at": "2019-08-24T14:15:22Z",
- "dependent_agent_count": 0,
- "is_encrypted": true
}
}Returns a list of agents that would lose access if the user terminates their session with this third-party service. Used to populate the termination warning dialog.
| serviceId required | string <uuid> UUID of the third-party OAuth2 service |
{- "data": {
- "affected_agents": [
- {
- "agent_id": "770e8400-e29b-41d4-a716-446655440000",
- "display_name": "Code Assistant"
}, - {
- "agent_id": "770e8400-e29b-41d4-a716-446655440001",
- "display_name": "PR Reviewer"
}
]
}
}Creates a pending approval record for a tool invocation that requires human-in-the-loop authorization. Called by ExtProc when a tool call is intercepted that requires approval. Dual-auth required: subject token + client assertion. The subject token binds the request to user/agent context, while the client assertion proves the trusted gateway caller that is allowed to mint approval prompts. Idempotent: returns existing record for duplicate pending requests.
| traceparent | string W3C Trace Context propagation header. |
required | object |
| tool_name required | string <= 255 characters |
required | object |
| risk_level | string Enum: "low" "medium" "critical" |
{- "metadata": {
- "mcp_session_id": "string",
- "agent_session_id": "string",
- "tool_invocation_id": "string",
- "description": "string"
}, - "tool_name": "string",
- "arguments": { },
- "risk_level": "low"
}{- "data": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "status": "pending",
- "created_at": "2019-08-24T14:15:22Z"
}
}Returns all active approvals grouped by (principal, agent) pair. Supports long-poll via If-None-Match + X-Long-Poll-Timeout headers. Auth: client assertion only (CEL-validated). No subject token is required because this is a gateway control-plane sync channel rather than a user-facing operation.
| principal | string |
| agent_session_id | string Repeat for each active agent session. Session-scoped approvals are returned only for matching IDs. |
| If-None-Match | string |
| X-Long-Poll-Timeout | integer [ 1 .. 120 ] |
{- "data": {
- "pairs": [
- {
- "principal": "string",
- "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978",
- "approvals": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "tool_name": "string",
- "arguments_hash": "string",
- "tool_pattern": "string",
- "params_pattern": {
- "property1": "string",
- "property2": "string"
}, - "status": "pending",
- "persistence": "once",
- "consumed": true,
- "agent_session_id": "string",
- "approved_at": "2019-08-24T14:15:22Z"
}
], - "granted_permission_sets": { }
}
]
}
}Returns all pending approvals for the authenticated user.
Used by the approval and tool authorization UIs.
Auth: acting user principal from the browser auth layer (for example X-Remote-User in pre-auth deployments).
{- "data": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "principal": "string",
- "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978",
- "agent_display_name": "string",
- "mcp_session_id": "string",
- "agent_session_id": "string",
- "tool_invocation_id": "string",
- "tool_name": "string",
- "arguments": { },
- "tool_pattern": "string",
- "params_pattern": {
- "property1": "string",
- "property2": "string"
}, - "pattern_preview": "string",
- "description": "string",
- "risk_level": "low",
- "status": "pending",
- "persistence": "once",
- "consumed": true,
- "created_at": "2019-08-24T14:15:22Z",
- "approved_at": "2019-08-24T14:15:22Z",
- "denied_at": "2019-08-24T14:15:22Z",
- "consumed_at": "2019-08-24T14:15:22Z",
- "expires_at": "2019-08-24T14:15:22Z"
}
]
}Returns all permanent approvals and denials for the authenticated user.
Used by the consent management UI.
Auth: acting user principal from the browser auth layer (for example X-Remote-User in pre-auth deployments).
{- "data": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "principal": "string",
- "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978",
- "agent_display_name": "string",
- "mcp_session_id": "string",
- "agent_session_id": "string",
- "tool_invocation_id": "string",
- "tool_name": "string",
- "arguments": { },
- "tool_pattern": "string",
- "params_pattern": {
- "property1": "string",
- "property2": "string"
}, - "pattern_preview": "string",
- "description": "string",
- "risk_level": "low",
- "status": "pending",
- "persistence": "once",
- "consumed": true,
- "created_at": "2019-08-24T14:15:22Z",
- "approved_at": "2019-08-24T14:15:22Z",
- "denied_at": "2019-08-24T14:15:22Z",
- "consumed_at": "2019-08-24T14:15:22Z",
- "expires_at": "2019-08-24T14:15:22Z"
}
]
}Retrieves a tool approval record by ID for the Approval UI. Auth: acting user principal from the browser auth layer; principal must match.
| id required | string <uuid> |
{- "data": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "principal": "string",
- "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978",
- "agent_display_name": "string",
- "mcp_session_id": "string",
- "agent_session_id": "string",
- "tool_invocation_id": "string",
- "tool_name": "string",
- "arguments": { },
- "tool_pattern": "string",
- "params_pattern": {
- "property1": "string",
- "property2": "string"
}, - "pattern_preview": "string",
- "description": "string",
- "risk_level": "low",
- "status": "pending",
- "persistence": "once",
- "consumed": true,
- "created_at": "2019-08-24T14:15:22Z",
- "approved_at": "2019-08-24T14:15:22Z",
- "denied_at": "2019-08-24T14:15:22Z",
- "consumed_at": "2019-08-24T14:15:22Z",
- "expires_at": "2019-08-24T14:15:22Z"
}
}Transitions a pending approval to approved state with selected persistence scope. Auth: acting user principal from the browser auth layer; principal must match.
| id required | string <uuid> |
| persistence required | string Enum: "once" "session" "permanent" |
object Constrained argument names mapped to globs. Omit the field to cover only the reviewed argument values. This field is permitted only for session or permanent persistence. With once persistence, every supplied value, including an empty object, returns 422 invalid_pattern. The resulting pattern must cover the reviewed arguments. |
{- "persistence": "once",
- "params_pattern": {
- "property1": "string",
- "property2": "string"
}
}{- "data": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "status": "approved",
- "persistence": "once",
- "approved_at": "2019-08-24T14:15:22Z"
}
}| id required | string <uuid> |
object Constrained argument names mapped to globs. Omit the field entirely to cover only the reviewed argument values; send an empty object to leave every argument unconstrained. | |||
| |||
{- "params_pattern": {
- "property1": "string",
- "property2": "string"
}
}{- "data": {
- "tool_pattern": "string",
- "params_pattern": {
- "property1": "string",
- "property2": "string"
}, - "preview": "string"
}
}Transitions a pending approval to denied state. Auth: acting user principal from the browser auth layer; principal must match.
| id required | string <uuid> |
| persistence | string Value: "permanent" |
{- "persistence": "permanent"
}{- "data": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "status": "denied",
- "persistence": "permanent",
- "denied_at": "2019-08-24T14:15:22Z"
}
}Marks an approved once-persistence approval as consumed. Auth: subject token only (Bearer); principal must match. Idempotent: consuming already-consumed returns 200. No client assertion is required because this is a per-approval, principal-scoped machine mutation.
| id required | string <uuid> |
{- "data": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "consumed": true,
- "consumed_at": "2019-08-24T14:15:22Z"
}
}Revokes a permanent approval or denial. Auth: acting user principal from the browser auth layer; principal must match.
| id required | string <uuid> |
{- "data": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "status": "denied",
- "persistence": "permanent",
- "denied_at": "2019-08-24T14:15:22Z"
}
}