Skip to content

Add documents

POST /document-intelligence/v1/collections/{collection_id}/documents

Add one document or many. Answers 202: the work has been accepted, not finished. Poll the returned job_id to find out how it went.

Each document names exactly one source - text, url, or file_url. Send an Idempotency-Key header so a retry does not ingest the same document twice.

This call is metered against the ingestion rate limit, which is lower than the general one, because each document starts real processing work.

Parameters

Name In Required Notes
collection_id path yes -

Request body

Send one object, or an array of them to submit several in one call.

Field Type Required Notes
text string no The document's text, sent inline.
url string no A web page to fetch and read.
file_url string no A URL to fetch a file from. Not every public URL is accepted - see the ingesting-documents guide. Cannot contain a comma.
metadata object no Your own key/value data, stored with the document and available to filter search on later.

Example

curl -X POST "https://api.futuresmart.ai/document-intelligence/v1/collections/{collection_id}/documents" \
  -H "Authorization: Bearer $FS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "<text>"
  }'

Responses

202

Field Type Required Notes
job_id string yes -
collection_id string yes -
status string yes -
document_count integer yes -

Every failure, a malformed request included, comes back in the shared envelope with a stable code to branch on. See Errors.