Skip to main content
POST
/
auth
/
token
Troca token no Auth0 e retorna contexto do usuário interno
curl --request POST \
  --url http://localhost:3000/auth/token \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "grantType": "authorization_code",
  "code": "<string>",
  "codeVerifier": "<string>",
  "redirectUri": "https://app.kortex.com/callback",
  "refreshToken": "<string>"
}
'
{
  "accessToken": "<string>",
  "tokenType": "<string>",
  "expiresIn": 123,
  "user": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "tenantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "role": "ADMIN",
    "email": "<string>"
  },
  "idToken": "<string>",
  "refreshToken": "<string>",
  "scope": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
grantType
enum<string>
required

OAuth2 grant type aceito pelo endpoint

Available options:
authorization_code,
refresh_token
Example:

"authorization_code"

code
string

Authorization code retornado pelo Auth0

codeVerifier
string

PKCE code verifier usado no login

redirectUri
string

Redirect URI usada no fluxo authorization_code

Example:

"https://app.kortex.com/callback"

refreshToken
string

Refresh token para renovação da sessão

Response

Token trocado com sucesso

accessToken
string
required
tokenType
string
required
expiresIn
number
required
user
object
required
idToken
string
refreshToken
string
scope
string