# Quickstart

> Make an API key, fill your first PDF with one call and read the result for each field.

Send a PDF and the values you want on it. AppliFlo finds the fields, fits each value and returns the filled PDF with a result for every field.

> **Before you start**
>
> API keys come with the Business plan. Keep your key on your server: anyone with it can act for your workspace.

### Make an API key

An owner or admin opens [Settings, API keys](https://appliflo.com/settings/api-keys) on appliflo.com and chooses **Create key**. For this quickstart, tick **Read** and **Create drafts**. Copy the key when it is shown: it is shown once. Keys start with `aflo_live_`.

Save it in your shell so the samples below can read it:

```bash
export APPLIFLO_API_KEY="paste-your-key-here"
```

### Fill a PDF in one call

Send the PDF in the multipart field `file` and your values in `values`, a JSON object keyed by the label printed next to each box. Add an `Idempotency-Key` header so a retry never does the work twice.

**curl**

```bash
curl -X POST https://appliflo.com/api/v1/fill \
  -H "Authorization: Bearer $APPLIFLO_API_KEY" \
  -H "Idempotency-Key: quickstart-0001" \
  -F "file=@rental-application.pdf" \
  -F 'values={"Applicant full name":"Alexandra Whitfield-Harrington","Move-in date":"2026-08-01"}'
```

**Node**

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

const form = new FormData();
form.append("file", new Blob([await readFile("rental-application.pdf")], { type: "application/pdf" }), "rental-application.pdf");
form.append("values", JSON.stringify({
  "Applicant full name": "Alexandra Whitfield-Harrington",
  "Move-in date": "2026-08-01",
}));

const res = await fetch("https://appliflo.com/api/v1/fill", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.APPLIFLO_API_KEY}`,
    "Idempotency-Key": "quickstart-0001",
  },
  body: form,
});
const { data } = await res.json();
await writeFile("filled.pdf", Buffer.from(data.pdf_base64, "base64"));
console.log(data.results);
```

**Python**

```python
import base64, json, os, requests

res = requests.post(
    "https://appliflo.com/api/v1/fill",
    headers={
        "Authorization": f"Bearer {os.environ['APPLIFLO_API_KEY']}",
        "Idempotency-Key": "quickstart-0001",
    },
    files={"file": open("rental-application.pdf", "rb")},
    data={"values": json.dumps({
        "Applicant full name": "Alexandra Whitfield-Harrington",
        "Move-in date": "2026-08-01",
    })},
)
data = res.json()["data"]
open("filled.pdf", "wb").write(base64.b64decode(data["pdf_base64"]))
print(data["results"])
```

### Read the results

The reply has the filled PDF as base64 in `data.pdf_base64` and one entry per field in `data.results`:

```json
{
  "success": true,
  "data": {
    "pdf_base64": "JVBERi0xLjcK...",
    "results": [
      { "field_id": "field_12", "status": "filled", "rendered_text": "Alexandra Whitfield-Harrington", "font_size": 8, "lines": 1 },
      { "field_id": "field_19", "status": "formatted", "rendered_text": "01/08/2026" },
      { "field_id": "field_31", "status": "overflowed", "rendered_text": "...", "font_size": 6, "lines": 3 }
    ],
    "groups": [],
    "warnings": [],
    "ai_pages": { "used": 2, "limit": 1000, "remaining": 998, "exhausted": false, "resets_at": "2026-12-01T00:00:00.000Z" }
  }
}
```

| `status` | What it means |
| --- | --- |
| `filled` | Written as sent. `font_size` and `lines` say how it was fitted. |
| `formatted` | Changed to the form's format first, such as a date. `rendered_text` is what was written. |
| `overflowed` | Too long for the box even at the smallest size. It was not written. |
| `skipped` | Not written. `reason` says why: `empty`, `invalid-format`, `invalid-value`, `unsupported-type` or `not-needed`. |

Check for `overflowed` and `skipped` before you pass the PDF on. Fields AppliFlo was unsure about are listed in `data.warnings` and left empty rather than guessed. Choice questions, such as a set of tick boxes, report in `data.groups`, and unsure ones in `data.group_warnings`.

`data.ai_pages` shows the workspace's [AI pages](https://dev.appliflo.com/guides/plans) for this month.

## Next

- [Upload, detect and fill step by step](https://dev.appliflo.com/guides/upload-detect-fill), to see each field before you fill it.
- [Send a document for signature](https://dev.appliflo.com/guides/send-for-signature).
- [Use AppliFlo from a coding agent](https://dev.appliflo.com/guides/coding-agent) with the MCP server.
