Use your refresh token to obtain a new access token and refresh token pair without re-entering your credentials. Your previous refresh token is invalidated after a successful refresh.
Endpoint: POST https://api.agentity.to/auth/token/refresh
Request
No Authorization header is required for this endpoint.
The refresh token returned by the Login or a previous refresh request.
Response
A successful request returns 200 OK with a new token pair.
A new short-lived JWT for authenticating API requests.
A new long-lived refresh token. Use this on your next refresh request — the previous token is no longer valid.
Errors
| Status | Description |
|---|
400 | refreshToken is missing from the request body. |
401 | The refresh token is invalid or has expired. |
curl -X POST https://api.agentity.to/auth/token/refresh \
-H "Content-Type: application/json" \
-d '{"refreshToken": "dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4..."}'
{
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refreshToken": "bmV3UmVmcmVzaFRva2Vu..."
}