Upload & Manage Documents
Documents are uploaded into a Document Source. After upload, you typically trigger ingestion so the content becomes searchable/retrievable.
Upload files to a source
Endpoint: POST /api/documentSources/{code}/documents
The upload request is multipart/form-data and supports uploading multiple files.
The server accepts one or many file parts. In the OpenAPI spec the field is named files, and many internal clients use filename.
In practice, the upload handler accepts any file part name as long as it is a file part.
Example (two files):
curl -X POST "https://app.noema.ai/api/documentSources/my-source/documents" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-F "files=@./docs/handbook.pdf" \
-F "files=@./docs/policy.docx"
Upload flags
The upload endpoint supports optional query flags:
temporary: tag uploads as temporaryoverwriteExisting: overwrite a document with the same name/idgenerateName: ignore the original filename and generate a random name
Example:
curl -X POST "https://app.noema.ai/api/documentSources/my-source/documents?temporary=true&generateName=true" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-F "files=@./docs/handbook.pdf"
Add per-document metadata (properties)
You can include an optional multipart form field called properties containing a JSON string.
This gets applied as document metadata/properties for the next file part.
curl -X POST "https://app.noema.ai/api/documentSources/my-source/documents" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-F 'properties={"department":"Legal","confidential":"true"}' \
-F "files=@./docs/policy.pdf"
The response returns the uploaded document objects (including an id). You’ll use that id to trigger processing.
List documents in a source
Endpoint: GET /api/documentSources/{code}/documents
curl "https://app.noema.ai/api/documentSources/my-source/documents" \
-H "Authorization: Bearer $ACCESS_TOKEN"
Pagination:
pageSizecontrols how many results to return.nextPageTokenfetches the next page.
Next steps
- Index uploaded documents: Ingestion & Processing