Endpoint
curl -X POST http://localhost:8000/api/v1/auth/factus/refresh \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-d '{
"refresh_token": "def502004a8b9c..."
}'
POST /api/v1/auth/factus/refresh
Refresh an expired Factus OAuth2 access token using a valid refresh token.
Authentication
Required: Bearer token from local login.
You must be authenticated with a local access token (from /api/v1/auth/login) before calling this endpoint.
Request Body
The refresh token obtained from the Factus login endpoint
Request Example
{
"refresh_token": "def502004a8b9c..."
}
Response
The response is wrapped in a standard ApiResponse envelope:
Indicates if the operation was successful (always true on success)
Success message: “Token refrescado exitosamente”
Contains the refreshed authentication token information:New OAuth2 access token for Factus API requests
Token type (typically “bearer”)
Token expiration time in seconds
New OAuth2 refresh token (if rotation is enabled)
Error details (null on success)
Success Response Example
{
"success": true,
"message": "Token refrescado exitosamente",
"data": {
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "bearer",
"expires_in": 3600,
"refresh_token": "def502004a8b9c..."
},
"errors": null
}
Error Responses
400 Bad Request
Returned when the refresh token is invalid or expired.
{
"detail": "No se pudo refrescar el token de Factus: [error message]"
}
401 Unauthorized
Returned when the local bearer token is missing or invalid.
{
"detail": "Not authenticated"
}