---
title: Quickstart · Autorizo API
description: Create an authorisation for minors, share the link, read signatures, download PDF and CSV, close and delete. With curl, JavaScript and Python.
---

# Quickstart

This guide walks through the full life of an authorisation with Autorizo API: create it, share the signing link, read the signatures, download the results, close it and delete it. Every step has an example in curl, JavaScript (`fetch`) and Python (`requests`).

## Before you start

The base URL is `https://developers.autorizo.es`. You can follow this guide in two ways:

- **No key (free mode).** Create the authorisation without an `Authorization` header and use the `results_token` (`azr_…`) it returns for everything else.
- **With a test key.** Get one with `POST /v1/test-keys` and send it as `Authorization: Bearer az_test_…`. The key adds webhooks, `metadata` and a list of your authorisations.

```bash
curl -X POST https://developers.autorizo.es/v1/test-keys
```

In the examples, `AUTORIZO_TOKEN` is your key (`az_test_…` or `az_live_…`) or the authorisation's `results_token` (`azr_…`). Keep the key on your server, never in the browser.

The request bodies below are in Spanish because the signing page is in Spanish by default. Set `"locale": "ca"` or `"locale": "en"` for a Catalan or English signing page.

## 1. Create the authorisation

```bash
curl https://developers.autorizo.es/v1/authorizations \
  -H "Authorization: Bearer $AUTORIZO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "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
  }'
```

```js
const res = await fetch("https://developers.autorizo.es/v1/authorizations", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.AUTORIZO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    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,
  }),
});
if (!res.ok) throw new Error((await res.json()).error.message);
const authorization = await res.json();
console.log(authorization.id, authorization.signing.url, authorization.results_token);
```

```python
import os
import requests

BASE = "https://developers.autorizo.es"
headers = {"Authorization": f"Bearer {os.environ['AUTORIZO_TOKEN']}"}

res = requests.post(f"{BASE}/v1/authorizations", headers=headers, json={
    "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,
})
res.raise_for_status()
authorization = res.json()
print(authorization["id"], authorization["signing"]["url"], authorization["results_token"])
```

For free mode, drop the `Authorization` header from the create call. The response is the full authorisation plus `results_token`. Keep it: it appears only in this response and it is what gives you access to that authorisation when you have no key.

## 2. Share the signing link

An authorisation is signed in one of two ways:

- **Open link** (default): `signing.url` takes signatures until `max_signatures`. Paste it into a WhatsApp group.
- **One link per family**: if you send `families`, each family gets its own `url` in `families[]`, and each link takes one signature. See the [API reference](/en/api).

Autorizo never sends invitations: you share the link. The signer types their email on the signing page, receives a 6-digit code from `codigo@autorizo.app`, enters it and signs.

## 3. Read the signatures

```bash
curl https://developers.autorizo.es/v1/authorizations/auz_7KQ2M9X4TB8RJH3N/signatures \
  -H "Authorization: Bearer $AUTORIZO_TOKEN"
```

```js
const res = await fetch(
  `https://developers.autorizo.es/v1/authorizations/${authorization.id}/signatures`,
  { headers: { "Authorization": `Bearer ${process.env.AUTORIZO_TOKEN}` } },
);
const { data: signatures } = await res.json();
for (const s of signatures) {
  console.log(s.child_name, s.signer_name, s.relationship, s.decision, s.answers);
}
```

```python
res = requests.get(f"{BASE}/v1/authorizations/{authorization['id']}/signatures", headers=headers)
res.raise_for_status()
for s in res.json()["data"]:
    print(s["child_name"], s["signer_name"], s["relationship"], s["decision"], s["answers"])
```

```json
{
  "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", "q2": "Alergia a los frutos secos" },
      "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
    }
  ]
}
```

`decision` is `authorize` or `decline`. For just the counts (`signature_count`, `authorized_count`, `declined_count`) and the status (`open`, `closed` or `expired`), use `GET /v1/authorizations/{id}`.

## 4. Download the PDF and the CSV

The PDF holds the document, a summary and one evidence block per signature. The CSV has one row per signature.

```bash
curl -o results.pdf https://developers.autorizo.es/v1/authorizations/auz_7KQ2M9X4TB8RJH3N/results.pdf \
  -H "Authorization: Bearer $AUTORIZO_TOKEN"
```

```bash
curl -o results.csv https://developers.autorizo.es/v1/authorizations/auz_7KQ2M9X4TB8RJH3N/results.csv \
  -H "Authorization: Bearer $AUTORIZO_TOKEN"
```

```js
import { writeFile } from "node:fs/promises";

const pdf = await fetch(
  `https://developers.autorizo.es/v1/authorizations/${authorization.id}/results.pdf`,
  { headers: { "Authorization": `Bearer ${process.env.AUTORIZO_TOKEN}` } },
);
await writeFile("results.pdf", Buffer.from(await pdf.arrayBuffer()));
```

```python
pdf = requests.get(f"{BASE}/v1/authorizations/{authorization['id']}/results.pdf", headers=headers)
pdf.raise_for_status()
with open("results.pdf", "wb") as f:
    f.write(pdf.content)
```

## 5. Close the authorisation

Closing stops new signatures. It responds `200` with the authorisation, now with `status: "closed"`. The signatures collected stay until `deletes_at`.

```bash
curl -X POST https://developers.autorizo.es/v1/authorizations/auz_7KQ2M9X4TB8RJH3N/close \
  -H "Authorization: Bearer $AUTORIZO_TOKEN"
```

```js
await fetch(`https://developers.autorizo.es/v1/authorizations/${authorization.id}/close`, {
  method: "POST",
  headers: { "Authorization": `Bearer ${process.env.AUTORIZO_TOKEN}` },
});
```

```python
requests.post(f"{BASE}/v1/authorizations/{authorization['id']}/close", headers=headers).raise_for_status()
```

## 6. Delete the authorisation

Deletes the authorisation and all its signatures right away. Responds `204` with no body. If you do not delete it, it deletes itself at `deletes_at`.

```bash
curl -X DELETE https://developers.autorizo.es/v1/authorizations/auz_7KQ2M9X4TB8RJH3N \
  -H "Authorization: Bearer $AUTORIZO_TOKEN"
```

```js
await fetch(`https://developers.autorizo.es/v1/authorizations/${authorization.id}`, {
  method: "DELETE",
  headers: { "Authorization": `Bearer ${process.env.AUTORIZO_TOKEN}` },
});
```

```python
requests.delete(f"{BASE}/v1/authorizations/{authorization['id']}", headers=headers).raise_for_status()
```

## 7. Receive signatures by webhook

With a key (`az_test_…` or `az_live_…`), add `webhook_url` when you create the authorisation. The create response includes `webhook_secret`: store it. Every new signature arrives as a JSON `POST` to your URL:

```json
{
  "type": "signature.created",
  "created_at": "2026-12-03T10:05:01.000Z",
  "authorization_id": "auz_7KQ2M9X4TB8RJH3N",
  "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
  }
}
```

The `Autorizo-Signature` header looks like `t=<unix seconds>,v1=<signature>`, where the signature is the hex HMAC-SHA256 of `"<t>.<raw body>"` keyed with your `webhook_secret`. Check it against the raw, unparsed body before reading the JSON. There is a single attempt with a 5-second timeout: answer with a `2xx` right away and do the work afterwards. If your server does not answer, the signature is still available from `GET /v1/authorizations/{id}/signatures`, so poll that as well.

### Verifying in Node.js (Express)

```js
import crypto from "node:crypto";
import express from "express";

function verifyAutorizoSignature(rawBody, header, secret, toleranceSeconds = 300) {
  if (!header) return false;
  const parts = Object.fromEntries(
    header.split(",").map((part) => {
      const i = part.indexOf("=");
      return [part.slice(0, i).trim(), part.slice(i + 1).trim()];
    }),
  );
  const t = Number(parts.t);
  if (!Number.isInteger(t) || !parts.v1) return false;
  if (Math.abs(Date.now() / 1000 - t) > toleranceSeconds) return false;
  const expected = crypto
    .createHmac("sha256", secret)
    .update(`${t}.`)
    .update(rawBody)
    .digest();
  const received = Buffer.from(parts.v1, "hex");
  return received.length === expected.length && crypto.timingSafeEqual(received, expected);
}

const app = express();

app.post("/webhooks/autorizo", express.raw({ type: "application/json" }), (req, res) => {
  const ok = verifyAutorizoSignature(
    req.body,
    req.get("Autorizo-Signature"),
    process.env.AUTORIZO_WEBHOOK_SECRET,
  );
  if (!ok) return res.status(400).send("invalid signature");
  const event = JSON.parse(req.body.toString("utf8"));
  if (event.type === "signature.created") {
    console.log(event.authorization_id, event.data.child_name, event.data.decision);
  }
  res.sendStatus(200);
});

app.listen(3000);
```

### Verifying in Python (Flask)

```python
import hashlib
import hmac
import json
import os
import time

from flask import Flask, request

app = Flask(__name__)


def verify_autorizo_signature(raw_body: bytes, header: str, secret: str, tolerance: int = 300) -> bool:
    if not header:
        return False
    parts = dict(p.strip().split("=", 1) for p in header.split(",") if "=" in p)
    try:
        t = int(parts["t"])
        v1 = parts["v1"]
    except (KeyError, ValueError):
        return False
    if abs(time.time() - t) > tolerance:
        return False
    expected = hmac.new(secret.encode(), f"{t}.".encode() + raw_body, hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected, v1)


@app.post("/webhooks/autorizo")
def autorizo_webhook():
    raw = request.get_data()
    if not verify_autorizo_signature(raw, request.headers.get("Autorizo-Signature", ""), os.environ["AUTORIZO_WEBHOOK_SECRET"]):
        return "invalid signature", 400
    event = json.loads(raw)
    if event["type"] == "signature.created":
        print(event["authorization_id"], event["data"]["child_name"], event["data"]["decision"])
    return "", 200
```

The 300-second tolerance on `t` is a check on your side against replays of an old message; adjust it if you need to.

## Next

- [API reference](/en/api) with every field and error.
- [Use-case guides](/es/guias) (in Spanish) with ready request bodies.
