We collect minimal analytics to understand how the site is used. If you decline, we do not load analytics.
Docs/Endpoints/POST /documents
POST/v1/documents

Upload a PDF to AnchorGrid. Returns a document_id that you pass to every detection and parsing endpoint. Documents are stored for the duration of your tier's retention window and then automatically deleted.

multipart/form-dataSync · 201Required first step

Request

Auth via X-API-Key header. Body must be multipart/form-data — do not JSON-encode it. Only PDF files are accepted.

filereq
binary
The PDF file. Filename is preserved in original_filename. Maximum size depends on your tier — see the Limits section below.

This endpoint does not accept a JSON body. Set Content-Type to multipart/form-data (most HTTP clients handle this automatically when you attach a file).

Code examples

curl -X POST https://api.anchorgrid.ai/v1/documents \
  -H "X-API-Key: <your-api-key>" \
  -F "file=@floor-plan.pdf"

Response — 201 Created

Returns the document object immediately. Save the document_id — it is the only way to reference this document in subsequent API calls.

document_id
string (UUID)
Stable identifier for the uploaded document. Pass this to detection and parsing endpoints.
original_filename
string
The filename sent with the upload.
file_size_bytes
integer
Size of the stored PDF in bytes.
page_count
integer
Number of pages in the PDF. Use this to build valid page_numbers arrays for detection calls.
mime_type
string
Always application/pdf.
tier
string
Your account tier at the time of upload (free, developer, pro, enterprise).
uploaded_at
string (ISO 8601)
When the document was stored.
expires_at
string (ISO 8601)
When the document will be deleted. Retention window is tier-dependent.
download_url
string
Presigned URL for downloading the original PDF. Valid for 15 minutes.
download_url_expires_in_seconds
integer
Always 900. Re-fetch via GET /v1/documents/{id} for a fresh URL.

Size limits & retention

Free
50 MB · 30-day retention
Developer
100 MB · 30-day retention
Pro
150 MB · 90-day retention
Enterprise
200 MB · custom retention
413 PDF_TOO_LARGE
File exceeds the maximum for your tier. Compress or split the PDF before re-uploading.
422 PDF_ENCRYPTED
Password-protected PDFs cannot be processed. Remove the password and re-upload.
422 PDF_CORRUPT
The file could not be parsed as a valid PDF.

Errors

401
Missing or invalid X-API-Key.
413
PDF_TOO_LARGE — file exceeds tier limit.
422
PDF_ENCRYPTED or PDF_CORRUPT — invalid file.

Response Preview

201 Created
201 OK
{
  "document_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "original_filename": "floor-plan-lvl2.pdf",
  "file_size_bytes": 2048000,
  "page_count": 24,
  "mime_type": "application/pdf",
  "tier": "developer",
  "uploaded_at": "2026-03-30T14:32:00Z",
  "expires_at": "2026-04-29T14:32:00Z",
  "download_url": "https://storage.anchorgrid.ai/…?X-Amz-Expires=900",
  "download_url_expires_in_seconds": 900
}