# Amazon Textract

> Read documents with Amazon Textract: pull the text out of scans, photos and PDFs, read forms, tables and signatures, ask a document questions in plain English, read invoices, receipts and US IDs, and sort loan packets, with results as plain text, fields and rows.

App · 22 actions. Web page: https://docs.lodol.com/docs/integrations/amazon-textract

## Actions

### Analyze document

Read a one-page form or document: its text, each form label with its value (as fields), tables as rows, answers to questions you ask in plain English, signatures and layout. For a longer PDF use Analyze multi-page document.

**Inputs**

- Document (`document`, text, required): Upload a scan or photo, pick a file from an earlier step, or give a link or an S3 address (s3://bucket/file). A JPEG or PNG image, or a PDF or TIFF of one page, up to 10 MB. For longer documents use the multi-page action.
- Look for (`features`, list): What to read besides the text. Forms and Tables if you choose nothing; Questions is turned on by typing a question. Textract charges for each one chosen. One or more of: `FORMS` (Forms (labels and their values)), `TABLES`, `QUERIES` (Questions), `SIGNATURES`, `LAYOUT` (Layout (titles, headers, paragraphs, lists)). Default: `["FORMS", "TABLES"]`.
- Questions (`queries`, list): Questions to ask of the document in plain English, one per line, such as 'What is the invoice number?'. Up to 15, of up to 200 characters each. Each answer comes back under answers.
- Adapter (`adapter_id`, text): An adapter trained in the Textract console to read your kind of document better. Leave empty to use Textract as it comes.
- Adapter version (`adapter_version`, text): Which trained version of the adapter to use. Needed with an adapter.

**Outputs**

- `answers` (object): Each question's answer, by question.
- `blocks_truncated` (true/false): Whether raw holds only the first 5,000 blocks.
- `fields` (object): Each form label's value, by label, such as fields['Full Name']. A label seen again gets ' (2)' after it.
- `key_values` (list): Every form label with its value (with Forms).
- `layout` (list): The page's parts in reading order (with Layout).
- `lines` (list): Every line of text, in reading order.
- `pages` (number): How many pages the document has.
- `query_answers` (list): Each question's answer (with Questions).
- `raw` (object): Textract's own answer, with up to 5,000 of its blocks.
- `signatures` (list): Every signature found (with Signatures).
- `tables` (list): Every table (with Tables).
- `text` (text): All the text, line by line, with a blank line between pages.

**Example output**

```json
{
  "answers": {
    "What is the applicant's phone number?": "555-0100"
  },
  "blocks_truncated": false,
  "fields": {
    "Full Name": "Jane Doe"
  },
  "key_values": [
    {
      "confidence": 99.2,
      "key": "Full Name",
      "page": 1,
      "selected": null,
      "value": "Jane Doe"
    }
  ],
  "layout": [
    {
      "page": 1,
      "text": "Employment Application",
      "type": "title"
    }
  ],
  "lines": [
    {
      "confidence": 99.2,
      "page": 1,
      "text": "Employment Application"
    },
    {
      "confidence": 99.2,
      "page": 1,
      "text": "Full Name: Jane Doe"
    },
    {
      "confidence": 99.2,
      "page": 1,
      "text": "Employer Name Position Held"
    }
  ],
  "pages": 1,
  "query_answers": [
    {
      "alias": null,
      "answer": "555-0100",
      "confidence": 99.2,
      "page": 1,
      "question": "What is the applicant's phone number?"
    }
  ],
  "raw": {
    "AnalyzeDocumentModelVersion": "1.0",
    "Blocks": [
      {
        "BlockType": "PAGE",
        "Confidence": 99.2,
        "Id": "p1",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "l1",
              "l2",
              "l3"
            ],
            "Type": "CHILD"
          }
        ]
      },
      {
        "BlockType": "LINE",
        "Confidence": 99.2,
        "Id": "l1",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "w1",
              "w2"
            ],
            "Type": "CHILD"
          }
        ],
        "Text": "Employment Application"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w1",
        "Page": 1,
        "Text": "Employment",
        "TextType": "PRINTED"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w2",
        "Page": 1,
        "Text": "Application",
        "TextType": "PRINTED"
      },
      {
        "BlockType": "LINE",
        "Confidence": 99.2,
        "Id": "l2",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "w3",
              "w4",
              "w5",
              "w5b"
            ],
            "Type": "CHILD"
          }
        ],
        "Text": "Full Name: Jane Doe"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w3",
        "Page": 1,
        "Text": "Full"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w4",
        "Page": 1,
        "Text": "Name:"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w5",
        "Page": 1,
        "Text": "Jane"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w5b",
        "Page": 1,
        "Text": "Doe"
      },
      {
        "BlockType": "LINE",
        "Confidence": 99.2,
        "Id": "l3",
        "Page": 1,
        "Text": "Employer Name Position Held"
      },
      {
        "BlockType": "KEY_VALUE_SET",
        "Confidence": 99.2,
        "EntityTypes": [
          "KEY"
        ],
        "Id": "k1",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "v1"
            ],
            "Type": "VALUE"
          },
          {
            "Ids": [
              "w3",
              "w4"
            ],
            "Type": "CHILD"
          }
        ]
      },
      {
        "BlockType": "KEY_VALUE_SET",
        "Confidence": 99.2,
        "EntityTypes": [
          "VALUE"
        ],
        "Id": "v1",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "w5",
              "w5b"
            ],
            "Type": "CHILD"
          }
        ]
      },
      {
        "BlockType": "TABLE",
        "Confidence": 99.2,
        "EntityTypes": [
          "STRUCTURED_TABLE"
        ],
        "Id": "t1",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "c1",
              "c2",
              "c3",
              "c4"
            ],
            "Type": "CHILD"
          }
        ]
      },
      {
        "BlockType": "CELL",
        "ColumnIndex": 1,
        "Confidence": 99.2,
        "EntityTypes": [
          "COLUMN_HEADER"
        ],
        "Id": "c1",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "w6"
            ],
            "Type": "CHILD"
          }
        ],
        "RowIndex": 1
      },
      {
        "BlockType": "CELL",
        "ColumnIndex": 2,
        "Confidence": 99.2,
        "EntityTypes": [
          "COLUMN_HEADER"
        ],
        "Id": "c2",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "w7"
            ],
            "Type": "CHILD"
          }
        ],
        "RowIndex": 1
      },
      {
        "BlockType": "CELL",
        "ColumnIndex": 1,
        "Confidence": 99.2,
        "Id": "c3",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "w8"
            ],
            "Type": "CHILD"
          }
        ],
        "RowIndex": 2
      },
      {
        "BlockType": "CELL",
        "ColumnIndex": 2,
        "Confidence": 99.2,
        "Id": "c4",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "w9"
            ],
            "Type": "CHILD"
          }
        ],
        "RowIndex": 2
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w6",
        "Page": 1,
        "Text": "Employer"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w7",
        "Page": 1,
        "Text": "Position"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w8",
        "Page": 1,
        "Text": "AnyCompany"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w9",
        "Page": 1,
        "Text": "Baker"
      },
      {
        "BlockType": "QUERY",
        "Confidence": 99.2,
        "Id": "q1",
        "Page": 1,
        "Query": {
          "Text": "What is the applicant's phone number?"
        },
        "Relationships": [
          {
            "Ids": [
              "a1"
            ],
            "Type": "ANSWER"
          }
        ]
      },
      {
        "BlockType": "QUERY_RESULT",
        "Confidence": 99.2,
        "Id": "a1",
        "Page": 1,
        "Text": "555-0100"
      },
      {
        "BlockType": "SIGNATURE",
        "Confidence": 99.2,
        "Id": "s1",
        "Page": 1
      },
      {
        "BlockType": "LAYOUT_TITLE",
        "Confidence": 99.2,
        "Id": "y1",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "l1"
            ],
            "Type": "CHILD"
          }
        ]
      }
    ],
    "DocumentMetadata": {
      "Pages": 1
    }
  },
  "signatures": [
    {
      "confidence": 99.2,
      "page": 1
    }
  ],
  "tables": [
    {
      "column_count": 2,
      "confidence": 99.2,
      "page": 1,
      "records": [
        {
          "Employer": "AnyCompany",
          "Position": "Baker"
        }
      ],
      "row_count": 2,
      "rows": [
        [
          "Employer",
          "Position"
        ],
        [
          "AnyCompany",
          "Baker"
        ]
      ],
      "title": null
    }
  ],
  "text": "Employment Application\nFull Name: Jane Doe\nEmployer Name Position Held"
}
```

### Analyze ID document

Read a US driver's license or passport: name, date of birth, document number, expiry, address and the rest, with each field's confidence. Give a license's back too, if you have it.

**Inputs**

- Document (`document`, text, required): A photo or scan of the ID (its front): upload it, pick a file from an earlier step, or give a link or an S3 address. JPEG, PNG, or a one-page PDF or TIFF, up to 10 MB.
- Back of the ID (`back_document`, text): The back of a driver's license, in the same way.

**Outputs**

- `blocks_truncated` (true/false): Whether raw holds only the first 5,000 blocks.
- `date_of_birth` (text): The date of birth, as printed.
- `document_number` (text): The license or passport number.
- `expiration_date` (text): When it expires, as printed.
- `field_list` (list): Every field, with its confidence.
- `fields` (object): Every field, by name, such as fields['ADDRESS'].
- `first_name` (text): The first name.
- `id_type` (text): DRIVER LICENSE FRONT, PASSPORT or another kind.
- `last_name` (text): The last name.
- `pages` (number): How many pages were read.
- `raw` (object): Textract's own answer, with up to 5,000 of its blocks.

**Example output**

```json
{
  "blocks_truncated": false,
  "date_of_birth": "03/18/2001",
  "document_number": "736HDV7874JSB",
  "expiration_date": "01/20/2028",
  "field_list": [
    {
      "confidence": 98.5,
      "normalized_value": null,
      "type": "FIRST_NAME",
      "value": "MARIA"
    },
    {
      "confidence": 98.5,
      "normalized_value": null,
      "type": "LAST_NAME",
      "value": "GARCIA"
    },
    {
      "confidence": 98.5,
      "normalized_value": "2001-03-18T00:00:00",
      "type": "DATE_OF_BIRTH",
      "value": "03/18/2001"
    },
    {
      "confidence": 98.5,
      "normalized_value": null,
      "type": "DOCUMENT_NUMBER",
      "value": "736HDV7874JSB"
    },
    {
      "confidence": 98.5,
      "normalized_value": "2028-01-20T00:00:00",
      "type": "EXPIRATION_DATE",
      "value": "01/20/2028"
    },
    {
      "confidence": 98.5,
      "normalized_value": null,
      "type": "ID_TYPE",
      "value": "DRIVER LICENSE FRONT"
    },
    {
      "confidence": 98.5,
      "normalized_value": null,
      "type": "ADDRESS",
      "value": "100 MARKET STREET"
    }
  ],
  "fields": {
    "ADDRESS": "100 MARKET STREET",
    "DATE_OF_BIRTH": "03/18/2001",
    "DOCUMENT_NUMBER": "736HDV7874JSB",
    "EXPIRATION_DATE": "01/20/2028",
    "FIRST_NAME": "MARIA",
    "ID_TYPE": "DRIVER LICENSE FRONT",
    "LAST_NAME": "GARCIA"
  },
  "first_name": "MARIA",
  "id_type": "DRIVER LICENSE FRONT",
  "last_name": "GARCIA",
  "pages": 1,
  "raw": {
    "AnalyzeIDModelVersion": "1.0",
    "DocumentMetadata": {
      "Pages": 1
    },
    "IdentityDocuments": [
      {
        "Blocks": [],
        "DocumentIndex": 1,
        "IdentityDocumentFields": [
          {
            "Type": {
              "Text": "FIRST_NAME"
            },
            "ValueDetection": {
              "Confidence": 98.5,
              "Text": "MARIA"
            }
          },
          {
            "Type": {
              "Text": "LAST_NAME"
            },
            "ValueDetection": {
              "Confidence": 98.5,
              "Text": "GARCIA"
            }
          },
          {
            "Type": {
              "Text": "DATE_OF_BIRTH"
            },
            "ValueDetection": {
              "Confidence": 98.5,
              "NormalizedValue": {
                "Value": "2001-03-18T00:00:00",
                "ValueType": "DATE"
              },
              "Text": "03/18/2001"
            }
          },
          {
            "Type": {
              "Text": "DOCUMENT_NUMBER"
            },
            "ValueDetection": {
              "Confidence": 98.5,
              "Text": "736HDV7874JSB"
            }
          },
          {
            "Type": {
              "Text": "EXPIRATION_DATE"
            },
            "ValueDetection": {
              "Confidence": 98.5,
              "NormalizedValue": {
                "Value": "2028-01-20T00:00:00",
                "ValueType": "DATE"
              },
              "Text": "01/20/2028"
            }
          },
          {
            "Type": {
              "Text": "ID_TYPE"
            },
            "ValueDetection": {
              "Confidence": 98.5,
              "Text": "DRIVER LICENSE FRONT"
            }
          },
          {
            "Type": {
              "Text": "ADDRESS"
            },
            "ValueDetection": {
              "Confidence": 98.5,
              "Text": "100 MARKET STREET"
            }
          }
        ]
      }
    ]
  }
}
```

### Analyze invoice or receipt

Read an invoice or receipt (one page): the vendor, number, date, tax and total, every other field at the top, and each line item with its quantity and price.

**Inputs**

- Document (`document`, text, required): Upload a scan or photo, pick a file from an earlier step, or give a link or an S3 address (s3://bucket/file). A JPEG or PNG image, or a PDF or TIFF of one page, up to 10 MB. For longer documents use the multi-page action.

**Outputs**

- `amount_due` (text): The amount due, as printed.
- `blocks_truncated` (true/false): Whether raw holds only the first 5,000 blocks.
- `currency` (text): The currency code Textract found, such as USD.
- `documents` (list): Each invoice or receipt in the file; the fields above are the first one's.
- `due_date` (text): When payment is due, as printed.
- `invoice_receipt_date` (text): Its date, as printed.
- `invoice_receipt_id` (text): The invoice or receipt number.
- `line_items` (list): Every line item.
- `pages` (number): How many pages the document has.
- `raw` (object): Textract's own answer, with up to 5,000 of its blocks.
- `subtotal` (text): The subtotal, as printed.
- `summary` (object): Every field at the top of the document, by name, such as summary['TOTAL'].
- `summary_fields` (list): Every summary field, with its label and confidence.
- `tax` (text): The tax, as printed.
- `total` (text): The total, as printed.
- `vendor_name` (text): Who issued it.

**Example output**

```json
{
  "amount_due": null,
  "blocks_truncated": false,
  "currency": "USD",
  "documents": [
    {
      "currency": "USD",
      "index": 1,
      "line_items": [
        {
          "ITEM": "Sourdough loaf",
          "PRICE": "$27.50",
          "QUANTITY": "5"
        }
      ],
      "summary": {
        "INVOICE_RECEIPT_DATE": "05/10/2026",
        "INVOICE_RECEIPT_ID": "INV-1042",
        "TOTAL": "$27.50",
        "VENDOR_NAME": "AnyCompany Bakery"
      }
    }
  ],
  "due_date": null,
  "invoice_receipt_date": "05/10/2026",
  "invoice_receipt_id": "INV-1042",
  "line_items": [
    {
      "ITEM": "Sourdough loaf",
      "PRICE": "$27.50",
      "QUANTITY": "5"
    }
  ],
  "pages": 1,
  "raw": {
    "DocumentMetadata": {
      "Pages": 1
    },
    "ExpenseDocuments": [
      {
        "Blocks": [],
        "ExpenseIndex": 1,
        "LineItemGroups": [
          {
            "LineItemGroupIndex": 1,
            "LineItems": [
              {
                "LineItemExpenseFields": [
                  {
                    "Type": {
                      "Text": "ITEM"
                    },
                    "ValueDetection": {
                      "Text": "Sourdough loaf"
                    }
                  },
                  {
                    "Type": {
                      "Text": "QUANTITY"
                    },
                    "ValueDetection": {
                      "Text": "5"
                    }
                  },
                  {
                    "Type": {
                      "Text": "PRICE"
                    },
                    "ValueDetection": {
                      "Text": "$27.50"
                    }
                  }
                ]
              }
            ]
          }
        ],
        "SummaryFields": [
          {
            "PageNumber": 1,
            "Type": {
              "Confidence": 99.1,
              "Text": "VENDOR_NAME"
            },
            "ValueDetection": {
              "Confidence": 98.7,
              "Text": "AnyCompany Bakery"
            }
          },
          {
            "LabelDetection": {
              "Confidence": 99.0,
              "Text": "Invoice No:"
            },
            "PageNumber": 1,
            "Type": {
              "Confidence": 99.0,
              "Text": "INVOICE_RECEIPT_ID"
            },
            "ValueDetection": {
              "Confidence": 97.4,
              "Text": "INV-1042"
            }
          },
          {
            "LabelDetection": {
              "Confidence": 99.0,
              "Text": "Date"
            },
            "PageNumber": 1,
            "Type": {
              "Confidence": 99.0,
              "Text": "INVOICE_RECEIPT_DATE"
            },
            "ValueDetection": {
              "Confidence": 98.0,
              "Text": "05/10/2026"
            }
          },
          {
            "Currency": {
              "Code": "USD",
              "Confidence": 95.0
            },
            "LabelDetection": {
              "Confidence": 99.5,
              "Text": "Total"
            },
            "PageNumber": 1,
            "Type": {
              "Confidence": 99.5,
              "Text": "TOTAL"
            },
            "ValueDetection": {
              "Confidence": 99.1,
              "Text": "$27.50"
            }
          }
        ]
      }
    ]
  },
  "subtotal": null,
  "summary": {
    "INVOICE_RECEIPT_DATE": "05/10/2026",
    "INVOICE_RECEIPT_ID": "INV-1042",
    "TOTAL": "$27.50",
    "VENDOR_NAME": "AnyCompany Bakery"
  },
  "summary_fields": [
    {
      "confidence": 98.7,
      "currency": null,
      "groups": [],
      "label": null,
      "page": 1,
      "type": "VENDOR_NAME",
      "value": "AnyCompany Bakery"
    },
    {
      "confidence": 97.4,
      "currency": null,
      "groups": [],
      "label": "Invoice No:",
      "page": 1,
      "type": "INVOICE_RECEIPT_ID",
      "value": "INV-1042"
    },
    {
      "confidence": 98.0,
      "currency": null,
      "groups": [],
      "label": "Date",
      "page": 1,
      "type": "INVOICE_RECEIPT_DATE",
      "value": "05/10/2026"
    },
    {
      "confidence": 99.1,
      "currency": "USD",
      "groups": [],
      "label": "Total",
      "page": 1,
      "type": "TOTAL",
      "value": "$27.50"
    }
  ],
  "tax": null,
  "total": "$27.50",
  "vendor_name": "AnyCompany Bakery"
}
```

### Analyze lending documents

Sort a mortgage or loan packet into its documents (pay slips, bank statements, tax forms, IDs and more) and read each page's fields, waiting for Textract to finish. Get lending analysis summary groups the documents by kind. Needs an S3 bucket on the connection, or a document already in S3.

**Inputs**

- Document (`document`, text, required): Upload a PDF, TIFF, JPEG or PNG, pick a file from an earlier step, or give a link or an S3 address (s3://bucket/file) in the connection's region. Lodol puts an uploaded file or link in the connection's S3 bucket for Textract to read, and deletes it once the results are in (it stays if the step stops waiting first). PDF and TIFF files of any length; images up to 10 MB.
- Wait for results (`wait_seconds`, number): How many seconds to wait for Textract to finish, checking every 5 seconds, up to 600. Most documents take under a minute. Set 0 to start the job and read its results later with the matching Get step. From 0 to 600. Default: `300`.

**Outputs**

- `blocks_truncated` (true/false): Whether raw holds only the first 5,000 blocks.
- `document_location` (text): The s3:// address Textract read the document from.
- `finished` (true/false): Whether the results are in.
- `job_id` (text): The job's ID, for the matching Get step.
- `pages` (number): How many pages the packet has.
- `raw` (object): Textract's own answer, with up to 5,000 of its blocks.
- `results` (list): Each page, classified, with its fields.
- `status` (text): IN_PROGRESS, SUCCEEDED, PARTIAL_SUCCESS or FAILED.
- `status_message` (text): Textract's note on the job, if any.
- `warnings` (list): Pages Textract couldn't read in full.

**Example output**

```json
{
  "blocks_truncated": false,
  "document_location": "s3://my-documents/lodol-textract/3f2a9c1d/application.pdf",
  "finished": true,
  "job_id": "8f1c6a0e2b7d4c93a5e1f0b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2",
  "pages": 1,
  "raw": {
    "DocumentMetadata": {
      "Pages": 1
    },
    "JobStatus": "SUCCEEDED",
    "Results": [
      {
        "Extractions": [
          {
            "LendingDocument": {
              "LendingFields": [
                {
                  "Type": "OVERTIME_CONTINUANCE_LIKELY",
                  "ValueDetections": [
                    {
                      "Confidence": 95.0,
                      "Text": "Yes"
                    }
                  ]
                },
                {
                  "KeyDetection": {
                    "Confidence": 99.98,
                    "Text": "Weekly"
                  },
                  "Type": "CURRENT_GROSS_PAY_WEEKLY",
                  "ValueDetections": [
                    {
                      "Confidence": 99.6,
                      "SelectionStatus": "NOT_SELECTED"
                    }
                  ]
                }
              ],
              "SignatureDetections": [
                {
                  "Confidence": 98.0
                }
              ]
            }
          }
        ],
        "Page": 1,
        "PageClassification": {
          "PageNumber": [
            {
              "Confidence": 100.0,
              "Value": "undetected"
            }
          ],
          "PageType": [
            {
              "Confidence": 99.99,
              "Value": "1005"
            }
          ]
        }
      }
    ]
  },
  "results": [
    {
      "fields": {
        "CURRENT_GROSS_PAY_WEEKLY": "not selected",
        "OVERTIME_CONTINUANCE_LIKELY": "Yes"
      },
      "page": 1,
      "page_type": "1005",
      "page_type_confidence": 100.0,
      "signature_count": 1
    }
  ],
  "status": "SUCCEEDED",
  "status_message": null,
  "warnings": []
}
```

### Analyze multi-page document

Read the form fields, tables, answers to your questions, signatures and layout of a PDF or TIFF of any length, waiting for Textract to finish. Questions and the adapter apply to every page. Needs an S3 bucket on the connection, or a document already in S3.

**Inputs**

- Document (`document`, text, required): Upload a PDF, TIFF, JPEG or PNG, pick a file from an earlier step, or give a link or an S3 address (s3://bucket/file) in the connection's region. Lodol puts an uploaded file or link in the connection's S3 bucket for Textract to read, and deletes it once the results are in (it stays if the step stops waiting first). PDF and TIFF files of any length; images up to 10 MB.
- Look for (`features`, list): What to read besides the text. Forms and Tables if you choose nothing; Questions is turned on by typing a question. Textract charges for each one chosen. One or more of: `FORMS` (Forms (labels and their values)), `TABLES`, `QUERIES` (Questions), `SIGNATURES`, `LAYOUT` (Layout (titles, headers, paragraphs, lists)). Default: `["FORMS", "TABLES"]`.
- Questions (`queries`, list): Questions to ask of the document in plain English, one per line, such as 'What is the invoice number?'. Up to 30, of up to 200 characters each. Each answer comes back under answers.
- Adapter (`adapter_id`, text): An adapter trained in the Textract console to read your kind of document better. Leave empty to use Textract as it comes.
- Adapter version (`adapter_version`, text): Which trained version of the adapter to use. Needed with an adapter.
- Wait for results (`wait_seconds`, number): How many seconds to wait for Textract to finish, checking every 5 seconds, up to 600. Most documents take under a minute. Set 0 to start the job and read its results later with the matching Get step. From 0 to 600. Default: `300`.

**Outputs**

- `answers` (object): Each question's answer, by question.
- `blocks_truncated` (true/false): Whether raw holds only the first 5,000 blocks.
- `document_location` (text): The s3:// address Textract read the document from.
- `fields` (object): Each form label's value, by label, such as fields['Full Name']. A label seen again gets ' (2)' after it.
- `finished` (true/false): Whether the results are in.
- `job_id` (text): The job's ID, for the matching Get step.
- `key_values` (list): Every form label with its value (with Forms).
- `layout` (list): The page's parts in reading order (with Layout).
- `lines` (list): Every line of text, in reading order.
- `pages` (number): How many pages the document has.
- `query_answers` (list): Each question's answer (with Questions).
- `raw` (object): Textract's own answer, with up to 5,000 of its blocks.
- `signatures` (list): Every signature found (with Signatures).
- `status` (text): IN_PROGRESS, SUCCEEDED, PARTIAL_SUCCESS or FAILED.
- `status_message` (text): Textract's note on the job, if any.
- `tables` (list): Every table (with Tables).
- `text` (text): All the text, line by line, with a blank line between pages.
- `warnings` (list): Pages Textract couldn't read in full.

**Example output**

```json
{
  "answers": {
    "What is the applicant's phone number?": "555-0100"
  },
  "blocks_truncated": false,
  "document_location": "s3://my-documents/lodol-textract/3f2a9c1d/application.pdf",
  "fields": {
    "Full Name": "Jane Doe"
  },
  "finished": true,
  "job_id": "8f1c6a0e2b7d4c93a5e1f0b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2",
  "key_values": [
    {
      "confidence": 99.2,
      "key": "Full Name",
      "page": 1,
      "selected": null,
      "value": "Jane Doe"
    }
  ],
  "layout": [
    {
      "page": 1,
      "text": "Employment Application",
      "type": "title"
    }
  ],
  "lines": [
    {
      "confidence": 99.2,
      "page": 1,
      "text": "Employment Application"
    },
    {
      "confidence": 99.2,
      "page": 1,
      "text": "Full Name: Jane Doe"
    },
    {
      "confidence": 99.2,
      "page": 1,
      "text": "Employer Name Position Held"
    }
  ],
  "pages": 1,
  "query_answers": [
    {
      "alias": null,
      "answer": "555-0100",
      "confidence": 99.2,
      "page": 1,
      "question": "What is the applicant's phone number?"
    }
  ],
  "raw": {
    "AnalyzeDocumentModelVersion": "1.0",
    "Blocks": [
      {
        "BlockType": "PAGE",
        "Confidence": 99.2,
        "Id": "p1",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "l1",
              "l2",
              "l3"
            ],
            "Type": "CHILD"
          }
        ]
      },
      {
        "BlockType": "LINE",
        "Confidence": 99.2,
        "Id": "l1",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "w1",
              "w2"
            ],
            "Type": "CHILD"
          }
        ],
        "Text": "Employment Application"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w1",
        "Page": 1,
        "Text": "Employment",
        "TextType": "PRINTED"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w2",
        "Page": 1,
        "Text": "Application",
        "TextType": "PRINTED"
      },
      {
        "BlockType": "LINE",
        "Confidence": 99.2,
        "Id": "l2",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "w3",
              "w4",
              "w5",
              "w5b"
            ],
            "Type": "CHILD"
          }
        ],
        "Text": "Full Name: Jane Doe"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w3",
        "Page": 1,
        "Text": "Full"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w4",
        "Page": 1,
        "Text": "Name:"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w5",
        "Page": 1,
        "Text": "Jane"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w5b",
        "Page": 1,
        "Text": "Doe"
      },
      {
        "BlockType": "LINE",
        "Confidence": 99.2,
        "Id": "l3",
        "Page": 1,
        "Text": "Employer Name Position Held"
      },
      {
        "BlockType": "KEY_VALUE_SET",
        "Confidence": 99.2,
        "EntityTypes": [
          "KEY"
        ],
        "Id": "k1",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "v1"
            ],
            "Type": "VALUE"
          },
          {
            "Ids": [
              "w3",
              "w4"
            ],
            "Type": "CHILD"
          }
        ]
      },
      {
        "BlockType": "KEY_VALUE_SET",
        "Confidence": 99.2,
        "EntityTypes": [
          "VALUE"
        ],
        "Id": "v1",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "w5",
              "w5b"
            ],
            "Type": "CHILD"
          }
        ]
      },
      {
        "BlockType": "TABLE",
        "Confidence": 99.2,
        "EntityTypes": [
          "STRUCTURED_TABLE"
        ],
        "Id": "t1",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "c1",
              "c2",
              "c3",
              "c4"
            ],
            "Type": "CHILD"
          }
        ]
      },
      {
        "BlockType": "CELL",
        "ColumnIndex": 1,
        "Confidence": 99.2,
        "EntityTypes": [
          "COLUMN_HEADER"
        ],
        "Id": "c1",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "w6"
            ],
            "Type": "CHILD"
          }
        ],
        "RowIndex": 1
      },
      {
        "BlockType": "CELL",
        "ColumnIndex": 2,
        "Confidence": 99.2,
        "EntityTypes": [
          "COLUMN_HEADER"
        ],
        "Id": "c2",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "w7"
            ],
            "Type": "CHILD"
          }
        ],
        "RowIndex": 1
      },
      {
        "BlockType": "CELL",
        "ColumnIndex": 1,
        "Confidence": 99.2,
        "Id": "c3",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "w8"
            ],
            "Type": "CHILD"
          }
        ],
        "RowIndex": 2
      },
      {
        "BlockType": "CELL",
        "ColumnIndex": 2,
        "Confidence": 99.2,
        "Id": "c4",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "w9"
            ],
            "Type": "CHILD"
          }
        ],
        "RowIndex": 2
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w6",
        "Page": 1,
        "Text": "Employer"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w7",
        "Page": 1,
        "Text": "Position"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w8",
        "Page": 1,
        "Text": "AnyCompany"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w9",
        "Page": 1,
        "Text": "Baker"
      },
      {
        "BlockType": "QUERY",
        "Confidence": 99.2,
        "Id": "q1",
        "Page": 1,
        "Query": {
          "Text": "What is the applicant's phone number?"
        },
        "Relationships": [
          {
            "Ids": [
              "a1"
            ],
            "Type": "ANSWER"
          }
        ]
      },
      {
        "BlockType": "QUERY_RESULT",
        "Confidence": 99.2,
        "Id": "a1",
        "Page": 1,
        "Text": "555-0100"
      },
      {
        "BlockType": "SIGNATURE",
        "Confidence": 99.2,
        "Id": "s1",
        "Page": 1
      },
      {
        "BlockType": "LAYOUT_TITLE",
        "Confidence": 99.2,
        "Id": "y1",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "l1"
            ],
            "Type": "CHILD"
          }
        ]
      }
    ],
    "DocumentMetadata": {
      "Pages": 1
    }
  },
  "signatures": [
    {
      "confidence": 99.2,
      "page": 1
    }
  ],
  "status": "SUCCEEDED",
  "status_message": null,
  "tables": [
    {
      "column_count": 2,
      "confidence": 99.2,
      "page": 1,
      "records": [
        {
          "Employer": "AnyCompany",
          "Position": "Baker"
        }
      ],
      "row_count": 2,
      "rows": [
        [
          "Employer",
          "Position"
        ],
        [
          "AnyCompany",
          "Baker"
        ]
      ],
      "title": null
    }
  ],
  "text": "Employment Application\nFull Name: Jane Doe\nEmployer Name Position Held",
  "warnings": []
}
```

### Analyze multi-page invoices and receipts

Read every invoice or receipt in a PDF or TIFF of any length: each one's vendor, totals and line items, waiting for Textract to finish. Needs an S3 bucket on the connection, or a document already in S3.

**Inputs**

- Document (`document`, text, required): Upload a PDF, TIFF, JPEG or PNG, pick a file from an earlier step, or give a link or an S3 address (s3://bucket/file) in the connection's region. Lodol puts an uploaded file or link in the connection's S3 bucket for Textract to read, and deletes it once the results are in (it stays if the step stops waiting first). PDF and TIFF files of any length; images up to 10 MB.
- Wait for results (`wait_seconds`, number): How many seconds to wait for Textract to finish, checking every 5 seconds, up to 600. Most documents take under a minute. Set 0 to start the job and read its results later with the matching Get step. From 0 to 600. Default: `300`.

**Outputs**

- `amount_due` (text): The amount due, as printed.
- `blocks_truncated` (true/false): Whether raw holds only the first 5,000 blocks.
- `currency` (text): The currency code Textract found, such as USD.
- `document_location` (text): The s3:// address Textract read the document from.
- `documents` (list): Each invoice or receipt in the file; the fields above are the first one's.
- `due_date` (text): When payment is due, as printed.
- `finished` (true/false): Whether the results are in.
- `invoice_receipt_date` (text): Its date, as printed.
- `invoice_receipt_id` (text): The invoice or receipt number.
- `job_id` (text): The job's ID, for the matching Get step.
- `line_items` (list): Every line item.
- `pages` (number): How many pages the document has.
- `raw` (object): Textract's own answer, with up to 5,000 of its blocks.
- `status` (text): IN_PROGRESS, SUCCEEDED, PARTIAL_SUCCESS or FAILED.
- `status_message` (text): Textract's note on the job, if any.
- `subtotal` (text): The subtotal, as printed.
- `summary` (object): Every field at the top of the document, by name, such as summary['TOTAL'].
- `summary_fields` (list): Every summary field, with its label and confidence.
- `tax` (text): The tax, as printed.
- `total` (text): The total, as printed.
- `vendor_name` (text): Who issued it.
- `warnings` (list): Pages Textract couldn't read in full.

**Example output**

```json
{
  "amount_due": null,
  "blocks_truncated": false,
  "currency": "USD",
  "document_location": "s3://my-documents/lodol-textract/3f2a9c1d/application.pdf",
  "documents": [
    {
      "currency": "USD",
      "index": 1,
      "line_items": [
        {
          "ITEM": "Sourdough loaf",
          "PRICE": "$27.50",
          "QUANTITY": "5"
        }
      ],
      "summary": {
        "INVOICE_RECEIPT_DATE": "05/10/2026",
        "INVOICE_RECEIPT_ID": "INV-1042",
        "TOTAL": "$27.50",
        "VENDOR_NAME": "AnyCompany Bakery"
      }
    }
  ],
  "due_date": null,
  "finished": true,
  "invoice_receipt_date": "05/10/2026",
  "invoice_receipt_id": "INV-1042",
  "job_id": "8f1c6a0e2b7d4c93a5e1f0b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2",
  "line_items": [
    {
      "ITEM": "Sourdough loaf",
      "PRICE": "$27.50",
      "QUANTITY": "5"
    }
  ],
  "pages": 1,
  "raw": {
    "DocumentMetadata": {
      "Pages": 1
    },
    "ExpenseDocuments": [
      {
        "Blocks": [],
        "ExpenseIndex": 1,
        "LineItemGroups": [
          {
            "LineItemGroupIndex": 1,
            "LineItems": [
              {
                "LineItemExpenseFields": [
                  {
                    "Type": {
                      "Text": "ITEM"
                    },
                    "ValueDetection": {
                      "Text": "Sourdough loaf"
                    }
                  },
                  {
                    "Type": {
                      "Text": "QUANTITY"
                    },
                    "ValueDetection": {
                      "Text": "5"
                    }
                  },
                  {
                    "Type": {
                      "Text": "PRICE"
                    },
                    "ValueDetection": {
                      "Text": "$27.50"
                    }
                  }
                ]
              }
            ]
          }
        ],
        "SummaryFields": [
          {
            "PageNumber": 1,
            "Type": {
              "Confidence": 99.1,
              "Text": "VENDOR_NAME"
            },
            "ValueDetection": {
              "Confidence": 98.7,
              "Text": "AnyCompany Bakery"
            }
          },
          {
            "LabelDetection": {
              "Confidence": 99.0,
              "Text": "Invoice No:"
            },
            "PageNumber": 1,
            "Type": {
              "Confidence": 99.0,
              "Text": "INVOICE_RECEIPT_ID"
            },
            "ValueDetection": {
              "Confidence": 97.4,
              "Text": "INV-1042"
            }
          },
          {
            "LabelDetection": {
              "Confidence": 99.0,
              "Text": "Date"
            },
            "PageNumber": 1,
            "Type": {
              "Confidence": 99.0,
              "Text": "INVOICE_RECEIPT_DATE"
            },
            "ValueDetection": {
              "Confidence": 98.0,
              "Text": "05/10/2026"
            }
          },
          {
            "Currency": {
              "Code": "USD",
              "Confidence": 95.0
            },
            "LabelDetection": {
              "Confidence": 99.5,
              "Text": "Total"
            },
            "PageNumber": 1,
            "Type": {
              "Confidence": 99.5,
              "Text": "TOTAL"
            },
            "ValueDetection": {
              "Confidence": 99.1,
              "Text": "$27.50"
            }
          }
        ]
      }
    ]
  },
  "status": "SUCCEEDED",
  "status_message": null,
  "subtotal": null,
  "summary": {
    "INVOICE_RECEIPT_DATE": "05/10/2026",
    "INVOICE_RECEIPT_ID": "INV-1042",
    "TOTAL": "$27.50",
    "VENDOR_NAME": "AnyCompany Bakery"
  },
  "summary_fields": [
    {
      "confidence": 98.7,
      "currency": null,
      "groups": [],
      "label": null,
      "page": 1,
      "type": "VENDOR_NAME",
      "value": "AnyCompany Bakery"
    },
    {
      "confidence": 97.4,
      "currency": null,
      "groups": [],
      "label": "Invoice No:",
      "page": 1,
      "type": "INVOICE_RECEIPT_ID",
      "value": "INV-1042"
    },
    {
      "confidence": 98.0,
      "currency": null,
      "groups": [],
      "label": "Date",
      "page": 1,
      "type": "INVOICE_RECEIPT_DATE",
      "value": "05/10/2026"
    },
    {
      "confidence": 99.1,
      "currency": "USD",
      "groups": [],
      "label": "Total",
      "page": 1,
      "type": "TOTAL",
      "value": "$27.50"
    }
  ],
  "tax": null,
  "total": "$27.50",
  "vendor_name": "AnyCompany Bakery",
  "warnings": []
}
```

### Create adapter

Create an adapter: a way to tune Textract's answers to your kind of document. Train it with your labelled samples in the Textract console, or with Create adapter version.

**Inputs**

- Name (`adapter_name`, text, required): A name, using letters, digits, '-' and '_', such as invoice-queries.
- Made for (`features`, list, required): What the adapter improves. Textract adapters mostly tune Questions. One or more of: `FORMS` (Forms (labels and their values)), `TABLES`, `QUERIES` (Questions), `SIGNATURES`, `LAYOUT` (Layout (titles, headers, paragraphs, lists)).
- Description (`description`, text): What the adapter is for, up to 256 characters of plain text.
- Auto update (`auto_update`, text): Whether Textract retrains the adapter when it updates its own model. One of: `ENABLED` (Retrain when Textract updates its model), `DISABLED` (Keep it as trained).

**Outputs**

- `adapter_id` (text): The adapter's ID.
- `adapter_name` (text): Its name.
- `auto_update` (text): ENABLED or DISABLED: whether it is retrained when Textract updates.
- `created_at` (text): When it was created, in UTC.
- `description` (text): Its description.
- `features` (list): What it was made for: QUERIES, TABLES and so on.

**Example output**

```json
{
  "adapter_id": "2e9bf1b0f2a8",
  "adapter_name": "invoice-queries",
  "auto_update": "DISABLED",
  "created_at": "2026-10-20T09:15:02Z",
  "description": "Reads our suppliers' invoices",
  "features": [
    "QUERIES"
  ]
}
```

### Create adapter version

Train a new version of an adapter from a labelled dataset in S3, such as the manifest the Textract console's labelling tool saves. Training can take hours; Get adapter version shows when it is ready.

**Inputs**

- Adapter (`adapter_id`, text, required): The adapter. Pick it, or give its ID from List adapters.
- Dataset manifest (`manifest_s3_uri`, text, required): The S3 address of the dataset's manifest file, such as s3://my-bucket/adapter/manifest.jsonl.
- Output location (`output_s3_uri`, text, required): An S3 address for the training results, such as s3://my-bucket/adapter-output/.

**Outputs**

- `adapter_id` (text): The adapter's ID.
- `adapter_version` (text): The new version's number.

**Example output**

```json
{
  "adapter_id": "2e9bf1b0f2a8",
  "adapter_version": "1"
}
```

### Delete adapter

Delete an adapter and all its versions. This can't be undone.

**Inputs**

- Adapter (`adapter_id`, text, required): The adapter. Pick it, or give its ID from List adapters.

**Outputs**

- `adapter_id` (text): The deleted adapter's ID.
- `deleted` (true/false): Always true.

**Example output**

```json
{
  "adapter_id": "2e9bf1b0f2a8",
  "deleted": true
}
```

### Delete adapter version

Delete one trained version of an adapter. This can't be undone.

**Inputs**

- Adapter (`adapter_id`, text, required): The adapter. Pick it, or give its ID from List adapters.
- Adapter version (`adapter_version`, text, required): The version, such as 1. Pick it, or give it from List adapter versions.

**Outputs**

- `adapter_id` (text): The adapter's ID.
- `adapter_version` (text): The deleted version.
- `deleted` (true/false): Always true.

**Example output**

```json
{
  "adapter_id": "2e9bf1b0f2a8",
  "adapter_version": "1",
  "deleted": true
}
```

### Extract text

Read all the text in a scan, photo or one-page PDF (printed or handwritten), line by line. For a longer PDF use Extract text from multi-page document.

**Inputs**

- Document (`document`, text, required): Upload a scan or photo, pick a file from an earlier step, or give a link or an S3 address (s3://bucket/file). A JPEG or PNG image, or a PDF or TIFF of one page, up to 10 MB. For longer documents use the multi-page action.

**Outputs**

- `answers` (object): Each question's answer, by question.
- `blocks_truncated` (true/false): Whether raw holds only the first 5,000 blocks.
- `fields` (object): Each form label's value, by label, such as fields['Full Name']. A label seen again gets ' (2)' after it.
- `key_values` (list): Every form label with its value (with Forms).
- `layout` (list): The page's parts in reading order (with Layout).
- `lines` (list): Every line of text, in reading order.
- `pages` (number): How many pages the document has.
- `query_answers` (list): Each question's answer (with Questions).
- `raw` (object): Textract's own answer, with up to 5,000 of its blocks.
- `signatures` (list): Every signature found (with Signatures).
- `tables` (list): Every table (with Tables).
- `text` (text): All the text, line by line, with a blank line between pages.

**Example output**

```json
{
  "answers": {},
  "blocks_truncated": false,
  "fields": {},
  "key_values": [],
  "layout": [],
  "lines": [
    {
      "confidence": 99.2,
      "page": 1,
      "text": "Employment Application"
    },
    {
      "confidence": 99.2,
      "page": 1,
      "text": "Full Name: Jane Doe"
    },
    {
      "confidence": 99.2,
      "page": 1,
      "text": "Employer Name Position Held"
    }
  ],
  "pages": 1,
  "query_answers": [],
  "raw": {
    "Blocks": [
      {
        "BlockType": "PAGE",
        "Confidence": 99.2,
        "Id": "p1",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "l1",
              "l2",
              "l3"
            ],
            "Type": "CHILD"
          }
        ]
      },
      {
        "BlockType": "LINE",
        "Confidence": 99.2,
        "Id": "l1",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "w1",
              "w2"
            ],
            "Type": "CHILD"
          }
        ],
        "Text": "Employment Application"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w1",
        "Page": 1,
        "Text": "Employment",
        "TextType": "PRINTED"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w2",
        "Page": 1,
        "Text": "Application",
        "TextType": "PRINTED"
      },
      {
        "BlockType": "LINE",
        "Confidence": 99.2,
        "Id": "l2",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "w3",
              "w4",
              "w5",
              "w5b"
            ],
            "Type": "CHILD"
          }
        ],
        "Text": "Full Name: Jane Doe"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w3",
        "Page": 1,
        "Text": "Full"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w4",
        "Page": 1,
        "Text": "Name:"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w5",
        "Page": 1,
        "Text": "Jane"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w5b",
        "Page": 1,
        "Text": "Doe"
      },
      {
        "BlockType": "LINE",
        "Confidence": 99.2,
        "Id": "l3",
        "Page": 1,
        "Text": "Employer Name Position Held"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w6",
        "Page": 1,
        "Text": "Employer"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w7",
        "Page": 1,
        "Text": "Position"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w8",
        "Page": 1,
        "Text": "AnyCompany"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w9",
        "Page": 1,
        "Text": "Baker"
      }
    ],
    "DetectDocumentTextModelVersion": "1.0",
    "DocumentMetadata": {
      "Pages": 1
    }
  },
  "signatures": [],
  "tables": [],
  "text": "Employment Application\nFull Name: Jane Doe\nEmployer Name Position Held"
}
```

### Extract text from multi-page document

Read all the text in a PDF or TIFF of any length (up to 3,000 pages), line by line, waiting for Textract to finish. Needs an S3 bucket on the connection, or a document already in S3.

**Inputs**

- Document (`document`, text, required): Upload a PDF, TIFF, JPEG or PNG, pick a file from an earlier step, or give a link or an S3 address (s3://bucket/file) in the connection's region. Lodol puts an uploaded file or link in the connection's S3 bucket for Textract to read, and deletes it once the results are in (it stays if the step stops waiting first). PDF and TIFF files of any length; images up to 10 MB.
- Wait for results (`wait_seconds`, number): How many seconds to wait for Textract to finish, checking every 5 seconds, up to 600. Most documents take under a minute. Set 0 to start the job and read its results later with the matching Get step. From 0 to 600. Default: `300`.

**Outputs**

- `answers` (object): Each question's answer, by question.
- `blocks_truncated` (true/false): Whether raw holds only the first 5,000 blocks.
- `document_location` (text): The s3:// address Textract read the document from.
- `fields` (object): Each form label's value, by label, such as fields['Full Name']. A label seen again gets ' (2)' after it.
- `finished` (true/false): Whether the results are in.
- `job_id` (text): The job's ID, for the matching Get step.
- `key_values` (list): Every form label with its value (with Forms).
- `layout` (list): The page's parts in reading order (with Layout).
- `lines` (list): Every line of text, in reading order.
- `pages` (number): How many pages the document has.
- `query_answers` (list): Each question's answer (with Questions).
- `raw` (object): Textract's own answer, with up to 5,000 of its blocks.
- `signatures` (list): Every signature found (with Signatures).
- `status` (text): IN_PROGRESS, SUCCEEDED, PARTIAL_SUCCESS or FAILED.
- `status_message` (text): Textract's note on the job, if any.
- `tables` (list): Every table (with Tables).
- `text` (text): All the text, line by line, with a blank line between pages.
- `warnings` (list): Pages Textract couldn't read in full.

**Example output**

```json
{
  "answers": {},
  "blocks_truncated": false,
  "document_location": "s3://my-documents/lodol-textract/3f2a9c1d/application.pdf",
  "fields": {},
  "finished": true,
  "job_id": "8f1c6a0e2b7d4c93a5e1f0b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2",
  "key_values": [],
  "layout": [],
  "lines": [
    {
      "confidence": 99.2,
      "page": 1,
      "text": "Employment Application"
    },
    {
      "confidence": 99.2,
      "page": 1,
      "text": "Full Name: Jane Doe"
    },
    {
      "confidence": 99.2,
      "page": 1,
      "text": "Employer Name Position Held"
    }
  ],
  "pages": 1,
  "query_answers": [],
  "raw": {
    "Blocks": [
      {
        "BlockType": "PAGE",
        "Confidence": 99.2,
        "Id": "p1",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "l1",
              "l2",
              "l3"
            ],
            "Type": "CHILD"
          }
        ]
      },
      {
        "BlockType": "LINE",
        "Confidence": 99.2,
        "Id": "l1",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "w1",
              "w2"
            ],
            "Type": "CHILD"
          }
        ],
        "Text": "Employment Application"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w1",
        "Page": 1,
        "Text": "Employment",
        "TextType": "PRINTED"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w2",
        "Page": 1,
        "Text": "Application",
        "TextType": "PRINTED"
      },
      {
        "BlockType": "LINE",
        "Confidence": 99.2,
        "Id": "l2",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "w3",
              "w4",
              "w5",
              "w5b"
            ],
            "Type": "CHILD"
          }
        ],
        "Text": "Full Name: Jane Doe"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w3",
        "Page": 1,
        "Text": "Full"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w4",
        "Page": 1,
        "Text": "Name:"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w5",
        "Page": 1,
        "Text": "Jane"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w5b",
        "Page": 1,
        "Text": "Doe"
      },
      {
        "BlockType": "LINE",
        "Confidence": 99.2,
        "Id": "l3",
        "Page": 1,
        "Text": "Employer Name Position Held"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w6",
        "Page": 1,
        "Text": "Employer"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w7",
        "Page": 1,
        "Text": "Position"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w8",
        "Page": 1,
        "Text": "AnyCompany"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w9",
        "Page": 1,
        "Text": "Baker"
      }
    ],
    "DetectDocumentTextModelVersion": "1.0",
    "DocumentMetadata": {
      "Pages": 1
    }
  },
  "signatures": [],
  "status": "SUCCEEDED",
  "status_message": null,
  "tables": [],
  "text": "Employment Application\nFull Name: Jane Doe\nEmployer Name Position Held",
  "warnings": []
}
```

### Get adapter

Get an adapter's name, description, features and settings.

**Inputs**

- Adapter (`adapter_id`, text, required): The adapter. Pick it, or give its ID from List adapters.

**Outputs**

- `adapter_id` (text): The adapter's ID.
- `adapter_name` (text): Its name.
- `auto_update` (text): ENABLED or DISABLED: whether it is retrained when Textract updates.
- `created_at` (text): When it was created, in UTC.
- `description` (text): Its description.
- `features` (list): What it was made for: QUERIES, TABLES and so on.

**Example output**

```json
{
  "adapter_id": "2e9bf1b0f2a8",
  "adapter_name": "invoice-queries",
  "auto_update": "DISABLED",
  "created_at": "2026-10-20T09:15:02Z",
  "description": "Reads our suppliers' invoices",
  "features": [
    "QUERIES"
  ]
}
```

### Get adapter version

Get an adapter version's training status and, once trained, how well it reads each feature compared with Textract alone.

**Inputs**

- Adapter (`adapter_id`, text, required): The adapter. Pick it, or give its ID from List adapters.
- Adapter version (`adapter_version`, text, required): The version, such as 1. Pick it, or give it from List adapter versions.

**Outputs**

- `adapter_id` (text): The adapter's ID.
- `adapter_version` (text): The version's number.
- `created_at` (text): When it was created, in UTC.
- `evaluation` (list): Its scores against the test set.
- `features` (list): What it was trained for.
- `manifest` (text): The s3:// address of the dataset it was trained on.
- `output_location` (text): The s3:// address its training results went to.
- `status` (text): ACTIVE, CREATION_IN_PROGRESS, CREATION_ERROR, AT_RISK or DEPRECATED.
- `status_message` (text): Textract's note on the status.

**Example output**

```json
{
  "adapter_id": "2e9bf1b0f2a8",
  "adapter_version": "1",
  "created_at": "2026-10-21T10:00:00Z",
  "evaluation": [
    {
      "baseline_f1_score": 0.81,
      "f1_score": 0.94,
      "feature": "QUERIES",
      "precision": 0.95,
      "recall": 0.93
    }
  ],
  "features": [
    "QUERIES"
  ],
  "manifest": "s3://my-documents/adapter/manifest.jsonl",
  "output_location": "s3://my-documents/adapter-output/",
  "status": "ACTIVE",
  "status_message": null
}
```

### Get document analysis results

Read the results of a document analysis job by its ID, waiting for it if it is still running.

**Inputs**

- Job ID (`job_id`, text, required): The job ID that Analyze multi-page document returned.
- Wait for results (`wait_seconds`, number): How many seconds to wait for a job that is still running, checking every 5 seconds, up to 600. Set 0 to read the job as it is now. From 0 to 600. Default: `300`.

**Outputs**

- `answers` (object): Each question's answer, by question.
- `blocks_truncated` (true/false): Whether raw holds only the first 5,000 blocks.
- `document_location` (text): The s3:// address Textract read the document from.
- `fields` (object): Each form label's value, by label, such as fields['Full Name']. A label seen again gets ' (2)' after it.
- `finished` (true/false): Whether the results are in.
- `job_id` (text): The job's ID, for the matching Get step.
- `key_values` (list): Every form label with its value (with Forms).
- `layout` (list): The page's parts in reading order (with Layout).
- `lines` (list): Every line of text, in reading order.
- `pages` (number): How many pages the document has.
- `query_answers` (list): Each question's answer (with Questions).
- `raw` (object): Textract's own answer, with up to 5,000 of its blocks.
- `signatures` (list): Every signature found (with Signatures).
- `status` (text): IN_PROGRESS, SUCCEEDED, PARTIAL_SUCCESS or FAILED.
- `status_message` (text): Textract's note on the job, if any.
- `tables` (list): Every table (with Tables).
- `text` (text): All the text, line by line, with a blank line between pages.
- `warnings` (list): Pages Textract couldn't read in full.

**Example output**

```json
{
  "answers": {
    "What is the applicant's phone number?": "555-0100"
  },
  "blocks_truncated": false,
  "document_location": null,
  "fields": {
    "Full Name": "Jane Doe"
  },
  "finished": true,
  "job_id": "8f1c6a0e2b7d4c93a5e1f0b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2",
  "key_values": [
    {
      "confidence": 99.2,
      "key": "Full Name",
      "page": 1,
      "selected": null,
      "value": "Jane Doe"
    }
  ],
  "layout": [
    {
      "page": 1,
      "text": "Employment Application",
      "type": "title"
    }
  ],
  "lines": [
    {
      "confidence": 99.2,
      "page": 1,
      "text": "Employment Application"
    },
    {
      "confidence": 99.2,
      "page": 1,
      "text": "Full Name: Jane Doe"
    },
    {
      "confidence": 99.2,
      "page": 1,
      "text": "Employer Name Position Held"
    }
  ],
  "pages": 1,
  "query_answers": [
    {
      "alias": null,
      "answer": "555-0100",
      "confidence": 99.2,
      "page": 1,
      "question": "What is the applicant's phone number?"
    }
  ],
  "raw": {
    "AnalyzeDocumentModelVersion": "1.0",
    "Blocks": [
      {
        "BlockType": "PAGE",
        "Confidence": 99.2,
        "Id": "p1",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "l1",
              "l2",
              "l3"
            ],
            "Type": "CHILD"
          }
        ]
      },
      {
        "BlockType": "LINE",
        "Confidence": 99.2,
        "Id": "l1",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "w1",
              "w2"
            ],
            "Type": "CHILD"
          }
        ],
        "Text": "Employment Application"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w1",
        "Page": 1,
        "Text": "Employment",
        "TextType": "PRINTED"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w2",
        "Page": 1,
        "Text": "Application",
        "TextType": "PRINTED"
      },
      {
        "BlockType": "LINE",
        "Confidence": 99.2,
        "Id": "l2",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "w3",
              "w4",
              "w5",
              "w5b"
            ],
            "Type": "CHILD"
          }
        ],
        "Text": "Full Name: Jane Doe"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w3",
        "Page": 1,
        "Text": "Full"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w4",
        "Page": 1,
        "Text": "Name:"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w5",
        "Page": 1,
        "Text": "Jane"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w5b",
        "Page": 1,
        "Text": "Doe"
      },
      {
        "BlockType": "LINE",
        "Confidence": 99.2,
        "Id": "l3",
        "Page": 1,
        "Text": "Employer Name Position Held"
      },
      {
        "BlockType": "KEY_VALUE_SET",
        "Confidence": 99.2,
        "EntityTypes": [
          "KEY"
        ],
        "Id": "k1",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "v1"
            ],
            "Type": "VALUE"
          },
          {
            "Ids": [
              "w3",
              "w4"
            ],
            "Type": "CHILD"
          }
        ]
      },
      {
        "BlockType": "KEY_VALUE_SET",
        "Confidence": 99.2,
        "EntityTypes": [
          "VALUE"
        ],
        "Id": "v1",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "w5",
              "w5b"
            ],
            "Type": "CHILD"
          }
        ]
      },
      {
        "BlockType": "TABLE",
        "Confidence": 99.2,
        "EntityTypes": [
          "STRUCTURED_TABLE"
        ],
        "Id": "t1",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "c1",
              "c2",
              "c3",
              "c4"
            ],
            "Type": "CHILD"
          }
        ]
      },
      {
        "BlockType": "CELL",
        "ColumnIndex": 1,
        "Confidence": 99.2,
        "EntityTypes": [
          "COLUMN_HEADER"
        ],
        "Id": "c1",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "w6"
            ],
            "Type": "CHILD"
          }
        ],
        "RowIndex": 1
      },
      {
        "BlockType": "CELL",
        "ColumnIndex": 2,
        "Confidence": 99.2,
        "EntityTypes": [
          "COLUMN_HEADER"
        ],
        "Id": "c2",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "w7"
            ],
            "Type": "CHILD"
          }
        ],
        "RowIndex": 1
      },
      {
        "BlockType": "CELL",
        "ColumnIndex": 1,
        "Confidence": 99.2,
        "Id": "c3",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "w8"
            ],
            "Type": "CHILD"
          }
        ],
        "RowIndex": 2
      },
      {
        "BlockType": "CELL",
        "ColumnIndex": 2,
        "Confidence": 99.2,
        "Id": "c4",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "w9"
            ],
            "Type": "CHILD"
          }
        ],
        "RowIndex": 2
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w6",
        "Page": 1,
        "Text": "Employer"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w7",
        "Page": 1,
        "Text": "Position"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w8",
        "Page": 1,
        "Text": "AnyCompany"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w9",
        "Page": 1,
        "Text": "Baker"
      },
      {
        "BlockType": "QUERY",
        "Confidence": 99.2,
        "Id": "q1",
        "Page": 1,
        "Query": {
          "Text": "What is the applicant's phone number?"
        },
        "Relationships": [
          {
            "Ids": [
              "a1"
            ],
            "Type": "ANSWER"
          }
        ]
      },
      {
        "BlockType": "QUERY_RESULT",
        "Confidence": 99.2,
        "Id": "a1",
        "Page": 1,
        "Text": "555-0100"
      },
      {
        "BlockType": "SIGNATURE",
        "Confidence": 99.2,
        "Id": "s1",
        "Page": 1
      },
      {
        "BlockType": "LAYOUT_TITLE",
        "Confidence": 99.2,
        "Id": "y1",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "l1"
            ],
            "Type": "CHILD"
          }
        ]
      }
    ],
    "DocumentMetadata": {
      "Pages": 1
    }
  },
  "signatures": [
    {
      "confidence": 99.2,
      "page": 1
    }
  ],
  "status": "SUCCEEDED",
  "status_message": null,
  "tables": [
    {
      "column_count": 2,
      "confidence": 99.2,
      "page": 1,
      "records": [
        {
          "Employer": "AnyCompany",
          "Position": "Baker"
        }
      ],
      "row_count": 2,
      "rows": [
        [
          "Employer",
          "Position"
        ],
        [
          "AnyCompany",
          "Baker"
        ]
      ],
      "title": null
    }
  ],
  "text": "Employment Application\nFull Name: Jane Doe\nEmployer Name Position Held",
  "warnings": []
}
```

### Get invoice and receipt results

Read the results of an invoice and receipt job by its ID, waiting for it if it is still running.

**Inputs**

- Job ID (`job_id`, text, required): The job ID that Analyze multi-page invoices and receipts returned.
- Wait for results (`wait_seconds`, number): How many seconds to wait for a job that is still running, checking every 5 seconds, up to 600. Set 0 to read the job as it is now. From 0 to 600. Default: `300`.

**Outputs**

- `amount_due` (text): The amount due, as printed.
- `blocks_truncated` (true/false): Whether raw holds only the first 5,000 blocks.
- `currency` (text): The currency code Textract found, such as USD.
- `document_location` (text): The s3:// address Textract read the document from.
- `documents` (list): Each invoice or receipt in the file; the fields above are the first one's.
- `due_date` (text): When payment is due, as printed.
- `finished` (true/false): Whether the results are in.
- `invoice_receipt_date` (text): Its date, as printed.
- `invoice_receipt_id` (text): The invoice or receipt number.
- `job_id` (text): The job's ID, for the matching Get step.
- `line_items` (list): Every line item.
- `pages` (number): How many pages the document has.
- `raw` (object): Textract's own answer, with up to 5,000 of its blocks.
- `status` (text): IN_PROGRESS, SUCCEEDED, PARTIAL_SUCCESS or FAILED.
- `status_message` (text): Textract's note on the job, if any.
- `subtotal` (text): The subtotal, as printed.
- `summary` (object): Every field at the top of the document, by name, such as summary['TOTAL'].
- `summary_fields` (list): Every summary field, with its label and confidence.
- `tax` (text): The tax, as printed.
- `total` (text): The total, as printed.
- `vendor_name` (text): Who issued it.
- `warnings` (list): Pages Textract couldn't read in full.

**Example output**

```json
{
  "amount_due": null,
  "blocks_truncated": false,
  "currency": "USD",
  "document_location": null,
  "documents": [
    {
      "currency": "USD",
      "index": 1,
      "line_items": [
        {
          "ITEM": "Sourdough loaf",
          "PRICE": "$27.50",
          "QUANTITY": "5"
        }
      ],
      "summary": {
        "INVOICE_RECEIPT_DATE": "05/10/2026",
        "INVOICE_RECEIPT_ID": "INV-1042",
        "TOTAL": "$27.50",
        "VENDOR_NAME": "AnyCompany Bakery"
      }
    }
  ],
  "due_date": null,
  "finished": true,
  "invoice_receipt_date": "05/10/2026",
  "invoice_receipt_id": "INV-1042",
  "job_id": "8f1c6a0e2b7d4c93a5e1f0b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2",
  "line_items": [
    {
      "ITEM": "Sourdough loaf",
      "PRICE": "$27.50",
      "QUANTITY": "5"
    }
  ],
  "pages": 1,
  "raw": {
    "DocumentMetadata": {
      "Pages": 1
    },
    "ExpenseDocuments": [
      {
        "Blocks": [],
        "ExpenseIndex": 1,
        "LineItemGroups": [
          {
            "LineItemGroupIndex": 1,
            "LineItems": [
              {
                "LineItemExpenseFields": [
                  {
                    "Type": {
                      "Text": "ITEM"
                    },
                    "ValueDetection": {
                      "Text": "Sourdough loaf"
                    }
                  },
                  {
                    "Type": {
                      "Text": "QUANTITY"
                    },
                    "ValueDetection": {
                      "Text": "5"
                    }
                  },
                  {
                    "Type": {
                      "Text": "PRICE"
                    },
                    "ValueDetection": {
                      "Text": "$27.50"
                    }
                  }
                ]
              }
            ]
          }
        ],
        "SummaryFields": [
          {
            "PageNumber": 1,
            "Type": {
              "Confidence": 99.1,
              "Text": "VENDOR_NAME"
            },
            "ValueDetection": {
              "Confidence": 98.7,
              "Text": "AnyCompany Bakery"
            }
          },
          {
            "LabelDetection": {
              "Confidence": 99.0,
              "Text": "Invoice No:"
            },
            "PageNumber": 1,
            "Type": {
              "Confidence": 99.0,
              "Text": "INVOICE_RECEIPT_ID"
            },
            "ValueDetection": {
              "Confidence": 97.4,
              "Text": "INV-1042"
            }
          },
          {
            "LabelDetection": {
              "Confidence": 99.0,
              "Text": "Date"
            },
            "PageNumber": 1,
            "Type": {
              "Confidence": 99.0,
              "Text": "INVOICE_RECEIPT_DATE"
            },
            "ValueDetection": {
              "Confidence": 98.0,
              "Text": "05/10/2026"
            }
          },
          {
            "Currency": {
              "Code": "USD",
              "Confidence": 95.0
            },
            "LabelDetection": {
              "Confidence": 99.5,
              "Text": "Total"
            },
            "PageNumber": 1,
            "Type": {
              "Confidence": 99.5,
              "Text": "TOTAL"
            },
            "ValueDetection": {
              "Confidence": 99.1,
              "Text": "$27.50"
            }
          }
        ]
      }
    ]
  },
  "status": "SUCCEEDED",
  "status_message": null,
  "subtotal": null,
  "summary": {
    "INVOICE_RECEIPT_DATE": "05/10/2026",
    "INVOICE_RECEIPT_ID": "INV-1042",
    "TOTAL": "$27.50",
    "VENDOR_NAME": "AnyCompany Bakery"
  },
  "summary_fields": [
    {
      "confidence": 98.7,
      "currency": null,
      "groups": [],
      "label": null,
      "page": 1,
      "type": "VENDOR_NAME",
      "value": "AnyCompany Bakery"
    },
    {
      "confidence": 97.4,
      "currency": null,
      "groups": [],
      "label": "Invoice No:",
      "page": 1,
      "type": "INVOICE_RECEIPT_ID",
      "value": "INV-1042"
    },
    {
      "confidence": 98.0,
      "currency": null,
      "groups": [],
      "label": "Date",
      "page": 1,
      "type": "INVOICE_RECEIPT_DATE",
      "value": "05/10/2026"
    },
    {
      "confidence": 99.1,
      "currency": "USD",
      "groups": [],
      "label": "Total",
      "page": 1,
      "type": "TOTAL",
      "value": "$27.50"
    }
  ],
  "tax": null,
  "total": "$27.50",
  "vendor_name": "AnyCompany Bakery",
  "warnings": []
}
```

### Get lending analysis results

Read each page's kind and fields from a lending analysis job by its ID, waiting for it if it is still running.

**Inputs**

- Job ID (`job_id`, text, required): The job ID that Analyze lending documents returned.
- Wait for results (`wait_seconds`, number): How many seconds to wait for a job that is still running, checking every 5 seconds, up to 600. Set 0 to read the job as it is now. From 0 to 600. Default: `300`.

**Outputs**

- `blocks_truncated` (true/false): Whether raw holds only the first 5,000 blocks.
- `document_location` (text): The s3:// address Textract read the document from.
- `finished` (true/false): Whether the results are in.
- `job_id` (text): The job's ID, for the matching Get step.
- `pages` (number): How many pages the packet has.
- `raw` (object): Textract's own answer, with up to 5,000 of its blocks.
- `results` (list): Each page, classified, with its fields.
- `status` (text): IN_PROGRESS, SUCCEEDED, PARTIAL_SUCCESS or FAILED.
- `status_message` (text): Textract's note on the job, if any.
- `warnings` (list): Pages Textract couldn't read in full.

**Example output**

```json
{
  "blocks_truncated": false,
  "document_location": null,
  "finished": true,
  "job_id": "8f1c6a0e2b7d4c93a5e1f0b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2",
  "pages": 1,
  "raw": {
    "DocumentMetadata": {
      "Pages": 1
    },
    "JobStatus": "SUCCEEDED",
    "Results": [
      {
        "Extractions": [
          {
            "LendingDocument": {
              "LendingFields": [
                {
                  "Type": "OVERTIME_CONTINUANCE_LIKELY",
                  "ValueDetections": [
                    {
                      "Confidence": 95.0,
                      "Text": "Yes"
                    }
                  ]
                },
                {
                  "KeyDetection": {
                    "Confidence": 99.98,
                    "Text": "Weekly"
                  },
                  "Type": "CURRENT_GROSS_PAY_WEEKLY",
                  "ValueDetections": [
                    {
                      "Confidence": 99.6,
                      "SelectionStatus": "NOT_SELECTED"
                    }
                  ]
                }
              ],
              "SignatureDetections": [
                {
                  "Confidence": 98.0
                }
              ]
            }
          }
        ],
        "Page": 1,
        "PageClassification": {
          "PageNumber": [
            {
              "Confidence": 100.0,
              "Value": "undetected"
            }
          ],
          "PageType": [
            {
              "Confidence": 99.99,
              "Value": "1005"
            }
          ]
        }
      }
    ]
  },
  "results": [
    {
      "fields": {
        "CURRENT_GROSS_PAY_WEEKLY": "not selected",
        "OVERTIME_CONTINUANCE_LIKELY": "Yes"
      },
      "page": 1,
      "page_type": "1005",
      "page_type_confidence": 100.0,
      "signature_count": 1
    }
  ],
  "status": "SUCCEEDED",
  "status_message": null,
  "warnings": []
}
```

### Get lending analysis summary

Summarise a lending analysis job by its ID: the documents in the packet grouped by kind, with their pages, pages missing a signature, and the kinds of document Textract didn't find.

**Inputs**

- Job ID (`job_id`, text, required): The job ID that Analyze lending documents returned.
- Wait for results (`wait_seconds`, number): How many seconds to wait for a job that is still running, checking every 5 seconds, up to 600. Set 0 to read the job as it is now. From 0 to 600. Default: `300`.

**Outputs**

- `document_groups` (list): The packet's documents, grouped by kind.
- `document_location` (text): The s3:// address Textract read the document from.
- `finished` (true/false): Whether the results are in.
- `job_id` (text): The job's ID, for the matching Get step.
- `pages` (number): How many pages the packet has.
- `raw` (object): Textract's own answer.
- `status` (text): IN_PROGRESS, SUCCEEDED, PARTIAL_SUCCESS or FAILED.
- `status_message` (text): Textract's note on the job, if any.
- `undetected_document_types` (list): Kinds of document Textract looked for and didn't find.
- `warnings` (list): Pages Textract couldn't read in full.

**Example output**

```json
{
  "document_groups": [
    {
      "document_count": 1,
      "documents": [
        {
          "index": 1,
          "pages": [
            1,
            2
          ]
        }
      ],
      "signed_pages": [
        2
      ],
      "type": "PAYSLIPS",
      "unsigned_pages": []
    },
    {
      "document_count": 1,
      "documents": [
        {
          "index": 1,
          "pages": [
            3
          ]
        }
      ],
      "signed_pages": [],
      "type": "BANK_STATEMENT",
      "unsigned_pages": [
        3
      ]
    }
  ],
  "document_location": null,
  "finished": true,
  "job_id": "8f1c6a0e2b7d4c93a5e1f0b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2",
  "pages": 3,
  "raw": {
    "DocumentMetadata": {
      "Pages": 3
    },
    "JobStatus": "SUCCEEDED",
    "Summary": {
      "DocumentGroups": [
        {
          "DetectedSignatures": [
            {
              "Page": 2
            }
          ],
          "SplitDocuments": [
            {
              "Index": 1,
              "Pages": [
                1,
                2
              ]
            }
          ],
          "Type": "PAYSLIPS",
          "UndetectedSignatures": []
        },
        {
          "DetectedSignatures": [],
          "SplitDocuments": [
            {
              "Index": 1,
              "Pages": [
                3
              ]
            }
          ],
          "Type": "BANK_STATEMENT",
          "UndetectedSignatures": [
            {
              "Page": 3
            }
          ]
        }
      ],
      "UndetectedDocumentTypes": [
        "W2"
      ]
    }
  },
  "status": "SUCCEEDED",
  "status_message": null,
  "undetected_document_types": [
    "W2"
  ],
  "warnings": []
}
```

### Get text extraction results

Read the results of a text extraction job by its ID, waiting for it if it is still running.

**Inputs**

- Job ID (`job_id`, text, required): The job ID that Extract text from multi-page document returned.
- Wait for results (`wait_seconds`, number): How many seconds to wait for a job that is still running, checking every 5 seconds, up to 600. Set 0 to read the job as it is now. From 0 to 600. Default: `300`.

**Outputs**

- `answers` (object): Each question's answer, by question.
- `blocks_truncated` (true/false): Whether raw holds only the first 5,000 blocks.
- `document_location` (text): The s3:// address Textract read the document from.
- `fields` (object): Each form label's value, by label, such as fields['Full Name']. A label seen again gets ' (2)' after it.
- `finished` (true/false): Whether the results are in.
- `job_id` (text): The job's ID, for the matching Get step.
- `key_values` (list): Every form label with its value (with Forms).
- `layout` (list): The page's parts in reading order (with Layout).
- `lines` (list): Every line of text, in reading order.
- `pages` (number): How many pages the document has.
- `query_answers` (list): Each question's answer (with Questions).
- `raw` (object): Textract's own answer, with up to 5,000 of its blocks.
- `signatures` (list): Every signature found (with Signatures).
- `status` (text): IN_PROGRESS, SUCCEEDED, PARTIAL_SUCCESS or FAILED.
- `status_message` (text): Textract's note on the job, if any.
- `tables` (list): Every table (with Tables).
- `text` (text): All the text, line by line, with a blank line between pages.
- `warnings` (list): Pages Textract couldn't read in full.

**Example output**

```json
{
  "answers": {},
  "blocks_truncated": false,
  "document_location": null,
  "fields": {},
  "finished": true,
  "job_id": "8f1c6a0e2b7d4c93a5e1f0b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2",
  "key_values": [],
  "layout": [],
  "lines": [
    {
      "confidence": 99.2,
      "page": 1,
      "text": "Employment Application"
    },
    {
      "confidence": 99.2,
      "page": 1,
      "text": "Full Name: Jane Doe"
    },
    {
      "confidence": 99.2,
      "page": 1,
      "text": "Employer Name Position Held"
    }
  ],
  "pages": 1,
  "query_answers": [],
  "raw": {
    "Blocks": [
      {
        "BlockType": "PAGE",
        "Confidence": 99.2,
        "Id": "p1",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "l1",
              "l2",
              "l3"
            ],
            "Type": "CHILD"
          }
        ]
      },
      {
        "BlockType": "LINE",
        "Confidence": 99.2,
        "Id": "l1",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "w1",
              "w2"
            ],
            "Type": "CHILD"
          }
        ],
        "Text": "Employment Application"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w1",
        "Page": 1,
        "Text": "Employment",
        "TextType": "PRINTED"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w2",
        "Page": 1,
        "Text": "Application",
        "TextType": "PRINTED"
      },
      {
        "BlockType": "LINE",
        "Confidence": 99.2,
        "Id": "l2",
        "Page": 1,
        "Relationships": [
          {
            "Ids": [
              "w3",
              "w4",
              "w5",
              "w5b"
            ],
            "Type": "CHILD"
          }
        ],
        "Text": "Full Name: Jane Doe"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w3",
        "Page": 1,
        "Text": "Full"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w4",
        "Page": 1,
        "Text": "Name:"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w5",
        "Page": 1,
        "Text": "Jane"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w5b",
        "Page": 1,
        "Text": "Doe"
      },
      {
        "BlockType": "LINE",
        "Confidence": 99.2,
        "Id": "l3",
        "Page": 1,
        "Text": "Employer Name Position Held"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w6",
        "Page": 1,
        "Text": "Employer"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w7",
        "Page": 1,
        "Text": "Position"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w8",
        "Page": 1,
        "Text": "AnyCompany"
      },
      {
        "BlockType": "WORD",
        "Confidence": 99.2,
        "Id": "w9",
        "Page": 1,
        "Text": "Baker"
      }
    ],
    "DetectDocumentTextModelVersion": "1.0",
    "DocumentMetadata": {
      "Pages": 1
    }
  },
  "signatures": [],
  "status": "SUCCEEDED",
  "status_message": null,
  "tables": [],
  "text": "Employment Application\nFull Name: Jane Doe\nEmployer Name Position Held",
  "warnings": []
}
```

### List adapter versions

List the versions of an adapter (or of every adapter), with each one's training status.

**Inputs**

- Adapter (`adapter_id`, text): Only this adapter's versions. Leave empty for every adapter's.
- Created after (`created_after`, date and time): Only those created after this moment.
- Created before (`created_before`, date and time): Only those created before this moment.

**Outputs**

- `count` (number): How many there are.
- `versions` (list): The versions.

**Example output**

```json
{
  "count": 1,
  "versions": [
    {
      "adapter_id": "2e9bf1b0f2a8",
      "adapter_version": "1",
      "created_at": "2026-10-21T10:00:00Z",
      "evaluation": [
        {
          "baseline_f1_score": 0.81,
          "f1_score": 0.94,
          "feature": "QUERIES",
          "precision": 0.95,
          "recall": 0.93
        }
      ],
      "features": [
        "QUERIES"
      ],
      "manifest": "s3://my-documents/adapter/manifest.jsonl",
      "output_location": "s3://my-documents/adapter-output/",
      "status": "ACTIVE",
      "status_message": null
    }
  ]
}
```

### List adapters

List the adapters in the connection's region, optionally only those created in a time window.

**Inputs**

- Created after (`created_after`, date and time): Only those created after this moment.
- Created before (`created_before`, date and time): Only those created before this moment.

**Outputs**

- `adapters` (list): The adapters.
- `count` (number): How many there are.

**Example output**

```json
{
  "adapters": [
    {
      "adapter_id": "2e9bf1b0f2a8",
      "adapter_name": "invoice-queries",
      "auto_update": "DISABLED",
      "created_at": "2026-10-20T09:15:02Z",
      "description": "Reads our suppliers' invoices",
      "features": [
        "QUERIES"
      ]
    }
  ],
  "count": 1
}
```

### Update adapter

Rename an adapter, change its description, or turn its auto update on or off.

**Inputs**

- Adapter (`adapter_id`, text, required): The adapter. Pick it, or give its ID from List adapters.
- New name (`adapter_name`, text): A new name, using letters, digits, '-' and '_'.
- Description (`description`, text): What the adapter is for, up to 256 characters of plain text.
- Auto update (`auto_update`, text): Whether Textract retrains the adapter when it updates its own model. One of: `ENABLED` (Retrain when Textract updates its model), `DISABLED` (Keep it as trained).

**Outputs**

- `adapter_id` (text): The adapter's ID.
- `adapter_name` (text): Its name.
- `auto_update` (text): ENABLED or DISABLED: whether it is retrained when Textract updates.
- `created_at` (text): When it was created, in UTC.
- `description` (text): Its description.
- `features` (list): What it was made for: QUERIES, TABLES and so on.

**Example output**

```json
{
  "adapter_id": "2e9bf1b0f2a8",
  "adapter_name": "invoice-queries",
  "auto_update": "DISABLED",
  "created_at": "2026-10-20T09:15:02Z",
  "description": "Reads our suppliers' invoices",
  "features": [
    "QUERIES"
  ]
}
```
