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

# Create Collection

POST https://api.useinterlace.com/collections
Content-Type: application/json

Create a new collection in your organization.

Collections are containers for organizing and searching across data from multiple
sources. After creation, add source connections to begin syncing data.

The collection will be assigned a unique `readable_id` based on the name you provide,
which is used in URLs and API calls. You can optionally configure:

- **Sync schedule**: How frequently to automatically sync data from all sources
- **Custom readable_id**: Provide your own identifier (must be unique and URL-safe)

Reference: https://useinterlace.com/docs/api-reference/collections/create-collections-post

## Authentication

- `x-api-key` header (required) — API Key authentication via header

## Servers

- `https://api.useinterlace.com` (Production, default)
- `http://localhost:8001` (Local)

## Request

### Body (application/json)

This endpoint expects a CollectionCreate.

- `name` (string, required) — Human-readable display name for the collection. This appears in the UI and should clearly describe the data contained within (e.g., 'Finance Data').
- `readable_id` (string, optional, nullable) — URL-safe unique identifier used in API endpoints. Must contain only lowercase letters, numbers, and hyphens. If not provided, it will be automatically generated from the collection name with a random suffix for uniqueness (e.g., 'finance-data-ab123').
- `sync_config` (SyncConfig, optional, nullable) — Default sync configuration for all syncs in this collection. This provides collection-level defaults that can be overridden at sync or job level.

## Response

### 200

Created collection

- `name` (string, required) — Human-readable display name for the collection.
- `readable_id` (string, required) — URL-safe unique identifier used in API endpoints. This becomes non-optional once the collection is created.
- `id` (string, required) — Unique system identifier for the collection. This UUID is generated automatically and used for internal references.
- `created_at` (string, required) — Timestamp when the collection was created (ISO 8601 format).
- `modified_at` (string, required) — Timestamp when the collection was last modified (ISO 8601 format).
- `organization_id` (string, required) — Identifier of the organization that owns this collection. Collections are isolated per organization.
- `vector_size` (integer, required) — Vector dimensions used by this collection (derived from deployment metadata).
- `embedding_model_name` (string, required) — Name of the embedding model used for this collection (derived from deployment metadata).
- `sync_config` (SyncConfig, optional, nullable) — Default sync configuration for all syncs in this collection. Overridable at sync and job level.
- `created_by_email` (string, optional, nullable) — Email address of the user who created this collection.
- `modified_by_email` (string, optional, nullable) — Email address of the user who last modified this collection.
- `status` (enum, optional) — Current operational status of the collection:• **NEEDS\_SOURCE**: Collection has no authenticated connections, or connections exist but haven't synced yet• **ACTIVE**: At least one connection has completed a sync or is currently syncing• **ERROR**: All connections have failed their last sync
  - Allowed values: `ACTIVE`, `NEEDS SOURCE`, `ERROR`
- `source_connection_summaries` (list of SourceConnectionSummary, optional) — Lightweight list of source connections attached to this collection. Contains only short_name and name, suitable for rendering icons in list views.

## Errors

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationErrorDetail, required) — List of validation errors

### 429 Too Many Requests Error

Rate Limit Exceeded

- `detail` (string, required) — Error message explaining the rate limit

## Types

### SyncConfig

Sync configuration with automatic env var loading. Env vars use double underscore as delimiter: SYNC_CONFIG__HANDLERS__ENABLE_VECTOR_HANDLERS=false

- `destinations` (DestinationConfig, optional) — Controls where entities are written.
- `handlers` (HandlerConfig, optional) — Controls which handlers run during sync.
- `cursor` (CursorConfig, optional) — Controls incremental sync cursor behavior.
- `behavior` (BehaviorConfig, optional) — Miscellaneous execution behavior flags.

### SourceConnectionSummary

Lightweight summary of a source connection for collection list display.

- `short_name` (string, required)
- `name` (string, required)

### ValidationErrorDetail

Details about a validation error for a specific field.

- `loc` (list of string, required) — Location of the error (e.g., ['body', 'url'])
- `msg` (string, required) — Human-readable error message
- `type` (string, required) — Error type identifier

### DestinationConfig

Controls where entities are written.

- `skip_vespa` (boolean, optional, default: false) — Skip writing to native Vespa
- `target_destinations` (list of string, optional, nullable) — If set, ONLY write to these destination UUIDs
- `exclude_destinations` (list of string, optional, nullable) — Skip these destination UUIDs

### HandlerConfig

Controls which handlers run during sync.

- `enable_vector_handlers` (boolean, optional, default: true) — Enable VectorDBHandler
- `enable_raw_data_handler` (boolean, optional, default: true) — Enable RawDataHandler (ARF)
- `enable_postgres_handler` (boolean, optional, default: true) — Enable EntityPostgresHandler

### CursorConfig

Controls incremental sync cursor behavior.

- `skip_load` (boolean, optional, default: false) — Don't load cursor (fetch all entities)
- `skip_updates` (boolean, optional, default: false) — Don't persist cursor progress

### BehaviorConfig

Miscellaneous execution behavior flags.

- `skip_hash_comparison` (boolean, optional, default: false) — Force INSERT for all entities
- `replay_from_arf` (boolean, optional, default: false) — Replay from ARF storage instead of calling source
- `skip_guardrails` (boolean, optional, default: false) — Skip usage guardrails (entity count checks)

## Examples

**Request**

```json
{
  "name": "Finance Data",
  "readable_id": "finance-data-reports"
}
```

**Response**

```json
{
  "name": "Finance Data",
  "readable_id": "finance-data-ab123",
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "created_at": "2024-01-15T09:30:00Z",
  "modified_at": "2024-01-15T14:22:15Z",
  "organization_id": "org12345-6789-abcd-ef01-234567890abc",
  "vector_size": 3072,
  "embedding_model_name": "text-embedding-3-large",
  "created_by_email": "admin@company.com",
  "modified_by_email": "finance@company.com",
  "status": "ACTIVE",
  "source_connection_summaries": [
    {
      "short_name": "slack",
      "name": "Slack"
    },
    {
      "short_name": "github",
      "name": "GitHub"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.useinterlace.com/collections"

payload = {
    "name": "Finance Data",
    "readable_id": "finance-data-reports"
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```typescript
import { InterlaceSDKClient } from "@interlace/sdk";

const client = new InterlaceSDKClient({ apiKey: "YOUR_API_KEY" });
await client.collections.create({
    name: "Finance Data",
    readable_id: "finance-data-reports"
});

```

```go
package main

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

func main() {

	url := "https://api.useinterlace.com/collections"

	payload := strings.NewReader("{\n  \"name\": \"Finance Data\",\n  \"readable_id\": \"finance-data-reports\"\n}")

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

	req.Header.Add("x-api-key", "<apiKey>")
	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
require 'uri'
require 'net/http'

url = URI("https://api.useinterlace.com/collections")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"Finance Data\",\n  \"readable_id\": \"finance-data-reports\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.useinterlace.com/collections")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Finance Data\",\n  \"readable_id\": \"finance-data-reports\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.useinterlace.com/collections', [
  'body' => '{
  "name": "Finance Data",
  "readable_id": "finance-data-reports"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.useinterlace.com/collections");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Finance Data\",\n  \"readable_id\": \"finance-data-reports\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "Finance Data",
  "readable_id": "finance-data-reports"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.useinterlace.com/collections")! 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()
```