# Get started with the API

> Create a key, make a first call, describe your fields, publish a template and generate your first PDF through the API.

The Mizanpage API lets your software generate PDFs from the templates your users design. Your server sends the data and Mizanpage returns the PDF in the same response. Nothing is kept.

- **Base URL**: `https://api.mizanpage.com`
- **Format**: JSON in, PDF or JSON out
- **Authentication**: `Authorization: Bearer mzp_…`
- **Plans**: Team and Enterprise, and all of them during the free trial (Solo has no API)

## 1. Create a key

In your workspace: **Developers › API keys › New key**. Give it a name that says where it is used ("ERP"). The `mzp_…` key is shown only once. Store it in your server's secrets.

To build your integration, choose the **Test** environment: the PDFs of that key are free and watermarked. See [API keys](https://mizanpage.com/en/docs/api/cles.md).

## 2. Check the key

```bash
curl https://api.mizanpage.com/v1/me \
  -H "Authorization: Bearer mzp_…"
```

The response describes your workspace and its status.

## 3. Describe your fields

A catalog lists the fields of a document type. Send it once, then again whenever your fields change:

```bash
curl -X PUT https://api.mizanpage.com/v1/catalogs/invoice \
  -H "Authorization: Bearer mzp_…" \
  -H "Content-Type: application/json" \
  -d '{
    "label": "Invoice",
    "groups": [
      { "key": "customer", "label": "Customer", "fields": [
        { "key": "customer.name", "label": "Name" },
        { "key": "customer.address", "label": "Address", "type": "longtext" }
      ]},
      { "key": "invoice", "label": "Invoice", "fields": [
        { "key": "invoice.number", "label": "Number" },
        { "key": "invoice.total", "label": "Total", "type": "amount" }
      ]}
    ],
    "sample": { "customer.name": "Mary Smith", "invoice.number": "INV-2026-001", "invoice.total": "€1,250.00" }
  }'
```

The fields appear in the editor straight away. See [Describe your fields](https://mizanpage.com/en/docs/api/catalogues.md).

## 4. Design and publish a template

In the editor, create a template on the **Invoice** type, place the fields, then click **Make available**. Your software can only print a published version.

## 5. Generate the PDF

```bash
curl -X POST https://api.mizanpage.com/v1/render \
  -H "Authorization: Bearer mzp_…" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: invoice-INV-2026-001" \
  -d '{
    "kind": "invoice",
    "format": "pdf",
    "data": { "values": {
      "customer.name": "Orlanne Brewery Ltd",
      "customer.address": "12 Iron Street, 5000 Namur",
      "invoice.number": "INV-2026-001",
      "invoice.total": "€7,788.00"
    }}
  }' \
  -o INV-2026-001.pdf
```

The response is the PDF. Keep it: Mizanpage does not store it. See [Generate a document](https://mizanpage.com/en/docs/api/generer.md).

## Track your progress

The **Connect my software** page ticks off each step as soon as it sees the matching call. It also gives the examples in cURL, PHP and JavaScript, with a button to copy them.

## Going further

- The full list of routes: [API reference](https://mizanpage.com/en/docs/api/reference.md).
- Get notified when a template is published: [Webhooks](https://mizanpage.com/en/docs/webhooks/recevoir.md).
- Open the editor inside your application: [Embed the editor](https://mizanpage.com/en/docs/integration/principe.md).

---

Documentation Mizanpage · Developers › API
https://mizanpage.com/en/docs/api/demarrer/
