Submitting Documents

Two endpoints for getting documents into your pipeline — multipart form upload for standard integrations, and raw binary for serverless or streaming workflows.

Submit Pipeline Document

POST /api/v1/pipelines/{pipeline_id}/documents

Submit a PDF deck to a pipeline via file upload or URL. AlphaLens enqueues the document for indexing and runs your pipeline's configured questions.

Parameters

Parameter

Type

Required

Description

pipeline_id

integer (path)

Yes

The pipeline to submit the document to

attachment_file

file (multipart)

One of file or URL

PDF file to upload directly

attachment_url

string (form field)

One of file or URL

URL to a supported deck provider (DocSend, Google Slides, Notion, Pitch.com)

attachment_email

string (form field)

No

Email address used when fetching a deck from a URL

attachment_password

string (form field)

No

Password for accessing a protected deck link

keyword_args

JSON string (form field)

No

Custom key-value metadata to attach to the document (JSON-encoded)

Note: Provide either attachment_file or attachment_url, not both. The attachment_email and attachment_password fields are only relevant when using attachment_url.

Response — 202 Accepted

Field

Type

Description

document_id

integer

Unique identifier for the submitted document

document_url

string

URL to view the document in AlphaLens

Errors

Status

Description

400

Invalid input — check file format or missing required fields

401

Authentication required

403

Authorization denied or credit limit exceeded

404

Pipeline not found

429

Rate limit exceeded (per company, per minute)

Submit Pipeline Document (Binary)

POST /api/v1/pipelines/{pipeline_id}/documents-binary-data

Submit a document as raw binary data. Use this endpoint when streaming file bytes directly rather than using multipart form upload — for example, from a serverless function or data pipeline where constructing multipart requests is impractical.

Parameters

Parameter

Type

Required

Description

pipeline_id

integer (path)

Yes

The pipeline to submit the document to

Request body

binary (application/pdf)

Yes

Raw PDF file bytes

Example

bash

curl -X POST "/api/v1/pipelines/{pipeline_id}/documents-binary-data" \
  -H "Content-Type: application/pdf" \
  -H "API-Key: your-api-key" \
  --data-binary "@./deck.pdf"

Response — 202 Accepted

Field

Type

Description

document_id

integer

Unique identifier for the submitted document

document_url

string

URL to view the document in AlphaLens

Errors

Same as the standard submit endpoint above.