Overview
YoFacturo uses a two-step authentication flow:
- Exchange your organization’s
api_key for a short-lived session_token.
- Include the
session_token as a Bearer token in the Authorization header of every subsequent request.
Create a session token
Exchange your api_key for a session_token valid for 24 hours.
Endpoint
Request
Your organization’s API key.
Example
Response
This endpoint returns a flat JSON object — no data envelope.
Error responses
Authenticate requests
Include the session_token in the Authorization header as a Bearer token for all protected endpoints:
If the Authorization header is missing, the API returns 401 Unauthorized:
If the token is invalid or expired, the API returns 401 Unauthorized:
Token expiry and renewal
Session tokens expire 24 hours after creation. There is no refresh mechanism — simply request a new token by calling POST /api/v1/auth/sessions again with your api_key.
We recommend storing the expires_at timestamp and proactively renewing the token before it expires to avoid failed requests.