DocuClipper logo

File uploads

Uploads on the Agent API are a two-step flow: request a presigned S3 URL, then PUTthe file directly to S3. There's no multipart endpoint — every upload (small or large) takes this path.

1. Request a presigned URL

bash
curl -X POST "https://www.docuclipper.com/api/v1/agent/documents/upload-url" \
  -H "Authorization: Bearer $PAT" \
  -H "Content-Type: application/json" \
  -d '{"filename":"statement.pdf","mimetype":"application/pdf"}'

Response:

json
{
  "url": "https://jorgemarsal-ocr2.s3.us-west-2.amazonaws.com/1779809224157-statement.pdf?X-Amz-Algorithm=...",
  "expiresIn": 3600,
  "document": {
    "id": "2666888",
    "s3Key": "1779809224157-statement.pdf",
    "s3Path": "https://jorgemarsal-ocr2.s3.amazonaws.com/1779809224157-statement.pdf"
  }
}

The document.id is what you pass to create a job. The presigned URL is valid for one hour by default — pass ?expiresIn=N (seconds) on the request to override.

2. PUT the file to S3

bash
curl -X PUT \
  -H "Content-Type: application/pdf" \
  --data-binary "@statement.pdf" \
  "$URL_FROM_ABOVE"

The Content-Type header MUST match the mimetype you passed in step 1 — the presigned URL is signed against it. A successful PUT returns 200 OK with empty body.

Supported file types

  • application/pdf — single and multi-page, scanned or digital
  • image/png, image/jpeg — single-page check images, receipts, tax forms

Why no multipart?

Presigned PUTs scale better (no API server in the request path for the bytes), avoid request-size limits, and don't require multipart parsing in your client. Large files (10MB+) work without special treatment.