Guest Machines
DevelopersApi referenceAuthentication

Grant integration access

POST/api/v1/oauth-clients/{client_id}/grant

Allow an integration to request delegated tokens for the signed-in member. The selected scopes cannot exceed the integration's allowance.

Required access

Credentials: user session

Consent is personal and requires the member's signed-in session; an integration cannot grant access to itself.

Authorization

UserSession
AuthorizationBearer <token>

A short-lived bearer token for a signed-in person. Use it only for the human integration-installation and consent steps; never store it as an integration credential.

In: header

Path Parameters

client_id*Client Id
Formatuuid

Header Parameters

X-Org-Id?|

Selects the active organization for a direct user session that has more than one membership. Service-principal keys and delegated tokens are each bound to one organization and ignore it.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Payload for a user granting a client access to act as them.

scopes narrows the consent below the client's allowance; empty means "everything the client is allowed" โ€” materialized at grant time so a later widening of the client never widens this consent.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/oauth-clients/497f6eca-6276-4993-bfeb-53cbbbba6f08/grant" \  -H "Authorization: Bearer $GUEST_MACHINES_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "scopes": [      "mcp_servers:list",      "mcp_servers:read",      "mcp_servers:create",      "mcp_servers:edit",      "mcp_servers:delete",      "mcp_servers:publish"    ]  }'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "oauth_client_id": "727760ca-b97d-449c-90e5-7773c8142d5d",  "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",  "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",  "scopes": [    "string"  ],  "status": "active",  "granted_at": "2019-08-24T14:15:22Z",  "revoked_at": "2019-08-24T14:15:22Z"}
{  "detail": "string",  "error_code": "string",  "request_id": "string"}
{  "detail": "string",  "error_code": "string",  "request_id": "string"}
{  "detail": "string",  "error_code": "string",  "request_id": "string"}
{  "detail": "string",  "error_code": "string",  "request_id": "string"}
{  "detail": "string",  "error_code": "string",  "request_id": "string"}
{  "detail": "string",  "error_code": "string",  "request_id": "string"}