> ## Documentation Index
> Fetch the complete documentation index at: https://docs.autype.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Developer API

> Programmatic access to Autype's document generation capabilities

The Autype Developer API lets you generate PDFs, DOCX, and ODT documents at scale. Perfect for automating document workflows, batch processing, and integrating document generation into your applications.

## Base URL

```
https://api.autype.com/api/v1/dev
```

## Key capabilities

> [card] Persistent Documents
>
> Create and manage documents that are saved in your Autype workspace —
> visible in the app and editable by your team.

> [card] Document Rendering
>
> Render persistent documents or ad-hoc JSON/Markdown to PDF, DOCX, or ODT.

> [card] Bulk Rendering
>
> Create up to 100 documents at once from a template with different variable
> sets.

> [card] Template Variables
>
> Use `{{ variables }}` or `${variables}` for dynamic content substitution.

> [card] Reusable Styles
>
> Browse immutable built-in styles or manage organization-owned presets, then
> reference either from JSON or Markdown renders via `stylePresetId`.

> [card] Template Catalogs
>
> Keep productive workspace templates separate from the browse-only built-in
> catalog and fetch Extended Markdown only for the selected template.

> [card] Reusable Blocks
>
> Manage versioned organization content and insert it as a linked reference or
> editable snapshot.

> [card] Records
>
> Save customer or case values against document versions and retain their
> export history.

> [card] Interactive Forms
>
> Author styled form fields that become AcroForm widgets in PDF exports.

> [card] PDF Tools
>
> Merge, split, rotate, watermark, and extract metadata from PDFs.

> [card] DOCX Roundtrip
>
> Import editable Word documents as validated Autype JSON, modify them, and
> render them back to DOCX.

## Persistent vs. temporary resources

The API works with two types of resources. Understanding the difference is important:

### Persistent resources (visible in the Autype app)

| Resource | Endpoints | Description |
| - | - | - |
| **Projects** | `POST /projects`, `GET /projects` | Workspaces that organize documents. Created via the API as PUBLIC projects. |
| **Documents** | `POST /documents/markdown`, `GET /documents/{id}/markdown`, `PATCH /documents/{id}/markdown`, `POST /documents`, `GET /documents`, `GET /documents/{id}` | Documents stored in your workspace. Markdown endpoints are recommended for AI/API authoring; JSON endpoints remain available for advanced clients. |
| **Style presets** | `GET /styles`, `GET /styles/{id}`, `POST /styles`, `PATCH /styles/{id}` | Immutable built-in system styles and editable organization styles. Filter by `source=workspace`, `source=system`, or `source=all`; both can be reused through `stylePresetId`. |
| **Template catalogs** | `GET /templates`, `GET /templates/{id}/markdown` | Productive organization templates use `scope=workspace`; browse-only built-in quick starts use `scope=catalog`. |
| **Reusable blocks** | `GET /reusable-blocks`, `POST /reusable-blocks`, `PATCH /reusable-blocks/{id}`, `POST /reusable-blocks/{id}/versions/{version}/restore` | Versioned Extended Markdown with immutable changelogs and auditable restore shared across organization documents. |
| **Records** | `GET /documents/{id}/records`, `POST /documents/{id}/records`, `POST /records/{id}/render` | Version-aware variable datasets and their render history. |
| **Document images** | Auto-converted on document creation | Permanent images attached to a document (referenced as `/image/{assetId}` in document JSON). See [Images in documents](#images-in-documents). |

### Temporary resources (API-only, not visible in the app)

| Resource | Endpoints | Lifetime | Description |
| - | - | - | - |
| **Temporary images** | `POST /images/upload`, `GET /images`, `DELETE /images/{id}` | 24 hours | Short-lived images for use in temporary renders. Referenced as `/temp-image/{id}` in document JSON. **Not visible in the Autype app.** |
| **Render jobs** | `POST /render`, `POST /render/markdown`, `POST /render/images`, `POST /render/markdown/images`, `GET /render/{id}` | Transient | Ad-hoc PDF/DOCX/ODT or PNG/JPEG page renders from inline JSON or Markdown. The input document is not saved. **Not visible in the Autype app.** |
| **Bulk render jobs** | `POST /bulk-render`, `GET /bulk-render/{id}` | Transient | Bulk render outputs. **Not visible in the Autype app.** |
| **Tool files** | `POST /tools/files/upload`, `GET /tools/files`, `DELETE /tools/files/{id}` | 60 minutes | Temporary files for PDF tools (merge, split, etc.). **Not visible in the Autype app.** |
| **DOCX imports** | `POST /import/docx`, `POST /import/docx/file` | Request / 24-hour images | Convert Word to validated editable Autype JSON; embedded images use protected temporary references. |
| **Tool jobs** | `POST /tools/pdf/*`, `GET /tools/jobs/{id}` | Transient | PDF processing jobs (merge, split, rotate, watermark, metadata). **Not visible in the Autype app.** |

> [!TIP]
>
> Use **POST /render/document/{documentId}** to render a persistent document.
> This uses the document's saved content and its permanent images — no temporary
> image uploads needed.

## Recommended AI/API workflow

For AI agents and API automation, prefer **Extended Markdown plus reusable styles** when possible:

1. List styles with `GET /styles?source=workspace`, `source=system`, or
   `source=all`, then fetch the selected definition with `GET /styles/{id}`.
2. Create an organization style only when the built-in catalog does not fit.
3. For saved workspace documents, use `POST /documents/markdown`.
4. For ad-hoc output that should not be saved, use `POST /render/markdown`.
5. Pass the selected workspace UUID or immutable `system:<id>` as
   `stylePresetId`.
6. Add inline `defaults` only for request-specific overrides.

To inspect layout with a vision-capable client, use
`POST /render/markdown/images`. One selected page is returned directly as PNG
or JPEG; multiple pages are returned as a ZIP archive.

Markdown document requests keep content readable while still accepting structured metadata:

```json theme={null}
{
  "projectId": "project-id",
  "title": "Quarterly Report",
  "content": "# Report\n\nHello {{companyName}}.",
  "document": { "type": "pdf", "size": "A4" },
  "stylePresetId": "system:executive-annual-report",
  "variables": { "companyName": "Acme GmbH" }
}
```

You can read the saved document back with `GET /documents/{id}/markdown` and update it with `PATCH /documents/{id}/markdown`.

The full document JSON remains supported for advanced clients, editors, and integrations that need complete structural control. `stylePresetId` is additive: existing inline `defaults` still work, and inline values override the referenced style preset. Built-in `system:<id>` styles are immutable and can be used directly in temporary renders as well as persistent documents; organization style UUIDs remain editable. Applying a built-in style does not create a workspace preset. Customizing one creates an explicit independent copy.

Template scopes are intentionally separate. Use `scope=workspace` for
organization-owned templates that can drive production document generation.
Use `scope=catalog` to browse built-in quick starts, then create a workspace
copy before treating one as an organization template. Fetch the Extended
Markdown only after selecting a template through
`GET /templates/{id}/markdown`.

### Temporary render shortcut

For temporary render jobs:

1. Send the document content as Extended Markdown to `POST /render/markdown`.
2. Pass the selected style as `stylePresetId`.
3. Add inline `defaults` only for request-specific overrides.

## Images in documents

How you handle images depends on whether you're working with persistent or temporary resources:

### Persistent documents with images

When creating a persistent document via `POST /documents`, you can embed images using the following workflow:

1. **Upload images** via `POST /images/upload` — you receive `/temp-image/{id}` reference paths.
2. **Create the document** via `POST /documents` with the `/temp-image/{id}` paths in your document JSON.
3. **Reuse the saved document** — images referenced by the persistent document remain available with that document; no second create request is needed.

> [!NOTE]
>
> Unused temporary images expire after 24 hours. Images used by a persistent
> document remain available without further client-side work.

### Temporary renders with images

For ad-hoc renders (`POST /render`, `POST /render/markdown`), use `POST /images/upload` to upload temporary images and reference them as `/temp-image/{id}` in your document JSON. These images are valid for 24 hours and are resolved at render time.

### External URLs

You can also use full `https://` URLs for images in any context — both persistent documents and temporary renders. External URLs are fetched at render time.

## Credit costs

Operations consume credits from your organization's balance. Credits are only charged on successful completion.

| Operation | Credit Cost |
| - | - |
| Temporary Image Upload | Free |
| Single Render | 1 credit |
| Bulk Render | 1 credit per item |
| Tool File Upload | Free |
| Tool PDF Action | 1 credit |

## Quick example

Render a persistent document:

```bash theme={null}
curl -X POST "https://api.autype.com/api/v1/dev/render/document/YOUR_DOCUMENT_ID" \
  -H "X-API-Key: ak_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "variables": { "clientName": "Acme Inc" }
  }'
```

Or render from inline JSON (temporary, not saved):

```bash theme={null}
curl -X POST "https://api.autype.com/api/v1/dev/render" \
  -H "X-API-Key: ak_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "config": {
      "document": { "type": "pdf", "size": "A4" },
      "variables": { "name": "World" },
      "sections": [{
        "id": "main",
        "type": "flow",
        "content": [
          { "type": "h1", "text": "Hello, {{name}}!" }
        ]
      }]
    }
  }'
```

## Next steps

> [card] [Authentication](https://docs.autype.com/api-reference/authentication.md)
>
> Learn how to authenticate your API requests.

> [card] [Rate Limits](https://docs.autype.com/api-reference/rate-limits.md)
>
> Understand usage limits and quotas.

> [card] [OpenAPI Specification](https://docs.autype.com/api-reference/openapi.json)
>
> Download the full OpenAPI 3.0 spec as JSON — for code generation, Postman
> import, or AI context.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.