Skip to Content
Docs

POST /api/sources/from_attachments

POST
/api/sources/from_attachments

Creates a Knowledge source from chat attachments the caller already uploaded. The stored originals are copied into a new source and ingested like an upload (a zip contributes its files); the files together may not exceed the upload request limit (413). Returns the source id and the ingest task id; progress arrives as source.ingest.* events for that source id. Honors an optional Idempotency-Key header: a repeat request with the same key within 24h returns the first request's source and task ids without copying the files or queueing a second ingest.

Personal access token scope: sources:write.

Authorization

bearer
headerAuthorizationBearer <token>

A session token or a personal access token. Leave it empty when the instance runs without authentication (AUTH_TYPE unset).

Request Body

application/json
  1. body
attachment_ids*array<string>

Ids of the caller's chat attachments, in the order to list them

name?string

Name of the new source; defaults to the first file's name and a count

Response Body

Success

Example Request
curl -X POST 'http://localhost:7091/api/sources/from_attachments' \  -H 'Content-Type: application/json' \  -d '{  "attachment_ids": [    "string"  ]}'
Example Response200
Empty