{"openapi":"3.1.0","info":{"title":"Autorizo API","version":"1.0.0","summary":"Signed authorisations for minors (parental consent) as an API.","description":"Autorizo API creates authorisations for minors (trips, camps, image rights, data consent), returns signing links to share through your own channels and delivers every signature with its evidence chain. Autorizo never sends invitations: the only email is a 6-digit sign-in code, from codigo@autorizo.app, to the address the signer types on the signing page (optionally restricted to the organiser's expected emails). Modes: free (no key), test (az_test_ key from POST /v1/test-keys) and live (az_live_ key, contact developers@autorizo.es). An MCP server is available at https://developers.autorizo.es/mcp. /v1 and /mcp answer CORS with Access-Control-Allow-Origin *, but keep API keys on your server. Error messages are in English. Hashes: every hash is the hex SHA-256 of canonical JSON (keys sorted, strings NFC, no spaces). document_hash covers {id, organiser_name, title, text, questions, ask_child_name, locale, created_at}; evidence_hash covers {authorization_id, document_hash, signature_id, seq, family_id, reference, decision, signer_name, relationship, child_name, answers, drawing_hash (SHA-256 of the drawn path), verified_by, verified_email, ip, user_agent, signed_at, previous_hash}; the first signature's previous_hash is the document_hash. Docs: https://developers.autorizo.es/es and https://developers.autorizo.es/llms-full.txt.","contact":{"name":"Autorizo API","email":"developers@autorizo.es","url":"https://developers.autorizo.es"}},"servers":[{"url":"https://developers.autorizo.es"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Test keys"},{"name":"Authorizations"},{"name":"Signatures"}],"paths":{"/v1/test-keys":{"post":{"tags":["Test keys"],"operationId":"createTestKey","summary":"Create a test key","description":"Creates a test key (az_test_) instantly, with no sign-up. At most 5 per day per IP. Test keys do not expire.","security":[],"responses":{"201":{"description":"The new test key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestKey"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/Internal"}}}},"/v1/authorizations":{"post":{"tags":["Authorizations"],"operationId":"createAuthorization","summary":"Create an authorisation","description":"Creates an authorisation. With no Authorization header it is created in free mode; with an API key, in the key's mode. The response includes results_token (azr_) and, when webhook_url is set, webhook_secret. Both appear only in this response.","security":[{},{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAuthorizationRequest"},"examples":{"openLink":{"summary":"Day trip with an open link","value":{"organiser_name":"Grupo Scout Ejemplo","title":"Salida al Montseny, sábado 13 de diciembre","text":"Autorizo a mi hijo/a a participar en la salida al Montseny del sábado 13 de diciembre, con salida a las 9:00 desde el local y vuelta a las 18:00.","questions":[{"label":"¿Puede salir en fotos del grupo?","type":"yes_no"},{"label":"¿Alguna alergia o medicación que debamos conocer?","type":"text","required":false}],"open_days":5,"locale":"es"}},"perFamily":{"summary":"One link per family, from a platform","value":{"organiser_name":"Escuela de Fútbol Ejemplo","title":"Torneo de Navidad, 20 de diciembre","text":"Autorizo a mi hijo/a a participar en el torneo de Navidad del 20 de diciembre en el polideportivo municipal, de 9:00 a 14:00.","families":[{"label":"Familia García","reference":"jugador-1042","email":"garcia@example.com"},{"label":"Familia Puig","reference":"jugador-1043","email":"puig@example.com"}],"webhook_url":"https://your-platform.example.com/webhooks/autorizo","metadata":{"event":"torneo-navidad"}}}}}}},"responses":{"201":{"description":"The authorisation, plus results_token and (with webhook_url) webhook_secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizationCreated"},"examples":{"free":{"summary":"Created in free mode","value":{"id":"auz_7KQ2M9X4TB8RJH3N","object":"authorization","mode":"free","status":"open","locale":"es","organiser":{"name":"Grupo Scout Ejemplo"},"title":"Salida al Montseny, sábado 13 de diciembre","text":"Autorizo a mi hijo/a a participar en la salida al Montseny del sábado 13 de diciembre, con salida a las 9:00 desde el local y vuelta a las 18:00.","questions":[{"id":"q1","label":"¿Puede salir en fotos del grupo?","type":"yes_no","required":true}],"ask_child_name":true,"signing":{"type":"open_link","url":"https://autorizo.app/f/…"},"families":null,"verification":"email_code","expected_emails":null,"max_signatures":30,"signature_count":0,"authorized_count":0,"declined_count":0,"results_url":"https://autorizo.app/r/…","created_at":"2026-12-03T10:00:00.000Z","opens_until":"2026-12-10T10:00:00.000Z","closed_at":null,"deletes_at":"2026-12-13T10:00:00.000Z","document_hash":"9c1f…","webhook_url":null,"metadata":{},"results_token":"azr_…"}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/Internal"},"503":{"$ref":"#/components/responses/Unavailable"}}},"get":{"tags":["Authorizations"],"operationId":"listAuthorizations","summary":"List authorisations","description":"Lists the authorisations created with the API key, newest first. API keys only (not results tokens).","parameters":[{"name":"limit","in":"query","required":false,"description":"How many to return, 20 by default, up to 100.","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"starting_after","in":"query","required":false,"description":"The id of the last authorisation on the previous page.","schema":{"type":"string"}}],"responses":{"200":{"description":"A list of authorisations.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizationList"}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/Internal"}}}},"/v1/authorizations/{id}":{"parameters":[{"$ref":"#/components/parameters/AuthorizationId"}],"get":{"tags":["Authorizations"],"operationId":"getAuthorization","summary":"Get an authorisation","description":"Returns one authorisation with its status and counts. Accepts the API key that created it or the authorisation's results token (azr_). results_url is filled in only when authenticating with the results token; with an API key it is null.","responses":{"200":{"description":"The authorisation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Authorization"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/Internal"}}},"delete":{"tags":["Authorizations"],"operationId":"deleteAuthorization","summary":"Delete an authorisation","description":"Deletes the authorisation, its links and all its signatures right away.","responses":{"204":{"description":"Deleted. No body."},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/Internal"}}}},"/v1/authorizations/{id}/signatures":{"parameters":[{"$ref":"#/components/parameters/AuthorizationId"}],"get":{"tags":["Signatures"],"operationId":"listSignatures","summary":"List signatures","description":"Lists the authorisation's signatures.","responses":{"200":{"description":"A list of signatures.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignatureList"},"examples":{"one":{"value":{"object":"list","data":[{"id":"sig_…","object":"signature","authorization_id":"auz_7KQ2M9X4TB8RJH3N","family_id":null,"reference":null,"decision":"authorize","signer_name":"Laura Pérez","relationship":"madre","child_name":"Martí","answers":{"q1":"yes"},"verified_by":"email_code","verified_email":"laura@example.com","signed_at":"2026-12-03T10:05:00.000Z","evidence_hash":"4b7e…","previous_hash":"9c1f…","webhook":null}]}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/Internal"}}}},"/v1/authorizations/{id}/results.pdf":{"parameters":[{"$ref":"#/components/parameters/AuthorizationId"}],"get":{"tags":["Signatures"],"operationId":"getResultsPdf","summary":"Download the results PDF","description":"A PDF with the document, a summary and one evidence block per signature.","responses":{"200":{"description":"The PDF.","content":{"application/pdf":{"schema":{"type":"string","contentMediaType":"application/pdf"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/Internal"}}}},"/v1/authorizations/{id}/results.csv":{"parameters":[{"$ref":"#/components/parameters/AuthorizationId"}],"get":{"tags":["Signatures"],"operationId":"getResultsCsv","summary":"Download the results CSV","description":"A CSV with one row per signature.","responses":{"200":{"description":"The CSV.","content":{"text/csv":{"schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/Internal"}}}},"/v1/authorizations/{id}/close":{"parameters":[{"$ref":"#/components/parameters/AuthorizationId"}],"post":{"tags":["Authorizations"],"operationId":"closeAuthorization","summary":"Close an authorisation","description":"Stops accepting signatures. The signatures collected stay until deletes_at. Returns 409 closed if it is already closed or expired.","responses":{"200":{"description":"The authorisation, with status closed and closed_at set.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Authorization"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/Internal"}}}}},"webhooks":{"signature.created":{"post":{"summary":"A new signature","description":"Sent to webhook_url (API keys only) for every new signature. Header Autorizo-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" keyed with webhook_secret>. One attempt with a 5-second timeout; the result is kept on the signature as webhook.","parameters":[{"name":"Autorizo-Signature","in":"header","required":true,"description":"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" keyed with webhook_secret>","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignatureCreatedEvent"}}}},"responses":{"200":{"description":"Any 2xx within 5 seconds counts as delivered."}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"An API key (az_test_… or az_live_…), which sees the authorisations it created, or an authorisation's results token (azr_…), which sees only that authorisation. POST /v1/authorizations without this header creates in free mode."}},"parameters":{"AuthorizationId":{"name":"id","in":"path","required":true,"description":"The authorisation id (auz_…).","schema":{"type":"string","examples":["auz_7KQ2M9X4TB8RJH3N"]}}},"responses":{"InvalidRequest":{"description":"invalid_request: the body or parameters are not valid, an unknown field was sent, or there are more families or expected_emails than max_signatures.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"unauthorized: the token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"forbidden: the token has no access to this authorisation, or webhook_url or metadata was sent in free mode.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"not_found: the authorisation does not exist or has been deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Conflict":{"description":"closed: the authorisation is closed or expired. limit_reached: max_signatures or open_days above the mode's cap (and, at signing, a full authorisation or an already-signed family link).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"rate_limited: a request limit was hit, such as the daily creation limit.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Internal":{"description":"internal: server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unavailable":{"description":"unavailable: email-code signing is not open yet on this deployment. Live keys with verification \"platform\" work.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["invalid_request","unauthorized","forbidden","not_found","closed","limit_reached","rate_limited","internal"]},"message":{"type":"string"}}}}},"TestKey":{"type":"object","required":["key","mode","limits"],"properties":{"key":{"type":"string","description":"The test key. Shown once. Test keys do not expire.","examples":["az_test_…"]},"mode":{"type":"string","const":"test"},"limits":{"type":"object","required":["creations_per_day","max_signatures","max_open_days","deleted_days_after_close"],"properties":{"creations_per_day":{"type":"integer","examples":[20]},"max_signatures":{"type":"integer","examples":[30]},"max_open_days":{"type":"integer","examples":[7]},"deleted_days_after_close":{"type":"integer","examples":[3]}}},"note":{"type":"string","description":"An informative note."}}},"QuestionInput":{"type":"object","required":["label","type"],"properties":{"label":{"type":"string","maxLength":200},"type":{"type":"string","enum":["yes_no","text"]},"required":{"type":"boolean","default":true}}},"Question":{"type":"object","required":["id","label","type","required"],"properties":{"id":{"type":"string","description":"Key of the answer in Signature.answers.","examples":["q1"]},"label":{"type":"string","maxLength":200},"type":{"type":"string","enum":["yes_no","text"]},"required":{"type":"boolean"}}},"FamilyInput":{"type":"object","properties":{"label":{"type":"string","maxLength":120},"reference":{"type":"string","maxLength":120,"description":"Your id for the family; returned on its signature."},"email":{"type":"string","format":"email","description":"Only this address can verify on this family's link."}}},"Family":{"type":"object","required":["id","url","signed"],"properties":{"id":{"type":"string","examples":["fam_…"]},"label":{"type":["string","null"]},"reference":{"type":["string","null"]},"email":{"type":["string","null"],"format":"email","description":"The only address that can verify on this link, if given."},"url":{"type":"string","format":"uri","description":"This family's signing link. Takes one signature."},"signed":{"type":"boolean"}}},"CreateAuthorizationRequest":{"type":"object","description":"Unknown fields return 400 invalid_request. More families or expected_emails than max_signatures return 400 invalid_request. max_signatures or open_days above the mode's cap return 409 limit_reached. webhook_url or metadata in free mode return 403 forbidden.","additionalProperties":false,"required":["organiser_name","title","text"],"properties":{"organiser_name":{"type":"string","maxLength":120},"title":{"type":"string","maxLength":160},"text":{"type":"string","maxLength":4000,"description":"Plain text. A blank line separates paragraphs; a single newline is a line break. Links are removed in free and test modes."},"questions":{"type":"array","maxItems":10,"items":{"$ref":"#/components/schemas/QuestionInput"}},"ask_child_name":{"type":"boolean","default":true},"families":{"type":"array","description":"One signing link per family, each taking one signature. At most max_signatures.","items":{"$ref":"#/components/schemas/FamilyInput"}},"expected_emails":{"type":"array","description":"Open link only: only these addresses can verify. At most max_signatures.","items":{"type":"string","format":"email"}},"verification":{"type":"string","enum":["email_code","platform"],"default":"email_code","description":"email_code: the signer verifies their email with a 6-digit code. platform: live keys with families only; the platform vouches for its logged-in user and no code is sent."},"max_signatures":{"type":"integer","minimum":1,"description":"Default: the number of families when families is given, otherwise the mode's cap (30 free/test, 2000 live). Above the cap: 409 limit_reached."},"open_days":{"type":"integer","minimum":1,"description":"Default 7 (free/test) or 30 (live). Maximum 7 (free/test) or 90 (live); above it: 409 limit_reached."},"locale":{"type":"string","enum":["es","ca","en"],"default":"es","description":"Language of the signing page."},"webhook_url":{"type":"string","format":"uri","description":"https URL. Test and live keys only (free mode: 403 forbidden)."},"metadata":{"type":"object","description":"Test and live keys only. Up to 20 keys; string values up to 500 characters.","maxProperties":20,"additionalProperties":{"type":"string","maxLength":500}}}},"Authorization":{"type":"object","required":["id","object","mode","status","locale","organiser","title","text","questions","ask_child_name","signing","families","verification","expected_emails","max_signatures","signature_count","authorized_count","declined_count","results_url","created_at","opens_until","closed_at","deletes_at","document_hash","webhook_url","metadata"],"properties":{"id":{"type":"string","examples":["auz_7KQ2M9X4TB8RJH3N"]},"object":{"type":"string","const":"authorization"},"mode":{"type":"string","enum":["free","test","live"]},"status":{"type":"string","enum":["open","closed","expired"],"description":"open while it accepts signatures, closed once closed, expired after opens_until."},"locale":{"type":"string","enum":["es","ca","en"]},"organiser":{"type":"object","required":["name"],"properties":{"name":{"type":"string"}}},"title":{"type":"string"},"text":{"type":"string"},"questions":{"type":"array","items":{"$ref":"#/components/schemas/Question"}},"ask_child_name":{"type":"boolean"},"signing":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["open_link","per_family"]},"url":{"type":"string","format":"uri","description":"Open link only."}}},"families":{"description":"With per-family links, one entry per family; otherwise null.","oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/Family"}},{"type":"null"}]},"verification":{"type":"string","enum":["email_code","platform"]},"expected_emails":{"type":["array","null"],"items":{"type":"string","format":"email"}},"max_signatures":{"type":"integer"},"signature_count":{"type":"integer"},"authorized_count":{"type":"integer"},"declined_count":{"type":"integer"},"results_url":{"type":["string","null"],"format":"uri","description":"Results page. It carries the results token: anyone holding it sees the results. Filled in on the create response and when authenticating with the results token; null with an API key (the token is stored only as a hash)."},"created_at":{"type":"string","format":"date-time"},"opens_until":{"type":"string","format":"date-time"},"closed_at":{"type":["string","null"],"format":"date-time"},"deletes_at":{"type":"string","format":"date-time"},"document_hash":{"type":"string","description":"Hex SHA-256 of the canonical JSON of {id, organiser_name, title, text, questions, ask_child_name, locale, created_at}."},"webhook_url":{"type":["string","null"],"format":"uri"},"metadata":{"type":"object","additionalProperties":{"type":"string"}}}},"AuthorizationCreated":{"allOf":[{"$ref":"#/components/schemas/Authorization"},{"type":"object","required":["results_token"],"properties":{"results_token":{"type":"string","description":"azr_ token for this authorisation. Only in the create response.","examples":["azr_…"]},"webhook_secret":{"type":"string","description":"Secret for Autorizo-Signature. Only in the create response, when webhook_url is set."}}}]},"AuthorizationList":{"type":"object","required":["object","data","has_more"],"properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Authorization"}},"has_more":{"type":"boolean","description":"true when there is another page: pass the last id in data as starting_after."}}},"Signature":{"type":"object","required":["id","object","authorization_id","family_id","reference","decision","signer_name","relationship","child_name","answers","verified_by","verified_email","signed_at","evidence_hash","previous_hash","webhook"],"properties":{"id":{"type":"string","examples":["sig_…"]},"object":{"type":"string","const":"signature"},"authorization_id":{"type":"string"},"family_id":{"type":["string","null"]},"reference":{"type":["string","null"],"description":"The family's reference, with per-family links."},"decision":{"type":"string","enum":["authorize","decline"]},"signer_name":{"type":"string"},"relationship":{"type":"string","enum":["madre","padre","tutor_legal","otro"]},"child_name":{"type":["string","null"]},"answers":{"type":"object","description":"Answers by question id: yes/no for yes_no, up to 500 characters for text.","additionalProperties":{"type":"string","maxLength":500}},"verified_by":{"type":"string","enum":["email_code","platform"]},"verified_email":{"type":["string","null"],"format":"email","description":"The email verified with the code (email_code); null with platform verification."},"signed_at":{"type":"string","format":"date-time"},"evidence_hash":{"type":"string","description":"Hex SHA-256 of the canonical JSON of this signature's evidence (see the API description)."},"previous_hash":{"type":"string","description":"The previous signature's evidence_hash; for the first signature, the authorisation's document_hash."},"webhook":{"type":["string","null"],"description":"Webhook delivery result: \"delivered 200\", \"failed <status>\", \"failed timeout\" or \"failed network\"; null when there is no webhook.","examples":["delivered 200"]}}},"SignatureList":{"type":"object","required":["object","data"],"properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Signature"}}}},"SignatureCreatedEvent":{"type":"object","required":["type","created_at","authorization_id","data"],"properties":{"type":{"type":"string","const":"signature.created"},"created_at":{"type":"string","format":"date-time"},"authorization_id":{"type":"string"},"data":{"$ref":"#/components/schemas/Signature"}}}}}}