Exchange Session Token
GEThttps://apis.<domain>/auth/sessions/token-exchange
Exchange Session Token
Request
Query Parameters
init_code stringrequired
The part of the code return when initializing the flow.
return_to_code stringrequired
The part of the code returned by the return_to URL.
Responses
- 200
- 403
- 404
- 410
- default
successfulNativeLogin
- application/json
- Schema
- Example (from schema)
Schema
session objectrequired
session_token string
The Session Token
A session token is equivalent to a session cookie, but it can be sent in the HTTP Authorization Header:
Authorization: bearer ${session-token}
The session token is only issued for API flows, not for Browser flows!
{
"session": {
"active": true,
"authenticated_at": "2024-03-30T07:38:31.808Z",
"authentication_methods": [
{
"aal": "aal0",
"completed_at": "2024-03-30T07:38:31.808Z",
"method": "link_recovery",
"organization": "string",
"provider": "string"
}
],
"authenticator_assurance_level": "aal0",
"devices": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"ip_address": "string",
"location": "string",
"user_agent": "string"
}
],
"expires_at": "2024-03-30T07:38:31.808Z",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"identity": {
"created_at": "2024-03-30T07:38:31.808Z",
"credentials": {},
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"organization_id": "string",
"recovery_addresses": [
{
"created_at": "2024-03-30T07:38:31.808Z",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"updated_at": "2024-03-30T07:38:31.808Z",
"value": "string",
"via": "string"
}
],
"schema_id": "string",
"schema_url": "string",
"state": "active",
"state_changed_at": "2024-03-30T07:38:31.808Z",
"updated_at": "2024-03-30T07:38:31.808Z",
"verifiable_addresses": [
{
"created_at": "2014-01-01T23:28:56.782Z",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"status": "string",
"updated_at": "2014-01-01T23:28:56.782Z",
"value": "string",
"verified": true,
"verified_at": "2024-03-30T07:38:31.808Z",
"via": "email"
}
]
},
"issued_at": "2024-03-30T07:38:31.808Z",
"tokenized": "string"
},
"session_token": "string"
}
errorGeneric
- application/json
- Schema
- Example (from schema)
Schema
error objectrequired
{
"error": {
"code": 404,
"debug": "SQL field \"foo\" is not a bool.",
"details": {},
"id": "string",
"message": "The resource could not be found",
"reason": "User with ID 1234 does not exist.",
"request": "d7ef54b1-ec15-46e6-bccb-524b82c035e6",
"status": "Not Found"
}
}
errorGeneric
- application/json
- Schema
- Example (from schema)
Schema
error objectrequired
{
"error": {
"code": 404,
"debug": "SQL field \"foo\" is not a bool.",
"details": {},
"id": "string",
"message": "The resource could not be found",
"reason": "User with ID 1234 does not exist.",
"request": "d7ef54b1-ec15-46e6-bccb-524b82c035e6",
"status": "Not Found"
}
}
errorGeneric
- application/json
- Schema
- Example (from schema)
Schema
error objectrequired
{
"error": {
"code": 404,
"debug": "SQL field \"foo\" is not a bool.",
"details": {},
"id": "string",
"message": "The resource could not be found",
"reason": "User with ID 1234 does not exist.",
"request": "d7ef54b1-ec15-46e6-bccb-524b82c035e6",
"status": "Not Found"
}
}
errorGeneric
- application/json
- Schema
- Example (from schema)
Schema
error objectrequired
{
"error": {
"code": 404,
"debug": "SQL field \"foo\" is not a bool.",
"details": {},
"id": "string",
"message": "The resource could not be found",
"reason": "User with ID 1234 does not exist.",
"request": "d7ef54b1-ec15-46e6-bccb-524b82c035e6",
"status": "Not Found"
}
}
- curl
- python
- go
- nodejs
- ruby
- csharp
- php
- java
- powershell
- CURL
curl -L -X GET 'https://apis.<domain>/auth/sessions/token-exchange' \
-H 'Accept: application/json'