Documents API
Base URL: https://YOUR-SERVER/api. Send your API key in x-api-key where authentication is required. A key also needs the listed permission; your account's access rules still apply.
API guide · All endpoints · OpenAPI JSON
GET /documents— Search documentsGET /documents/{id}— Retrieve a documentDELETE /documents/{id}/fields/{field}— Clear a document field decisionPUT /documents/{id}/fields/{field}— Decide a document fieldPUT /documents/{id}/lines— Correct or dismiss a line of textDELETE /documents/{id}/lines/{editId}— Restore a line of text
Search documents
GET /api/documents
List the signed-in account’s photos that show recognized text, newest first, optionally matching text read from them or the owner’s corrections.
Authentication: API key. Permission: asset.read.
Parameters
| Name | Where | Required | Description |
|---|---|---|---|
page | query | No | integer |
query | query | No | Text to find in recognized text and in the owner’s corrections |
size | query | No | integer |
Parameter types, defaults and constraints
[
{
"name": "page",
"required": false,
"in": "query",
"schema": {
"minimum": 1,
"maximum": 9007199254740991,
"default": 1,
"type": "integer"
}
},
{
"name": "query",
"required": false,
"in": "query",
"description": "Text to find in recognized text and in the owner’s corrections",
"schema": {
"maxLength": 200,
"type": "string"
}
},
{
"name": "size",
"required": false,
"in": "query",
"schema": {
"minimum": 1,
"maximum": 250,
"default": 100,
"type": "integer"
}
}
]Responses
Field definitions: DocumentSearchResponseDto
{
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DocumentSearchResponseDto"
}
}
},
"description": ""
}
}Retrieve a document
GET /api/documents/{id}
Retrieve the text read from a photo with the owner’s corrections applied, where each line is in the photo, and, for the owner, the values suggested from it.
Authentication: API key. Permission: asset.read.
Parameters
| Name | Where | Required | Description |
|---|---|---|---|
id | path | Yes | string |
Parameter types, defaults and constraints
[
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
"type": "string"
}
}
]Responses
Field definitions: DocumentResponseDto
{
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DocumentResponseDto"
}
}
},
"description": ""
}
}Clear a document field decision
DELETE /api/documents/{id}/fields/{field}
Remove the owner’s decision about a field, so the text’s suggestion shows again.
Authentication: API key. Permission: asset.update.
Parameters
| Name | Where | Required | Description |
|---|---|---|---|
field | path | Yes | |
id | path | Yes | string |
revision | query | Yes | Revision of the decision being removed |
Parameter types, defaults and constraints
Field definitions: DocumentField
[
{
"name": "field",
"required": true,
"in": "path",
"schema": {
"$ref": "#/components/schemas/DocumentField"
}
},
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
"type": "string"
}
},
{
"name": "revision",
"required": true,
"in": "query",
"description": "Revision of the decision being removed",
"schema": {
"minimum": 1,
"maximum": 9007199254740991,
"type": "integer"
}
}
]Responses
Field definitions: DocumentResponseDto
{
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DocumentResponseDto"
}
}
},
"description": ""
}
}Decide a document field
PUT /api/documents/{id}/fields/{field}
Confirm, correct or dismiss a value suggested from the text of a photo.
Authentication: API key. Permission: asset.update.
Parameters
| Name | Where | Required | Description |
|---|---|---|---|
field | path | Yes | |
id | path | Yes | string |
Parameter types, defaults and constraints
Field definitions: DocumentField
[
{
"name": "field",
"required": true,
"in": "path",
"schema": {
"$ref": "#/components/schemas/DocumentField"
}
},
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
"type": "string"
}
}
]Request body
Required.
Field definitions: DocumentFieldEditDto
{
"application/json": {
"schema": {
"$ref": "#/components/schemas/DocumentFieldEditDto"
}
}
}Responses
Field definitions: DocumentResponseDto
{
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DocumentResponseDto"
}
}
},
"description": ""
}
}Correct or dismiss a line of text
PUT /api/documents/{id}/lines
Record the owner’s correction or dismissal of one recognized line. The recognized text itself is kept unchanged.
Authentication: API key. Permission: asset.update.
Parameters
| Name | Where | Required | Description |
|---|---|---|---|
id | path | Yes | string |
Parameter types, defaults and constraints
[
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
"type": "string"
}
}
]Request body
Required.
Field definitions: DocumentLineEditDto
{
"application/json": {
"schema": {
"$ref": "#/components/schemas/DocumentLineEditDto"
}
}
}Responses
Field definitions: DocumentResponseDto
{
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DocumentResponseDto"
}
}
},
"description": ""
}
}Restore a line of text
DELETE /api/documents/{id}/lines/{editId}
Remove the owner’s correction or dismissal of a line, so it reads as recognized again.
Authentication: API key. Permission: asset.update.
Parameters
| Name | Where | Required | Description |
|---|---|---|---|
editId | path | Yes | string |
id | path | Yes | string |
revision | query | Yes | Revision of the decision being removed |
Parameter types, defaults and constraints
[
{
"name": "editId",
"required": true,
"in": "path",
"schema": {
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
"type": "string"
}
},
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
"type": "string"
}
},
{
"name": "revision",
"required": true,
"in": "query",
"description": "Revision of the decision being removed",
"schema": {
"minimum": 1,
"maximum": 9007199254740991,
"type": "integer"
}
}
]Responses
Field definitions: DocumentResponseDto
{
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DocumentResponseDto"
}
}
},
"description": ""
}
}© 2026 Frameleaf Inc. All rights reserved.
Frameleaf and the Frameleaf logo are Trademarks of Frameleaf Inc.