DATPAQ Document Generation API

Generate business documents (invoices, letters, forms) as PDF, DOCX, or HTML

Operations 9

GET /document-generation/documents List available document types #
GET /document-generation/openapi.json Get the service OpenAPI document #
GET /document-generation/{documentType}/schema Get a document type's field schema #
GET /document-generation/{documentType}/json-schema Get a document type's JSON Schema #
GET /document-generation/{documentType}/example Get example data for a document type #
GET /document-generation/{documentType}/render Render a blank document as HTML #
POST /document-generation/{documentType}/render Render a document with data as HTML #
POST /document-generation/{documentType}/generate Generate a PDF or DOCX document #
POST /document-generation/batch Generate up to 5 documents as base64 #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/datpaq-com:datpaq-com-document-generation-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

datpaq-com-document-generation-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Datpaq Com Document Generation API
  version: 1.1.0
  contact:
    name: Datpaq Support
    url: https://datpaq.com
  license:
    name: Proprietary
  description: 'Operations tagged Document Generation across 2 of this provider''s published API definitions: datpaq-com.yaml, datpaq-com-openapi.yaml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://datpaq.com/api/v1
  description: Production
- url: https://staging.datpaq.com/api/v1
  description: Staging
security:
- ApiKeyHeader: []
- ApiKeyQuery: []
tags:
- name: Document Generation
  description: Generate business documents (invoices, letters, forms) as PDF, DOCX, or HTML
paths:
  /document-generation/documents:
    get:
      tags:
      - Document Generation
      operationId: documentGenerationDocuments
      summary: List available document types
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccess'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        default:
          $ref: '#/components/responses/ServiceUnavailable'
    servers:
    - url: https://datpaq.com/api/v1
      description: Production
    - url: https://staging.datpaq.com/api/v1
      description: Staging
  /document-generation/openapi.json:
    get:
      tags:
      - Document Generation
      operationId: documentGenerationOpenapi
      summary: Get the service OpenAPI document
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccess'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        default:
          $ref: '#/components/responses/ServiceUnavailable'
    servers:
    - url: https://datpaq.com/api/v1
      description: Production
    - url: https://staging.datpaq.com/api/v1
      description: Staging
  /document-generation/{documentType}/schema:
    get:
      tags:
      - Document Generation
      operationId: documentGenerationSchema
      summary: Get a document type's field schema
      parameters:
      - name: documentType
        in: path
        required: true
        description: Document type slug (see documents)
        schema:
          type: string
          example: invoice
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccess'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        default:
          $ref: '#/components/responses/ServiceUnavailable'
    servers:
    - url: https://datpaq.com/api/v1
      description: Production
    - url: https://staging.datpaq.com/api/v1
      description: Staging
  /document-generation/{documentType}/json-schema:
    get:
      tags:
      - Document Generation
      operationId: documentGenerationJsonSchema
      summary: Get a document type's JSON Schema
      parameters:
      - name: documentType
        in: path
        required: true
        description: Document type slug (see documents)
        schema:
          type: string
          example: invoice
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccess'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        default:
          $ref: '#/components/responses/ServiceUnavailable'
    servers:
    - url: https://datpaq.com/api/v1
      description: Production
    - url: https://staging.datpaq.com/api/v1
      description: Staging
  /document-generation/{documentType}/example:
    get:
      tags:
      - Document Generation
      operationId: documentGenerationExample
      summary: Get example data for a document type
      parameters:
      - name: documentType
        in: path
        required: true
        description: Document type slug (see documents)
        schema:
          type: string
          example: invoice
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccess'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        default:
          $ref: '#/components/responses/ServiceUnavailable'
    servers:
    - url: https://datpaq.com/api/v1
      description: Production
    - url: https://staging.datpaq.com/api/v1
      description: Staging
  /document-generation/{documentType}/render:
    get:
      tags:
      - Document Generation
      operationId: documentGenerationRenderBlank
      summary: Render a blank document as HTML
      parameters:
      - name: documentType
        in: path
        required: true
        description: Document type slug (see documents)
        schema:
          type: string
          example: invoice
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccess'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        default:
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      tags:
      - Document Generation
      operationId: documentGenerationRender
      summary: Render a document with data as HTML
      parameters:
      - name: documentType
        in: path
        required: true
        description: Document type slug (see documents)
        schema:
          type: string
          example: invoice
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                mode:
                  type: string
                  description: filled (default) or blank
                data:
                  type: object
                  description: Document data JSON (see the type's schema/example)
                branding:
                  type: object
                  description: Branding JSON (organizationName, primaryColor, footerText, ...)
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccess'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        default:
          $ref: '#/components/responses/ServiceUnavailable'
    servers:
    - url: https://datpaq.com/api/v1
      description: Production
    - url: https://staging.datpaq.com/api/v1
      description: Staging
  /document-generation/{documentType}/generate:
    post:
      tags:
      - Document Generation
      operationId: documentGenerationGenerate
      summary: Generate a PDF or DOCX document
      parameters:
      - name: documentType
        in: path
        required: true
        description: Document type slug (see documents)
        schema:
          type: string
          example: invoice
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                mode:
                  type: string
                  description: filled (default) or blank
                data:
                  type: object
                  description: Document data JSON (see the type's schema/example)
                branding:
                  type: object
                  description: Branding JSON (organizationName, primaryColor, footerText, ...)
                output:
                  type: object
                  description: 'Output JSON: {"type":"pdf|docx","format":"Letter","responseType":"base64|binary","landscape":false}'
            example:
              mode: filled
              templateVersion: 1.0.0
              data:
                invoiceNumber: INV-2026-0042
                invoiceDate: '2026-09-02'
                dueDate: '2026-10-02'
                sellerName: Datpaq
                customerName: Example Corporation
                currency: USD
                taxRate: 0
                items:
                - description: API Platform Subscription
                  quantity: 1
                  unitPrice: 499
              output:
                type: docx
                responseType: base64
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccess'
              example:
                success: true
                docxBase64: UEsDB...
                documentMetadata:
                  documentType: invoice
                  templateVersion: 1.0.0
                  mode: filled
                  format: DOCX
                  byteLength: 12345
                  timingMs: 120
                metadata:
                  correlationId: req_abc123
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        default:
          $ref: '#/components/responses/ServiceUnavailable'
    servers:
    - url: https://datpaq.com/api/v1
      description: Production
    - url: https://staging.datpaq.com/api/v1
      description: Staging
  /document-generation/batch:
    post:
      tags:
      - Document Generation
      operationId: documentGenerationBatch
      summary: Generate up to 5 documents as base64
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - requests
              properties:
                requests:
                  type: array
                  description: JSON array of {"documentType","data","output"} requests (1-5)
                  items: {}
            example:
              requests:
              - documentType: employment-verification
                mode: blank
                branding:
                  logoText: Example Co
                  primaryColor: '#225588'
                  accentColor: '#882255'
                output:
                  type: html
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccess'
              example:
                success: true
                total: 1
                failed: 0
                results:
                - index: 0
                  success: true
                  documentType: employment-verification
                  templateVersion: 1.0.0
                  outputType: html
                  html: <!doctype html>...
                metadata:
                  correlationId: req_batch123
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        default:
          $ref: '#/components/responses/ServiceUnavailable'
    servers:
    - url: https://datpaq.com/api/v1
      description: Production
    - url: https://staging.datpaq.com/api/v1
      description: Staging
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Human-readable error message
          example: Invalid API key
        correlationId:
          type: string
          description: Request tracking identifier for support
          example: abc123-def456-789ghi
        service:
          type: string
          description: Service name that produced the error
          example: ip-geolocation
    GenericSuccess:
      type: object
      description: Standard success envelope. The data property structure varies by endpoint.
      properties:
        correlationId:
          type: string
          description: Request tracking identifier
          example: abc123-def456
        data:
          type: object
          description: Response payload (structure varies by endpoint)
        cached:
          type: boolean
          description: Whether the response was served from cache
          example: false
  responses:
    BadRequest:
      description: Bad request — missing or invalid parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    RateLimited:
      description: Rate limit exceeded — retry after the indicated period
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ServiceUnavailable:
      description: Service temporarily unavailable
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Unauthorized — missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: API key passed via x-api-key request header
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api_key
      description: API key passed as api_key query parameter
x-refined-from:
- datpaq-com.yaml
- datpaq-com-openapi.yaml