Create collection
const url = 'https://firma.company-gpt.com/companygpt/rag/api/api/collections';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","displayName":"example","description":"example","visibility":"private","searchLanguage":"english","chunkingStrategy":"recursive","chunkSize":1,"chunkOverlap":1,"type":"rag","datasetMode":"imported","tables":{"additionalProperty":{"columns":[{"name":"example","type":"text","primary":true,"nullable":true}],"relationships":[{}]}},"structuredExtraction":{"enabled":true,"instructions":"example","maxPages":1},"embeddingModel":"example","imageDescriptionsEnabled":false,"imageDescriptionMode":"all"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://firma.company-gpt.com/companygpt/rag/api/api/collections \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "displayName": "example", "description": "example", "visibility": "private", "searchLanguage": "english", "chunkingStrategy": "recursive", "chunkSize": 1, "chunkOverlap": 1, "type": "rag", "datasetMode": "imported", "tables": { "additionalProperty": { "columns": [ { "name": "example", "type": "text", "primary": true, "nullable": true } ], "relationships": [ {} ] } }, "structuredExtraction": { "enabled": true, "instructions": "example", "maxPages": 1 }, "embeddingModel": "example", "imageDescriptionsEnabled": false, "imageDescriptionMode": "all" }'Create a new collection. Either “name” or “displayName” must be provided. Creating a “dataset” collection with datasetMode=“live”, or a “rag” collection with structuredExtraction.enabled=true, also provisions backing Postgres tables.
Authorizations
Abschnitt betitelt „Authorizations“Request Bodyrequired
Abschnitt betitelt „Request Bodyrequired“Either “name” or “displayName” must be provided (not enforceable as a plain JSON Schema
required). When “datasetMode” is “live”, “tables” is required and describes the
live-dataset schema; the same field also carries the extraction schema when
structuredExtraction.enabled is true on a “rag” collection.
object
Technical name; auto-generated from displayName when omitted
PostgreSQL text search dictionary
Only honoured when chunkingStrategy is “recursive”
Only honoured when chunkingStrategy is “recursive”
Applies to type=“dataset” only
Required when datasetMode=“live”; also used as the extraction schema when structuredExtraction.enabled is true
object
One table of a live-dataset / structured-extraction schema (livestore.TableDef)
object
One column of a live-dataset / structured-extraction table (livestore.ColumnDef)
object
Marks this column as the table’s natural key (dedup / upsert target). At most one per table.
Defaults to true when omitted; a primary column is always NOT NULL regardless of this value
Optional foreign-key style relationships between tables
object
Enables LLM field extraction on a “rag” collection (CreateCollectionRequest.structuredExtraction)
object
Cost guardrail — caps how many pages of a document extraction scans. Omit or set <= 0 for no cap.
Catalog model id (see GET /api/embedding-models); falls back to the server default when omitted
Responses
Abschnitt betitelt „Responses“Collection created
Collection record as returned by POST /api/collections, GET /api/collections/{id} and PUT /api/collections/{id} (database.Collection, encoded as-is — this is a different, lower-level shape than the enriched CollectionResponse used by the list endpoint).
object
PostgreSQL text search dictionary, e.g. “english”
Empty for “rag” collections; “imported” or “live” for “dataset” collections
Live-dataset / structured-extraction schema (see LiveSchema)
object
Omitted from the JSON body when empty
Omitted from the JSON body when empty
Example
{ "visibility": "private", "type": "rag", "chunkingStrategy": "recursive", "datasetMode": "", "imageDescriptionMode": ""}Invalid request (missing name/displayName, invalid schema, invalid enum value, etc.)
object
Error message
Examplegenerated
{ "error": "example"}Unauthorized
A collection with this technical name already exists
Server error (including provisioning failures for live datasets / structured extraction)