---
title: "Extract Lines Endpoint"
method: POST
path: "/api/v1/extract_lines"
---

# Extract Lines Endpoint

`POST /api/v1/extract_lines`

## Request body

- ExtractLinesRequest
  - `key_value_pairs` string, nullable
  - `key_value_pairs_s3` object, nullable
  - `textract_text` string, required
  - `textract_raw_expense_s3` object, nullable

## Response `200`

Successful Response

- ExtractLinesResponse
  - `run_id` string, required
  - `extracted_data` AppSchemasDocumentsLineItem[], required
    - `id` integer, nullable
    - `cancellation` boolean, nullable
    - `claim_type` string, required
    - `description` string, required
    - `early_childhood` boolean, nullable
    - `line_total` number, required
    - `quantity` number, required
    - `service_date_from` string, nullable
    - `service_date_to` string, nullable
    - `service_item_number` string, nullable
    - `service_item_number_inferred` boolean, nullable
    - `service_type` string, nullable
    - `time_from` integer, nullable
    - `time_to` integer, nullable
    - `unit_price` number, nullable
    - `line_tax` number, nullable
    - `method` string, nullable
    - `line_total_valid` boolean, nullable
    - `gst_code` string, nullable
    - `fallback_data` object[], nullable
    - `has_business_violations` boolean, nullable
    - `business_violation_messages` string[], nullable
    - `business_violation_types` string[], nullable
    - `page_number` integer, nullable
    - `coordinates` object, nullable
    - `location_source` string, nullable

## Other responses

- `422` — Validation Error

## Changes

- **2026-09-17** `9d2892eca00b` — 2 info
  - added the optional property `extracted_data/items/location_source` to the response with the `200` status
  - added the optional property `extracted_data/items/service_item_number_inferred` to the response with the `200` status

[Change history](https://skmtc.dev/caresquare/apis/fastapi/changes/api/v1/extract_lines/post.md)

---

[API](https://skmtc.dev/caresquare/apis/fastapi.md) · [All operations](https://skmtc.dev/caresquare/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc.dev/caresquare/apis/fastapi/revisions/e4798856d733?raw)
