Skip to content

API Overview

The DocMap API provides REST endpoints for extracting structured data from PDF documents using AI-powered templates.

Base URL

All API requests are made to:

https://api.docmap.io

All versioned endpoints are prefixed with /v1/.

Authentication

All /v1/* endpoints require an Authorization header with a Bearer token. You can use either an API key or a Firebase ID token:

Authorization: Bearer dm_live_abc123def456ghi789jkl012mno345

API keys can be created and managed from Dashboard > Settings > API Keys or via the API Keys endpoints. See the Authentication guide for details.

Content Type

All request and response bodies use JSON:

Content-Type: application/json

Rate Limits

Extraction requests are subject to monthly limits based on your plan. Use the GET /v1/usage endpoint to check your current consumption. See the Rate Limits guide for per-plan quotas.

Endpoints Summary

MethodPathDescription
GET/healthHealth check (unauthenticated)
POST/v1/extractions/runRun an extraction on a PDF document
GET/v1/extractionsList extraction records
DELETE/v1/extractions/{id}Delete an extraction record
GET/v1/usageGet current usage for the billing period
POST/v1/api-keysCreate a new API key
GET/v1/api-keysList all active API keys
DELETE/v1/api-keys/{id}Revoke an API key

Health Check

GET /health is the only unauthenticated endpoint. Use it to verify the API is reachable.

bash
curl https://api.docmap.io/health
typescript
const res = await fetch('https://api.docmap.io/health')
const data = await res.json()
console.log(data) // { status: "ok" }
python
import requests

res = requests.get("https://api.docmap.io/health")
print(res.json())  # {"status": "ok"}

Response:

json
{ "status": "ok" }

Error Format

All error responses follow a consistent structure:

json
{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Invalid or expired API key."
  }
}

See the Error Codes reference for a full list of error codes and their meanings.

OpenAPI Spec

The full OpenAPI specification is available for tooling and client generation:

DocMap API Documentation