This endpoint creates a new sorteo (group) document in MongoDB and returns theDocumentation 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.
adminToken that acts as the sole credential for managing the group. Save this token immediately — there is no way to recover it after the response is received.
Request
Method:POSTURL:
/api/sorteosHeaders:
Content-Type: application/json
Body Parameters
Display name for the group (e.g.
"Navidad Familia Pérez"). Stored with leading and trailing whitespace trimmed.A free-text budget description (e.g.
"20€ - 30€"). Optional — leave blank if no budget guidance is needed.Planned gift exchange date in ISO 8601 format (e.g.
"2024-12-24"). Stored as a MongoDB Date. Optional.Array of participant objects. The draw algorithm requires a minimum of 3 participants, though this minimum is not enforced at creation time — it is only checked when the draw is launched.
Display name for this participant (e.g.
"Ana"). This value is used by the exclusion rules — it must match exactly the names listed in other participants’ exclusiones arrays.Email address for this participant. Used both as a unique identity key during draw pairing and as the delivery address for the reveal email.
Names of participants that this person must never be assigned to gift. Each entry must match the
nombre field of another participant exactly. Pass an empty array [] if no exclusions apply.Example Request
Response
Status:201 Created
Human-readable confirmation message. Value is always
"¡Grupo crado con éxito!".A randomly generated UUID (via Node.js
crypto.randomUUID()) that serves as the group’s management credential. All future API calls for this group require this value in the URL path.Relative path to the admin panel for this group, in the format
/admin/{adminToken}. Intended for use by the frontend to build the full admin URL.Example Response
Error Responses
| Status | Scenario | Body |
|---|---|---|
500 | Database write failed or unexpected server error | { "error": "Hubo un problema al crear el grupo." } |