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

# Queue up to eight independently validated documents



## OpenAPI

````yaml openapi.json POST /v1/documents/batch
openapi: 3.1.0
info:
  title: DocKiln API
  version: 1.1.0-review
  description: >-
    Workspace-scoped document generation. All timestamps are Unix milliseconds
    unless documented otherwise. The parity additions in this review
    specification require the matching server build. Dynamic rendering also
    requires operator configuration.
servers:
  - url: https://dockiln.io
    description: DocKiln hosted API
security: []
paths:
  /v1/documents/batch:
    post:
      summary: Queue up to eight independently validated documents
      parameters:
        - in: header
          name: Idempotency-Key
          required: true
          schema:
            type: string
            maxLength: 128
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                items:
                  type: array
                  items:
                    $ref: '#/components/schemas/Generation'
                  minItems: 1
                  maxItems: 8
              required:
                - items
      responses:
        '207':
          description: Queue up to eight independently validated documents
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        index:
                          type: integer
                        code:
                          type: integer
                        id:
                          type: string
                        status:
                          type: string
                        created:
                          type: integer
                        error:
                          type: string
          headers:
            X-Request-Id:
              description: Server-generated correlation ID
              schema:
                type: string
        default:
          description: Request failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Problem'
          headers:
            X-Request-Id:
              description: Server-generated correlation ID
              schema:
                type: string
      security:
        - bearer: []
        - session: []
components:
  schemas:
    Generation:
      type: object
      properties:
        templateId:
          type: string
        version:
          type: integer
        data:
          type: object
          additionalProperties: true
        html:
          type: string
        url:
          type: string
          format: uri
        format:
          type: string
          enum:
            - pdf
            - png
            - jpeg
            - webp
        page:
          $ref: '#/components/schemas/Page'
        controls:
          $ref: '#/components/schemas/Controls'
        delivery:
          type: string
          enum:
            - local
            - object
        compress:
          type: boolean
        externalAssets:
          type: boolean
        assetUrls:
          type: array
          items:
            type: string
            format: uri
          maxItems: 16
        allowHttpErrors:
          type: boolean
        sourceAuth:
          $ref: '#/components/schemas/SourceAuth'
        print:
          $ref: '#/components/schemas/PrintOptions'
        processing:
          $ref: '#/components/schemas/Processing'
        sandbox:
          type: boolean
        ttlSeconds:
          type: integer
          minimum: 60
          maximum: 2592000
        logRequest:
          type: boolean
        sensitive:
          type: boolean
        response:
          type: string
          enum:
            - async
            - binary
            - base64
        filename:
          type: string
          maxLength: 91
        webhook:
          type: object
          properties:
            url:
              type: string
              format: uri
            secret:
              type: string
              maxLength: 128
              minLength: 32
              writeOnly: true
          required:
            - url
            - secret
      oneOf:
        - required:
            - url
        - required:
            - html
        - required:
            - templateId
      example:
        html: <h1>Order confirmed</h1>
        format: pdf
        page:
          format: Letter
          footer: Page {page} of {pages}
    Problem:
      type: object
      properties:
        error:
          type: string
      required:
        - error
    Page:
      type: object
      properties:
        format:
          type: string
          enum:
            - A4
            - Letter
            - Legal
            - Label
        margin:
          type: integer
          minimum: 8
          maximum: 35
        landscape:
          type: boolean
        header:
          type: string
        footer:
          type: string
    Controls:
      type: object
      properties:
        preset:
          type: string
          enum:
            - og
            - square
            - story
        media:
          type: string
          enum:
            - screen
            - print
        width:
          type: integer
          minimum: 160
          maximum: 2400
        height:
          type: integer
          minimum: 100
          maximum: 2400
        fullPage:
          type: boolean
        waitFonts:
          type: boolean
        waitImages:
          type: boolean
        selector:
          type: string
        timeoutMs:
          type: integer
          minimum: 100
          maximum: 5000
        css:
          type: string
        javascript:
          type: boolean
        script:
          type: string
          maxLength: 12000
        predicate:
          type: string
          maxLength: 1000
        lazyImages:
          type: boolean
        delayMs:
          type: integer
          minimum: 0
          maximum: 2000
        idleMs:
          type: integer
          minimum: 0
          maximum: 1000
        ignoreLongPolling:
          type: boolean
        transparent:
          type: boolean
        quality:
          type: integer
          minimum: 1
          maximum: 100
        pixelRatio:
          type: integer
          enum:
            - 1
            - 2
            - 4
        captureSelector:
          type: string
          maxLength: 160
        clip:
          type: object
          properties:
            x:
              type: integer
              minimum: 0
              maximum: 6000
            'y':
              type: integer
              minimum: 0
              maximum: 6000
            width:
              type: integer
              minimum: 1
              maximum: 6000
            height:
              type: integer
              minimum: 1
              maximum: 6000
          required:
            - x
            - 'y'
            - width
            - height
    SourceAuth:
      type: object
      properties:
        basic:
          type: object
          properties:
            username:
              type: string
            password:
              type: string
              writeOnly: true
          required:
            - username
            - password
        headers:
          type: object
          maxProperties: 12
          additionalProperties:
            type: string
            maxLength: 1024
            writeOnly: true
        cookies:
          type: object
          maxProperties: 12
          additionalProperties:
            type: string
            maxLength: 1024
            writeOnly: true
      additionalProperties: false
    PrintOptions:
      type: object
      properties:
        paper:
          type: string
          enum:
            - A0
            - A1
            - A2
            - A3
            - A4
            - A5
            - A6
            - Letter
            - Legal
            - Ledger
            - Tabloid
        width:
          type: string
          pattern: ^\d{1,4}(\.\d{1,3})?(mm|cm|in|pt|px)$
        height:
          oneOf:
            - type: string
              pattern: ^\d{1,4}(\.\d{1,3})?(mm|cm|in|pt|px)$
            - type: string
              enum:
                - auto
        margins:
          type: object
          properties:
            left:
              type: string
              pattern: ^\d{1,4}(\.\d{1,3})?(mm|cm|in|pt|px)$
            right:
              type: string
              pattern: ^\d{1,4}(\.\d{1,3})?(mm|cm|in|pt|px)$
            top:
              type: string
              pattern: ^\d{1,4}(\.\d{1,3})?(mm|cm|in|pt|px)$
            bottom:
              type: string
              pattern: ^\d{1,4}(\.\d{1,3})?(mm|cm|in|pt|px)$
          additionalProperties: false
        ranges:
          type: string
          maxLength: 100
        scale:
          type: number
          minimum: 0.1
          maximum: 2
        background:
          type: boolean
        headerHtml:
          type: string
          maxLength: 4000
        footerHtml:
          type: string
          maxLength: 4000
        startAt:
          type: integer
          minimum: 1
          maximum: 500
      additionalProperties: false
    Processing:
      type: object
      properties:
        metadata:
          type: object
          properties:
            title:
              type: string
              maxLength: 256
            author:
              type: string
              maxLength: 256
            subject:
              type: string
              maxLength: 256
            creator:
              type: string
              maxLength: 256
          additionalProperties: false
        trimBlankEnd:
          type: boolean
        watermark:
          type: object
          properties:
            text:
              type: string
              maxLength: 100
            image:
              type: string
              maxLength: 240000
            size:
              type: integer
              minimum: 4
              maximum: 256
            rotate:
              type: number
              minimum: -180
              maximum: 180
            opacity:
              type: number
              minimum: 0
              maximum: 1
            position:
              type: string
              enum:
                - top-left
                - center
                - bottom-right
          oneOf:
            - required:
                - text
            - required:
                - image
        protection:
          type: object
          properties:
            userPassword:
              type: string
              maxLength: 120
              writeOnly: true
            ownerPassword:
              type: string
              maxLength: 100
              writeOnly: true
            print:
              type: boolean
            copy:
              type: boolean
            modify:
              type: boolean
          required:
            - ownerPassword
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
    session:
      type: apiKey
      in: cookie
      name: dockiln

````

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