---
title: "Fill fields"
method: PUT
path: "/v1/documents/{id}/fields/"
tags: ["Documents"]
---

# Fill fields

`PUT /v1/documents/{id}/fields/`

## Request

- Base URL: `https://api.pdfbetter.com`
- URL: `https://api.pdfbetter.com/v1/documents/{id}/fields/`
- Auth: HTTP bearer

Sets values by field name. Values are validated like in the editor (types, options, formats, patterns; formulas recalculated). If anything is invalid you get 422 `invalid_fields` with a message per field and nothing is saved. `complete: true` also requires every required field.

Signature and button fields in the PDF can't be filled through the API — send a signature request instead.

## Path parameters

- `id` string, required

## Request body

- object
  - `values` object, required
  - `complete` boolean
  - `expectedRevision` integer

## Response `200`

Fill fields

- FieldList
  - `object` 'field_list', required
  - `documentId` string, required
  - `revision` integer, required: Document revision; pass as `expectedRevision` to fill safely
  - `data` object[], required
    - `name` string, required: The name you fill by. Radio groups are one entry named after the group.
    - `type` string, required: Model fields: text, number, date, checkbox, radio, dropdown, signature, … PDF fields: text, checkbox, radio, dropdown, optionlist, signature, button
    - `source` 'model' | 'pdf', required: `model` = added in PDFBetter; `pdf` = AcroForm field that was already in the uploaded PDF
    - `label` string, nullable, required
    - `required` boolean, required
    - `readOnly` boolean, required
    - `options` string[], nullable, required
    - `value` union, required
      - string
      - number
      - boolean
    - `page` integer, nullable, required: 1-based page number
    - `multiline` boolean, nullable, required
    - `maxLength` integer, nullable, required
  - `updated` string[]: Fields changed by this request (fill only)

## Other responses

- `400`: Invalid request (see `error.details.issues`)
- `401`: Missing or invalid API key
- `402`: Your plan doesn't include this (API access needs Business) or a monthly allowance is used up
- `403`: The API key lacks the required scope
- `404`: Not found (or not yours)
- `409`: Conflict with the current state
- `422`: Validation failed
- `429`: Rate limited — see RateLimit-* and Retry-After

---

[API](https://skmtc.dev/pdfbetter/apis/pdfbetter-api.md) · [All operations](https://skmtc.dev/pdfbetter/apis/pdfbetter-api/llms.txt) · [OpenAPI document](https://skmtc.dev/pdfbetter/apis/pdfbetter-api/revisions/6960b18754a8?raw)
