Endpoint
curl -X POST http://localhost:8000/api/v1/auth/factus/login \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-d '{
"email": "[email protected]",
"password": "your_password"
}'
POST /api/v1/auth/factus/login
Authenticate with the Factus API using email and password to receive OAuth2 access and refresh tokens.
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
Email address for Factus authentication (must be a valid email format)
Password for Factus authentication
Request Example
Response
The response is wrapped in a standard ApiResponse envelope:
Indicates if the operation was successful (always true on success)
Success message: “Autenticación exitosa”
Contains the authentication token information:OAuth2 access token for Factus API requests
Token type (typically “bearer”)
Token expiration time in seconds
OAuth2 refresh token for obtaining new access tokens
Error details (null on success)
Success Response Example
{
"success": true,
"message": "Autenticación exitosa",
"data": {
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "bearer",
"expires_in": 3600,
"refresh_token": "def502004a8b9c..."
},
"errors": null
}
Error Responses
400 Bad Request
Returned when authentication with Factus fails.
{
"detail": "No se pudo obtener el token de Factus: [error message]"
}
401 Unauthorized
Returned when the local bearer token is missing or invalid.
{
"detail": "Not authenticated"
}