Skip to main content
Command-line examples using cURL.

Set Your API Key

export DOCINTELL_API_KEY="dk_live_YOUR_KEY_HERE"

Upload a Document

curl -X POST https://api.docintell.com/v1/documents \
  -H "Authorization: Bearer $DOCINTELL_API_KEY" \
  -F "file=@invoice.pdf" \
  -F "retention_years=7"
Response:
{
  "document_id": "019370ab-c123-7def-8901-234567890abc",
  "job_id": "019370ab-c456-7def-8901-234567890def",
  "status": "pending"
}

Check Job Status

curl -X GET https://api.docintell.com/v1/jobs/019370ab-c456-7def-8901-234567890def \
  -H "Authorization: Bearer $DOCINTELL_API_KEY"

List Documents

curl -X GET "https://api.docintell.com/v1/documents?page=1&per_page=20" \
  -H "Authorization: Bearer $DOCINTELL_API_KEY"

Create a Webhook

curl -X POST https://api.docintell.com/v1/webhooks \
  -H "Authorization: Bearer $DOCINTELL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://yourapp.com/webhooks/docintell",
    "events": ["job.completed", "job.failed"]
  }'

Health Check

curl -X GET https://api.docintell.com/health

Shell Script: Complete Workflow

#!/bin/bash
set -e

API_KEY="$DOCINTELL_API_KEY"
FILE="$1"

if [ -z "$FILE" ]; then
  echo "Usage: $0 <pdf-file>"
  exit 1
fi

# Upload
echo "Uploading $FILE..."
RESULT=$(curl -s -X POST https://api.docintell.com/v1/documents \
  -H "Authorization: Bearer $API_KEY" \
  -F "file=@$FILE")

JOB_ID=$(echo $RESULT | jq -r '.job_id')
DOC_ID=$(echo $RESULT | jq -r '.document_id')

echo "Document ID: $DOC_ID"
echo "Job ID: $JOB_ID"

# Wait for completion
echo "Waiting for extraction to complete..."
while true; do
  STATUS=$(curl -s -X GET "https://api.docintell.com/v1/jobs/$JOB_ID" \
    -H "Authorization: Bearer $API_KEY" | jq -r '.status')

  if [ "$STATUS" = "completed" ]; then
    echo "Extraction completed!"
    break
  elif [ "$STATUS" = "failed" ]; then
    echo "Extraction failed!"
    exit 1
  fi

  sleep 2
done