> ## 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.

# Render a document from JSON (temporary)

> Submit a document JSON for rendering to PDF, DOCX, or ODT. This is a **temporary render** — the document JSON is not persisted and the render output expires. No document is created in your Autype workspace. Use POST /render/document/{documentId} to render a persistent document instead. Returns a job ID for status polling. Credits are charged on successful completion.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/dev/render
openapi: 3.0.0
info:
  title: Autype Developer API
  description: >-
    Autype Developer API for programmatic document generation.


    ## Authentication

    All endpoints require an API key. Include it in the `X-API-Key` header or as
    a Bearer token.


    ## Rate Limiting

    API requests are rate-limited to 100 requests per minute per API key.


    ## Token Billing

    Rendering operations consume tokens from your organization's balance.
  version: '1.0'
  contact: {}
servers:
  - url: https://api.autype.com
    description: Production
security: []
tags:
  - name: Temporary Images
    description: Upload and manage temporary images for document rendering
  - name: Render
    description: Render documents to PDF, DOCX, or ODT
  - name: Bulk Render
    description: Bulk document generation with variable substitution
  - name: Documents
    description: Document variable inspection
  - name: Projects
    description: List organization projects
paths:
  /api/v1/dev/render:
    post:
      tags:
        - developer-api
      summary: Render a document from JSON (temporary)
      description: >-
        Submit a document JSON for rendering to PDF, DOCX, or ODT. This is a
        **temporary render** — the document JSON is not persisted and the render
        output expires. No document is created in your Autype workspace. Use
        POST /render/document/{documentId} to render a persistent document
        instead. Returns a job ID for status polling. Credits are charged on
        successful completion.
      operationId: RenderController_render_v1
      parameters:
        - name: strict
          required: false
          in: query
          description: >-
            Enable strict validation mode (validates anchors, references,
            citations, abbreviations)
          schema:
            type: boolean
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RenderDocumentDto'
      responses:
        '201':
          description: Render job created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RenderResponseDto'
        '400':
          description: Invalid document JSON or insufficient credits
        '401':
          description: Invalid or missing API key
      security:
        - api-key: []
components:
  schemas:
    RenderDocumentDto:
      type: object
      properties:
        config:
          description: >-
            Complete document JSON following the Autype document schema. Must
            include `document` (with `type`) and `sections`. May also include
            `variables`, `defaults`, `abbreviations`, `citations`, and `style` —
            all at the same level inside this object. The output format is
            determined by the `document.type` field (pdf, docx, or odt).
            Variable placeholders can use either `{{varName}}` or `${varName}`
            syntax — both are accepted on input. See the **Document JSON
            Syntax** docs for the full schema reference.
          example:
            document:
              type: pdf
              size: A4
            variables:
              companyName: Acme Inc
            sections:
              - id: section-1
                type: flow
                content:
                  - type: h1
                    text: Hello {{companyName}}
                  - type: text
                    text: This is a paragraph.
          allOf:
            - $ref: '#/components/schemas/DocumentJsonSchema'
        webhook:
          description: >-
            Optional webhook configuration. Receives a POST when the job
            completes or fails.
          allOf:
            - $ref: '#/components/schemas/WebhookConfigDto'
      required:
        - config
    RenderResponseDto:
      type: object
      properties:
        jobId:
          type: string
          description: Render job ID for status polling
        status:
          type: string
          enum:
            - PENDING
            - PROCESSING
            - COMPLETED
            - FAILED
        downloadUrl:
          type: string
          description: >-
            Autype API download URL with signed token (only when completed).
            Supports direct browser download.
        filename:
          type: string
          description: Filename for download
        format:
          type: string
          enum:
            - PDF
            - DOCX
            - ODT
        error:
          type: string
          description: Error message if failed
        creditCost:
          type: number
          description: Credit cost for this render job
        createdAt:
          format: date-time
          type: string
        completedAt:
          format: date-time
          type: string
      required:
        - jobId
        - status
        - format
        - creditCost
        - createdAt
    DocumentJsonSchema:
      type: object
      properties:
        document:
          description: Document settings (page size, margins, orientation, output format)
          allOf:
            - $ref: '#/components/schemas/DocumentSettingsSchema'
        sections:
          type: array
          description: >-
            Array of document sections (min: 1, max: 500). Each section is an
            object with id, type (flow|page), and content array. See the
            **Document JSON Syntax** docs for the full section and element
            reference.
          items:
            type: object
          example:
            - type: flow
              content:
                - type: h1
                  text: Hello World
                - type: text
                  text: This is a paragraph.
        variables:
          type: object
          description: >-
            Variables for template substitution. Keys are variable names, values
            are strings or objects (for images/lists/tables). Reference
            variables in text with {{varName}} or ${varName} syntax.
          example:
            companyName: Acme Inc
            invoiceDate: '2024-01-15'
        abbreviations:
          type: object
          description: Abbreviations map. Keys are abbreviations, values are full text
          example:
            API: Application Programming Interface
        defaults:
          type: object
          description: >-
            Default styles and formatting options (fontFamily, fontSize, styles,
            header, footer, etc.)
          example:
            fontFamily: arial
            fontSize: 11
        citations:
          type: array
          description: Citations array (CSL-JSON format) for bibliography
          items:
            type: object
      required:
        - document
        - sections
    WebhookConfigDto:
      type: object
      properties:
        webhookUrl:
          type: string
          example: https://example.com/webhook
          description: URL to receive a POST notification when the job completes or fails
        webhookAuth:
          description: >-
            Optional authentication for the webhook request (custom header or
            Basic Auth)
          allOf:
            - $ref: '#/components/schemas/WebhookAuthDto'
    DocumentSettingsSchema:
      type: object
      properties:
        type:
          type: string
          description: Output format
          enum:
            - pdf
            - docx
            - odt
          example: pdf
        size:
          type: string
          description: Page size
          enum:
            - A4
            - A3
            - A5
            - Letter
            - Legal
          example: A4
        orientation:
          type: string
          description: Page orientation
          enum:
            - portrait
            - landscape
          example: portrait
        title:
          type: string
          description: Document title (PDF metadata)
          example: 'Invoice #123'
        author:
          type: string
          description: Document author (PDF metadata)
          example: Acme Inc
        marginTop:
          type: number
          description: Top margin in cm
          example: 2.5
        marginBottom:
          type: number
          description: Bottom margin in cm
          example: 2.5
        marginLeft:
          type: number
          description: Left margin in cm
          example: 2.5
        marginRight:
          type: number
          description: Right margin in cm
          example: 2.5
        filename:
          type: string
          description: Output filename (without extension)
          example: invoice-123
      required:
        - type
    WebhookAuthDto:
      type: object
      properties:
        headerName:
          type: string
          example: X-API-Key
          description: Custom header name
        headerValue:
          type: string
          example: my-secret-key
          description: Custom header value
        basicAuthUsername:
          type: string
          example: user
          description: Username for Basic Auth
        basicAuthPassword:
          type: string
          example: pass
          description: Password for Basic Auth
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: X-API-Key
      description: API Key (starts with ak_...)

````