> This page is for version v1 (default).
> For other versions, use one of these documentation indexes:
> - v1 (default): https://docs.rightbrain.ai/v-1/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.rightbrain.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.rightbrain.ai/_mcp/server.

# Create Collection

POST https://app.rightbrain.ai/api/v1/org/{org_id}/project/{project_id}/collection
Content-Type: application/json

Create a new collection for organizing document embeddings.

Collections serve as knowledge bases for RAG-enabled features:
- Group related documents together
- Enable contextual AI responses
- Support multiple embedding instances
- Organize information by topic or use case

You can add documents to the collection after creation.

Reference: https://docs.rightbrain.ai/api-reference/api-reference/knowledge/collections/create-collection

## Authentication

- `Authorization` header (bearer token, required) — API key or access token, sent as `Authorization: Bearer <token>`. The simplest option: create an API key in your dashboard under Settings, then paste it here.

## Servers

- `https://app.rightbrain.ai/api/v1` (Production, default)
- `https://app.rightbrain.ai/api/v1` (Staging API)
- `https://app.rblocal.dev/api/v1` (Local development)

## Request

### Path parameters

- `org_id` (string, required) — The unique identifier of the organization.
- `project_id` (string, required) — The unique identifier of the project.

### Body (application/json)

This endpoint expects a CollectionCreate.

- `title` (string, required)
- `document_embedding_instance_ids` (list of string, optional, default: [])

## Response

### 200

Collection created successfully

- `title` (string, required)
- `project_id` (string, required)
- `id` (string, required)
- `created` (string, required)
- `modified` (string, required)
- `summary` (string, optional, nullable)
- `embedding_instances` (list of ChatDocumentEmbeddingInstance, optional, default: [])
- `task_ids` (list of string, optional, default: [])

## Errors

### 400 Bad Request Error

Bad Request

- `detail` (MalformedResourceIdentifierErrorPayload, required) — The error payload.

### 403 Forbidden Error

Forbidden

- `CreateCollectionRequestForbiddenError`
  - PermissionCheckFailedErrorResponse: PermissionCheckFailedErrorResponse
  - MissingAuthenticationErrorResponse: MissingAuthenticationErrorResponse

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### ChatDocumentEmbeddingInstance

- `id` (string, required)
- `chat_document_id` (string, required)
- `is_active` (boolean, required)
- `config` (map from string to any, optional, nullable, default: {})

### MalformedResourceIdentifierErrorPayload

- `message` (string, required) — Human readable representation of the error
- `reason` (enum, required) — The machine-readable error reason.
  - Allowed values: `MALFORMED_RESOURCE_IDENTIFIER`
- `malformedResourceIdentifierError` (MalformedResourceIdentifierErrorDetails, required) — Metadata detailing more information about the error.

### PermissionCheckFailedErrorResponse

- `detail` (PermissionCheckFailedErrorPayload, required) — The error payload.

### MissingAuthenticationErrorResponse

- `detail` (MissingAuthenticationErrorPayload, required) — The error payload.

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `input` (any, optional)
- `ctx` (ValidationErrorCtx, optional)

### MalformedResourceIdentifierErrorDetails

- `field` (string, required)
- `value` (any, required)
- `expected_format` (string, required)

### PermissionCheckFailedErrorPayload

- `message` (string, required) — Human readable representation of the error
- `reason` (enum, required) — The machine-readable error reason.
  - Allowed values: `PERMISSION_CHECK_FAILED`
- `permissionCheckFailedError` (PermissionCheckFailedErrorDetails, required) — Metadata detailing more information about the error.

### MissingAuthenticationErrorPayload

- `message` (string, required) — Human readable representation of the error
- `reason` (enum, required) — The machine-readable error reason.
  - Allowed values: `MISSING_AUTHENTICATION`
- `missingAuthenticationError` (EmptyErrorDetails, required) — Metadata detailing more information about the error.

### ValidationErrorLocItems

- string
- integer

### ValidationErrorCtx

### PermissionCheckFailedErrorDetails

- `permission` (string, required)
- `subject` (IAMObjectErrorDetails, optional, nullable)
- `resource` (IAMObjectErrorDetails, optional, nullable)

### EmptyErrorDetails

### IAMObjectErrorDetails

- `type` (string, required)
- `id` (string, optional, nullable)

## Examples

### Basic Collection

**Request**

```json
{
  "title": "Carrier Contracts 2026",
  "document_embedding_instance_ids": []
}
```

**Response**

```json
{
  "title": "Carrier Contracts 2026",
  "project_id": "019a2f10-8b2d-7e43-9c64-1c9d4e7b6f02",
  "id": "019a2f10-a2a5-7e51-94ec-1c9d4e7b6f21",
  "created": "2026-07-20T10:00:00Z",
  "modified": "2026-07-20T10:00:00Z",
  "summary": "Signed carrier rate agreements and service-level terms for the 2026 contract year.",
  "embedding_instances": [],
  "task_ids": []
}
```

**SDK Code**

```python Basic Collection
import requests

url = "https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/collection"

payload = {
    "title": "Carrier Contracts 2026",
    "document_embedding_instance_ids": []
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Basic Collection
const url = 'https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/collection';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"title":"Carrier Contracts 2026","document_embedding_instance_ids":[]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Basic Collection
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/collection"

	payload := strings.NewReader("{\n  \"title\": \"Carrier Contracts 2026\",\n  \"document_embedding_instance_ids\": []\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Basic Collection
require 'uri'
require 'net/http'

url = URI("https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/collection")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"title\": \"Carrier Contracts 2026\",\n  \"document_embedding_instance_ids\": []\n}"

response = http.request(request)
puts response.read_body
```

```java Basic Collection
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/collection")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"title\": \"Carrier Contracts 2026\",\n  \"document_embedding_instance_ids\": []\n}")
  .asString();
```

```php Basic Collection
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/collection', [
  'body' => '{
  "title": "Carrier Contracts 2026",
  "document_embedding_instance_ids": []
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Basic Collection
using RestSharp;

var client = new RestClient("https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/collection");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"title\": \"Carrier Contracts 2026\",\n  \"document_embedding_instance_ids\": []\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Basic Collection
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "title": "Carrier Contracts 2026",
  "document_embedding_instance_ids": []
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/collection")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Collection with Documents

**Request**

```json
{
  "title": "Operations Handbook",
  "document_embedding_instance_ids": [
    "019a2f10-c1d8-7e70-971f-1c9d4e7b6f40",
    "019a2f10-c3fa-7e72-9931-1c9d4e7b6f42"
  ]
}
```

**Response**

```json
{
  "title": "Carrier Contracts 2026",
  "project_id": "019a2f10-8b2d-7e43-9c64-1c9d4e7b6f02",
  "id": "019a2f10-a2a5-7e51-94ec-1c9d4e7b6f21",
  "created": "2026-07-20T10:00:00Z",
  "modified": "2026-07-20T10:00:00Z",
  "summary": "Signed carrier rate agreements and service-level terms for the 2026 contract year.",
  "embedding_instances": [],
  "task_ids": []
}
```

**SDK Code**

```python Collection with Documents
import requests

url = "https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/collection"

payload = {
    "title": "Operations Handbook",
    "document_embedding_instance_ids": ["019a2f10-c1d8-7e70-971f-1c9d4e7b6f40", "019a2f10-c3fa-7e72-9931-1c9d4e7b6f42"]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Collection with Documents
const url = 'https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/collection';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"title":"Operations Handbook","document_embedding_instance_ids":["019a2f10-c1d8-7e70-971f-1c9d4e7b6f40","019a2f10-c3fa-7e72-9931-1c9d4e7b6f42"]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Collection with Documents
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/collection"

	payload := strings.NewReader("{\n  \"title\": \"Operations Handbook\",\n  \"document_embedding_instance_ids\": [\n    \"019a2f10-c1d8-7e70-971f-1c9d4e7b6f40\",\n    \"019a2f10-c3fa-7e72-9931-1c9d4e7b6f42\"\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Collection with Documents
require 'uri'
require 'net/http'

url = URI("https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/collection")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"title\": \"Operations Handbook\",\n  \"document_embedding_instance_ids\": [\n    \"019a2f10-c1d8-7e70-971f-1c9d4e7b6f40\",\n    \"019a2f10-c3fa-7e72-9931-1c9d4e7b6f42\"\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Collection with Documents
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/collection")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"title\": \"Operations Handbook\",\n  \"document_embedding_instance_ids\": [\n    \"019a2f10-c1d8-7e70-971f-1c9d4e7b6f40\",\n    \"019a2f10-c3fa-7e72-9931-1c9d4e7b6f42\"\n  ]\n}")
  .asString();
```

```php Collection with Documents
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/collection', [
  'body' => '{
  "title": "Operations Handbook",
  "document_embedding_instance_ids": [
    "019a2f10-c1d8-7e70-971f-1c9d4e7b6f40",
    "019a2f10-c3fa-7e72-9931-1c9d4e7b6f42"
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Collection with Documents
using RestSharp;

var client = new RestClient("https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/collection");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"title\": \"Operations Handbook\",\n  \"document_embedding_instance_ids\": [\n    \"019a2f10-c1d8-7e70-971f-1c9d4e7b6f40\",\n    \"019a2f10-c3fa-7e72-9931-1c9d4e7b6f42\"\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Collection with Documents
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "title": "Operations Handbook",
  "document_embedding_instance_ids": ["019a2f10-c1d8-7e70-971f-1c9d4e7b6f40", "019a2f10-c3fa-7e72-9931-1c9d4e7b6f42"]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/collection")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```