v4

latestOpenAPI 3.0.3Commercialraw.githubusercontent.com2026-08-0112681.4 KB
Documents

Annotate

Populate fields inside a DOCX template using SuperDoc annotations.

Send a JSON request body with:

  • document: object containing either base64 or url
  • fields: array of field objects (id/group, type, value, optional options)

Note: Each field requires either id or group:

  • id: Targets a single specific field in the template
  • group: Targets multiple fields with the same group identifier

The response returns the annotated DOCX/PDF file as a base64 data URI.

Example Request

{
  "document": {
    "url": "https://example.com/template.docx"
  },
  "fields": [
    {
      "id": "customer_name",
      "type": "text",
      "value": "John Doe"
    },
    {
      "id": "author",
      "type": "image",
      "value": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
      "options": {
        "dimensions": {
          "width": 200,
          "height": 100
        }
      }
    }
  ]
}

Alternative using base64 document input:

{
  "document": {
    "base64": "UEsDBBQAAAAIAL+H..."
  },
  "fields": [
    {
      "id": "title",
      "type": "text",
      "value": "Annual Report 2024"
    }
  ]
}

Using group to populate multiple fields:

{
  "document": {
    "url": "https://example.com/template.docx"
  },
  "fields": [
    {
      "group": "company_logo",
      "type": "image",
      "value": "https://example.com/logo.png"
    }
  ]
}
post/v1/annotate

Query parameters

to'docx' | 'pdf'

Output format for the annotated document (defaults to docx)

Request body

documentobject required

DOCX input provided as either base64 or URL

Example request

{
  "fields": [
    {
      "options": {
        "dimensions": {
          "width": "180",
          "height": "250"
        },
        "arcElement": {
          "color": "#3bc0f1"
        },
        "topLabel": {
          "color": "#002fff"
        },
        "bottomLabel": {
          "color": "#ff0000",
          "text": "ip: 192.168.0.1"
        }
      }
    }
  ]
}

Response

Annotated DOCX output encoded as a base64 data URI