---
title: "Where the document is waiting to be filled in"
method: GET
path: "/api/v1/documents/{id}/blanks"
tags: ["Documents"]
---

# Where the document is waiting to be filled in

`GET /api/v1/documents/{id}/blanks`

## Request

- Base URL: `https://api.korala.ai`
- URL: `https://api.korala.ai/api/v1/documents/{id}/blanks`
- Auth: one of:
  - API key in header `X-API-Key`
  - `bearer` (a scheme the document does not define)

Reads the printed page and returns every ruled line and labelled blank, each with the words printed against it, the line it sits on and a box to place a field in. It does not decide what any blank is for: the label is returned so the caller can. A rule drawn as a graphic is not in the text layer and is not found here; use the text search to locate its label instead.

## Path parameters

- `id` string, required

## Response `200`

- DocumentBlanksDto
  - `blanks` BlankDto[], required
    - `pageNumber` number, required
    - `label` string, required: The words printed against the blank: before a rule on the same line, or under it. Empty when the rule carries no nearby label.
    - `line` string, required: The whole printed line, so two blanks sharing a label can be told apart.
    - `xPosition` number, required
    - `yPosition` number, required
    - `width` number, required
    - `height` number, required
    - `found` 'rule' | 'gap', required: "rule" is a run of underscores or dashes. "gap" is a short label ending in a colon with room after it.
  - `pages` PageSizeDto[], required
    - `pageNumber` number, required
    - `width` number, required: Page width in PDF points
    - `height` number, required: Page height in PDF points
    - `rotated` boolean: True for a page stored rotated. Text positions on it cannot be trusted, so fields there need coordinates.
  - `pageCount` number, required
  - `hasFormFields` boolean, nullable, required: Whether the document is a fillable form. When it is, its own fields say where everything goes and import_form_fields places them; the blanks here are only what the printed text shows. Null when the file was never scanned for them, which is not the same as having none.

## Other responses

- `400`: Malformed UUID in path parameter (`id`).

---

[API](https://skmtc.dev/korala/apis/korala-public-api.md) · [All operations](https://skmtc.dev/korala/apis/korala-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/korala/apis/korala-public-api/revisions/5c4d7810c507?raw)
