Documentation Index
Fetch the complete documentation index at: https://docs.yofacturo.es/llms.txt
Use this file to discover all available pages before exploring further.
Overview
YoFacturo uses a two-step authentication flow:- Exchange your organization’s
api_keyfor a short-livedsession_token. - Include the
session_tokenas a Bearer token in theAuthorizationheader of every subsequent request.
Create a session token
Exchange yourapi_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 — nodata envelope.
| Field | Type | Description |
|---|---|---|
session_token | string | Bearer token to use in subsequent requests |
expires_at | ISO 8601 datetime | Expiry time of the token (24 hours from issuance) |
Error responses
| Status | Code | Cause |
|---|---|---|
400 | bad_request | api_key parameter is missing, null, or empty |
401 | unauthorized | The provided api_key is invalid or has been revoked — message: "Invalid API key" |
Authenticate requests
Include thesession_token in the Authorization header as a Bearer token for all protected endpoints:
Authorization header is missing, the API returns 401 Unauthorized:
401 Unauthorized:
Token expiry and renewal
Session tokens expire 24 hours after creation. There is no refresh mechanism — simply request a new token by callingPOST /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.
