The Amigo Invisible backend exposes three REST endpoints underDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Sufianeh7/AmigoInvisible/llms.txt
Use this file to discover all available pages before exploring further.
/api/sorteos. All requests and responses use JSON. These endpoints cover the full lifecycle of a Secret Santa group: creating a group, retrieving its data, and launching the randomised draw that sends reveal emails to every participant.
Base URL
All endpoints share the same base URL. Swap between production and local development as needed:Authentication
There are no API keys, OAuth flows, or session cookies. Authentication is entirely token-based at the URL level: when a group is created, the server generates a random UUID calledadminToken and returns it in the response. Every subsequent operation on that group requires the adminToken to appear in the URL path.
Anyone in possession of the token can retrieve the group’s data or trigger the draw. Treat the adminToken as a secret — it should never be embedded in publicly accessible frontend source code, logged to third-party services, or shared beyond the group administrator.
Request Format
All request bodies must be valid JSON. AnyPOST request that includes a body must set the Content-Type header:
GET requests do not require a body or a Content-Type header.
Endpoints Summary
POST /api/sorteos
Create a new Secret Santa group. Returns the
adminToken UUID used for all subsequent management operations.GET /api/sorteos/:adminToken
Retrieve the full group document — participants, budget, status, and past draw history — by admin token.
POST /api/sorteos/:adminToken/lanzar
Run the Secret Santa algorithm, persist pairings to MongoDB, and immediately send personalised reveal emails to all participants.
Error Responses
All error responses follow the same envelope shape: a JSON object with a singleerror key containing a human-readable message.
| Status | Scenario | Body |
|---|---|---|
400 | Algorithm failed due to an unsolvable exclusion conflict | { "error": "No se pudo encontrar una combinación válida. Revisa las exclusiones." } |
404 | Group not found for the supplied adminToken | { "error": "Sorteo no encontrado." } |
500 | Unexpected internal server error | { "error": "Error interno del servidor" } |