Unreleased documentation. These pages follow the main branch and can change before the next release. For supported guidance, use v0.43.0.
Redeem one pre-authorized code anonymously
POST
/token
const url = 'https://example.com/token';const options = { method: 'POST', headers: {'Content-Type': 'application/x-www-form-urlencoded'}, body: new URLSearchParams({ grant_type: 'urn:ietf:params:oauth:grant-type:pre-authorized_code', 'pre-authorized_code': 'example', tx_code: 'example' })};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/token \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data grant_type=urn:ietf:params:oauth:grant-type:pre-authorized_code \ --data pre-authorized_code=example \ --data tx_code=exampleRequest Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/x-www-form-urlencoded
object
grant_type
required
pre-authorized_code
required
string
tx_code
string
Responses
Section titled “Responses”Single-use access token
Media typeapplication/json
object
access_token
required
string
expires_in
required
integer
token_type
required
Example
{ "token_type": "Bearer"}Headers
Section titled “Headers”Cache-Control
string
Pragma
string
The grant or code was refused
Media typeapplication/json
object
error
required
error_description
required
string
Example
{ "error": "invalid_request"}Headers
Section titled “Headers”Cache-Control
string
Pragma
string
The configured request deadline elapsed
Media typeapplication/json
object
error
required
error_description
required
string
Example
{ "error": "invalid_request"}Headers
Section titled “Headers”Cache-Control
string
Pragma
string
The request body exceeds the configured byte limit
Media typetext/plain; charset=utf-8
string
Headers
Section titled “Headers”Cache-Control
string
Pragma
string
The request is not form encoded
Media typetext/plain; charset=utf-8
string
Headers
Section titled “Headers”Cache-Control
string
Pragma
string
The form body cannot be decoded
Media typetext/plain; charset=utf-8
string
Headers
Section titled “Headers”Cache-Control
string
Pragma
string
The bounded state store is unavailable
Media typeapplication/json
object
error
required
error_description
required
string
Example
{ "error": "invalid_request"}Headers
Section titled “Headers”Cache-Control
string
Pragma
string