Skip to main content
POST
/
api
/
v1
/
auth
/
oauth
/
{provider_name}
/
callback
Callback
curl --request POST \
  --url https://api.example.com/api/v1/auth/oauth/{provider_name}/callback \
  --header 'Content-Type: application/json' \
  --data '
{
  "code": "<string>",
  "state": "<string>",
  "redirect_uri": "<string>"
}
'
{
  "token": "<string>",
  "refresh_token": "<string>",
  "expires_in": 123,
  "account": {
    "id": "<string>",
    "slug": "<string>",
    "name": "<string>",
    "created_at": "2023-11-07T05:31:56Z"
  },
  "user": {
    "id": "<string>",
    "email": "<string>",
    "role": "<string>",
    "is_active": true,
    "created_at": "2023-11-07T05:31:56Z"
  },
  "is_new_user": true,
  "is_new_account": true
}

Path Parameters

provider_name
string
required

Body

application/json

Request body for OAuth callback completion.

code
string
required

Authorization code from provider

state
string
required

State token for CSRF protection

redirect_uri
string
required

Original redirect URI used in authorize request

Response

Successful Response

Response for successful OAuth callback authentication.

token
string
required

JWT access token

refresh_token
string
required

JWT refresh token

expires_in
integer
required

Access token expiration time in seconds

account
AccountResponse · object
required

Account information

user
UserResponse · object
required

User information

is_new_user
boolean
required

Whether a new user was created

is_new_account
boolean
required

Whether a new account was created