
How Intakes Work
An intake creates an HTTP endpoint that external systems can send documents to. When a document arrives at an intake endpoint:- The document is uploaded to the configured document store
- If a script is configured, it runs to validate or enrich the document metadata
- A document family is created for tracking
- If a task template is configured, a task is automatically created
- Any configured knowledge features are assigned to the document
- Domain events are published, triggering any subscribed processing pipelines
Upload Endpoint
Each intake exposes an upload endpoint at:invoice-upload in organization acme-corp would be available at:
Single File Upload
Multiple File Upload
When Allow Multiple Files is enabled on the intake, you can upload multiple files in a single request:Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
file | multipart file | Yes | One or more files to upload |
path | string | No | Document path in the store (defaults to filename) |
metadata | JSON | No | Key-value metadata to attach to the document |
Response
Returns HTTP201 on success with the created document family object. For multiple files, returns an array of document family objects.
Configuring an Intake
Create Intake
Click the add button on the Intakes page. Provide a name and slug for the intake. The slug determines the upload endpoint URL.
Intake Settings
| Setting | Description |
|---|---|
| Name | Human-readable label for the intake |
| Slug | URL-safe identifier used in the upload endpoint path |
| Description | Optional description of the intake’s purpose |
| Active | When disabled, the intake rejects all uploads |
| Allow Multiple Files | Enable uploading multiple files in a single request |
| Target Store | The document store where uploaded files are saved |
Script Tab
Intakes support a JavaScript scripting tab that lets you run custom logic on each uploaded file before it is stored. Scripts run in a Goja JavaScript runtime with a 5-second timeout.Available Variables
| Variable | Type | Description |
|---|---|---|
filename | string | Original uploaded filename |
fileSize | number | File size in bytes |
mimeType | string | Detected MIME type |
metadata | object | Mutable metadata object (merged from intake config + upload params) |
document.text | string | Extracted text content (first 5 pages for PDFs) |
document.pageCount | number | Page count if available |
document.metadata | object | Document-level metadata |
log(level, message) | function | Write to server logs (debug, info, warn, error) |
Return Value
Scripts must return an object with the following shape:Example: Validate File Size
Example: Route by Document Content
Enable the Script toggle to activate script execution. You can disable it without deleting the script code.
Task Template
Optionally select a task template to automatically create a task for each uploaded document. When configured:- A task is created using the selected template
- The task title defaults to the uploaded filename
- The uploaded document is linked to the task
- If the template has AI naming configured (via
titlePrompt), the task title is generated from the document content
Knowledge Features
Select one or more knowledge feature types to automatically assign to every document uploaded through this intake. This lets you pre-classify documents at ingestion time — for example, tagging all documents from a specific intake as belonging to a particular vendor or document category.Processing Metadata
The Processing Metadata section lets you define key-value pairs that are attached to every document uploaded through this intake. These metadata values are available to downstream processing modules and assistants. Metadata is merged in this order (later values override earlier ones):- Intake-level metadata (configured here)
- Metadata extracted from the document file
- Per-upload metadata (provided in the API request)
- Script modifications (if a script is enabled)
API Tokens
The API Tokens tab lets you create scoped tokens for machine-to-machine authentication against a specific intake endpoint. Unlike user API keys, intake tokens are scoped to a single intake and bypass user authentication — making them ideal for automated pipelines, third-party integrations, and CI/CD workflows.Creating a Token
Using Intake Tokens
Pass the token in theAuthorization header when uploading to the intake endpoint:
Managing Tokens
The API Tokens tab displays all tokens for the intake with their creation date, hint, and expiration status. Click the delete button to revoke a token. A confirmation dialog is shown before deletion.Token Security
- Tokens are hashed with SHA-256 before storage — the platform never stores plaintext tokens
- Each token is scoped to a single intake and cannot access other resources
- Tokens can have optional expiration dates
- Revoked tokens take effect immediately
Each intake provides a unique URL. Keep intake URLs and authentication credentials secure, as anyone with access can submit documents to your organization.

