Exchange a code, or refresh
RFC 6749 token endpoint.
grant_type=authorization_code: exchanges the code from/v1/oauth/authorize. The code is single-use and expires after ten minutes;redirect_urimust equal the one in the authorization request andcode_verifiermust match the PKCE challenge. Replaying a consumed code revokes every token it issued.grant_type=refresh_token: returns a fresh access token and a new refresh token; the presented refresh token is retired. Presenting a retired token again revokes the whole connection. Granted scopes are re-intersected with what the consenting user currently holds — they can shrink, never grow.
Confidential clients authenticate with client_id + client_secret in the body or with HTTP Basic auth. Accepts application/x-www-form-urlencoded and application/json. Errors use the RFC 6749 error body, not the API's standard ErrorResponse.
Body·
Token request (RFC 6749). Sent as application/x-www-form-urlencoded or application/json. Confidential clients authenticate with client_id + client_secret in the body (client_secret_post) or an Authorization: Basic header (client_secret_basic); public clients send client_id only.
- Type: stringclient
_id required - Type: "authorization_code" or "refresh_token"enumgrant
_type required - Type: stringclient
_secret Required for confidential clients unless sent as HTTP Basic auth.
- Type: stringcode
The authorization code (grant
authorization_code). - Type: stringcode
_verifier PKCE verifier whose S256 digest matches the
code_challengeof the authorization request (grantauthorization_code). - Type: stringFormat: uriredirect
_uri Must equal the
redirect_uriof the authorization request (grantauthorization_code). - Type: stringrefresh
_token The current refresh token (grant
refresh_token). It is rotated on every use; reusing a rotated-out token revokes the connection. - Type: stringFormat: uriresource
RFC 8707 resource indicator. Optional; must equal the authorization request's resource when supplied.
Responses
- application/json
- application/json
- application/json
curl https://api.signstack.ai/v1/oauth/token \
--request POST \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=authorization_code' \
--data-urlencode 'client_id=oc_01jv8m7qfj6xj9gkz7a4s2h8e' \
--data-urlencode 'client_secret=' \
--data-urlencode 'code=' \
--data-urlencode 'redirect_uri=https://example.com' \
--data-urlencode 'code_verifier=' \
--data-urlencode 'refresh_token=' \
--data-urlencode 'resource=https://example.com'
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "wQz3…",
"scope": "workflow:read workflow:create resource:read"
}