An ingestion runs the full convert → split → shape → extract pipeline as a single managed job and loads the result into a workspace. You get orchestration, retries, and cancellation handling without chaining the tools yourself.

Prerequisites

  • An AiQL API key in the AIQL_API_KEY environment variable
  • A workspace ID (see Quickstart to create one)
  • A source document AiQL can reach

Start the ingestion

Pass the source document and the workspace ID in the AiQL-Workspace header. Unlike the individual tools, ingestions operate on a workspace.
curl -X POST https://api.aiql.io/ingestions \
  -H "Authorization: Bearer $AIQL_API_KEY" \
  -H "AiQL-Workspace: YOUR_WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{"source": "https://example.com/report.pdf"}'

Poll for completion

Ingestions run asynchronously. Poll until the status reports the job is done.
curl https://api.aiql.io/ingestions/YOUR_INGESTION_ID \
  -H "Authorization: Bearer $AIQL_API_KEY" \
  -H "AiQL-Workspace: YOUR_WORKSPACE_ID"

Handle interruptions

Cancel a running ingestion, or retry one that failed. A cancelled job is only billed for the steps that finished; a retry only bills for the steps it re-runs.
curl -X POST https://api.aiql.io/ingestions/YOUR_INGESTION_ID/cancel \
  -H "Authorization: Bearer $AIQL_API_KEY" \
  -H "AiQL-Workspace: YOUR_WORKSPACE_ID"

curl -X POST https://api.aiql.io/ingestions/YOUR_INGESTION_ID/retry \
  -H "Authorization: Bearer $AIQL_API_KEY" \
  -H "AiQL-Workspace: YOUR_WORKSPACE_ID"

Next step

Once the ingestion finishes, query the data in your workspace. See the Quickstart for a query example.
An ingestion is billed as the sum of the steps it runs: convert per page, plus split, shape, and extract per 1,000 words. See Pricing for details.