---
title: "Populate DOCX template fields"
method: POST
path: "/superdoc/v1/annotate"
tags: ["SuperDoc"]
---

# Populate DOCX template fields

`POST /superdoc/v1/annotate`

Populate fields inside a DOCX template using SuperDoc annotations. Supports text, images, dates, and numbers. Can target individual fields by ID or multiple fields by group.

## Request body

- object
  - `document` object, required — Document source - provide either URL or base64
    - `url` string — URL to the DOCX template
    - `base64` string — Base64-encoded DOCX template
  - `fields` object[], required — Fields to populate in the template
    - `id` string — Target field ID (for single field)
    - `group` string — Target field group (for multiple fields with same tag)
    - `type` 'text' | 'image' | 'date' | 'number', required — Field data type
    - `value` union, required — Value to populate
      - string
      - number
    - `options` object — Optional configuration (e.g., image dimensions)
      - `width` number — Image width in pixels
      - `height` number — Image height in pixels
  - `output_format` 'docx' | 'pdf' — Output format for the annotated document

## Response `200`

Annotated document

## Other responses

- `400` — Invalid request - missing document or fields
- `401` — Invalid API key
- `403` — Insufficient permissions for SuperDoc service
- `503` — SuperDoc service not configured

---

[API](https://skmtc.net/casemark/apis/case-dev-api.md) · [All operations](https://skmtc.net/casemark/apis/case-dev-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/casemark/case-dev-api/versions/5b7e64e6d6f9/schema)
