POST
/
split
Split Document into Sections
curl --request POST \
  --url https://api.trycardinal.ai/split \
  --header 'Content-Type: multipart/form-data' \
  --header 'x-api-key: <api-key>' \
  --form 'fileUrl=<string>' \
  --form 'queries=<string>' \
  --form file=@example-file
{
  "success": true,
  "pages": [
    {
      "content": "ACME CORPORATION Annual Report...",
      "page_number": 1
    },
    {
      "content": "Financial Summary Table...",
      "page_number": 2
    }
  ],
  "partitions": [
    {
      "name": "cover_pages",
      "description": "Title pages, cover sheets, or document headers",
      "pages": [
        1
      ]
    },
    {
      "name": "financial_data",
      "description": "Pages with financial tables, revenue data, or numerical information",
      "pages": [
        2,
        5,
        6
      ]
    },
    {
      "name": "appendices",
      "description": "Supporting documents, references, or supplementary materials",
      "pages": [
        7,
        8,
        9
      ]
    }
  ]
}

Authorizations

x-api-key
string
header
required

Body

multipart/form-data
file
file
required

PDF or image file to upload (required if no document_url). Allowed: .pdf, .jpg, .jpeg, .png

queries
string
required

Required string containing array of queries. Each query must have 'name' (section label) and 'description' (natural language hint for identifying pages).

fileUrl
string<uri>

Publicly accessible URL of the file to process (required if no file).

Response

Successful document partitioning

success
boolean
required
pages
object[]
required

Array of page objects with extracted content

partitions
object[]
required

Array of partition results with classified page ranges