API

Agent authorization

Let an agent register itself, get a person to claim it, and trade its assertion for access tokens. Also list and revoke the agents that you authorized.

GET
/oauth/authorization-server

Response Body

The metadata.

application/json
  1. response
issuer*string
token_endpoint*string
revocation_endpoint*string
jwks_uri*string
grant_types_supported*array<string>
scopes_supported*array<string>
token_endpoint_auth_methods_supported*array<string>
agent_auth*
Example Request
curl -X GET 'https://api.letsship.ai/v1/oauth/authorization-server'
Example Response
{  "issuer": "string",  "token_endpoint": "string",  "revocation_endpoint": "string",  "jwks_uri": "string",  "grant_types_supported": [    "string"  ],  "scopes_supported": [    "string"  ],  "token_endpoint_auth_methods_supported": [    "string"  ],  "agent_auth": {    "property1": null,    "property2": null  }}
GET
/oauth/protected-resource

Query Parameters

resource*string
Length1 <= length

Response Body

The metadata.

application/json
  1. response
resource*string
resource_name*string
authorization_servers*array<string>
scopes_supported*array<string>
bearer_methods_supported*array<string>
resource_documentation*string
Example Request
curl -X GET 'https://api.letsship.ai/v1/oauth/protected-resource?resource=string'
Example Response
{  "resource": "string",  "resource_name": "string",  "authorization_servers": [    "string"  ],  "scopes_supported": [    "string"  ],  "bearer_methods_supported": [    "string"  ],  "resource_documentation": "string"}

Signing keys (JWKS)

GET
/oauth2/jwks

Response Body

The key set.

application/json
  1. response
keys*array<>
Example Request
curl -X GET 'https://api.letsship.ai/v1/oauth2/jwks'
Example Response
{  "keys": [    {      "property1": null,      "property2": null    }  ]}
POST
/agent/identity

Request Body

application/json
  1. body
type*"anonymous"
Value in"anonymous"
agent_name?string

What the agent calls itself. Shown on the claim page as the agent's own words; the person names the delegation.

Lengthlength <= 200

Response Body

Registered.

application/json
  1. response
registration_id*string
registration_type*string
Value in"anonymous""service_auth""identity_assertion"
identity_assertion?string
assertion_expires?string
pre_claim_scopes?array<string>
scopes?array<string>
claim_url?string
claim_token?string

Returned once. Keep it in memory for the claim, never longer.

claim_token_expires?string
post_claim_scopes?array<string>
claim?
Example Request
curl -X POST 'https://api.letsship.ai/v1/agent/identity' \  -H 'Content-Type: application/json' \  -d '{  "type": "anonymous"}'
Example Response
{  "registration_id": "string",  "registration_type": "anonymous",  "identity_assertion": "string",  "assertion_expires": "string",  "pre_claim_scopes": [    "string"  ],  "scopes": [    "string"  ],  "claim_url": "string",  "claim_token": "string",  "claim_token_expires": "string",  "post_claim_scopes": [    "string"  ],  "claim": {    "user_code": "string",    "verification_uri": "string",    "expires_in": 0,    "interval": 0  }}

Start or renew a claim

POST
/agent/identity/claim

Request Body

application/json
  1. body
claim_token*string
Length1 <= length <= 200
email*string
Length1 <= length <= 320

Response Body

Claim started.

application/json
  1. response
registration_id*string
claim_attempt_id*string
status*"initiated"
Value in"initiated"
expires_at*string
claim_attempt*
Example Request
curl -X POST 'https://api.letsship.ai/v1/agent/identity/claim' \  -H 'Content-Type: application/json' \  -d '{  "claim_token": "string",  "email": "string"}'
Example Response
{  "registration_id": "string",  "claim_attempt_id": "string",  "status": "initiated",  "expires_at": "string",  "claim_attempt": {    "user_code": "string",    "verification_uri": "string",    "expires_in": 0,    "interval": 0  }}

Token endpoint

POST
/oauth2/token

Request Body

application/x-www-form-urlencoded
  1. body
grant_type*string
assertion?string
claim_token?string
resource?string

RFC 8707 resource: the API (default) or the MCP server.

code?string
redirect_uri?string
client_id?string
code_verifier?string
refresh_token?string

Response Body

An access token. Never cached.

application/json
  1. response
access_token*string
token_type*"Bearer"
Value in"Bearer"
expires_in*integer
scope*string
refresh_token?string
identity_assertion?string
assertion_expires?string
Example Request
curl -X POST 'https://api.letsship.ai/v1/oauth2/token' \  -H 'Content-Type: application/x-www-form-urlencoded' \  -d 'grant_type=string'
Example Response
{  "access_token": "string",  "token_type": "Bearer",  "expires_in": 0,  "scope": "string",  "refresh_token": "string",  "identity_assertion": "string",  "assertion_expires": "string"}
POST
/oauth2/revoke

Request Body

application/x-www-form-urlencoded
  1. body
token*string
token_type_hint?string

Response Body

Done.

Example Request
curl -X POST 'https://api.letsship.ai/v1/oauth2/revoke' \  -H 'Content-Type: application/x-www-form-urlencoded' \  -d 'token=string'
Example Response
Empty
POST
/agent/event/notify

Request Body

body*stringapplication/secevent+jwt

Response Body

Accepted.

Example Request
curl -X POST 'https://api.letsship.ai/v1/agent/event/notify' \  -H 'Content-Type: application/secevent+jwt' \  -d 'string'
Example Response
Empty
POST
/agent/claims/resolve

Request Body

application/json
  1. body
claimAttemptToken*string
Length1 <= length <= 200

Response Body

The claim view.

application/json
  1. response
state*string

ready: show the form. invalid: no registration matches the link. claimed: already done. expired: the claim or its code expired. locked: too many wrong codes. wrong_account: started for another email.

Value in"ready""invalid""claimed""expired""locked""wrong_account"
signedInEmail*string
boundEmail*string|null
registration*|null
advisories*array<>
grantOptions*|null|null
codeExpiresAt*integer|null
attemptsLeft*integer|null
Example Request
curl -X POST 'https://api.letsship.ai/v1/agent/claims/resolve' \  -H 'Content-Type: application/json' \  -d '{  "claimAttemptToken": "string"}'
Example Response
{  "state": "ready",  "signedInEmail": "string",  "boundEmail": "string",  "registration": {    "id": "string",    "kind": "anonymous",    "agentName": "string",    "providerName": "string"  },  "advisories": [    {      "kind": "first_time_account",      "providerName": "string"    }  ],  "grantOptions": {    "orgs": [      {        "id": "string",        "name": "string",        "role": "string",        "grantableScopes": [          "string"        ],        "projects": [          {            "id": "string",            "name": "string"          }        ]      }    ],    "defaultOrgId": "string",    "defaultExpiresInDays": 0,    "maxExpiresInDays": 0  },  "codeExpiresAt": 0,  "attemptsLeft": 0}

Claim an agent

POST
/agent/claims/complete

Request Body

application/json
  1. body
orgId*string
Length1 <= length
scopes?array<string>
Itemsitems <= 31
Default[]
projectId?string
Length1 <= length
expiresInDays?integer
Range1 <= value <= 365
name*string
Length1 <= length <= 100
claimAttemptToken*string
Length1 <= length <= 200
userCode*string
Match^\d{6}$

Response Body

Claimed.

application/json
  1. response
status*"claimed"
Value in"claimed"
delegation*
Example Request
curl -X POST 'https://api.letsship.ai/v1/agent/claims/complete' \  -H 'Content-Type: application/json' \  -d '{  "orgId": "string",  "name": "string",  "claimAttemptToken": "string",  "userCode": "string"}'
Example Response
{  "status": "claimed",  "delegation": {    "id": "string",    "name": "string",    "source": "string",    "orgId": "string",    "projectId": "string",    "scopes": [      "string"    ],    "providerName": "string",    "createdAt": 0,    "expiresAt": 0,    "revokedAt": 0,    "lastUsedAt": 0  }}
GET
/agent-delegations

Authorization

bearerAuth
headerAuthorizationBearer <API token (pat_ or mcp_ prefix)>

Response Body

Your delegations.

application/json
  1. response
data*array<>
Example Request
curl -X GET 'https://api.letsship.ai/v1/agent-delegations'
Example Response
{  "data": [    {      "id": "string",      "name": "string",      "source": "string",      "orgId": "string",      "projectId": "string",      "scopes": [        "string"      ],      "providerName": "string",      "createdAt": 0,      "expiresAt": 0,      "revokedAt": 0,      "lastUsedAt": 0    }  ]}

Revoke an agent

DELETE
/agent-delegations/{delegationId}

Authorization

bearerAuth
headerAuthorizationBearer <API token (pat_ or mcp_ prefix)>

Path Parameters

delegationId*string
Length1 <= length

Response Body

Revoked.

application/json
  1. response
kind*string
Value in"revoked""already-revoked"
delegationId*string
revokedAt*integer
revokedTokens*integer

Live access tokens that stopped working with it.

Example Request
curl -X DELETE 'https://api.letsship.ai/v1/agent-delegations/string'
Example Response
{  "kind": "revoked",  "delegationId": "string",  "revokedAt": 0,  "revokedTokens": 0}
POST
/oauth2/register

Request Body

application/json
  1. body
redirect_uris*array<string>
client_name?string
Lengthlength <= 200
client_uri?string
logo_uri?string
grant_types?array<string>
response_types?array<string>
token_endpoint_auth_method?string
application_type?string

Response Body

Registered.

application/json
  1. response
client_id*string
client_id_issued_at*integer
client_name?string
redirect_uris*array<string>
grant_types*array<string>
response_types*array<string>
token_endpoint_auth_method*"none"
Value in"none"
Example Request
curl -X POST 'https://api.letsship.ai/v1/oauth2/register' \  -H 'Content-Type: application/json' \  -d '{  "redirect_uris": [    "string"  ]}'
Example Response
{  "client_id": "string",  "client_id_issued_at": 0,  "client_name": "string",  "redirect_uris": [    "string"  ],  "grant_types": [    "string"  ],  "response_types": [    "string"  ],  "token_endpoint_auth_method": "none"}
POST
/oauth/authorizations

Request Body

application/json
  1. body
response_type?string
client_id?string
redirect_uri?string
code_challenge?string
code_challenge_method?string
state?string
Lengthlength <= 2000
scope?string
Lengthlength <= 2000
resource?string

Response Body

What the consent page shows or does.

application/json
  1. response
kind*"consent"
Value in"consent"
requestId*string
client*
redirectHost*string

Where the browser goes after a decision. The page must show it.

redirectIsLoopback*boolean
resource*string
Value in"api""mcp""mcp-chatgpt""a2a"
requestedScopes*array<string>
offlineAccess*boolean
signedInEmail*string
grantOptions*
Example Request
curl -X POST 'https://api.letsship.ai/v1/oauth/authorizations' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "kind": "consent",  "requestId": "string",  "client": {    "clientId": "string",    "name": "string",    "clientUri": "string",    "registration": "dcr"  },  "redirectHost": "string",  "redirectIsLoopback": true,  "resource": "api",  "requestedScopes": [    "string"  ],  "offlineAccess": true,  "signedInEmail": "string",  "grantOptions": {    "orgs": [      {        "id": "string",        "name": "string",        "role": "string",        "grantableScopes": [          "string"        ],        "projects": [          {            "id": "string",            "name": "string"          }        ]      }    ],    "defaultOrgId": "string",    "defaultExpiresInDays": 0,    "maxExpiresInDays": 0  }}
POST
/oauth/authorizations/{requestId}/approve

Path Parameters

requestId*string
Length1 <= length

Request Body

application/json
  1. body
orgId*string
Length1 <= length
scopes?array<string>
Itemsitems <= 31
Default[]
projectId?string
Length1 <= length
expiresInDays?integer
Range1 <= value <= 365
name?string
Length1 <= length <= 100

Response Body

Where to send the browser.

application/json
  1. response
redirectTo*string

The client's redirect URI with code (or error), state and iss.

Example Request
curl -X POST 'https://api.letsship.ai/v1/oauth/authorizations/string/approve' \  -H 'Content-Type: application/json' \  -d '{  "orgId": "string"}'
Example Response
{  "redirectTo": "string"}
POST
/oauth/authorizations/{requestId}/deny

Path Parameters

requestId*string
Length1 <= length

Response Body

Where to send the browser.

application/json
  1. response
redirectTo*string

The client's redirect URI with code (or error), state and iss.

Example Request
curl -X POST 'https://api.letsship.ai/v1/oauth/authorizations/string/deny'
Example Response
{  "redirectTo": "string"}

How is this page?