Avycenna

Rotate token pair

Exchange a valid refresh token for a new `access_token` + `refresh_token` pair. The old refresh token is **immediately revoked**. Clients should store the new refresh token from the response. Call this automatically whenever a request returns HTTP 401.

POST
/api/v1/auth/refresh

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/api/v1/auth/refresh" \  -H "Content-Type: application/json" \  -d '{    "refresh_token": "string"  }'
{  "access_token": "string",  "refresh_token": "string",  "token_type": "bearer",  "user": {    "id": "string",    "name": "string",    "email": "string",    "image": "string",    "role": "patient"  }}
{  "detail": [    {      "loc": [        "string"      ],      "msg": "string",      "type": "string"    }  ]}