Index Text

Index plain text content into a collection. Accepts raw text content in the request body, saves it as a .txt file, and indexes it for semantic search. No file upload or cloud storage needed. Headers: - Authorization: Bearer {api_key} - Captain API key for authentication - X-Organization-ID: Organization UUID - Idempotency-Key: UUID for request deduplication (optional) Args: collection_name: Name of the collection (path parameter) body: Text content and optional metadata Returns: { job_id, status: "pending" }

Path parameters

collection_namestringRequired

Headers

authorizationstringOptional

Request

This endpoint expects an object.
contentstringRequired
The text content to index.
custom_metadatamap from strings to optional strings or integers or doubles or booleans or lists of stringsOptional

Custom metadata to attach to all indexed chunks. Keys must be strings. Values: str, int, float, bool, or List[str].

filenamestringOptional

Optional filename for the text document. Defaults to ‘snippet-{N}.txt’ where N auto-increments.

Response

Successful Response
job_idstring
statusstringDefaults to pending