VeryAIdocs

Developers

API Specs

OAuth2

Server URLs:

  • Production: https://api.very.org/oauth2
  • Development: http://localhost:3000/oauth2

GET /authorize

Start the OAuth-style authorization flow. Verifies client_id, redirect_uri, and optional state. If valid, redirects to the consent/verification page with an auth_request_id for further processing.

Parameters

ParameterRequiredTypeDescription
response_typeYesenumMust be "code"
client_idYesstringYour application client ID
redirect_uriYesURIPre-registered redirect URI
scopeYesstringSpace-separated scopes. Must include "openid". Use "offline_access" for refresh tokens.
stateNostringOpaque value for CSRF protection
nonceNostringString value for replay protection

Responses

CodeDescription
302Redirects to consent or palm verification UI
400Bad request
500Server error

POST /token

Exchange an authorization code for tokens. After successful palm verification, exchanges an authorization code for the corresponding external_user_id.

Content-Type: application/x-www-form-urlencoded

Request Body

ParameterRequiredTypeDescription
grant_typeYesenum"authorization_code" or "refresh_token"
client_idYesstringYour client ID
client_secretYesstringYour client secret
codeConditionalstringAuthorization code (required for authorization_code grant)
refresh_tokenConditionalstringRefresh token (required for refresh_token grant)
redirect_uriConditionalURIMust match original request (required for authorization_code grant)

Response (200)

FieldTypeDescription
access_tokenJWTJWT access token for accessing protected resources. Include as Bearer {access_token} in the Authorization header.
token_typeenumAlways "Bearer"
expires_inintegerLifetime in seconds of the access token
scopestringSpace-separated list of granted scopes
id_tokenJWTOIDC ID Token. sub claim === external_user_id.
refresh_tokenJWTOnly provided when "offline_access" scope is granted.
refresh_token_expires_inintegerLifetime in seconds of the refresh token (optional)

Error Responses

CodeDescription
400Bad request
401Unauthorized
500Server error

GET /userinfo

Standard OIDC UserInfo endpoint. Returns claims about the subject (sub) represented by the Bearer Access Token presented in the Authorization header. Requires scope=openid. Only returns claims the user originally consented to — never private biometric templates.

Security: Bearer Auth (JWT)

Response (200)

FieldTypeDescription
substringStable, pairwise identifier for the end user (same value as the sub claim in the ID Token).

Error Responses

CodeDescription
401Unauthorized — missing or invalid token
403Forbidden — insufficient scope
500Server error