API

Automate document analysis via REST API

Submit documents, configure analysis types, and retrieve confidence-scored results programmatically. Integrate into CI/CD pipelines, automated workflows, or bulk processing.

Three-step API flow

Every API integration follows the same pattern: submit a document, configure the review, and start the pipeline. Poll for results or receive a webhook callback when processing completes.

Submit

Upload your document content via POST /api/v1/documents. Receive a document ID for subsequent requests.

Configure

Create a review run via POST /api/v1/reviews. Specify analysis type, mode, confidence threshold, and max cycles.

Start

Start the pipeline via POST /api/v1/reviews/{id}/start. The pipeline processes asynchronously.

Retrieve

Poll GET /api/v1/reviews/{id} for status. When complete, download the result from GET /api/v1/reviews/{id}/output.

API key authentication

All API requests require an API key passed in the X-Api-Key header. Generate your API key from the account settings page in the web app.

X-Api-Key: your-api-key-here

# Every request must include this header
curl -H "X-Api-Key: sk_live_abc123..." \
     https://api.analyzemydocument.com/api/v1/documents

Rate limits

API keys are rate-limited to 60 requests per minute and 10 concurrent pipeline runs. Contact support if you need higher limits for bulk processing.

API key scopes

API keys inherit the permissions and tier of your account. Standard and Deep Analysis tiers include API access. Quick Review and Free tiers do not include API access.

Submit a document

Upload document content as markdown. The API returns a document ID used in subsequent calls.

curl

curl -X POST https://api.analyzemydocument.com/api/v1/documents \
  -H "X-Api-Key: sk_live_abc123..." \
  -H "Content-Type: application/json" \
  -d '{
    "title": "API Specification v2.1",
    "content": "# API Specification\n\n## Overview\n...",
    "content_type": "markdown"
  }'

# Response
{
  "id": "doc_8f3k2j1",
  "title": "API Specification v2.1",
  "word_count": 12450,
  "created_at": "2026-04-04T10:30:00Z"
}

Python

import requests

API_KEY = "sk_live_abc123..."
BASE_URL = "https://api.analyzemydocument.com/api/v1"

# Upload document
response = requests.post(
    f"{BASE_URL}/documents",
    headers={
        "X-Api-Key": API_KEY,
        "Content-Type": "application/json"
    },
    json={
        "title": "API Specification v2.1",
        "content": open("spec.md").read(),
        "content_type": "markdown"
    }
)

doc = response.json()
print(f"Document ID: {doc['id']}, Words: {doc['word_count']}")

Configure a review

Create a review run specifying the document, analysis type, mode, confidence threshold, and maximum revision cycles.

curl

curl -X POST https://api.analyzemydocument.com/api/v1/reviews \
  -H "X-Api-Key: sk_live_abc123..." \
  -H "Content-Type: application/json" \
  -d '{
    "document_id": "doc_8f3k2j1",
    "analysis_type": "technical_design_review",
    "mode": "generate_analysis",
    "confidence_threshold": 0.55,
    "max_cycles": 3
  }'

# Response
{
  "id": "rev_4m2n9p7",
  "document_id": "doc_8f3k2j1",
  "analysis_type": "technical_design_review",
  "mode": "generate_analysis",
  "confidence_threshold": 0.55,
  "max_cycles": 3,
  "status": "configured",
  "estimated_cost": "$6.14",
  "estimated_time_minutes": 20
}

Python

# Create review
review_response = requests.post(
    f"{BASE_URL}/reviews",
    headers={"X-Api-Key": API_KEY, "Content-Type": "application/json"},
    json={
        "document_id": doc["id"],
        "analysis_type": "technical_design_review",
        "mode": "generate_analysis",
        "confidence_threshold": 0.55,
        "max_cycles": 3
    }
)

review = review_response.json()
print(f"Review ID: {review['id']}, Est. Cost: {review['estimated_cost']}")

Start the pipeline and retrieve results

Start the review run, then poll for completion or configure a webhook. Download the output when the status is "completed".

curl

# Start the pipeline
curl -X POST https://api.analyzemydocument.com/api/v1/reviews/rev_4m2n9p7/start \
  -H "X-Api-Key: sk_live_abc123..."

# Poll for status
curl https://api.analyzemydocument.com/api/v1/reviews/rev_4m2n9p7 \
  -H "X-Api-Key: sk_live_abc123..."

# Response (when complete)
{
  "id": "rev_4m2n9p7",
  "status": "completed",
  "confidence_score": 0.72,
  "cycles_used": 2,
  "completed_at": "2026-04-04T10:52:00Z"
}

# Download output
curl https://api.analyzemydocument.com/api/v1/reviews/rev_4m2n9p7/output \
  -H "X-Api-Key: sk_live_abc123..." \
  -o analysis_output.md

Python

import time

# Start the pipeline
requests.post(
    f"{BASE_URL}/reviews/{review['id']}/start",
    headers={"X-Api-Key": API_KEY}
)

# Poll for completion
while True:
    status_response = requests.get(
        f"{BASE_URL}/reviews/{review['id']}",
        headers={"X-Api-Key": API_KEY}
    )
    status = status_response.json()

    if status["status"] in ("completed", "failed"):
        break

    print(f"Status: {status['status']}...")
    time.sleep(30)

# Download result
if status["status"] == "completed":
    output = requests.get(
        f"{BASE_URL}/reviews/{review['id']}/output",
        headers={"X-Api-Key": API_KEY}
    )
    with open("analysis_output.md", "w") as f:
        f.write(output.text)

    print(f"Done. Confidence: {status['confidence_score']}")

Complete API specification

The full API reference covers all endpoints, request/response schemas, error codes, webhook configuration, and pagination. Available as an OpenAPI 3.0 spec.

View Full API Docs Download OpenAPI Spec

Start integrating today

Sign up for a Standard or Deep Analysis tier to get API access. Your first run is free.