Niah Docs
Core APIs

Batches

Submit up to 1,000 consultations in one job. Poll for progress or get a webhook when the batch finishes.

Create a batch

post /v1/batch

Pass consultations inline (max 1,000) or upload a JSONL file via a presigned URL.

bash
curl -X POST https://api.niah.si/v1/batch \
  -H "Authorization: Bearer $NIAH_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: batch-q3-2026" \
  -d '{
    "consultations": [
      {"title": "Evaluate pricing for SMB segment"},
      {"title": "Risks of expanding into APAC"}
    ],
    "webhook_url": "https://example.com/hooks/niah"
  }'

Response is 202 with a poll_url. Status values: pending, validating, processing, completed, failed, partial_failure, cancelled.

Large inputs via upload

  1. post /v1/batch/upload-url — get a presigned PUT URL + file_key.
  2. PUT your JSONL file to the URL (one consultation JSON object per line).
  3. post /v1/batch with {"input_file": "<file_key>"}.

Track progress and results

get/v1/batch/{id}Status + item counts
get/v1/batch/{id}/resultsPaginated items (each links to a consultation)
delete/v1/batch/{id}Cancel a running batch

Subscribe to batch.completed, batch.failed, and batch.partial_failure via webhooks instead of polling.