Authentication

Get tokens

POST
/v1/auth/token

The OAuth 2.1 token endpoint, form-encoded. authorization_code (with PKCE: code, code_verifier, redirect_uri, client_id, and the device’s name as device_name) for an app signing a person in; refresh_token (with client_id) to get new tokens, each refresh token usable once; client_credentials for a server, authenticated with HTTP Basic. Errors are OAuth’s own shape, not problem+json.

Request Body

The token request, form-encoded

application/x-www-form-urlencoded
  1. body

The token request, form-encoded

grant_type*string

authorization_code, refresh_token or client_credentials

code?string

authorization_code: the code from /oauth/authorize

Lengthlength <= 200
code_verifier?string

authorization_code: the PKCE verifier

Lengthlength <= 200
redirect_uri?string

authorization_code: exactly as sent to /oauth/authorize

Lengthlength <= 500
client_id?string

authorization_code and refresh_token: your app’s client ID

Lengthlength <= 200
device_name?string

authorization_code: the device’s name, shown in Account › Devices

Lengthlength <= 200
refresh_token?string

refresh_token: the refresh token, used once

Lengthlength <= 200
scope?string

client_credentials: fewer scopes than the client holds, space-separated

Lengthlength <= 1000

Response Body

Tokens (RFC 6749 §5.1)

application/json
  1. response

Tokens (RFC 6749 §5.1)

access_token*string

Opaque; send it as Authorization: Bearer …

token_type*"Bearer"
Value in"Bearer"
expires_in*integer

Seconds until the access token expires: 900

Range-9007199254740991 <= value <= 9007199254740991
refresh_token?string

For an app acting for a person; each use returns a new one, and the old one must never be used again

scope*string

The scopes granted, space-separated

curl -X POST 'https://api.sign2approve.com/v1/auth/token' \  -H 'Content-Type: application/x-www-form-urlencoded' \  -d 'grant_type=string'
{  "access_token": "s2a_live_uk_9xQ…",  "token_type": "Bearer",  "expires_in": 900,  "refresh_token": "s2a_live_uk_Hk2…",  "scope": "me:read documents:envelopes:read"}