# API reference

> Every endpoint of the AppliFlo REST API, made from the OpenAPI file the server serves.

The base URL is `https://appliflo.com/api/v1`. Every call takes a workspace API key in the `Authorization` header, and every response has the shape `{ success, data, error }`. The machine-readable spec is at [`/api/v1/openapi.json`](https://appliflo.com/api/v1/openapi.json).

Each page has a **Try it** panel that calls the live API from your browser with your key. The key stays in the page's memory and is forgotten when you reload.

## Documents

- [Get a document with its fields and choice groups](https://dev.appliflo.com/api/documents/get-document): `GET /api/v1/documents/{id}`
- [Delete a draft document (move it to the Trash)](https://dev.appliflo.com/api/documents/delete-document): `DELETE /api/v1/documents/{id}`
- [Upload a document](https://dev.appliflo.com/api/documents/create-document): `POST /api/v1/documents`
- [Run field detection on a document](https://dev.appliflo.com/api/documents/detect-fields): `POST /api/v1/documents/{id}/detect`
- [List a document's fields](https://dev.appliflo.com/api/documents/list-fields): `GET /api/v1/documents/{id}/fields`
- [Correct a detected field (flywheel input)](https://dev.appliflo.com/api/documents/correct-field): `PATCH /api/v1/documents/{id}/fields/{fieldId}`
- [Fill a document's fields with values](https://dev.appliflo.com/api/documents/fill-document): `POST /api/v1/documents/{id}/fill`
- [Download a document artifact](https://dev.appliflo.com/api/documents/download-document-artifact): `GET /api/v1/documents/{id}/download`
- [Send a document for signature](https://dev.appliflo.com/api/documents/send-document): `POST /api/v1/documents/{id}/send`

## Fill

- [One-shot fill (multipart: file + values in, filled PDF + results out)](https://dev.appliflo.com/api/fill/fill-one-shot): `POST /api/v1/fill`

## Envelopes

- [List envelopes in the workspace](https://dev.appliflo.com/api/envelopes/list-envelopes): `GET /api/v1/envelopes`
- [Get envelope detail](https://dev.appliflo.com/api/envelopes/get-envelope): `GET /api/v1/envelopes/{id}`
- [Void an envelope](https://dev.appliflo.com/api/envelopes/void-envelope): `POST /api/v1/envelopes/{id}/void`
- [Send a reminder to recipients blocking signature](https://dev.appliflo.com/api/envelopes/remind-envelope): `POST /api/v1/envelopes/{id}/remind`
- [Download the sealed (completed) document or its completion certificate](https://dev.appliflo.com/api/envelopes/download-envelope): `GET /api/v1/envelopes/{id}/download`

## Templates

- [List the template library available to this workspace](https://dev.appliflo.com/api/templates/list-templates): `GET /api/v1/templates`
- [Draft a document from a template](https://dev.appliflo.com/api/templates/create-document-from-template): `POST /api/v1/templates/{id}/create-document`

## Saved templates

- [Get one template](https://dev.appliflo.com/api/saved-templates/get-template): `GET /api/v1/templates/{id}`
- [Send a Ready saved template](https://dev.appliflo.com/api/saved-templates/send-from-template): `POST /api/v1/templates/{id}/send`
- [List a saved template's versions](https://dev.appliflo.com/api/saved-templates/list-template-versions): `GET /api/v1/templates/{id}/versions`
- [Get one version of a saved template](https://dev.appliflo.com/api/saved-templates/get-template-version): `GET /api/v1/templates/{id}/versions/{n}`
- [Send a Ready saved template to many](https://dev.appliflo.com/api/saved-templates/send-template-bulk): `POST /api/v1/templates/{id}/bulk`
- [Get a send-to-many batch](https://dev.appliflo.com/api/saved-templates/get-bulk-batch): `GET /api/v1/bulk-batches/{id}`
- [Retry a batch's failed rows](https://dev.appliflo.com/api/saved-templates/retry-bulk-batch-failed): `POST /api/v1/bulk-batches/{id}/retry-failed`
- [Cancel a batch](https://dev.appliflo.com/api/saved-templates/cancel-bulk-batch): `POST /api/v1/bulk-batches/{id}/cancel`
- [Fix a failed row and send it again](https://dev.appliflo.com/api/saved-templates/fix-bulk-batch-row): `PATCH /api/v1/bulk-batches/{id}/rows/{row}`
- [List the workspace's saved templates](https://dev.appliflo.com/api/saved-templates/list-saved-templates): `GET /api/v1/saved-templates`
- [Save a draft document as a template](https://dev.appliflo.com/api/saved-templates/create-saved-template-from-document): `POST /api/v1/saved-templates`
- [Create a document from a saved template](https://dev.appliflo.com/api/saved-templates/create-document-from-saved-template): `POST /api/v1/saved-templates/{id}/create-document`
