Crescendo Lab Docs
English
Sign up

OAuth API reference

Platform API v1, OAuth: every operation's path, parameters, request and response fields, scopes, idempotency and errors, from the contract.

Last updated

Generated from the API contract (Agent Lab Platform API 1.0.0-alpha.1). Descriptions are the contract's own words.

Sign-in and tokens for applications (RFC 6749, 7009, 7662; OpenID Connect).

Start authorization (authorization code with PKCE)#

GET /v1/oauth/authorize

A browser navigation, not an API call. scope=install asks a workspace administrator to install the application (never combined with another scope). A valid request is redirected to the consent screen (or, for an operators' own application with a signed-in person, straight back to the client). An invalid one is answered here and never redirected to an unverified URI.

ScopesActs asAuthenticationIdempotency-Key
none—none—

Parameters

NameInTypeRequiredDescription
client_idquerystringyes—
redirect_uriquerystringyes—
code_challengequerystringyes—
code_challenge_methodquerystringyesOne of: S256.
response_typequerystringno—
statequerystringno—
resourcequerystringno—
scopequerystringno—
noncequerystringno—
organization_idquerystring (uuid)noThe workspace to preselect on the consent screen, by id. A hint only.
organizationquerystringnoThe same hint by the workspace's short name.

Responses

StatusBodyDescription
302—To the consent screen, or back to the client.
400application/json: OAuthErrorThe request is invalid.
500application/json: LegacyErrorStringThe consent screen's address is misconfigured.

Exchange a code, refresh a token, or get an installation token#

POST /v1/oauth/token

Three grants:

  • authorization_code (with PKCE): a person's sign-in. When the code came from an install request (scope=install at /v1/oauth/authorize), the answer names the installation and carries no token (InstallResult).
  • refresh_token: a new access token for the same sign-in.
  • client_credentials: an installed application's server asks for a one-hour installation token, naming the installation by installation_id or workspace_id. No refresh token: the application asks again. Refused alike unless the client authenticated with its secret, the installation is live for that client, and its workspace still allows it.

A workspace application authenticates with its secret, by HTTP Basic (client_secret_basic, each half form-encoded first) or in the body (client_secret_post); both at once must name the same client and the secret may be sent only once. Any other client is public and sends only client_id. Requests that carry a secret are rate limited per address.

ScopesActs asAuthenticationIdempotency-Key
none—clientSecretBasic—

Request body

application/x-www-form-urlencoded: TokenRequest

FieldTypeRequiredDescription
grant_typestringyesOne of: authorization_code, refresh_token, client_credentials.
codestringno—
code_verifierstringno—
client_idstringno—
client_secretstringnoclient_secret_post; a workspace application's secret.
redirect_uristringno—
resourcestringno—
refresh_tokenstringno—
installation_idstringnoclient_credentials: the installation, by id.
workspace_idstringnoclient_credentials: the installation, by the workspace it is in.
scopestringnoclient_credentials: install or absent.

Responses

StatusBodyDescription
200application/json: TokenResponse or InstallationTokenResponse or InstallResultThe tokens, or where an application was installed. Never cached.
400application/json: OAuthErrorinvalid_grant, invalid_request or unsupported_grant_type.
401application/json: OAuthErrorinvalid_client: the client authentication is missing, wrong or malformed.
429application/json: OAuthErrorToo many requests carrying a secret from this address, or tokens for this client.
503application/json: OAuthErrorTry again.

Revoke a token (RFC 7009)#

POST /v1/oauth/revoke

Answers 200 whether or not the token named anything.

ScopesActs asAuthenticationIdempotency-Key
none—none—

Request body

application/x-www-form-urlencoded: object

FieldTypeRequiredDescription
tokenstringno—
client_idstringno—

Responses

StatusBodyDescription
200—Revoked, or nothing to revoke.
503application/json: OAuthErrorStorage is unavailable; try again.

Introspect a token (RFC 7662)#

POST /v1/oauth/introspect

The application's server asks whether a bearer token is one the platform honors, and as whom: an operators' application about its sign-in tokens, a workspace application about its sign-in and installation tokens. Server to server only (no CORS). A token that is unknown, expired, revoked, for another audience or issued to any other client answers {"active": false}.

ScopesActs asAuthenticationIdempotency-Key
none—clientSecretBasic—

Request body

application/x-www-form-urlencoded: object

FieldTypeRequiredDescription
tokenstringyes—
token_type_hintstringno—

Responses

StatusBodyDescription
200application/json: IntrospectionThe token's state. Never cached.
400application/json: OAuthErrortoken is missing.
401application/json: OAuthErrorThe client credential is missing or wrong.
429application/json: OAuthErrorToo many requests from this address or client.
503application/json: OAuthErrorTry again.

The signed-in person (OpenID Connect userinfo)#

GET /v1/oauth/userinfo

For a sign-in's token of any client. Only an operators' application's page may call it from a browser; any other client calls it from its server.

ScopesActs asAuthenticationIdempotency-Key
none—personToken—

Responses

StatusBodyDescription
200application/json: UserInfoThe claims the token's scope allows, and the workspace it is bound to.
401application/json: OAuthErrorNo token, or one this endpoint does not honor.
403application/json: OAuthErrorSent from a page that is not the application's registered origin.
503application/json: OAuthErrorTry again.

The signed-in person (OpenID Connect userinfo, POST form)#

POST /v1/oauth/userinfo

ScopesActs asAuthenticationIdempotency-Key
none—personToken—

Responses

StatusBodyDescription
200application/json: UserInfoThe claims the token's scope allows, and the workspace it is bound to.
401application/json: OAuthErrorNo token, or one this endpoint does not honor.
403application/json: OAuthErrorSent from a page that is not the application's registered origin.
503application/json: OAuthErrorTry again.

The keys that sign ID tokens#

GET /v1/oauth/jwks.json

ScopesActs asAuthenticationIdempotency-Key
none—none—

Responses

StatusBodyDescription
200application/json: objectA JSON Web Key Set (public keys only).
404application/json: OAuthErrorID tokens are not configured on this server.

200 application/json

FieldTypeRequiredDescription
keysobject[]yes—