> ## 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 persistent document

> Render a pre-existing document from your Autype workspace by its ID. The document must belong to a PUBLIC project in your organization. Uses the latest saved document content (snapshot). You can optionally override variables or output format. Images stored in the document are resolved automatically. Returns a job ID for status polling. Credits are charged on successful completion.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/dev/render/document/{documentId}
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/document/{documentId}:
    post:
      tags:
        - developer-api
      summary: Render a persistent document
      description: >-
        Render a pre-existing document from your Autype workspace by its ID. The
        document must belong to a PUBLIC project in your organization. Uses the
        latest saved document content (snapshot). You can optionally override
        variables or output format. Images stored in the document are resolved
        automatically. Returns a job ID for status polling. Credits are charged
        on successful completion.
      operationId: RenderController_renderDocumentById_v1
      parameters:
        - name: documentId
          required: true
          in: path
          description: ID of the persistent document to render
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RenderDocumentByIdDto'
      responses:
        '201':
          description: Render job created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RenderResponseDto'
        '400':
          description: >-
            Document has no content, belongs to private project, or insufficient
            credits
        '401':
          description: Invalid or missing API key
        '404':
          description: Document not found
      security:
        - api-key: []
components:
  schemas:
    RenderDocumentByIdDto:
      type: object
      properties:
        variables:
          type: object
          description: Variable overrides (merged with variables defined in the document)
          example:
            name: Acme Inc
            date: '2024-01-01'
        format:
          type: string
          description: >-
            Override the output format. If omitted, uses the format from the
            document JSON (document.type field).
          enum:
            - pdf
            - docx
            - odt
        webhook:
          description: >-
            Optional webhook configuration. Receives a POST when the job
            completes or fails.
          allOf:
            - $ref: '#/components/schemas/WebhookConfigDto'
    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
    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'
    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_...)

````