Skip to content

Refresh Token

POST
/api/auth/refresh
curl --request POST \
--url https://example.com/api/auth/refresh \
--header 'Content-Type: application/json' \
--data '{ "refresh_token": "example" }'

Refresh access token using refresh token from JSON body OR cookie.

Priority: body.refresh_token (if provided) → refresh_token cookie. This preserves backward compatibility with testagent (body path) while enabling cookie-based SSO flows (TASK-S10-003).

Media type application/json
Any of:
RefreshTokenRequest

Token refresh request.

refresh_token is optional (BUG-398): the SPA posts {} and relies on the httpOnly cookie. The handler returns 401 when neither is present.

object
refresh_token
Any of:
string
Example generated
{
"refresh_token": "example"
}

Successful Response

Media type application/json
Token

JWT token response

object
access_token
required
Access Token
string
expires_in
required
Expires In
integer
refresh_token
required
Refresh Token
string
token_type
Token Type
string
default: bearer
user
required
UserResponse

User response schema

object
created_at
required
Created At
string format: date-time
current_terms_version
Current Terms Version
string
""
email
required
Email
string format: email
full_name
required
Any of:
string
id
required
Id
string format: uuid
is_active
required
Is Active
boolean
is_superuser
Is Superuser
boolean
is_verified
required
Is Verified
boolean
last_login
required
Any of:
string format: date-time
organization_id
Any of:
string format: uuid
terms_acceptance_required
Terms Acceptance Required
boolean
terms_accepted_at
Any of:
string format: date-time
terms_version
Any of:
string
timezone
Any of:
string
username
required
Username
string
Example
{
"token_type": "bearer",
"user": {
"current_terms_version": "",
"is_superuser": false,
"terms_acceptance_required": false,
"timezone": "UTC"
}
}

Validation Error

Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Example generated
{
"detail": [
{
"ctx": {},
"input": "example",
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}