POST /v1/auth/device/token
Exchanges an authorized device code or a refresh token for an access token and rotating refresh token. Accepts JSON and form-encoded bodies. While polling, wait at least interval seconds and increase the interval on slow_down. Store the new refresh token after every successful grant.
- TypeScript
- Python
- Rust
TypeScript
Body
One of: DeviceCodeGrantRequeststring
required
device_code returned by POST /v1/auth/device/code. Required for a device-code grant.
"urn:ietf:params:oauth:grant-type:device_code"
required
Selects the device authorization grant to poll or exchange a device code.
"refresh_token"
required
Selects the refresh-token grant to obtain a new token pair.
string
required
Most recently issued refresh token. Required for a refresh grant; replace it with the returned refresh_token after success.
Returns
200 Token pair (snake_case OAuth wire format). Body (form-encoded or JSON): grant_type=urn:ietf:params:oauth:grant-type:device_code with device_code, or grant_type=refresh_token with refresh_token. Refresh tokens rotate on every grant — always store the new one. DeviceTokenResponse
string
required
Bearer access token for authenticated Photon API requests.
string
Authentication method used for the device login, when returned. Omitted for refresh grants.
number
required
Access-token validity in seconds, derived from its expiry and issue times; defaults to 300 when unavailable.
string
required
Refresh token for the next refresh grant. Tokens rotate on every grant; replace the stored value with this one.
DeviceTokenResponseUser
required
Profile of the authenticated user.