# Collections

> Kontiga is document fraud detection by Bynn Intelligence for insurers, letting agents, lenders and HR screening teams: every document is compared with a proprietary library of more than 300 million original documents, gathered over 20 years.

Documentation index: https://kontiga.com/llms.txt

Section: Reference. URL: https://kontiga.com/docs/collections

A collection is a reusable checklist: the documents and answers you ask an end customer for, the rule each must meet, and how the request reaches them. Create and change collections, read how they are doing, preview what the person sees, and move collections to and from Bynn in Bynn's own shape.

Updated December 1, 2026

## Contents

- [The collection object](https://kontiga.com/docs/collections#the-collection-object)
- [Create a collection](https://kontiga.com/docs/collections#create-a-collection)
- [List collections](https://kontiga.com/docs/collections#list-collections)
- [Read a collection](https://kontiga.com/docs/collections#read-a-collection)
- [Add a requirement](https://kontiga.com/docs/collections#add-a-requirement)
- [Duplicate a collection](https://kontiga.com/docs/collections#duplicate-a-collection)
- [Delete a collection](https://kontiga.com/docs/collections#delete-a-collection)
- [Read how collections are doing](https://kontiga.com/docs/collections#read-how-collections-are-doing)
- [List document types](https://kontiga.com/docs/collections#list-document-types)
- [Read a collection's request settings](https://kontiga.com/docs/collections#read-request-settings)
- [Change request settings](https://kontiga.com/docs/collections#change-request-settings)
- [Set a requirement's strictness](https://kontiga.com/docs/collections#set-a-requirements-strictness)
- [Preview what the person sees](https://kontiga.com/docs/collections#preview-what-the-person-sees)
- [List collections in Bynn's shape](https://kontiga.com/docs/collections#list-collections-in-bynns-shape)
- [Read a collection's definition](https://kontiga.com/docs/collections#read-a-collections-definition)
- [Create a collection in Bynn's shape](https://kontiga.com/docs/collections#create-a-collection-in-bynns-shape)
- [Save a collection's definition](https://kontiga.com/docs/collections#save-a-collections-definition)
- [Export a collection](https://kontiga.com/docs/collections#export-a-collection)
- [Import a collection from Bynn](https://kontiga.com/docs/collections#import-a-collection-from-bynn)
- [Draft a collection from a description](https://kontiga.com/docs/collections#draft-a-collection-from-a-description)
- [Propose changes to a collection](https://kontiga.com/docs/collections#propose-changes-to-a-collection)
- [Start the collection planner](https://kontiga.com/docs/collections#start-the-collection-planner)
- [Read a collection planner session](https://kontiga.com/docs/collections#read-a-collection-planner-session)
- [Answer the collection planner](https://kontiga.com/docs/collections#answer-the-collection-planner)
- [Ask the collection planner for changes](https://kontiga.com/docs/collections#ask-the-collection-planner-for-changes)
- [Keep the collection planner's proposal](https://kontiga.com/docs/collections#keep-the-collection-planners-proposal)
- [Stop the collection planner](https://kontiga.com/docs/collections#stop-the-collection-planner)
- [Drafts, versions and archiving](https://kontiga.com/docs/collections#drafts-versions-and-archiving)
- [Validate a collection](https://kontiga.com/docs/collections#validate-a-collection)
- [Publish a collection](https://kontiga.com/docs/collections#publish-a-collection)
- [List a collection's versions](https://kontiga.com/docs/collections#list-a-collections-versions)
- [Archive a collection](https://kontiga.com/docs/collections#archive-a-collection)
- [Restore a collection](https://kontiga.com/docs/collections#restore-a-collection)
- [The checklist, groups and conditions](https://kontiga.com/docs/collections#the-checklist-groups-and-conditions)
- [Read a collection's checklist](https://kontiga.com/docs/collections#read-a-collections-checklist)
- [Save a collection's checklist](https://kontiga.com/docs/collections#save-a-collections-checklist)

## The collection object

- `id` (string): The collection's id, starting with `col_`.
- `name` (string): Its name, as members see it.
- `description` (string): What it is for; null when it has none.
- `requirements` (array): What it asks for, in order. Each requirement is a `document`, an `identity` verification or a `question`, named as the checklist names it: its `key`, its `title` and `instructions` (null when none) in the default language, the document types it `accepts` (`[{"type": "passport"}]`), whether it is `required`, and `asked_when`, its condition in words (null when it is always asked). A member of a group of alternatives is never required alone: its `group` (`key`, `title`, `choose`, `required`) says how many of the group the person sends and whether the group is required; `group` is null for a requirement on its own. Required items make the checklist's count; optional ones are counted apart. The list answers `requirement_count` and `required_count` in its place unless you ask to expand it.
- `requirement_count` (integer): How many requirements it holds, group members included.
- `required_count` (integer): How many it asks for at least: each required requirement, and a required group's `choose`.
- `channel` (enum): How a request reaches the person: `email`, `sms`, `email_and_sms` or `link`.
- `reminders` (object): The reminder schedule: `first_after_days`, `then_every_days`, `before_expiry` and `max`, as the settings answer it.
- `reminders_in_words` (string): The reminder schedule in words.
- `expiry_days` (integer): How many days a request's link works.
- `cases_using` (integer): How many cases use it.
- `policy_ids` (array): The policies the whole collection is checked against.
- `requirement_policy_ids` (object): The policies each requirement is checked against, by requirement id.
- `state` (enum): `draft`, `active` or `archived`.
- `version` (integer): The latest published version; 0 for a draft never published. Requests keep the version they were sent with.
- `published_at` (string): When the latest version was published; null for a draft never published.
- `archived_at` (string): When it was archived; null unless it is.
- `created_at` (string): When it was made.

The calls with **in Bynn's shape** or **definition** in their name read and write a collection exactly as Bynn's collections API does, with Bynn's key names, so a collection made in either moves to the other unchanged. The planner turns a description in words into a collection, or a request into changes to one; nothing it proposes is saved until a member saves it.

**A collection**

```json
{
  "id": "col_5Gk3Tm7",
  "object": "collection",
  "name": "Mortgage application",
  "description": "Identity, income and address for a mortgage of up to 35 years.",
  "requirements": [
    {
      "id": "rqm_1Pa6Ws3",
      "key": "passport_or_national_id_card",
      "kind": "identity",
      "title": "Passport or national ID card",
      "instructions": "Valid for at least 30 more days",
      "accepts": [{ "type": "passport" }, { "type": "id_card" }],
      "required": true,
      "group": null,
      "asked_when": null
    },
    {
      "id": "rqm_4Yc2Hn8",
      "key": "payslips",
      "kind": "document",
      "title": "Payslips",
      "instructions": "The last 3 months, one each",
      "accepts": [{ "type": "payslip" }],
      "required": true
    },
    {
      "id": "rqm_7Lq9Dz1",
      "key": "bank_statements",
      "kind": "document",
      "title": "Bank statements",
      "instructions": "The last 3 months, the account the salary is paid into",
      "accepts": [{ "type": "bank_statements" }],
      "required": true
    },
    {
      "id": "rqm_2Bv5Kt6",
      "key": "proof_of_address",
      "kind": "document",
      "title": "Proof of address",
      "instructions": "A statement or a bill, dated in the last 3 months",
      "accepts": [{ "type": "bank_statements" }, { "type": "invoice" }],
      "required": false
    }
  ],
  "channel": "email_and_sms",
  "reminders": { "first_after_days": 2, "then_every_days": 3, "before_expiry": true, "max": 4 },
  "reminders_in_words": "After 2 days, then every 3 days, and the day before the link expires. At most 4.",
  "expiry_days": 14,
  "cases_using": 38,
  "policy_ids": ["pol_8Hm3Qr5"],
  "requirement_policy_ids": { "rqm_4Yc2Hn8": ["pol_8Hm3Qr5"] },
  "created_at": "2026-09-02T08:15:40Z",
  "updated_at": "2026-11-20T15:41:02Z",
  "state": "active",
  "version": 5,
  "published_at": "2026-11-20T15:41:02Z",
  "archived_at": null
}
```

## Create a collection

A new reusable checklist: its name, what it is for, and its requirements.

`POST /v1/collections`. Who may: Owner, Admin and Analyst. CLI: `kontiga collections create --name <name> [--description <text>] [--requirements <json>]`. MCP tool: `create_collection`.

**Parameters**
- `name` (string, required): Its name. At most 120 characters.
- `description` (string, default ""): What it is for. At most 500 characters.
- `requirements` (array of object, default []): What to ask for, in order, up to 50. Each has a `label`, a `kind` (`document`, `identity` or `question`), the document types it `accepts` (ids from the list of document types), its `rule` in words and whether it is `required` (it is unless you say `false`). The collection is made ready to send (`active`, version 1) when its checklist passes validation; otherwise it stays a `draft`, and validating it lists what to change.

**Returns** collection: The collection, ready to send.

API:

```bash
curl -X POST https://api.kontiga.com/v1/collections \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Tenancy check",
    "description": "Identity and income for a new tenant.",
    "requirements": [
      {
        "label": "Passport or national ID card",
        "kind": "identity",
        "accepts": [
          "passport",
          "national_id_card"
        ]
      },
      {
        "label": "Payslips",
        "kind": "document",
        "accepts": [
          "payslip"
        ],
        "rule": "The last 3 months"
      }
    ]
  }'
```

CLI:

```bash
kontiga collections create \
  --name 'Tenancy check' \
  --description 'Identity and income for a new tenant.' \
  --requirements '[{"label":"Passport or national ID card","kind":"identity","accepts":["passport","national_id_card"]},{"label":"Payslips","kind":"document","accepts":["payslip"],"rule":"The last 3 months"}]'
```

MCP tool `create_collection`:

```json
{
  "name": "create_collection",
  "arguments": {
    "name": "Tenancy check",
    "description": "Identity and income for a new tenant.",
    "requirements": [
      {
        "label": "Passport or national ID card",
        "kind": "identity",
        "accepts": [
          "passport",
          "national_id_card"
        ]
      },
      {
        "label": "Payslips",
        "kind": "document",
        "accepts": [
          "payslip"
        ],
        "rule": "The last 3 months"
      }
    ]
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.collections.create({
  name: "Tenancy check",
  description: "Identity and income for a new tenant.",
  requirements: [{ label: "Passport or national ID card", kind: "identity", accepts: ["passport", "national_id_card"] }, { label: "Payslips", kind: "document", accepts: ["payslip"], rule: "The last 3 months" }],
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.collections.create(
    name="Tenancy check",
    description="Identity and income for a new tenant.",
    requirements=[{"label": "Passport or national ID card", "kind": "identity", "accepts": ["passport", "national_id_card"]}, {"label": "Payslips", "kind": "document", "accepts": ["payslip"], "rule": "The last 3 months"}],
)
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Collections.Create(ctx, &kontiga.CollectionsCreateParams{
	Name:         "Tenancy check",
	Description:  "Identity and income for a new tenant.",
	Requirements: []any{map[string]any{"label": "Passport or national ID card", "kind": "identity", "accepts": []string{"passport", "national_id_card"}}, map[string]any{"label": "Payslips", "kind": "document", "accepts": []string{"payslip"}, "rule": "The last 3 months"}},
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.collections().create(CollectionsCreateParams.builder()
    .name("Tenancy check")
    .description("Identity and income for a new tenant.")
    .requirements(List.of(Map.of("label", "Passport or national ID card", "kind", "identity", "accepts", List.of("passport", "national_id_card")), Map.of("label", "Payslips", "kind", "document", "accepts", List.of("payslip"), "rule", "The last 3 months")))
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Collections.CreateAsync(new CollectionsCreateOptions
{
    Name = "Tenancy check",
    Description = "Identity and income for a new tenant.",
    Requirements = new object[] { new Dictionary<string, object> { ["label"] = "Passport or national ID card", ["kind"] = "identity", ["accepts"] = new[] { "passport", "national_id_card" } }, new Dictionary<string, object> { ["label"] = "Payslips", ["kind"] = "document", ["accepts"] = new[] { "payslip" }, ["rule"] = "The last 3 months" } },
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->collections->create([
    'name' => 'Tenancy check',
    'description' => 'Identity and income for a new tenant.',
    'requirements' => [['label' => 'Passport or national ID card', 'kind' => 'identity', 'accepts' => ['passport', 'national_id_card']], ['label' => 'Payslips', 'kind' => 'document', 'accepts' => ['payslip'], 'rule' => 'The last 3 months']],
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.collections.create(
  name: "Tenancy check",
  description: "Identity and income for a new tenant.",
  requirements: [{ label: "Passport or national ID card", kind: "identity", accepts: ["passport", "national_id_card"] }, { label: "Payslips", kind: "document", accepts: ["payslip"], rule: "The last 3 months" }]
)
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .collections()
    .create(kontiga::collections::CreateParams {
        name: "Tenancy check".into(),
        description: "Identity and income for a new tenant.".into(),
        requirements: vec![serde_json::json!({"label":"Passport or national ID card","kind":"identity","accepts":["passport","national_id_card"]}), serde_json::json!({"label":"Payslips","kind":"document","accepts":["payslip"],"rule":"The last 3 months"})],
        ..Default::default()
    })
    .await?;
```

Response, 201 Created:

```json
{
  "id": "col_9Rf2Lx4",
  "object": "collection",
  "name": "Tenancy check",
  "description": "Identity and income for a new tenant.",
  "requirements": [
    {
      "id": "rqm_3Gw8Mb2",
      "key": "passport_or_national_id_card",
      "kind": "identity",
      "title": "Passport or national ID card",
      "instructions": null,
      "accepts": [{ "type": "passport" }, { "type": "id_card" }],
      "required": true
    },
    {
      "id": "rqm_6Ns1Vy7",
      "key": "payslips",
      "kind": "document",
      "title": "Payslips",
      "instructions": "The last 3 months",
      "accepts": [{ "type": "payslip" }],
      "required": true
    }
  ],
  "channel": "email",
  "reminders": { "first_after_days": 2, "then_every_days": 7, "before_expiry": true, "max": 6 },
  "reminders_in_words": "After 2 days, then every 7 days, and the day before the link expires. At most 6.",
  "expiry_days": 30,
  "cases_using": 0,
  "policy_ids": [],
  "requirement_policy_ids": {},
  "created_at": "2026-11-27T10:12:30Z",
  "updated_at": "2026-11-27T10:12:30Z",
  "state": "active",
  "version": 1,
  "published_at": "2026-11-27T10:12:30Z",
  "archived_at": null
}
```

## List collections

The reusable checklists: what is asked for, and how.

`GET /v1/collections`. Who may: Owner, Admin, Analyst, Developer and Viewer. CLI: `kontiga collections list [--expand requirements] [--counts] [--limit <1-200>] [--cursor <next_cursor>]`. MCP tool: `list_collections`.

**Parameters**
- `expand` (enum): `requirements` gives each collection's requirements too; without it, a page answers their counts (`requirement_count`, `required_count`), which keeps a page small.
- `counts` (boolean): `true` adds `counts`: how many collections the workspace holds in all and in each state, in one count.
- `limit` (integer): How many collections a page holds, 1 to 200; 100 when left out. A page also stops at about 2 MB of collections, so a page of large ones may hold fewer than `limit` while `next_cursor` goes on. A workspace reads at most 4 such pages at once (the list, Bynn's definitions, the versions); one more answers `429 rate_limited` with `details.reason` `collection_reads_in_flight` and a wait of under a second.
- `cursor` (string): The `next_cursor` of the page before, for the page after it.

**Returns** list of collections: The collections, newest first, a page at a time (next_cursor): each with how many requirements it holds and requires, its state and version; with expand, each requirement too; with counts, how many the workspace holds in each state.

API:

```bash
curl -X GET https://api.kontiga.com/v1/collections \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga collections list
```

MCP tool `list_collections`:

```json
{
  "name": "list_collections",
  "arguments": {}
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.collections.list();
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.collections.list()
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Collections.List(ctx)
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.collections().list();
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Collections.ListAsync();
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->collections->list();
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.collections.list
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .collections()
    .list()
    .await?;
```

Response, 200 OK:

```json
{
  "items": [
    {
      "id": "col_9Rf2Lx4",
      "object": "collection",
      "name": "Tenancy check",
      "description": "Identity and income for a new tenant.",
      "requirement_count": 2,
      "required_count": 2,
      "channel": "email",
      "reminders": { "first_after_days": 2, "then_every_days": 7, "before_expiry": true, "max": 6 },
      "reminders_in_words": "After 2 days, then every 7 days, and the day before the link expires. At most 6.",
      "expiry_days": 30,
      "cases_using": 0,
      "policy_ids": [],
      "requirement_policy_ids": {},
      "updated_at": "2026-11-27T10:12:30Z",
      "state": "active",
      "version": 1
    }
  ],
  "next_cursor": "col_9Rf2Lx4",
  "counts": { "all": 12, "draft": 3, "active": 8, "archived": 1 }
}
```

## Read a collection

One checklist: its requirements in order, their rules, reminders, expiry and linked policies; or one published version as it was published.

`GET /v1/collections/{collection_id}`. Who may: Owner, Admin, Analyst, Developer and Viewer. CLI: `kontiga collections get <collection_id> [--version <n>]`. MCP tool: `get_collection`.

**Parameters**
- `collection_id` (id (col_), required): The collection to read, as it stands. In the path.
- `version` (integer): A published version, to read it exactly as it was published. At least 1.

**Returns** collection: The collection as it stands, or the version asked for.

API:

```bash
curl -X GET https://api.kontiga.com/v1/collections/col_5Gk3Tm7 \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga collections get col_5Gk3Tm7
```

MCP tool `get_collection`:

```json
{
  "name": "get_collection",
  "arguments": {
    "collection_id": "col_5Gk3Tm7"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.collections.get("col_5Gk3Tm7");
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.collections.get("col_5Gk3Tm7")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Collections.Get(ctx, "col_5Gk3Tm7")
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.collections().get("col_5Gk3Tm7");
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Collections.GetAsync("col_5Gk3Tm7");
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->collections->get('col_5Gk3Tm7');
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.collections.get("col_5Gk3Tm7")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .collections()
    .get("col_5Gk3Tm7".into())
    .await?;
```

Response, 200 OK:

```json
{
  "id": "col_5Gk3Tm7",
  "object": "collection",
  "name": "Mortgage application",
  "description": "Identity, income and address for a mortgage of up to 35 years.",
  "requirements": [
    {
      "id": "rqm_1Pa6Ws3",
      "key": "passport_or_national_id_card",
      "kind": "identity",
      "title": "Passport or national ID card",
      "instructions": "Valid for at least 30 more days",
      "accepts": [{ "type": "passport" }, { "type": "id_card" }],
      "required": true,
      "group": null,
      "asked_when": null
    },
    {
      "id": "rqm_4Yc2Hn8",
      "key": "payslips",
      "kind": "document",
      "title": "Payslips",
      "instructions": "The last 3 months, one each",
      "accepts": [{ "type": "payslip" }],
      "required": true
    },
    {
      "id": "rqm_7Lq9Dz1",
      "key": "bank_statements",
      "kind": "document",
      "title": "Bank statements",
      "instructions": "The last 3 months, the account the salary is paid into",
      "accepts": [{ "type": "bank_statements" }],
      "required": true
    },
    {
      "id": "rqm_2Bv5Kt6",
      "key": "proof_of_address",
      "kind": "document",
      "title": "Proof of address",
      "instructions": "A statement or a bill, dated in the last 3 months",
      "accepts": [{ "type": "bank_statements" }, { "type": "invoice" }],
      "required": false
    }
  ],
  "channel": "email_and_sms",
  "reminders": { "first_after_days": 2, "then_every_days": 3, "before_expiry": true, "max": 4 },
  "reminders_in_words": "After 2 days, then every 3 days, and the day before the link expires. At most 4.",
  "expiry_days": 14,
  "cases_using": 38,
  "policy_ids": ["pol_8Hm3Qr5"],
  "requirement_policy_ids": { "rqm_4Yc2Hn8": ["pol_8Hm3Qr5"] },
  "created_at": "2026-09-02T08:15:40Z",
  "updated_at": "2026-11-20T15:41:02Z",
  "state": "active",
  "version": 5,
  "published_at": "2026-11-20T15:41:02Z",
  "archived_at": null
}
```

## Add a requirement

Add one thing to ask for at the end of a checklist.

`POST /v1/collections/{collection_id}/requirements`. Who may: Owner, Admin and Analyst. CLI: `kontiga collections add-requirement <collection_id> --label <text> --kind <document|identity|question> [--accepts <type,...>] [--rule <text>] [--required=false] [--answer <yes_no|dropdown|number|date|text|...>] [--options <a,b,...>]`. MCP tool: `add_requirement`.

**Parameters**
- `label` (string, required): What the person is asked for, in a few words. At most 120 characters.
- `kind` (enum, required): A document, an identity verification or a question. One of `document`, `identity`, `question`.
- `accepts` (array of string, default []): The document types that satisfy it, from the list of document types. At most 20 items.
- `rule` (string, default ""): What it must meet, in words, such as how recent it is or how many months it covers. At most 240 characters.
- `required` (boolean, default true): `false` makes it optional. Optional items are shown apart and do not hold the checklist.
- `answer` (enum): A question's kind of answer: `yes_no`, `dropdown` (one of `options`), `multi_select`, `number`, `currency`, `date`, `text` (when left out), `textarea`, `email`, `phone` or `country`. A yes or no question, or one of a list, lets a later entry be asked only when it holds. One of `text`, `textarea`, `email`, `url`, `phone`, `number`, `date`, `dropdown`, `multi_select`, `yes_no`, `country`, `currency`.
- `options` (array of string): For `dropdown` and `multi_select`: the options, in order, up to 100.
- `collection_id` (id (col_), required): The collection to add it to. It goes at the end of the draft; requests ask for it once you publish the collection. In the path.

**Returns** collection: The collection with the requirement added.

API:

```bash
curl -X POST https://api.kontiga.com/v1/collections/col_5Gk3Tm7/requirements \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "label": "Employment contract",
    "kind": "document",
    "accepts": [
      "contract"
    ],
    "rule": "Signed by both sides",
    "required": false
  }'
```

CLI:

```bash
kontiga collections add-requirement col_5Gk3Tm7 \
  --label 'Employment contract' \
  --kind document \
  --accepts contract \
  --rule 'Signed by both sides' \
  --required=false
```

MCP tool `add_requirement`:

```json
{
  "name": "add_requirement",
  "arguments": {
    "label": "Employment contract",
    "kind": "document",
    "accepts": [
      "contract"
    ],
    "rule": "Signed by both sides",
    "required": false,
    "collection_id": "col_5Gk3Tm7"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.collections.addRequirement("col_5Gk3Tm7", {
  label: "Employment contract",
  kind: "document",
  accepts: ["contract"],
  rule: "Signed by both sides",
  required: false,
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.collections.add_requirement(
    "col_5Gk3Tm7",
    label="Employment contract",
    kind="document",
    accepts=["contract"],
    rule="Signed by both sides",
    required=False,
)
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Collections.AddRequirement(ctx, "col_5Gk3Tm7", &kontiga.CollectionsAddRequirementParams{
	Label:    "Employment contract",
	Kind:     "document",
	Accepts:  []string{"contract"},
	Rule:     "Signed by both sides",
	Required: false,
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.collections().addRequirement("col_5Gk3Tm7", CollectionsAddRequirementParams.builder()
    .label("Employment contract")
    .kind("document")
    .accepts(List.of("contract"))
    .rule("Signed by both sides")
    .required(false)
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Collections.AddRequirementAsync("col_5Gk3Tm7", new CollectionsAddRequirementOptions
{
    Label = "Employment contract",
    Kind = "document",
    Accepts = new[] { "contract" },
    Rule = "Signed by both sides",
    Required = false,
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->collections->addRequirement('col_5Gk3Tm7', [
    'label' => 'Employment contract',
    'kind' => 'document',
    'accepts' => ['contract'],
    'rule' => 'Signed by both sides',
    'required' => false,
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.collections.add_requirement(
  "col_5Gk3Tm7",
  label: "Employment contract",
  kind: "document",
  accepts: ["contract"],
  rule: "Signed by both sides",
  required: false
)
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .collections()
    .add_requirement("col_5Gk3Tm7".into(), kontiga::collections::AddRequirementParams {
        label: "Employment contract".into(),
        kind: "document".into(),
        accepts: vec!["contract".into()],
        rule: "Signed by both sides".into(),
        required: false,
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "id": "col_5Gk3Tm7",
  "object": "collection",
  "name": "Mortgage application",
  "description": "Identity, income and address for a mortgage of up to 35 years.",
  "requirements": [
    {
      "id": "rqm_1Pa6Ws3",
      "key": "passport_or_national_id_card",
      "kind": "identity",
      "title": "Passport or national ID card",
      "instructions": "Valid for at least 30 more days",
      "accepts": [{ "type": "passport" }, { "type": "id_card" }],
      "required": true,
      "group": null,
      "asked_when": null
    },
    {
      "id": "rqm_4Yc2Hn8",
      "key": "payslips",
      "kind": "document",
      "title": "Payslips",
      "instructions": "The last 3 months, one each",
      "accepts": [{ "type": "payslip" }],
      "required": true
    },
    {
      "id": "rqm_7Lq9Dz1",
      "key": "bank_statements",
      "kind": "document",
      "title": "Bank statements",
      "instructions": "The last 3 months, the account the salary is paid into",
      "accepts": [{ "type": "bank_statements" }],
      "required": true
    },
    {
      "id": "rqm_2Bv5Kt6",
      "key": "proof_of_address",
      "kind": "document",
      "title": "Proof of address",
      "instructions": "A statement or a bill, dated in the last 3 months",
      "accepts": [{ "type": "bank_statements" }, { "type": "invoice" }],
      "required": false
    }
  ],
  "channel": "email_and_sms",
  "reminders": { "first_after_days": 2, "then_every_days": 3, "before_expiry": true, "max": 4 },
  "reminders_in_words": "After 2 days, then every 3 days, and the day before the link expires. At most 4.",
  "expiry_days": 14,
  "cases_using": 38,
  "policy_ids": ["pol_8Hm3Qr5"],
  "requirement_policy_ids": { "rqm_4Yc2Hn8": ["pol_8Hm3Qr5"] },
  "created_at": "2026-09-02T08:15:40Z",
  "updated_at": "2026-11-20T15:41:02Z",
  "state": "active",
  "version": 5,
  "published_at": "2026-11-20T15:41:02Z",
  "archived_at": null
}
```

## Duplicate a collection

A copy as a draft, named “<name> (Copy)” unless you name it, with every document and every setting it holds, the questions only Kontiga asks and each requirement's strictness included. Policies linked to the original stay on it.

`POST /v1/collections/{collection_id}/duplicate`. Who may: Owner, Admin and Analyst. CLI: `kontiga collections duplicate <collection_id> [--name <text>] [--description <text>]`. MCP tool: `duplicate_collection`.

**Parameters**
- `collection_id` (id (col_), required): The collection to copy. The copy is a draft with every document and setting. Policies stay on the original only. In the path.
- `name` (string): The copy's name. It is the original's name with “(Copy)” after it unless you give one.
- `description` (string): The copy's description. The original's unless you give one.

**Returns** collection: The copy, a draft, as get_collection reads it.

API:

```bash
curl -X POST https://api.kontiga.com/v1/collections/col_5Gk3Tm7/duplicate \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga collections duplicate col_5Gk3Tm7
```

MCP tool `duplicate_collection`:

```json
{
  "name": "duplicate_collection",
  "arguments": {
    "collection_id": "col_5Gk3Tm7"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.collections.duplicate("col_5Gk3Tm7");
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.collections.duplicate("col_5Gk3Tm7")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Collections.Duplicate(ctx, "col_5Gk3Tm7")
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.collections().duplicate("col_5Gk3Tm7");
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Collections.DuplicateAsync("col_5Gk3Tm7");
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->collections->duplicate('col_5Gk3Tm7');
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.collections.duplicate("col_5Gk3Tm7")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .collections()
    .duplicate("col_5Gk3Tm7".into())
    .await?;
```

Response, 201 Created:

```json
{
  "id": "col_3Xm7Kd5",
  "object": "collection",
  "name": "Mortgage application (Copy)",
  "description": "Identity, income and address for a mortgage of up to 35 years.",
  "requirements": [
    { "id": "rqm_2Hq7Wd4", "label": "Passport or national ID card", "kind": "identity", "accepts": ["passport", "id_card"], "rule": "Valid for at least 30 more days", "required": true, "group": null },
    { "id": "rqm_5Kd3Tn8", "label": "Payslips", "kind": "document", "accepts": ["payslip"], "rule": "The last 3 months, one each", "required": true, "group": null }
  ],
  "requirement_count": 2,
  "required_count": 2,
  "channel": "email",
  "reminders": "After 2 days, then every 7 days, and the day before the link expires. At most 6.",
  "expiry_days": 30,
  "cases_using": 0,
  "updated_at": "2026-11-27T10:35:02Z",
  "state": "draft",
  "version": 0,
  "policy_ids": [],
  "requirement_policy_ids": {}
}
```

The answer is the copy, as `collections.get` reads it: a `draft`, under its own `col_` id.

## Delete a collection

Remove a collection and its documents. New requests cannot use it; a workflow step that names it asks for nothing from then on, so the console lists those workflows first.

`DELETE /v1/collections/{collection_id}`. Who may: Owner, Admin and Analyst. CLI: `kontiga collections delete <collection_id>`. MCP tool: `delete_collection`.

**Parameters**
- `collection_id` (id (col_), required): The collection to delete. Refused while a request on it is still open; requests already sent keep their checklist, and no new request can use it. A collection no request or case ever used is removed with its versions; one that was used is kept for its requests, and its versions still count in the workspace's storage. In the path.

**Returns** deleted collection: When it was removed, and the workflows that still name it.

API:

```bash
curl -X DELETE https://api.kontiga.com/v1/collections/col_9Rf2Lx4 \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga collections delete col_9Rf2Lx4
```

MCP tool `delete_collection`:

```json
{
  "name": "delete_collection",
  "arguments": {
    "collection_id": "col_9Rf2Lx4"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.collections.delete("col_9Rf2Lx4");
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.collections.delete("col_9Rf2Lx4")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Collections.Delete(ctx, "col_9Rf2Lx4")
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.collections().delete("col_9Rf2Lx4");
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Collections.DeleteAsync("col_9Rf2Lx4");
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->collections->delete('col_9Rf2Lx4');
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.collections.delete("col_9Rf2Lx4")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .collections()
    .delete("col_9Rf2Lx4".into())
    .await?;
```

Response, 200 OK:

```json
{
  "object": "deleted_collection",
  "collection_id": "col_9Rf2Lx4",
  "deleted_at": "2026-11-27T10:40:18Z",
  "used_by": ["wf_6Gn2Rt8"]
}
```

## Read how collections are doing

For each collection: the cases using it, the requests sent from it, how many are still open or expired, when the last one went out, and how many of the requests sent in the last 30 days were completed (the figure Insights shows for the collection).

`GET /v1/collections/stats`. Who may: Owner, Admin, Analyst, Developer and Viewer. CLI: `kontiga collections stats [--collection-id <collection_id> | --collection-ids <collection_id,...>]`. MCP tool: `get_collection_stats`.

**Parameters**
- `collection_id` (id (col_)): One collection. Every collection when left out.
- `collection_ids` (array of id (col_)): Several collections, comma-separated, up to 200: a page of the list. Use one or the other.

**Returns** list of collection stats: One line of figures per collection, or for the ones asked for.

API:

```bash
curl -X GET "https://api.kontiga.com/v1/collections/stats?collection_id=col_5Gk3Tm7" \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga collections stats --collection-id col_5Gk3Tm7
```

MCP tool `get_collection_stats`:

```json
{
  "name": "get_collection_stats",
  "arguments": {
    "collection_id": "col_5Gk3Tm7"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.collections.stats({
  collection_id: "col_5Gk3Tm7",
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.collections.stats(collection_id="col_5Gk3Tm7")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Collections.Stats(ctx, &kontiga.CollectionsStatsParams{
	CollectionId: "col_5Gk3Tm7",
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.collections().stats(CollectionsStatsParams.builder()
    .collectionId("col_5Gk3Tm7")
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Collections.StatsAsync(new CollectionsStatsOptions
{
    CollectionId = "col_5Gk3Tm7",
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->collections->stats([
    'collection_id' => 'col_5Gk3Tm7',
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.collections.stats(collection_id: "col_5Gk3Tm7")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .collections()
    .stats(kontiga::collections::StatsParams {
        collection_id: "col_5Gk3Tm7".into(),
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "items": [
    {
      "object": "collection_stats",
      "collection_id": "col_5Gk3Tm7",
      "cases_using": 38,
      "sent": 41,
      "completed": 33,
      "open": 6,
      "expired": 2,
      "period_days": 30,
      "sent_in_period": 12,
      "completed_in_period": 9,
      "completion_rate": 75.0,
      "last_sent_at": "2026-11-26T16:05:40Z"
    }
  ],
  "next_cursor": null
}
```

## List document types

The 84 document types a requirement can ask for, each with its id, its label and its category, in the catalogue's order.

`GET /v1/collections/document-types`. Who may: Owner, Admin, Analyst, Developer and Viewer. CLI: `kontiga collections document-types`. MCP tool: `list_document_types`.

**Parameters**

**Returns** list of document types: Each type's id, label and category (identity, financial, business and the rest).

API:

```bash
curl -X GET https://api.kontiga.com/v1/collections/document-types \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga collections document-types
```

MCP tool `list_document_types`:

```json
{
  "name": "list_document_types",
  "arguments": {}
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.collections.documentTypes();
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.collections.document_types()
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Collections.DocumentTypes(ctx)
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.collections().documentTypes();
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Collections.DocumentTypesAsync();
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->collections->documentTypes();
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.collections.document_types
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .collections()
    .document_types()
    .await?;
```

Response, 200 OK:

```json
{
  "items": [
    { "id": "passport", "label": "Passport", "category": "identity", "labels": { "en": "Passport", "pt": "Passaporte", "es": "Pasaporte", "ar": "جواز السفر", "zht": "護照", "zhs": "护照", "fr": "Passeport", "de": "Reisepass", "ja": "パスポート", "hi": "पासपोर्ट", "ru": "Паспорт", "sv": "Pass" } },
    { "id": "drivers_license", "label": "Driver's License", "category": "identity" },
    { "id": "bank_statements", "label": "Bank Statements", "category": "financial" },
    { "id": "payslip", "label": "Payslip", "category": "financial" },
    { "id": "business_registration", "label": "Business Registration", "category": "business" }
  ],
  "next_cursor": null
}
```

## Read a collection's request settings

How requests from a collection are sent: the channel, the reminder schedule, when the link expires, the brand kit, who may open the link, the fallback language and the purpose the person reads, with each requirement's strictness and rules.

`GET /v1/collections/{collection_id}/settings`. Who may: Owner, Admin, Analyst, Developer and Viewer. CLI: `kontiga collections settings <collection_id>`. MCP tool: `get_collection_settings`.

**Parameters**
- `collection_id` (id (col_), required): The collection whose request settings to read. In the path.

**Returns** collection settings: The collection's request settings, its state and version, the brand kits to choose from, and each requirement's checks.

API:

```bash
curl -X GET https://api.kontiga.com/v1/collections/col_5Gk3Tm7/settings \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga collections settings col_5Gk3Tm7
```

MCP tool `get_collection_settings`:

```json
{
  "name": "get_collection_settings",
  "arguments": {
    "collection_id": "col_5Gk3Tm7"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.collections.settings("col_5Gk3Tm7");
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.collections.settings("col_5Gk3Tm7")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Collections.Settings(ctx, "col_5Gk3Tm7")
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.collections().settings("col_5Gk3Tm7");
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Collections.SettingsAsync("col_5Gk3Tm7");
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->collections->settings('col_5Gk3Tm7');
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.collections.settings("col_5Gk3Tm7")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .collections()
    .settings("col_5Gk3Tm7".into())
    .await?;
```

Response, 200 OK:

```json
{
  "object": "collection_settings",
  "collection_id": "col_5Gk3Tm7",
  "state": "active",
  "version": 6,
  "purpose": "We need these to assess your mortgage application.",
  "channel": "email_and_sms",
  "reminders": {
    "first_after_days": 2,
    "then_every_days": 3,
    "before_expiry": true,
    "max": 4
  },
  "reminders_in_words": "After 2 days, then every 3 days, and the day before the link expires. At most 4.",
  "expiry_days": 14,
  "access": "code",
  "language": "en",
  "brand_kit": {
    "id": "bk_2Tz7Cn4",
    "name": "Harbourline",
    "sender_name": "Harbourline Lending",
    "reply_to": "mortgages@harbourline.example",
    "is_default": true
  },
  "brand_kits": [
    { "id": "bk_2Tz7Cn4", "name": "Harbourline", "sender_name": "Harbourline Lending", "reply_to": "mortgages@harbourline.example", "is_default": true }
  ],
  "requirements": [
    {
      "requirement_id": "rqm_4Yc2Hn8",
      "strictness": "advise",
      "files": { "min": 3, "max": 3 },
      "rules": [
        { "rule": "covers_consecutive_months", "words": "3 months in a row, the latest from the last 45 days" },
        { "rule": "name_matches", "words": "The name matches the person in People" }
      ],
      "asked_when": null
    }
  ],
  "updated_at": "2026-11-20T15:41:02Z"
}
```

## Change request settings

Set how requests from a collection are sent: the channel, the reminders, when the link expires, the brand kit, who may open the link, the fallback language and the purpose. Requests already sent keep theirs.

`PATCH /v1/collections/{collection_id}`. Who may: Owner, Admin and Analyst. CLI: `kontiga collections update <collection_id> [--channel <email|sms|email_and_sms|link>] [--expiry-days <1-365>] [--first-reminder-days <0-30>] [--reminder-every-days <0-30>] [--remind-before-expiry=false] [--max-reminders <1-10>] [--access <link|code|identity>] [--brand-kit-id <bk_id>] [--language <en|pt|es|ar|zht|zhs|fr|de|ja|hi|ru|sv>] [--purpose <text>]`. MCP tool: `update_collection_settings`.

**Parameters**
- `collection_id` (id (col_), required): The collection to change. Give only what changes: it applies to the next request at once, and requests already sent keep their settings. A value refused changes nothing. In the path.
- `channel` (enum): How a request reaches the person. `link` sends nothing and gives you the link for your own channel. One of `email`, `sms`, `email_and_sms`, `link`.
- `expiry_days` (integer): How many days the link works. At least 1, at most 365.
- `first_reminder_days` (integer): Days until the first reminder. 0 sends no reminders. At most 30.
- `reminder_every_days` (integer): Days between later reminders. At most 30.
- `remind_before_expiry` (boolean): Also remind the day before the link expires.
- `max_reminders` (integer): The most reminders one request gets. At least 1, at most 10.
- `access` (enum): Who may open the link: anyone with it (`link`), with a code sent to them (`code`), or after verifying their identity (`identity`).
- `brand_kit_id` (id (bk_)): The brand kit the person sees, from the settings' `brand_kits`.
- `language` (enum): The page's language when the person's own is not offered. One of `en`, `pt`, `es`, `ar`, `zht`, `zhs`, `fr`, `de`, `ja`, `hi`, `ru`, `sv`.
- `purpose` (string): Why you ask, in a sentence the person reads at the top. At most 300 characters.

**Returns** collection settings: The collection's request settings as they now are.

API:

```bash
curl -X PATCH https://api.kontiga.com/v1/collections/col_5Gk3Tm7 \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "channel": "email_and_sms",
    "expiry_days": 14,
    "first_reminder_days": 2,
    "reminder_every_days": 3,
    "max_reminders": 4
  }'
```

CLI:

```bash
kontiga collections update col_5Gk3Tm7 \
  --channel email_and_sms \
  --expiry-days 14 \
  --first-reminder-days 2 \
  --reminder-every-days 3 \
  --max-reminders 4
```

MCP tool `update_collection_settings`:

```json
{
  "name": "update_collection_settings",
  "arguments": {
    "collection_id": "col_5Gk3Tm7",
    "channel": "email_and_sms",
    "expiry_days": 14,
    "first_reminder_days": 2,
    "reminder_every_days": 3,
    "max_reminders": 4
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.collections.updateSettings("col_5Gk3Tm7", {
  channel: "email_and_sms",
  expiry_days: 14,
  first_reminder_days: 2,
  reminder_every_days: 3,
  max_reminders: 4,
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.collections.update_settings(
    "col_5Gk3Tm7",
    channel="email_and_sms",
    expiry_days=14,
    first_reminder_days=2,
    reminder_every_days=3,
    max_reminders=4,
)
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Collections.UpdateSettings(ctx, "col_5Gk3Tm7", &kontiga.CollectionsUpdateSettingsParams{
	Channel:           "email_and_sms",
	ExpiryDays:        14,
	FirstReminderDays: 2,
	ReminderEveryDays: 3,
	MaxReminders:      4,
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.collections().updateSettings("col_5Gk3Tm7", CollectionsUpdateSettingsParams.builder()
    .channel("email_and_sms")
    .expiryDays(14)
    .firstReminderDays(2)
    .reminderEveryDays(3)
    .maxReminders(4)
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Collections.UpdateSettingsAsync("col_5Gk3Tm7", new CollectionsUpdateSettingsOptions
{
    Channel = "email_and_sms",
    ExpiryDays = 14,
    FirstReminderDays = 2,
    ReminderEveryDays = 3,
    MaxReminders = 4,
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->collections->updateSettings('col_5Gk3Tm7', [
    'channel' => 'email_and_sms',
    'expiry_days' => 14,
    'first_reminder_days' => 2,
    'reminder_every_days' => 3,
    'max_reminders' => 4,
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.collections.update_settings(
  "col_5Gk3Tm7",
  channel: "email_and_sms",
  expiry_days: 14,
  first_reminder_days: 2,
  reminder_every_days: 3,
  max_reminders: 4
)
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .collections()
    .update_settings("col_5Gk3Tm7".into(), kontiga::collections::UpdateSettingsParams {
        channel: "email_and_sms".into(),
        expiry_days: 14,
        first_reminder_days: 2,
        reminder_every_days: 3,
        max_reminders: 4,
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "object": "collection_settings",
  "collection_id": "col_5Gk3Tm7",
  "state": "active",
  "version": 6,
  "purpose": "We need these to assess your mortgage application.",
  "channel": "email_and_sms",
  "reminders": {
    "first_after_days": 2,
    "then_every_days": 3,
    "before_expiry": true,
    "max": 4
  },
  "reminders_in_words": "After 2 days, then every 3 days, and the day before the link expires. At most 4.",
  "expiry_days": 14,
  "access": "code",
  "language": "en",
  "brand_kit": {
    "id": "bk_2Tz7Cn4",
    "name": "Harbourline",
    "sender_name": "Harbourline Lending",
    "reply_to": "mortgages@harbourline.example",
    "is_default": true
  },
  "brand_kits": [
    { "id": "bk_2Tz7Cn4", "name": "Harbourline", "sender_name": "Harbourline Lending", "reply_to": "mortgages@harbourline.example", "is_default": true }
  ],
  "requirements": [
    {
      "requirement_id": "rqm_4Yc2Hn8",
      "strictness": "advise",
      "files": { "min": 3, "max": 3 },
      "rules": [
        { "rule": "covers_consecutive_months", "words": "3 months in a row, the latest from the last 45 days" },
        { "rule": "name_matches", "words": "The name matches the person in People" }
      ],
      "asked_when": null
    }
  ],
  "updated_at": "2026-11-20T15:41:02Z"
}
```

## Set a requirement's strictness

How strictly a requirement's documents are held while the person uploads: off, advise (told what to fix, may keep the file) or enforce (must send one that passes).

`PATCH /v1/collections/{collection_id}/requirements/{requirement_id}`. Who may: Owner, Admin and Analyst. CLI: `kontiga collections set-strictness <collection_id> <requirement_id> --strictness <off|advise|enforce>`. MCP tool: `set_requirement_strictness`.

**Parameters**
- `collection_id` (id (col_), required): The collection the requirement is in. In the path.
- `requirement_id` (id (rqm_), required): The requirement to change. The change is made in the draft and applies once you publish the collection. In the path.
- `strictness` (enum, required): `off` refuses only files that cannot be opened or used. `advise` tells the person what to fix and lets them keep the file with a note. `enforce` asks for a file that passes. A gap against a policy never refuses a file.

**Returns** collection settings: The collection's settings, with the requirement's new strictness.

API:

```bash
curl -X PATCH https://api.kontiga.com/v1/collections/col_5Gk3Tm7/requirements/rqm_4Yc2Hn8 \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "strictness": "advise"
  }'
```

CLI:

```bash
kontiga collections set-strictness col_5Gk3Tm7 rqm_4Yc2Hn8 \
  --strictness advise
```

MCP tool `set_requirement_strictness`:

```json
{
  "name": "set_requirement_strictness",
  "arguments": {
    "collection_id": "col_5Gk3Tm7",
    "requirement_id": "rqm_4Yc2Hn8",
    "strictness": "advise"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.collections.setStrictness("col_5Gk3Tm7", "rqm_4Yc2Hn8", {
  strictness: "advise",
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.collections.set_strictness(
    "col_5Gk3Tm7",
    "rqm_4Yc2Hn8",
    strictness="advise",
)
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Collections.SetStrictness(ctx, "col_5Gk3Tm7", "rqm_4Yc2Hn8", &kontiga.CollectionsSetStrictnessParams{
	Strictness: "advise",
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.collections().setStrictness("col_5Gk3Tm7", "rqm_4Yc2Hn8", CollectionsSetStrictnessParams.builder()
    .strictness("advise")
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Collections.SetStrictnessAsync("col_5Gk3Tm7", "rqm_4Yc2Hn8", new CollectionsSetStrictnessOptions
{
    Strictness = "advise",
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->collections->setStrictness('col_5Gk3Tm7', 'rqm_4Yc2Hn8', [
    'strictness' => 'advise',
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.collections.set_strictness(
  "col_5Gk3Tm7",
  "rqm_4Yc2Hn8",
  strictness: "advise"
)
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .collections()
    .set_strictness("col_5Gk3Tm7".into(), "rqm_4Yc2Hn8".into(), kontiga::collections::SetStrictnessParams {
        strictness: "advise".into(),
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "object": "collection_settings",
  "collection_id": "col_5Gk3Tm7",
  "state": "active",
  "version": 6,
  "purpose": "We need these to assess your mortgage application.",
  "channel": "email_and_sms",
  "reminders": {
    "first_after_days": 2,
    "then_every_days": 3,
    "before_expiry": true,
    "max": 4
  },
  "reminders_in_words": "After 2 days, then every 3 days, and the day before the link expires. At most 4.",
  "expiry_days": 14,
  "access": "code",
  "language": "en",
  "brand_kit": {
    "id": "bk_2Tz7Cn4",
    "name": "Harbourline",
    "sender_name": "Harbourline Lending",
    "reply_to": "mortgages@harbourline.example",
    "is_default": true
  },
  "brand_kits": [
    { "id": "bk_2Tz7Cn4", "name": "Harbourline", "sender_name": "Harbourline Lending", "reply_to": "mortgages@harbourline.example", "is_default": true }
  ],
  "requirements": [
    {
      "requirement_id": "rqm_4Yc2Hn8",
      "strictness": "advise",
      "files": { "min": 3, "max": 3 },
      "rules": [
        { "rule": "covers_consecutive_months", "words": "3 months in a row, the latest from the last 45 days" },
        { "rule": "name_matches", "words": "The name matches the person in People" }
      ],
      "asked_when": null
    }
  ],
  "updated_at": "2026-11-20T15:41:02Z"
}
```

## Preview what the person sees

The portal's checklist for a collection as the end customer reads it, in the brand kit's name, and the message they get when a linked policy finds something they can add.

`GET /v1/collections/{collection_id}/preview`. Who may: Owner, Admin, Analyst, Developer and Viewer. CLI: `kontiga collections preview <collection_id> [--locale <en|pt|es|ar|zht|zhs|fr|de|ja|hi|ru|sv>]`. MCP tool: `preview_collection`.

**Parameters**
- `collection_id` (id (col_), required): The collection to preview. In the path.
- `locale` (enum): Optional: one of the 12 languages (`en`, `pt`, `es`, `ar`, `zht`, `zhs`, `fr`, `de`, `ja`, `hi`, `ru`, `sv`). The page's words (the heading, the introduction, how long the link lasts) are the portal's own in it, and `direction` says how it reads (`rtl` for Arabic); each line is in it too, a text not written in it in the collection's default language. Without it, the default language. One line an entry, as the portal lays it out: a group of alternatives is one line naming them (no `requirement_id`, its group `key`), and a line asked only under a condition is `conditional`, shown once the condition holds.

**Returns** collection preview: In the language asked for, as the portal writes it: the heading, the introduction, the purpose, each line with its instructions (a group of alternatives as one line, a line asked under a condition marked), the expiry line, the text's direction, and the fixable policy gap message, if any.

API:

```bash
curl -X GET "https://api.kontiga.com/v1/collections/col_5Gk3Tm7/preview?locale=en" \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga collections preview col_5Gk3Tm7 --locale en
```

MCP tool `preview_collection`:

```json
{
  "name": "preview_collection",
  "arguments": {
    "collection_id": "col_5Gk3Tm7",
    "locale": "en"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.collections.preview("col_5Gk3Tm7", {
  locale: "en",
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.collections.preview("col_5Gk3Tm7", locale="en")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Collections.Preview(ctx, "col_5Gk3Tm7", &kontiga.CollectionsPreviewParams{
	Locale: "en",
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.collections().preview("col_5Gk3Tm7", CollectionsPreviewParams.builder()
    .locale("en")
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Collections.PreviewAsync("col_5Gk3Tm7", new CollectionsPreviewOptions
{
    Locale = "en",
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->collections->preview('col_5Gk3Tm7', [
    'locale' => 'en',
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.collections.preview("col_5Gk3Tm7", locale: "en")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .collections()
    .preview("col_5Gk3Tm7".into(), kontiga::collections::PreviewParams {
        locale: "en".into(),
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "object": "collection_preview",
  "collection_id": "col_5Gk3Tm7",
  "language": "en",
  "direction": "ltr",
  "brand_name": "Harbourline Lending",
  "heading": "Harbourline Lending needs some documents from you",
  "intro": "Harbourline Lending is asking for 3 things for your mortgage application. Each one is checked as you send it, so you know at once if anything needs fixing.",
  "purpose": "for your mortgage application",
  "items": [
    { "requirement_id": null, "key": "identity", "title": "Proof of identity", "instructions": "Passport or National ID card", "optional": false, "conditional": false },
    { "requirement_id": "rqm_4Yc2Hn8", "key": "payslips", "title": "Payslips", "instructions": "Your payslips for the last 3 months, one for each month.", "optional": false, "conditional": false },
    { "requirement_id": "rqm_2Bv5Kt6", "key": "employer_letter", "title": "Letter from your employer", "instructions": "Letter", "optional": true, "conditional": true }
  ],
  "expires_in_words": "This link expires 14 days after it is sent.",
  "policy_gap": {
    "requirement_id": "rqm_4Yc2Hn8",
    "requirement_label": "Payslips",
    "policy_id": "pol_8Hm3Qr5",
    "policy_name": "Income verification standard",
    "passage_number": "3.2",
    "passage_heading": "Payslips",
    "message": "This payslip does not show the employer's tax number. Please send one that does, or add a note.",
    "file_name": "payslip-sep-2026.pdf"
  }
}
```

## List collections in Bynn's shape

Every collection of the workspace as Bynn's collections API returns it, the newest made first: its status, its documents with every setting, and the counts of required and optional ones.

`GET /v1/collections/definitions`. Who may: Owner, Admin, Analyst, Developer and Viewer. CLI: `kontiga collections definitions [--status <draft|active|archived>] [--search <text>] [--limit <1-200>] [--cursor <next_cursor>]`. MCP tool: `list_collection_definitions`.

**Parameters**
- `status` (enum): Only collections in this status. One of `draft`, `active`, `archived`.
- `search` (string): Words in the name or the description. At most 200 characters.
- `limit` (integer): How many collections a page holds, 1 to 200; 100 when left out. A page also stops at about 2 MB of collections, so a page of large ones may hold fewer than `limit` while `next_cursor` goes on. A workspace reads at most 4 such pages at once (the list, Bynn's definitions, the versions); one more answers `429 rate_limited` with `details.reason` `collection_reads_in_flight` and a wait of under a second.
- `cursor` (string): The `next_cursor` of the page before. A search may leave a page with fewer than `limit` while `next_cursor` goes on.

**Returns** list of collection definitions: Each collection with its Kontiga id and its Bynn API object, 100 a page.

API:

```bash
curl -X GET "https://api.kontiga.com/v1/collections/definitions?status=active" \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga collections definitions --status active
```

MCP tool `list_collection_definitions`:

```json
{
  "name": "list_collection_definitions",
  "arguments": {
    "status": "active"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.collections.definitions({
  status: "active",
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.collections.definitions(status="active")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Collections.Definitions(ctx, &kontiga.CollectionsDefinitionsParams{
	Status: "active",
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.collections().definitions(CollectionsDefinitionsParams.builder()
    .status("active")
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Collections.DefinitionsAsync(new CollectionsDefinitionsOptions
{
    Status = "active",
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->collections->definitions([
    'status' => 'active',
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.collections.definitions(status: "active")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .collections()
    .definitions(kontiga::collections::DefinitionsParams {
        status: "active".into(),
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "items": [
    {
      "collection_id": "col_5Gk3Tm7",
      "source": "kontiga",
      "used_by": [{ "workflow_id": "wf_3Kd8Pn2", "workflow_name": "Mortgage review", "node_id": "collect_documents", "label": "Collect the applicant's documents", "timeout": 14, "timeout_unit": "days" }],
      "definition": {
        "id": "col_5Gk3Tm7",
        "name": "Mortgage application",
        "status": "active",
        "documents": [],
        "createdAt": "2026-03-02T09:00:00Z",
        "updatedAt": "2026-11-20T15:41:02Z",
        "totalRequired": 3,
        "totalOptional": 1
      }
    }
  ],
  "next_cursor": null
}
```

## Read a collection's definition

One collection in full, in Bynn's shape: every document with its type, whether it is required, the files it takes, its sides, its acceptance check, its fraud check and the fields read from it, in order, the removed ones too.

`GET /v1/collections/{collection_id}/definition`. Who may: Owner, Admin, Analyst, Developer and Viewer. CLI: `kontiga collections definition <collection_id>`. MCP tool: `get_collection_definition`.

**Parameters**
- `collection_id` (id (col_), required): The collection to read. In the path.

**Returns** collection definition: The definition, the Bynn API object for it, how it came in, and the requirements only Kontiga has.

API:

```bash
curl -X GET https://api.kontiga.com/v1/collections/col_5Gk3Tm7/definition \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga collections definition col_5Gk3Tm7
```

MCP tool `get_collection_definition`:

```json
{
  "name": "get_collection_definition",
  "arguments": {
    "collection_id": "col_5Gk3Tm7"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.collections.definition("col_5Gk3Tm7");
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.collections.definition("col_5Gk3Tm7")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Collections.Definition(ctx, "col_5Gk3Tm7")
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.collections().definition("col_5Gk3Tm7");
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Collections.DefinitionAsync("col_5Gk3Tm7");
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->collections->definition('col_5Gk3Tm7');
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.collections.definition("col_5Gk3Tm7")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .collections()
    .definition("col_5Gk3Tm7".into())
    .await?;
```

Response, 200 OK:

```json
{
  "object": "collection_definition",
  "collection_id": "col_5Gk3Tm7",
  "source": "kontiga",
  "imported_at": null,
  "warnings": [],
  "kontiga_only": [
    { "requirement_id": "rqm_8Fh4Ze1", "label": "Purpose of the loan", "kind": "question" }
  ],
  "deleted_at": null,
  "used_by": [{ "workflow_id": "wf_3Kd8Pn2", "workflow_name": "Mortgage review", "node_id": "collect_documents", "label": "Collect the applicant's documents", "timeout": 14, "timeout_unit": "days" }],
  "api": {
    "id": "col_5Gk3Tm7",
    "name": "Mortgage application",
    "description": "Identity, income and address for a mortgage of up to 35 years.",
    "status": "active",
    "documents": [
      {
        "id": "doc_req_Pq7xB3nKs9Wz2LmR5vTc8YdH",
        "name": "Passport",
        "description": "The page with your photo.",
        "documentType": "passport",
        "documentTypeLabel": "Passport",
        "mandatory": true,
        "allowMultiple": false,
        "fileRestrictions": ["camera_only"],
        "requestSides": "front_only",
        "order": 1,
        "fraudDetectionEnabled": true
      },
      {
        "id": "doc_req_Sx9mR4tKw7Nq2VbL5cZh8DyP",
        "name": "Payslips",
        "description": "Your payslips for the last 3 months.",
        "documentType": "payslip",
        "documentTypeLabel": "Payslip",
        "mandatory": true,
        "allowMultiple": true,
        "fileRestrictions": ["pdf_only", "images_allowed"],
        "requestSides": null,
        "order": 2,
        "fraudDetectionEnabled": true,
        "ocrAnalysisEnabled": true,
        "ocrFields": [
          { "name": "employer_name", "overwriteIfExists": true },
          { "name": "net_pay", "overwriteIfExists": true }
        ]
      }
    ],
    "createdAt": "2026-03-02T09:00:00Z",
    "updatedAt": "2026-11-20T15:41:02Z",
    "totalRequired": 2,
    "totalOptional": 0
  }
}
```

## Create a collection in Bynn's shape

Make a collection as Bynn's editor creates one: a name, a description, draft or active, and its documents with every setting, in order. Nothing is made when one document is refused.

`POST /v1/collections/definitions`. Who may: Owner, Admin and Analyst. CLI: `kontiga collections create-definition --name <text> --description <text> [--status <draft|active>] [--documents <json>]`. MCP tool: `create_collection_definition`.

**Parameters**
- `name` (string, required): Its name.
- `description` (string, required): What it is for. Required, as Bynn requires it.
- `status` (enum): `draft` unless you say `active`.
- `documents` (array of object): The documents in order, each with `name`, `documentType` (an id from the list of document types), `documentTypeLabel`, `mandatory` and its other settings. Nothing is made when one is refused.

**Returns** collection definition: The collection made, in Bynn's shape, with its Kontiga id.

API:

```bash
curl -X POST https://api.kontiga.com/v1/collections/definitions \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Car loan application",
    "description": "Identity and income for a car loan of up to 5 years.",
    "status": "draft",
    "documents": [
      {
        "name": "Passport",
        "description": "The page with your photo.",
        "documentType": "passport",
        "documentTypeLabel": "Passport",
        "mandatory": true,
        "fileRestrictions": [
          "camera_only"
        ],
        "requestSides": "front_only",
        "fraudDetectionEnabled": true
      },
      {
        "name": "Payslips",
        "description": "Your payslips for the last 3 months.",
        "documentType": "payslip",
        "documentTypeLabel": "Payslip",
        "mandatory": true,
        "allowMultiple": true,
        "fraudDetectionEnabled": true
      }
    ]
  }'
```

CLI:

```bash
kontiga collections create-definition \
  --name 'Car loan application' \
  --description 'Identity and income for a car loan of up to 5 years.' \
  --status draft \
  --documents '[{"name":"Passport","description":"The page with your photo.","documentType":"passport","documentTypeLabel":"Passport","mandatory":true,"fileRestrictions":["camera_only"],"requestSides":"front_only","fraudDetectionEnabled":true},{"name":"Payslips","description":"Your payslips for the last 3 months.","documentType":"payslip","documentTypeLabel":"Payslip","mandatory":true,"allowMultiple":true,"fraudDetectionEnabled":true}]'
```

MCP tool `create_collection_definition`:

```json
{
  "name": "create_collection_definition",
  "arguments": {
    "name": "Car loan application",
    "description": "Identity and income for a car loan of up to 5 years.",
    "status": "draft",
    "documents": [
      {
        "name": "Passport",
        "description": "The page with your photo.",
        "documentType": "passport",
        "documentTypeLabel": "Passport",
        "mandatory": true,
        "fileRestrictions": [
          "camera_only"
        ],
        "requestSides": "front_only",
        "fraudDetectionEnabled": true
      },
      {
        "name": "Payslips",
        "description": "Your payslips for the last 3 months.",
        "documentType": "payslip",
        "documentTypeLabel": "Payslip",
        "mandatory": true,
        "allowMultiple": true,
        "fraudDetectionEnabled": true
      }
    ]
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.collections.createDefinition({
  name: "Car loan application",
  description: "Identity and income for a car loan of up to 5 years.",
  status: "draft",
  documents: [{ name: "Passport", description: "The page with your photo.", documentType: "passport", documentTypeLabel: "Passport", mandatory: true, fileRestrictions: ["camera_only"], requestSides: "front_only", fraudDetectionEnabled: true }, { name: "Payslips", description: "Your payslips for the last 3 months.", documentType: "payslip", documentTypeLabel: "Payslip", mandatory: true, allowMultiple: true, fraudDetectionEnabled: true }],
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.collections.create_definition(
    name="Car loan application",
    description="Identity and income for a car loan of up to 5 years.",
    status="draft",
    documents=[{"name": "Passport", "description": "The page with your photo.", "documentType": "passport", "documentTypeLabel": "Passport", "mandatory": True, "fileRestrictions": ["camera_only"], "requestSides": "front_only", "fraudDetectionEnabled": True}, {"name": "Payslips", "description": "Your payslips for the last 3 months.", "documentType": "payslip", "documentTypeLabel": "Payslip", "mandatory": True, "allowMultiple": True, "fraudDetectionEnabled": True}],
)
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Collections.CreateDefinition(ctx, &kontiga.CollectionsCreateDefinitionParams{
	Name:        "Car loan application",
	Description: "Identity and income for a car loan of up to 5 years.",
	Status:      "draft",
	Documents:   []any{map[string]any{"name": "Passport", "description": "The page with your photo.", "documentType": "passport", "documentTypeLabel": "Passport", "mandatory": true, "fileRestrictions": []string{"camera_only"}, "requestSides": "front_only", "fraudDetectionEnabled": true}, map[string]any{"name": "Payslips", "description": "Your payslips for the last 3 months.", "documentType": "payslip", "documentTypeLabel": "Payslip", "mandatory": true, "allowMultiple": true, "fraudDetectionEnabled": true}},
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.collections().createDefinition(CollectionsCreateDefinitionParams.builder()
    .name("Car loan application")
    .description("Identity and income for a car loan of up to 5 years.")
    .status("draft")
    .documents(List.of(Map.of("name", "Passport", "description", "The page with your photo.", "documentType", "passport", "documentTypeLabel", "Passport", "mandatory", true, "fileRestrictions", List.of("camera_only"), "requestSides", "front_only", "fraudDetectionEnabled", true), Map.of("name", "Payslips", "description", "Your payslips for the last 3 months.", "documentType", "payslip", "documentTypeLabel", "Payslip", "mandatory", true, "allowMultiple", true, "fraudDetectionEnabled", true)))
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Collections.CreateDefinitionAsync(new CollectionsCreateDefinitionOptions
{
    Name = "Car loan application",
    Description = "Identity and income for a car loan of up to 5 years.",
    Status = "draft",
    Documents = new object[] { new Dictionary<string, object> { ["name"] = "Passport", ["description"] = "The page with your photo.", ["documentType"] = "passport", ["documentTypeLabel"] = "Passport", ["mandatory"] = true, ["fileRestrictions"] = new[] { "camera_only" }, ["requestSides"] = "front_only", ["fraudDetectionEnabled"] = true }, new Dictionary<string, object> { ["name"] = "Payslips", ["description"] = "Your payslips for the last 3 months.", ["documentType"] = "payslip", ["documentTypeLabel"] = "Payslip", ["mandatory"] = true, ["allowMultiple"] = true, ["fraudDetectionEnabled"] = true } },
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->collections->createDefinition([
    'name' => 'Car loan application',
    'description' => 'Identity and income for a car loan of up to 5 years.',
    'status' => 'draft',
    'documents' => [['name' => 'Passport', 'description' => 'The page with your photo.', 'documentType' => 'passport', 'documentTypeLabel' => 'Passport', 'mandatory' => true, 'fileRestrictions' => ['camera_only'], 'requestSides' => 'front_only', 'fraudDetectionEnabled' => true], ['name' => 'Payslips', 'description' => 'Your payslips for the last 3 months.', 'documentType' => 'payslip', 'documentTypeLabel' => 'Payslip', 'mandatory' => true, 'allowMultiple' => true, 'fraudDetectionEnabled' => true]],
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.collections.create_definition(
  name: "Car loan application",
  description: "Identity and income for a car loan of up to 5 years.",
  status: "draft",
  documents: [{ name: "Passport", description: "The page with your photo.", documentType: "passport", documentTypeLabel: "Passport", mandatory: true, fileRestrictions: ["camera_only"], requestSides: "front_only", fraudDetectionEnabled: true }, { name: "Payslips", description: "Your payslips for the last 3 months.", documentType: "payslip", documentTypeLabel: "Payslip", mandatory: true, allowMultiple: true, fraudDetectionEnabled: true }]
)
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .collections()
    .create_definition(kontiga::collections::CreateDefinitionParams {
        name: "Car loan application".into(),
        description: "Identity and income for a car loan of up to 5 years.".into(),
        status: "draft".into(),
        documents: vec![serde_json::json!({"name":"Passport","description":"The page with your photo.","documentType":"passport","documentTypeLabel":"Passport","mandatory":true,"fileRestrictions":["camera_only"],"requestSides":"front_only","fraudDetectionEnabled":true}), serde_json::json!({"name":"Payslips","description":"Your payslips for the last 3 months.","documentType":"payslip","documentTypeLabel":"Payslip","mandatory":true,"allowMultiple":true,"fraudDetectionEnabled":true})],
        ..Default::default()
    })
    .await?;
```

Response, 201 Created:

```json
{
  "object": "collection_definition",
  "collection_id": "col_5Gk3Tm7",
  "source": "kontiga",
  "imported_at": null,
  "warnings": [],
  "kontiga_only": [
    { "requirement_id": "rqm_8Fh4Ze1", "label": "Purpose of the loan", "kind": "question" }
  ],
  "deleted_at": null,
  "used_by": [{ "workflow_id": "wf_3Kd8Pn2", "workflow_name": "Mortgage review", "node_id": "collect_documents", "label": "Collect the applicant's documents", "timeout": 14, "timeout_unit": "days" }],
  "api": {
    "id": "col_5Gk3Tm7",
    "name": "Mortgage application",
    "description": "Identity, income and address for a mortgage of up to 35 years.",
    "status": "active",
    "documents": [
      {
        "id": "doc_req_Pq7xB3nKs9Wz2LmR5vTc8YdH",
        "name": "Passport",
        "description": "The page with your photo.",
        "documentType": "passport",
        "documentTypeLabel": "Passport",
        "mandatory": true,
        "allowMultiple": false,
        "fileRestrictions": ["camera_only"],
        "requestSides": "front_only",
        "order": 1,
        "fraudDetectionEnabled": true
      },
      {
        "id": "doc_req_Sx9mR4tKw7Nq2VbL5cZh8DyP",
        "name": "Payslips",
        "description": "Your payslips for the last 3 months.",
        "documentType": "payslip",
        "documentTypeLabel": "Payslip",
        "mandatory": true,
        "allowMultiple": true,
        "fileRestrictions": ["pdf_only", "images_allowed"],
        "requestSides": null,
        "order": 2,
        "fraudDetectionEnabled": true,
        "ocrAnalysisEnabled": true,
        "ocrFields": [
          { "name": "employer_name", "overwriteIfExists": true },
          { "name": "net_pay", "overwriteIfExists": true }
        ]
      }
    ],
    "createdAt": "2026-03-02T09:00:00Z",
    "updatedAt": "2026-11-20T15:41:02Z",
    "totalRequired": 2,
    "totalOptional": 0
  }
}
```

## Save a collection's definition

Change a collection as Bynn's editor saves it: the name, description and status when given; with documents, each one named by id is updated with every field, the others are added, and any not sent is removed. Nothing is saved when one document is refused.

`PUT /v1/collections/{collection_id}/definition`. Who may: Owner, Admin and Analyst. CLI: `kontiga collections save-definition <collection_id> [--name <text>] [--description <text>] [--status <draft|active|archived>] [--documents <json>]`. MCP tool: `save_collection_definition`.

**Parameters**
- `collection_id` (id (col_), required): The collection to save. In the path.
- `name` (string): A new name.
- `description` (string): A new description.
- `status` (enum): A new status. One of `draft`, `active`, `archived`.
- `documents` (array of object): The full list, in order. A document with the id of one already there updates it with every field; one without an id is added; one left out is removed. Nothing is saved when one is refused.

**Returns** collection definition: The definition as it now is.

API:

```bash
curl -X PUT https://api.kontiga.com/v1/collections/col_5Gk3Tm7/definition \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "status": "active",
    "documents": [
      {
        "name": "Passport",
        "description": "The page with your photo.",
        "documentType": "passport",
        "documentTypeLabel": "Passport",
        "mandatory": true,
        "fileRestrictions": [
          "camera_only"
        ],
        "requestSides": "front_only",
        "fraudDetectionEnabled": true
      },
      {
        "name": "Payslips",
        "description": "Your payslips for the last 3 months.",
        "documentType": "payslip",
        "documentTypeLabel": "Payslip",
        "mandatory": true,
        "allowMultiple": true,
        "fraudDetectionEnabled": true
      }
    ]
  }'
```

CLI:

```bash
kontiga collections save-definition col_5Gk3Tm7 \
  --status active \
  --documents '[{"name":"Passport","description":"The page with your photo.","documentType":"passport","documentTypeLabel":"Passport","mandatory":true,"fileRestrictions":["camera_only"],"requestSides":"front_only","fraudDetectionEnabled":true},{"name":"Payslips","description":"Your payslips for the last 3 months.","documentType":"payslip","documentTypeLabel":"Payslip","mandatory":true,"allowMultiple":true,"fraudDetectionEnabled":true}]'
```

MCP tool `save_collection_definition`:

```json
{
  "name": "save_collection_definition",
  "arguments": {
    "collection_id": "col_5Gk3Tm7",
    "status": "active",
    "documents": [
      {
        "name": "Passport",
        "description": "The page with your photo.",
        "documentType": "passport",
        "documentTypeLabel": "Passport",
        "mandatory": true,
        "fileRestrictions": [
          "camera_only"
        ],
        "requestSides": "front_only",
        "fraudDetectionEnabled": true
      },
      {
        "name": "Payslips",
        "description": "Your payslips for the last 3 months.",
        "documentType": "payslip",
        "documentTypeLabel": "Payslip",
        "mandatory": true,
        "allowMultiple": true,
        "fraudDetectionEnabled": true
      }
    ]
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.collections.saveDefinition("col_5Gk3Tm7", {
  status: "active",
  documents: [{ name: "Passport", description: "The page with your photo.", documentType: "passport", documentTypeLabel: "Passport", mandatory: true, fileRestrictions: ["camera_only"], requestSides: "front_only", fraudDetectionEnabled: true }, { name: "Payslips", description: "Your payslips for the last 3 months.", documentType: "payslip", documentTypeLabel: "Payslip", mandatory: true, allowMultiple: true, fraudDetectionEnabled: true }],
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.collections.save_definition(
    "col_5Gk3Tm7",
    status="active",
    documents=[{"name": "Passport", "description": "The page with your photo.", "documentType": "passport", "documentTypeLabel": "Passport", "mandatory": True, "fileRestrictions": ["camera_only"], "requestSides": "front_only", "fraudDetectionEnabled": True}, {"name": "Payslips", "description": "Your payslips for the last 3 months.", "documentType": "payslip", "documentTypeLabel": "Payslip", "mandatory": True, "allowMultiple": True, "fraudDetectionEnabled": True}],
)
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Collections.SaveDefinition(ctx, "col_5Gk3Tm7", &kontiga.CollectionsSaveDefinitionParams{
	Status:    "active",
	Documents: []any{map[string]any{"name": "Passport", "description": "The page with your photo.", "documentType": "passport", "documentTypeLabel": "Passport", "mandatory": true, "fileRestrictions": []string{"camera_only"}, "requestSides": "front_only", "fraudDetectionEnabled": true}, map[string]any{"name": "Payslips", "description": "Your payslips for the last 3 months.", "documentType": "payslip", "documentTypeLabel": "Payslip", "mandatory": true, "allowMultiple": true, "fraudDetectionEnabled": true}},
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.collections().saveDefinition("col_5Gk3Tm7", CollectionsSaveDefinitionParams.builder()
    .status("active")
    .documents(List.of(Map.of("name", "Passport", "description", "The page with your photo.", "documentType", "passport", "documentTypeLabel", "Passport", "mandatory", true, "fileRestrictions", List.of("camera_only"), "requestSides", "front_only", "fraudDetectionEnabled", true), Map.of("name", "Payslips", "description", "Your payslips for the last 3 months.", "documentType", "payslip", "documentTypeLabel", "Payslip", "mandatory", true, "allowMultiple", true, "fraudDetectionEnabled", true)))
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Collections.SaveDefinitionAsync("col_5Gk3Tm7", new CollectionsSaveDefinitionOptions
{
    Status = "active",
    Documents = new object[] { new Dictionary<string, object> { ["name"] = "Passport", ["description"] = "The page with your photo.", ["documentType"] = "passport", ["documentTypeLabel"] = "Passport", ["mandatory"] = true, ["fileRestrictions"] = new[] { "camera_only" }, ["requestSides"] = "front_only", ["fraudDetectionEnabled"] = true }, new Dictionary<string, object> { ["name"] = "Payslips", ["description"] = "Your payslips for the last 3 months.", ["documentType"] = "payslip", ["documentTypeLabel"] = "Payslip", ["mandatory"] = true, ["allowMultiple"] = true, ["fraudDetectionEnabled"] = true } },
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->collections->saveDefinition('col_5Gk3Tm7', [
    'status' => 'active',
    'documents' => [['name' => 'Passport', 'description' => 'The page with your photo.', 'documentType' => 'passport', 'documentTypeLabel' => 'Passport', 'mandatory' => true, 'fileRestrictions' => ['camera_only'], 'requestSides' => 'front_only', 'fraudDetectionEnabled' => true], ['name' => 'Payslips', 'description' => 'Your payslips for the last 3 months.', 'documentType' => 'payslip', 'documentTypeLabel' => 'Payslip', 'mandatory' => true, 'allowMultiple' => true, 'fraudDetectionEnabled' => true]],
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.collections.save_definition(
  "col_5Gk3Tm7",
  status: "active",
  documents: [{ name: "Passport", description: "The page with your photo.", documentType: "passport", documentTypeLabel: "Passport", mandatory: true, fileRestrictions: ["camera_only"], requestSides: "front_only", fraudDetectionEnabled: true }, { name: "Payslips", description: "Your payslips for the last 3 months.", documentType: "payslip", documentTypeLabel: "Payslip", mandatory: true, allowMultiple: true, fraudDetectionEnabled: true }]
)
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .collections()
    .save_definition("col_5Gk3Tm7".into(), kontiga::collections::SaveDefinitionParams {
        status: "active".into(),
        documents: vec![serde_json::json!({"name":"Passport","description":"The page with your photo.","documentType":"passport","documentTypeLabel":"Passport","mandatory":true,"fileRestrictions":["camera_only"],"requestSides":"front_only","fraudDetectionEnabled":true}), serde_json::json!({"name":"Payslips","description":"Your payslips for the last 3 months.","documentType":"payslip","documentTypeLabel":"Payslip","mandatory":true,"allowMultiple":true,"fraudDetectionEnabled":true})],
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "object": "collection_definition",
  "collection_id": "col_5Gk3Tm7",
  "source": "kontiga",
  "imported_at": null,
  "warnings": [],
  "kontiga_only": [
    { "requirement_id": "rqm_8Fh4Ze1", "label": "Purpose of the loan", "kind": "question" }
  ],
  "deleted_at": null,
  "used_by": [{ "workflow_id": "wf_3Kd8Pn2", "workflow_name": "Mortgage review", "node_id": "collect_documents", "label": "Collect the applicant's documents", "timeout": 14, "timeout_unit": "days" }],
  "api": {
    "id": "col_5Gk3Tm7",
    "name": "Mortgage application",
    "description": "Identity, income and address for a mortgage of up to 35 years.",
    "status": "active",
    "documents": [
      {
        "id": "doc_req_Pq7xB3nKs9Wz2LmR5vTc8YdH",
        "name": "Passport",
        "description": "The page with your photo.",
        "documentType": "passport",
        "documentTypeLabel": "Passport",
        "mandatory": true,
        "allowMultiple": false,
        "fileRestrictions": ["camera_only"],
        "requestSides": "front_only",
        "order": 1,
        "fraudDetectionEnabled": true
      },
      {
        "id": "doc_req_Sx9mR4tKw7Nq2VbL5cZh8DyP",
        "name": "Payslips",
        "description": "Your payslips for the last 3 months.",
        "documentType": "payslip",
        "documentTypeLabel": "Payslip",
        "mandatory": true,
        "allowMultiple": true,
        "fileRestrictions": ["pdf_only", "images_allowed"],
        "requestSides": null,
        "order": 2,
        "fraudDetectionEnabled": true,
        "ocrAnalysisEnabled": true,
        "ocrFields": [
          { "name": "employer_name", "overwriteIfExists": true },
          { "name": "net_pay", "overwriteIfExists": true }
        ]
      }
    ],
    "createdAt": "2026-03-02T09:00:00Z",
    "updatedAt": "2026-11-20T15:41:02Z",
    "totalRequired": 2,
    "totalOptional": 0
  }
}
```

## Export a collection

A collection in Bynn's shape, to import into Bynn or keep: the API object (as Bynn's GET returns it) or the stored rows (with the removed documents and the settings the API does not show).

`GET /v1/collections/{collection_id}/export`. Who may: Owner, Admin, Analyst, Developer and Viewer. CLI: `kontiga collections export <collection_id> [--shape <api|rows>] [--output <collection.json>]`. MCP tool: `export_collection`.

**Parameters**
- `collection_id` (id (col_), required): The collection to export. In the path.
- `shape` (enum, default "api"): `api` for the object Bynn's API returns; `rows` for the stored rows, with removed documents and the settings the API does not show. Either imports back to the same collection.

**Returns** Bynn collection: The API object, or the document_collection row with its document_requirements.

API:

```bash
curl -X GET "https://api.kontiga.com/v1/collections/col_5Gk3Tm7/export?shape=api" \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga collections export col_5Gk3Tm7 --shape api
```

MCP tool `export_collection`:

```json
{
  "name": "export_collection",
  "arguments": {
    "collection_id": "col_5Gk3Tm7",
    "shape": "api"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.collections.export("col_5Gk3Tm7", {
  shape: "api",
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.collections.export("col_5Gk3Tm7", shape="api")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Collections.Export(ctx, "col_5Gk3Tm7", &kontiga.CollectionsExportParams{
	Shape: "api",
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.collections().export("col_5Gk3Tm7", CollectionsExportParams.builder()
    .shape("api")
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Collections.ExportAsync("col_5Gk3Tm7", new CollectionsExportOptions
{
    Shape = "api",
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->collections->export('col_5Gk3Tm7', [
    'shape' => 'api',
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.collections.export("col_5Gk3Tm7", shape: "api")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .collections()
    .export("col_5Gk3Tm7".into(), kontiga::collections::ExportParams {
        shape: "api".into(),
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "id": "col_5Gk3Tm7",
  "name": "Mortgage application",
  "description": "Identity, income and address for a mortgage of up to 35 years.",
  "status": "active",
  "documents": [
    {
      "id": "doc_req_Pq7xB3nKs9Wz2LmR5vTc8YdH",
      "name": "Passport",
      "description": "The page with your photo.",
      "documentType": "passport",
      "documentTypeLabel": "Passport",
      "mandatory": true,
      "allowMultiple": false,
      "fileRestrictions": ["camera_only"],
      "requestSides": "front_only",
      "order": 1,
      "fraudDetectionEnabled": true
    },
    {
      "id": "doc_req_Sx9mR4tKw7Nq2VbL5cZh8DyP",
      "name": "Payslips",
      "description": "Your payslips for the last 3 months.",
      "documentType": "payslip",
      "documentTypeLabel": "Payslip",
      "mandatory": true,
      "allowMultiple": true,
      "fileRestrictions": ["pdf_only", "images_allowed"],
      "requestSides": null,
      "order": 2,
      "fraudDetectionEnabled": true,
      "ocrAnalysisEnabled": true,
      "ocrFields": [
        { "name": "employer_name", "overwriteIfExists": true },
        { "name": "net_pay", "overwriteIfExists": true }
      ]
    }
  ],
  "createdAt": "2026-03-02T09:00:00Z",
  "updatedAt": "2026-11-20T15:41:02Z",
  "totalRequired": 2,
  "totalOptional": 0
}
```

## Import a collection from Bynn

Make collections from Bynn definitions: one collection, a list of them, or the stored rows, as JSON. Each keeps every setting; one Bynn would refuse is not imported, with Bynn's reason.

`POST /v1/collections/imports`. Who may: Owner, Admin and Analyst. CLI: `kontiga collections import --file <collection.json>`. MCP tool: `import_collection`.

**Parameters**
- `definition` (string or record or array of unknown, required): One Bynn collection, a list of up to 100, or the stored rows, as JSON. The CLI reads it from the file you give. A collection Bynn would refuse is not imported, and its problems are listed.

**Returns** collection import: One line per collection read: the Kontiga collection made, or why it was refused, and what was noticed.

API:

```bash
curl -X POST https://api.kontiga.com/v1/collections/imports \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "definition": {
      "name": "KYC and income",
      "description": "Identity and proof of income for a personal loan.",
      "status": "draft",
      "documents": [
        {
          "name": "Passport",
          "description": "The page with your photo.",
          "documentType": "passport",
          "documentTypeLabel": "Passport",
          "mandatory": true,
          "fileRestrictions": [
            "camera_only"
          ],
          "requestSides": "front_only",
          "fraudDetectionEnabled": true
        },
        {
          "name": "Payslips",
          "description": "Your payslips for the last 3 months.",
          "documentType": "payslip",
          "documentTypeLabel": "Payslip",
          "mandatory": true,
          "allowMultiple": true,
          "fraudDetectionEnabled": true
        }
      ]
    }
  }'
```

CLI:

```bash
kontiga collections import
```

MCP tool `import_collection`:

```json
{
  "name": "import_collection",
  "arguments": {
    "definition": {
      "name": "KYC and income",
      "description": "Identity and proof of income for a personal loan.",
      "status": "draft",
      "documents": [
        {
          "name": "Passport",
          "description": "The page with your photo.",
          "documentType": "passport",
          "documentTypeLabel": "Passport",
          "mandatory": true,
          "fileRestrictions": [
            "camera_only"
          ],
          "requestSides": "front_only",
          "fraudDetectionEnabled": true
        },
        {
          "name": "Payslips",
          "description": "Your payslips for the last 3 months.",
          "documentType": "payslip",
          "documentTypeLabel": "Payslip",
          "mandatory": true,
          "allowMultiple": true,
          "fraudDetectionEnabled": true
        }
      ]
    }
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.collections.import();
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.collections.import_()
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Collections.Import(ctx)
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.collections().import_();
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Collections.ImportAsync();
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->collections->import();
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.collections.import
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .collections()
    .import()
    .await?;
```

Response, 200 OK:

```json
{
  "object": "collection_import",
  "results": [
    {
      "name": "KYC and income",
      "shape": "api",
      "collection_id": "col_6Vb3Qw9",
      "bynn_id": "col_Tz3kQ8wNr5VmX2bLc7Hy9sDf",
      "problems": [],
      "warnings": ["Driving licence: front and back are asked for; the document type takes both sides."]
    },
    {
      "name": "Company onboarding",
      "shape": "api",
      "collection_id": null,
      "bynn_id": "col_Hn2xW7kQp4RtZ9vLm3Bc8YsD",
      "problems": [{ "path": "documents[2].documentType", "message": "is not a known document type" }],
      "warnings": []
    }
  ]
}
```

To make a collection from words, the way the console's Build with AI does: start a session with `collections.planner_start` and read it with `collections.planner_session` (pass `since`, the last event's `seq`, to read only what is new) until its `status` is `proposed`, answering its `questions` with `collections.planner_answer` while it is `waiting`. Then keep it with `collections.planner_accept` and `save: true`: the collection is made as a `draft`, and the answer names it (`collection_id`). Check it with `collections.validate` and make it live with `collections.publish`. The proposal is in this page's checklist language: `checklist`, the collection it would make, and `explanations` keyed by the entry each explains. `collections.plan` answers the same proposal in one call, saving nothing. To change a collection in words, `collections.improve` (or a `collection_improve` session) proposes `changes`, each naming the entry it adds, changes, moves or removes by its `key`, with its reason, and `checklist`, the collection whole as they leave it: every entry they do not touch keeps its id, key, condition and group. Keep a session with `save: true` to save them into the collection's draft; when the collection changed since the session read it, the keep is refused with `409 collection_changed` and nothing is saved. The same keep again answers what the first made, and an `Idempotency-Key` makes a retry safe. Ask a proposing session for changes with `collections.planner_revise` and `request`. Stop a session with `collections.planner_cancel`.

## Draft a collection from a description

Turns a few words about the case into the checklist to ask for: each requirement with its type, its instructions and its checks, written for the person's language. Nothing is saved.

`POST /v1/collections/plan`. Who may: Owner, Admin and Analyst. CLI: `kontiga collections plan --description <text> [--language <tag>] [--language-name <name>] [--answers <json>]`. MCP tool: `plan_collection`.

**Parameters**
- `description` (string, required): The case, and what the person should send, in your own words. At most 4,000 characters.
- `language` (string, default "en"): The person's language as a tag, such as `en`, `nl` or `pt-BR`. The instructions are written in it.
- `language_name` (string): The language's name in English, such as `Dutch`.
- `answers` (array of object): Answers to the questions an earlier call came back with, each `{id, choice}` or `{id, text}`. A question left unanswered is drafted with its first option, the recommended one, and comes back in `questions`: answer it and call again. At most 10 items.

**Returns** collection draft: The checklist it would make (a name, a description and the requirements in order, in the checklist's language), a summary, each explanation keyed by the requirement it explains, notes, what keeps it from being kept, and the questions the words leave open; nothing is saved.

API:

```bash
curl -X POST https://api.kontiga.com/v1/collections/plan \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "description": "Car loans for employees: we need their ID and proof of income for the last three months.",
    "language": "en"
  }'
```

CLI:

```bash
kontiga collections plan \
  --description 'Car loans for employees: we need their ID and proof of income for the last three months.' \
  --language en
```

MCP tool `plan_collection`:

```json
{
  "name": "plan_collection",
  "arguments": {
    "description": "Car loans for employees: we need their ID and proof of income for the last three months.",
    "language": "en"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.collections.plan({
  description: "Car loans for employees: we need their ID and proof of income for the last three months.",
  language: "en",
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.collections.plan(description="Car loans for employees: we need their ID and proof of income for the last three months.", language="en")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Collections.Plan(ctx, &kontiga.CollectionsPlanParams{
	Description: "Car loans for employees: we need their ID and proof of income for the last three months.",
	Language:    "en",
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.collections().plan(CollectionsPlanParams.builder()
    .description("Car loans for employees: we need their ID and proof of income for the last three months.")
    .language("en")
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Collections.PlanAsync(new CollectionsPlanOptions
{
    Description = "Car loans for employees: we need their ID and proof of income for the last three months.",
    Language = "en",
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->collections->plan([
    'description' => 'Car loans for employees: we need their ID and proof of income for the last three months.',
    'language' => 'en',
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.collections.plan(description: "Car loans for employees: we need their ID and proof of income for the last three months.", language: "en")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .collections()
    .plan(kontiga::collections::PlanParams {
        description: "Car loans for employees: we need their ID and proof of income for the last three months.".into(),
        language: "en".into(),
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "object": "collection_draft",
  "checklist": {
    "name": "Car loan application",
    "description": "Identity and income for a car loan of up to 5 years.",
    "default_language": "en",
    "checklist": [
      { "key": "passport", "kind": "document", "title": { "en": "Passport" }, "instructions": { "en": "The page with your photo." }, "required": true, "accepts": [{ "type": "passport" }], "files": { "min": 1, "max": 1 }, "file_types": ["image"], "capture": "camera_only", "sides": "front_only", "strictness": "advise", "when_unsure": "accept", "detect": true },
      { "key": "payslips", "kind": "document", "title": { "en": "Payslips" }, "instructions": { "en": "Your payslips for the last 3 months." }, "required": true, "accepts": [{ "type": "payslip" }], "files": { "min": 1, "max": 10 }, "file_types": ["pdf", "image"], "capture": "file_only", "acceptance": { "accept_criteria": "A payslip in the applicant's name from the last 3 months.", "reject_criteria": null, "threshold": 0.5 }, "strictness": "enforce", "when_unsure": "accept", "detect": true }
    ]
  },
  "summary": "Two documents: an ID to check who is applying, and three months of payslips for their income.",
  "explanations": { "passport": "Who is applying.", "payslips": "Their income over the last three months." },
  "notes": [],
  "problems": [],
  "language": "en",
  "language_name": "English",
  "questions": [
    {
      "id": "q1",
      "question": "Do self-employed applicants apply too?",
      "kind": "options",
      "options": [{ "label": "No, employees only" }, { "label": "Yes, ask them for tax returns" }]
    }
  ]
}
```

## Propose changes to a collection

Turns a request in words into changes to a collection's documents (add, change, move, remove, rename), each with its reason. A set holds 1 to 40 changes, each reason is 1 to 400 characters, and every change applies to the open collection before it is shown. Nothing is saved: the member keeps the changes they want.

`POST /v1/collections/improve`. Who may: Owner, Admin and Analyst. CLI: `kontiga collections improve --request <text> [--collection-id <collection_id>] [--collection <json>] [--answers <json>]`. MCP tool: `improve_collection`.

**Parameters**
- `collection_id` (id (col_)): A saved collection to change.
- `request` (string, required): What should change, in your own words. At most 4,000 characters.
- `collection` (object): The open form, with unsaved edits: its name, description, status and documents, each with its id. Give this or `collection_id`.
- `answers` (array of object): Answers to the questions an earlier call came back with; one left unanswered takes its first option and comes back in `questions`. At most 10 items.

**Returns** collection change set: A summary, the proposed changes in order in the checklist's language (each naming the entry it adds, changes, moves or removes by its key, with its reason), the checklist they leave whole, and the questions the request leaves open; nothing is saved.

API:

```bash
curl -X POST https://api.kontiga.com/v1/collections/improve \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "collection_id": "col_5Gk3Tm7",
    "request": "Read the employer and the net pay from every payslip, and make proof of address required."
  }'
```

CLI:

```bash
kontiga collections improve \
  --collection-id col_5Gk3Tm7 \
  --request 'Read the employer and the net pay from every payslip, and make proof of address required.'
```

MCP tool `improve_collection`:

```json
{
  "name": "improve_collection",
  "arguments": {
    "collection_id": "col_5Gk3Tm7",
    "request": "Read the employer and the net pay from every payslip, and make proof of address required."
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.collections.improve({
  collection_id: "col_5Gk3Tm7",
  request: "Read the employer and the net pay from every payslip, and make proof of address required.",
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.collections.improve(collection_id="col_5Gk3Tm7", request="Read the employer and the net pay from every payslip, and make proof of address required.")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Collections.Improve(ctx, &kontiga.CollectionsImproveParams{
	CollectionId: "col_5Gk3Tm7",
	Request:      "Read the employer and the net pay from every payslip, and make proof of address required.",
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.collections().improve(CollectionsImproveParams.builder()
    .collectionId("col_5Gk3Tm7")
    .request("Read the employer and the net pay from every payslip, and make proof of address required.")
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Collections.ImproveAsync(new CollectionsImproveOptions
{
    CollectionId = "col_5Gk3Tm7",
    Request = "Read the employer and the net pay from every payslip, and make proof of address required.",
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->collections->improve([
    'collection_id' => 'col_5Gk3Tm7',
    'request' => 'Read the employer and the net pay from every payslip, and make proof of address required.',
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.collections.improve(collection_id: "col_5Gk3Tm7", request: "Read the employer and the net pay from every payslip, and make proof of address required.")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .collections()
    .improve(kontiga::collections::ImproveParams {
        collection_id: "col_5Gk3Tm7".into(),
        request: "Read the employer and the net pay from every payslip, and make proof of address required.".into(),
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "object": "collection_change_set",
  "summary": "Read the employer and the net pay from every payslip, and make proof of address required.",
  "changes": [
    {
      "op": "update",
      "key": "payslips",
      "entry": { "id": "rqm_4Yc2Hn8", "key": "payslips", "kind": "document", "title": { "en": "Payslips" }, "required": true, "accepts": [{ "type": "payslip" }], "extract": [{ "name": "employer_name", "overwrite_if_exists": true }, { "name": "net_pay", "overwrite_if_exists": true }], "detect": true },
      "reason": "You asked for the employer and the net pay to be read."
    },
    {
      "op": "update",
      "key": "proof_of_address",
      "entry": { "id": "rqm_2Bv5Kt6", "key": "proof_of_address", "kind": "document", "title": { "en": "Proof of address" }, "required": true, "accepts": [{ "type": "lease_agreement" }], "detect": true },
      "reason": "Proof of address becomes required, as you asked."
    }
  ],
  "checklist": {
    "name": "Mortgage application",
    "description": "Identity, income and address for a mortgage of up to 35 years.",
    "default_language": "en",
    "checklist": [
      { "id": "rqm_8Fh4Ze1", "key": "loan_purpose", "kind": "question", "title": { "en": "Purpose of the loan" }, "required": true, "question": { "type": "text" } },
      { "id": "rqm_4Yc2Hn8", "key": "payslips", "kind": "document", "title": { "en": "Payslips" }, "required": true, "accepts": [{ "type": "payslip" }], "extract": [{ "name": "employer_name", "overwrite_if_exists": true }, { "name": "net_pay", "overwrite_if_exists": true }], "detect": true },
      { "id": "rqm_2Bv5Kt6", "key": "proof_of_address", "kind": "document", "title": { "en": "Proof of address" }, "required": true, "accepts": [{ "type": "lease_agreement" }], "detect": true, "when": { "field": "answer.loan_purpose", "op": "not_empty" } }
    ]
  },
  "notes": [],
  "questions": []
}
```

## Start the collection planner

Starts Build with AI (collection_plan) or Improve with AI (collection_improve) as a session: it works in steps, may stop to ask one to four questions, and proposes a draft or a change set to keep, revise or leave. Nothing is saved.

`POST /v1/collections/planner/sessions`. Who may: Owner, Admin and Analyst. CLI: `kontiga collections planner start --mode <collection_plan|collection_improve> --request <text> [--language <tag>] [--language-name <name>] [--collection-id <collection_id>] [--collection <json>]`. MCP tool: `start_collection_planner`.

**Parameters**
- `mode` (enum, required): `collection_plan` drafts a new collection; `collection_improve` proposes changes to one.
- `request` (string, required): What to draft or change, in your own words. At most 4,000 characters.
- `language` (string): The person's language as a tag.
- `language_name` (string): The language's name in English.
- `collection_id` (id (col_)): For `collection_improve`: the saved collection.
- `collection` (object): For `collection_improve`: the open form, with unsaved edits.

**Returns** collection planner session: The session, working: its id, its first events and its usage. Read it with collections.planner_session until it waits, proposes or ends.

API:

```bash
curl -X POST https://api.kontiga.com/v1/collections/planner/sessions \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "collection_plan",
    "request": "Car loans for employees: we need their ID and proof of income for the last three months.",
    "language": "en"
  }'
```

CLI:

```bash
kontiga collections planner start \
  --mode collection_plan \
  --request 'Car loans for employees: we need their ID and proof of income for the last three months.' \
  --language en
```

MCP tool `start_collection_planner`:

```json
{
  "name": "start_collection_planner",
  "arguments": {
    "mode": "collection_plan",
    "request": "Car loans for employees: we need their ID and proof of income for the last three months.",
    "language": "en"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.collections.plannerStart({
  mode: "collection_plan",
  request: "Car loans for employees: we need their ID and proof of income for the last three months.",
  language: "en",
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.collections.planner_start(
    mode="collection_plan",
    request="Car loans for employees: we need their ID and proof of income for the last three months.",
    language="en",
)
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Collections.PlannerStart(ctx, &kontiga.CollectionsPlannerStartParams{
	Mode:     "collection_plan",
	Request:  "Car loans for employees: we need their ID and proof of income for the last three months.",
	Language: "en",
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.collections().plannerStart(CollectionsPlannerStartParams.builder()
    .mode("collection_plan")
    .request("Car loans for employees: we need their ID and proof of income for the last three months.")
    .language("en")
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Collections.PlannerStartAsync(new CollectionsPlannerStartOptions
{
    Mode = "collection_plan",
    Request = "Car loans for employees: we need their ID and proof of income for the last three months.",
    Language = "en",
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->collections->plannerStart([
    'mode' => 'collection_plan',
    'request' => 'Car loans for employees: we need their ID and proof of income for the last three months.',
    'language' => 'en',
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.collections.planner_start(
  mode: "collection_plan",
  request: "Car loans for employees: we need their ID and proof of income for the last three months.",
  language: "en"
)
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .collections()
    .planner_start(kontiga::collections::PlannerStartParams {
        mode: "collection_plan".into(),
        request: "Car loans for employees: we need their ID and proof of income for the last three months.".into(),
        language: "en".into(),
        ..Default::default()
    })
    .await?;
```

Response, 201 Created:

```json
{
  "id": "wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40",
  "object": "collection_planner_session",
  "mode": "collection_plan",
  "status": "working",
  "revision": 0,
  "events": [
    { "seq": 1, "at": "2026-11-27T10:20:01Z", "kind": "start", "text": "Planning started" },
    { "seq": 2, "at": "2026-11-27T10:20:01Z", "kind": "step", "text": "Thinking (step 1)" }
  ],
  "questions": null,
  "proposal": null,
  "usage": { "steps": 0, "max_steps": 30 },
  "error": null,
  "created_at": "2026-11-27T10:20:01Z",
  "updated_at": "2026-11-27T10:20:01Z"
}
```

## Read a collection planner session

Where a planner session stands: working with its progress and usage, waiting on questions, a proposal to review, or ended, with its error when it failed.

`GET /v1/collections/planner/sessions/{session_id}`. Who may: Owner, Admin and Analyst. CLI: `kontiga collections planner get <session_id> [--since <seq>]`. MCP tool: `get_collection_planner_session`.

**Parameters**
- `session_id` (id (wfa_), required): The session to read. In the path.
- `since` (integer, default 0): Answer only the events after this one.

**Returns** collection planner session: Its status, the events after since, the questions while it waits, the proposal, the usage (steps of at most 30) and the error.

API:

```bash
curl -X GET "https://api.kontiga.com/v1/collections/planner/sessions/wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40?since=1" \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga collections planner get wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40 \
  --since 1
```

MCP tool `get_collection_planner_session`:

```json
{
  "name": "get_collection_planner_session",
  "arguments": {
    "session_id": "wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40",
    "since": 1
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.collections.plannerSession("wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40", {
  since: 1,
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.collections.planner_session("wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40", since=1)
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Collections.PlannerSession(ctx, "wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40", &kontiga.CollectionsPlannerSessionParams{
	Since: 1,
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.collections().plannerSession("wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40", CollectionsPlannerSessionParams.builder()
    .since(1)
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Collections.PlannerSessionAsync("wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40", new CollectionsPlannerSessionOptions
{
    Since = 1,
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->collections->plannerSession('wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40', [
    'since' => 1,
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.collections.planner_session("wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40", since: 1)
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .collections()
    .planner_session("wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40".into(), kontiga::collections::PlannerSessionParams {
        since: 1,
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "id": "wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40",
  "object": "collection_planner_session",
  "mode": "collection_plan",
  "status": "waiting",
  "revision": 2,
  "events": [
    { "seq": 3, "at": "2026-11-27T10:20:04Z", "kind": "tool", "text": "Read the document types" },
    { "seq": 4, "at": "2026-11-27T10:20:04Z", "kind": "tool", "text": "Listed the workspace's collections" },
    { "seq": 5, "at": "2026-11-27T10:20:04Z", "kind": "step", "text": "Thinking (step 2)" },
    { "seq": 6, "at": "2026-11-27T10:20:09Z", "kind": "question", "text": "Asking you 1 question" }
  ],
  "questions": [
    {
      "id": "q1",
      "question": "Do self-employed applicants apply too?",
      "kind": "options",
      "options": [{ "label": "No, employees only" }, { "label": "Yes, ask them for tax returns" }]
    }
  ],
  "proposal": null,
  "usage": { "steps": 2, "max_steps": 30 },
  "error": null,
  "created_at": "2026-11-27T10:20:01Z",
  "updated_at": "2026-11-27T10:20:09Z"
}
```

## Answer the collection planner

Answers the questions a waiting session asked, each with a listed choice or in your own words; the session works on with them.

`POST /v1/collections/planner/sessions/{session_id}/answer`. Who may: Owner, Admin and Analyst. CLI: `kontiga collections planner answer <session_id> --answers <json>`. MCP tool: `answer_collection_planner`.

**Parameters**
- `session_id` (id (wfa_), required): A session that is waiting. In the path.
- `answers` (array of object, required): One answer per question: `{id, choice}` with one of its options, or `{id, text}` in your own words. At most 10 items.

**Returns** collection planner session: The session, working again with the answers.

API:

```bash
curl -X POST https://api.kontiga.com/v1/collections/planner/sessions/wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40/answer \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "answers": [
      {
        "id": "q1",
        "choice": "No, employees only"
      }
    ]
  }'
```

CLI:

```bash
kontiga collections planner answer wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40 \
  --answers '[{"id":"q1","choice":"No, employees only"}]'
```

MCP tool `answer_collection_planner`:

```json
{
  "name": "answer_collection_planner",
  "arguments": {
    "session_id": "wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40",
    "answers": [
      {
        "id": "q1",
        "choice": "No, employees only"
      }
    ]
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.collections.plannerAnswer("wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40", {
  answers: [{ id: "q1", choice: "No, employees only" }],
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.collections.planner_answer("wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40", answers=[{"id": "q1", "choice": "No, employees only"}])
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Collections.PlannerAnswer(ctx, "wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40", &kontiga.CollectionsPlannerAnswerParams{
	Answers: []any{map[string]any{"id": "q1", "choice": "No, employees only"}},
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.collections().plannerAnswer("wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40", CollectionsPlannerAnswerParams.builder()
    .answers(List.of(Map.of("id", "q1", "choice", "No, employees only")))
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Collections.PlannerAnswerAsync("wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40", new CollectionsPlannerAnswerOptions
{
    Answers = new object[] { new Dictionary<string, object> { ["id"] = "q1", ["choice"] = "No, employees only" } },
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->collections->plannerAnswer('wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40', [
    'answers' => [['id' => 'q1', 'choice' => 'No, employees only']],
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.collections.planner_answer("wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40", answers: [{ id: "q1", choice: "No, employees only" }])
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .collections()
    .planner_answer("wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40".into(), kontiga::collections::PlannerAnswerParams {
        answers: vec![serde_json::json!({"id":"q1","choice":"No, employees only"})],
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "id": "wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40",
  "object": "collection_planner_session",
  "mode": "collection_plan",
  "status": "working",
  "revision": 0,
  "events": [
    { "seq": 1, "at": "2026-11-27T10:20:01Z", "kind": "start", "text": "Planning started" },
    { "seq": 2, "at": "2026-11-27T10:20:01Z", "kind": "step", "text": "Thinking (step 1)" }
  ],
  "questions": null,
  "proposal": null,
  "usage": { "steps": 0, "max_steps": 30 },
  "error": null,
  "created_at": "2026-11-27T10:20:01Z",
  "updated_at": "2026-11-27T10:20:01Z"
}
```

## Ask the collection planner for changes

Sends a proposal back with what should change; the session works on it and proposes again.

`POST /v1/collections/planner/sessions/{session_id}/revise`. Who may: Owner, Admin and Analyst. CLI: `kontiga collections planner revise <session_id> --request <text>`. MCP tool: `revise_collection_planner`.

**Parameters**
- `session_id` (id (wfa_), required): A session that has proposed. In the path.
- `request` (string, required): What should change in the proposal, in words, as a start names them (`message` is read as it too). At most 2,000 characters.

**Returns** collection planner session: The session, working again on the revision.

API:

```bash
curl -X POST https://api.kontiga.com/v1/collections/planner/sessions/wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40/revise \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request": "Make the bank statement optional."
  }'
```

CLI:

```bash
kontiga collections planner revise wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40 \
  --request 'Make the bank statement optional.'
```

MCP tool `revise_collection_planner`:

```json
{
  "name": "revise_collection_planner",
  "arguments": {
    "session_id": "wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40",
    "request": "Make the bank statement optional."
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.collections.plannerRevise("wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40", {
  request: "Make the bank statement optional.",
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.collections.planner_revise("wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40", request="Make the bank statement optional.")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Collections.PlannerRevise(ctx, "wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40", &kontiga.CollectionsPlannerReviseParams{
	Request: "Make the bank statement optional.",
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.collections().plannerRevise("wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40", CollectionsPlannerReviseParams.builder()
    .request("Make the bank statement optional.")
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Collections.PlannerReviseAsync("wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40", new CollectionsPlannerReviseOptions
{
    Request = "Make the bank statement optional.",
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->collections->plannerRevise('wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40', [
    'request' => 'Make the bank statement optional.',
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.collections.planner_revise("wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40", request: "Make the bank statement optional.")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .collections()
    .planner_revise("wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40".into(), kontiga::collections::PlannerReviseParams {
        request: "Make the bank statement optional.".into(),
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "id": "wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40",
  "object": "collection_planner_session",
  "mode": "collection_plan",
  "status": "working",
  "revision": 0,
  "events": [
    { "seq": 1, "at": "2026-11-27T10:20:01Z", "kind": "start", "text": "Planning started" },
    { "seq": 2, "at": "2026-11-27T10:20:01Z", "kind": "step", "text": "Thinking (step 1)" }
  ],
  "questions": null,
  "proposal": null,
  "usage": { "steps": 0, "max_steps": 30 },
  "error": null,
  "created_at": "2026-11-27T10:20:01Z",
  "updated_at": "2026-11-27T10:20:01Z"
}
```

## Keep the collection planner's proposal

Marks the proposal kept and ends the session. With save, the proposal's collection is saved too: a new one, as a draft to publish, or the improved one's draft.

`POST /v1/collections/planner/sessions/{session_id}/accept`. Who may: Owner, Admin and Analyst. CLI: `kontiga collections planner accept <session_id> [--save]`. MCP tool: `accept_collection_planner`.

**Parameters**
- `session_id` (id (wfa_), required): A session that has proposed. In the path.
- `save` (boolean): `true` saves the proposal's collection as it keeps it: a plan's is made as a new collection, a `draft`, named in `collection_id`; an improve's changes go into the collection's draft. Without it, nothing is saved.

**Returns** collection planner session: The session, finished; with save, collection_id names the collection saved.

API:

```bash
curl -X POST https://api.kontiga.com/v1/collections/planner/sessions/wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40/accept \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "save": true
  }'
```

CLI:

```bash
kontiga collections planner accept wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40 \
  --save
```

MCP tool `accept_collection_planner`:

```json
{
  "name": "accept_collection_planner",
  "arguments": {
    "session_id": "wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40",
    "save": true
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.collections.plannerAccept("wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40", {
  save: true,
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.collections.planner_accept("wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40", save=True)
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Collections.PlannerAccept(ctx, "wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40", &kontiga.CollectionsPlannerAcceptParams{
	Save: true,
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.collections().plannerAccept("wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40", CollectionsPlannerAcceptParams.builder()
    .save(true)
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Collections.PlannerAcceptAsync("wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40", new CollectionsPlannerAcceptOptions
{
    Save = true,
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->collections->plannerAccept('wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40', [
    'save' => true,
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.collections.planner_accept("wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40", save: true)
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .collections()
    .planner_accept("wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40".into(), kontiga::collections::PlannerAcceptParams {
        save: true,
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "id": "wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40",
  "object": "collection_planner_session",
  "mode": "collection_plan",
  "status": "finished",
  "revision": 6,
  "events": [
    { "seq": 12, "at": "2026-11-27T10:23:40Z", "kind": "accepted", "text": "Accepted; created 1 collection" }
  ],
  "questions": null,
  "proposal": {
    "kind": "collection",
    "checklist": { "name": "Car loan application", "description": "Identity and income for a car loan of up to 5 years.", "default_language": "en", "checklist": [] },
    "summary": "Two documents: an ID and three months of payslips.",
    "explanations": {},
    "notes": [],
    "problems": [],
    "language": "en",
    "language_name": "English",
    "questions": []
  },
  "usage": { "steps": 4, "max_steps": 30 },
  "error": null,
  "created_at": "2026-11-27T10:20:01Z",
  "updated_at": "2026-11-27T10:23:40Z",
  "collection_id": "col_6Tb2Vn9"
}
```

## Stop the collection planner

Stops a session that is working, waiting or proposing; a session that has ended stays as it is.

`POST /v1/collections/planner/sessions/{session_id}/cancel`. Who may: Owner, Admin and Analyst. CLI: `kontiga collections planner cancel <session_id>`. MCP tool: `cancel_collection_planner`.

**Parameters**
- `session_id` (id (wfa_), required): The session to stop. A session that has ended is answered as it is. In the path.

**Returns** collection planner session: The session, cancelled (or as it ended).

API:

```bash
curl -X POST https://api.kontiga.com/v1/collections/planner/sessions/wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40/cancel \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga collections planner cancel wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40
```

MCP tool `cancel_collection_planner`:

```json
{
  "name": "cancel_collection_planner",
  "arguments": {
    "session_id": "wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.collections.plannerCancel("wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40");
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.collections.planner_cancel("wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Collections.PlannerCancel(ctx, "wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40")
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.collections().plannerCancel("wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40");
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Collections.PlannerCancelAsync("wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40");
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->collections->plannerCancel('wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40');
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.collections.planner_cancel("wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .collections()
    .planner_cancel("wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40".into())
    .await?;
```

Response, 200 OK:

```json
{
  "id": "wfa_0193c6a2f1b47c0d9e3a5b7c1d2e3f40",
  "object": "collection_planner_session",
  "mode": "collection_plan",
  "status": "cancelled",
  "revision": 3,
  "events": [
    { "seq": 7, "at": "2026-11-27T10:21:12Z", "kind": "cancelled", "text": "Stopped" }
  ],
  "questions": null,
  "proposal": null,
  "usage": { "steps": 2, "max_steps": 30 },
  "error": null,
  "created_at": "2026-11-27T10:20:01Z",
  "updated_at": "2026-11-27T10:21:12Z"
}
```

## Drafts, versions and archiving

A collection is a `draft` until it is published, then `active`, or `archived`. Publishing makes the draft the next version; a version never changes once published, and every request keeps the version it was sent with, so changing a collection never changes what an open request asks. Adding a requirement, a save in Bynn's shape and a requirement's strictness change the draft, and requests ask for the change once you publish it; the request settings (channel, reminders, expiry, access, language, purpose, brand kit) apply to the next request at once. Publishing validates the checklist first and lists every problem at once, each with its path, its code and what to change. A draft that was never published is published as version 1 when its first request is sent, once it passes the same checks a publish makes; a draft that does not is refused with the publish's problems, and nothing is sent. Publishing, archiving and restoring answer the collection itself. An archived collection leaves the team's list and can still be sent; a deleted one starts no request.

## Validate a collection

Check a collection's draft as publishing would, without publishing it: every problem at once, each with where it is, its code and what to change.

`POST /v1/collections/{collection_id}/validate`. Who may: Owner, Admin, Analyst, Developer and Viewer. CLI: `kontiga collections validate <collection_id>`. MCP tool: `validate_collection`.

**Parameters**
- `collection_id` (id (col_), required): The collection whose draft to check. Nothing changes. In the path.

**Returns** collection validation: Whether the draft would publish, and every problem with its path, code and message.

API:

```bash
curl -X POST https://api.kontiga.com/v1/collections/col_5Gk3Tm7/validate \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga collections validate col_5Gk3Tm7
```

MCP tool `validate_collection`:

```json
{
  "name": "validate_collection",
  "arguments": {
    "collection_id": "col_5Gk3Tm7"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.collections.validate("col_5Gk3Tm7");
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.collections.validate("col_5Gk3Tm7")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Collections.Validate(ctx, "col_5Gk3Tm7")
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.collections().validate("col_5Gk3Tm7");
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Collections.ValidateAsync("col_5Gk3Tm7");
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->collections->validate('col_5Gk3Tm7');
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.collections.validate("col_5Gk3Tm7")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .collections()
    .validate("col_5Gk3Tm7".into())
    .await?;
```

Response, 200 OK:

```json
{
  "object": "collection_validation",
  "collection_id": "col_5Gk3Tm7",
  "valid": false,
  "problems": [
    { "path": "checklist[2].accepts", "code": "accepts_empty", "message": "Proof of address: name the document types that satisfy it." },
    { "path": "checklist[4].accepts[0].type", "code": "type_unknown", "message": "Rental agreement: \"rental_agreement\" is not one of the 84 document types. Choose one, or ask for it as a custom type." }
  ]
}
```

## Publish a collection

Make the draft the collection's next version: requests sent from now on ask what it asks, and requests already open keep the version they were sent with. Refused, with every problem listed at once, while the checklist does not pass its checks.

`POST /v1/collections/{collection_id}/publish`. Who may: Owner, Admin and Analyst. CLI: `kontiga collections publish <collection_id>`. MCP tool: `publish_collection`.

**Parameters**
- `collection_id` (id (col_), required): The collection to publish. A draft becomes version 1; an active collection goes up by one. A collection is published at most 100 times a day (UTC): one more answers `429 rate_limited` with `details.reason` `collection_daily_publishes` and `Retry-After` until 00:00 UTC, and its draft is kept. In the path.

**Returns** collection: The collection, active, with its new version number. Its state, version, published_at and archived_at among its fields.

API:

```bash
curl -X POST https://api.kontiga.com/v1/collections/col_5Gk3Tm7/publish \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga collections publish col_5Gk3Tm7
```

MCP tool `publish_collection`:

```json
{
  "name": "publish_collection",
  "arguments": {
    "collection_id": "col_5Gk3Tm7"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.collections.publish("col_5Gk3Tm7");
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.collections.publish("col_5Gk3Tm7")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Collections.Publish(ctx, "col_5Gk3Tm7")
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.collections().publish("col_5Gk3Tm7");
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Collections.PublishAsync("col_5Gk3Tm7");
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->collections->publish('col_5Gk3Tm7');
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.collections.publish("col_5Gk3Tm7")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .collections()
    .publish("col_5Gk3Tm7".into())
    .await?;
```

Response, 200 OK:

```json
{
  "id": "col_5Gk3Tm7",
  "object": "collection",
  "name": "Mortgage application",
  "description": "Identity, income and address for a mortgage of up to 35 years.",
  "requirements": [
    {
      "id": "rqm_1Pa6Ws3",
      "key": "passport_or_national_id_card",
      "kind": "identity",
      "title": "Passport or national ID card",
      "instructions": "Valid for at least 30 more days",
      "accepts": [
        {
          "type": "passport"
        },
        {
          "type": "id_card"
        }
      ],
      "required": true,
      "group": null,
      "asked_when": null
    },
    {
      "id": "rqm_4Yc2Hn8",
      "key": "payslips",
      "kind": "document",
      "title": "Payslips",
      "instructions": "The last 3 months, one each",
      "accepts": [
        {
          "type": "payslip"
        }
      ],
      "required": true
    },
    {
      "id": "rqm_7Lq9Dz1",
      "key": "bank_statements",
      "kind": "document",
      "title": "Bank statements",
      "instructions": "The last 3 months, the account the salary is paid into",
      "accepts": [
        {
          "type": "bank_statements"
        }
      ],
      "required": true
    },
    {
      "id": "rqm_2Bv5Kt6",
      "key": "proof_of_address",
      "kind": "document",
      "title": "Proof of address",
      "instructions": "A statement or a bill, dated in the last 3 months",
      "accepts": [
        {
          "type": "bank_statements"
        },
        {
          "type": "invoice"
        }
      ],
      "required": false
    }
  ],
  "channel": "email_and_sms",
  "reminders": {
    "first_after_days": 2,
    "then_every_days": 3,
    "before_expiry": true,
    "max": 4
  },
  "reminders_in_words": "After 2 days, then every 3 days, and the day before the link expires. At most 4.",
  "expiry_days": 14,
  "cases_using": 38,
  "policy_ids": [
    "pol_8Hm3Qr5"
  ],
  "requirement_policy_ids": {
    "rqm_4Yc2Hn8": [
      "pol_8Hm3Qr5"
    ]
  },
  "created_at": "2026-09-02T08:15:40Z",
  "updated_at": "2026-11-27T09:12:00Z",
  "state": "active",
  "version": 5,
  "published_at": "2026-11-27T09:12:00Z",
  "archived_at": null
}
```

## List a collection's versions

Every published version of a collection, newest first: when it was published and by whom, how many requirements it asks, and how many open requests still run on it.

`GET /v1/collections/{collection_id}/versions`. Who may: Owner, Admin, Analyst, Developer and Viewer. CLI: `kontiga collections versions <collection_id> [--limit <n>] [--cursor <next_cursor>]`. MCP tool: `list_collection_versions`.

**Parameters**
- `collection_id` (id (col_), required): The collection whose versions to list. In the path.
- `limit` (integer): How many versions a page holds, 1 to 200; 50 when left out. A page also stops at about 2 MB of versions, so a page of large ones may hold fewer than `limit` while `next_cursor` goes on. A workspace reads at most 4 such pages at once (the list, Bynn's definitions, the versions); one more answers `429 rate_limited` with `details.reason` `collection_reads_in_flight` and a wait of under a second.
- `cursor` (string): The `next_cursor` of the page before: the versions older than it.

**Returns** list of collection versions: The versions, newest first, the active one marked, 50 a page.

API:

```bash
curl -X GET https://api.kontiga.com/v1/collections/col_5Gk3Tm7/versions \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga collections versions col_5Gk3Tm7
```

MCP tool `list_collection_versions`:

```json
{
  "name": "list_collection_versions",
  "arguments": {
    "collection_id": "col_5Gk3Tm7"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.collections.versions("col_5Gk3Tm7");
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.collections.versions("col_5Gk3Tm7")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Collections.Versions(ctx, "col_5Gk3Tm7")
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.collections().versions("col_5Gk3Tm7");
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Collections.VersionsAsync("col_5Gk3Tm7");
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->collections->versions('col_5Gk3Tm7');
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.collections.versions("col_5Gk3Tm7")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .collections()
    .versions("col_5Gk3Tm7".into())
    .await?;
```

Response, 200 OK:

```json
{
  "items": [
    { "object": "collection_version", "collection_id": "col_5Gk3Tm7", "version": 5, "active": true, "published_at": "2026-11-27T09:12:00Z", "published_by": "usr_4Hk8Tq2Wn6", "requirement_count": 6, "open_requests": 14 },
    { "object": "collection_version", "collection_id": "col_5Gk3Tm7", "version": 4, "active": false, "published_at": "2026-11-13T15:40:00Z", "published_by": "usr_4Hk8Tq2Wn6", "requirement_count": 5, "open_requests": 3 }
  ],
  "next_cursor": null
}
```

## Archive a collection

Put an active collection away for the team. As in Bynn, an archived collection can still be sent and a workflow can still run it; requests already open continue.

`POST /v1/collections/{collection_id}/archive`. Who may: Owner, Admin and Analyst. CLI: `kontiga collections archive <collection_id>`. MCP tool: `archive_collection`.

**Parameters**
- `collection_id` (id (col_), required): An active collection. In the path.

**Returns** collection: The collection, archived. Its state, version, published_at and archived_at among its fields.

API:

```bash
curl -X POST https://api.kontiga.com/v1/collections/col_5Gk3Tm7/archive \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga collections archive col_5Gk3Tm7
```

MCP tool `archive_collection`:

```json
{
  "name": "archive_collection",
  "arguments": {
    "collection_id": "col_5Gk3Tm7"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.collections.archive("col_5Gk3Tm7");
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.collections.archive("col_5Gk3Tm7")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Collections.Archive(ctx, "col_5Gk3Tm7")
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.collections().archive("col_5Gk3Tm7");
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Collections.ArchiveAsync("col_5Gk3Tm7");
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->collections->archive('col_5Gk3Tm7');
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.collections.archive("col_5Gk3Tm7")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .collections()
    .archive("col_5Gk3Tm7".into())
    .await?;
```

Response, 200 OK:

```json
{
  "id": "col_5Gk3Tm7",
  "object": "collection",
  "name": "Mortgage application",
  "description": "Identity, income and address for a mortgage of up to 35 years.",
  "requirements": [
    {
      "id": "rqm_1Pa6Ws3",
      "key": "passport_or_national_id_card",
      "kind": "identity",
      "title": "Passport or national ID card",
      "instructions": "Valid for at least 30 more days",
      "accepts": [
        {
          "type": "passport"
        },
        {
          "type": "id_card"
        }
      ],
      "required": true,
      "group": null,
      "asked_when": null
    },
    {
      "id": "rqm_4Yc2Hn8",
      "key": "payslips",
      "kind": "document",
      "title": "Payslips",
      "instructions": "The last 3 months, one each",
      "accepts": [
        {
          "type": "payslip"
        }
      ],
      "required": true
    },
    {
      "id": "rqm_7Lq9Dz1",
      "key": "bank_statements",
      "kind": "document",
      "title": "Bank statements",
      "instructions": "The last 3 months, the account the salary is paid into",
      "accepts": [
        {
          "type": "bank_statements"
        }
      ],
      "required": true
    },
    {
      "id": "rqm_2Bv5Kt6",
      "key": "proof_of_address",
      "kind": "document",
      "title": "Proof of address",
      "instructions": "A statement or a bill, dated in the last 3 months",
      "accepts": [
        {
          "type": "bank_statements"
        },
        {
          "type": "invoice"
        }
      ],
      "required": false
    }
  ],
  "channel": "email_and_sms",
  "reminders": {
    "first_after_days": 2,
    "then_every_days": 3,
    "before_expiry": true,
    "max": 4
  },
  "reminders_in_words": "After 2 days, then every 3 days, and the day before the link expires. At most 4.",
  "expiry_days": 14,
  "cases_using": 38,
  "policy_ids": [
    "pol_8Hm3Qr5"
  ],
  "requirement_policy_ids": {
    "rqm_4Yc2Hn8": [
      "pol_8Hm3Qr5"
    ]
  },
  "created_at": "2026-09-02T08:15:40Z",
  "updated_at": "2026-11-28T08:00:00Z",
  "state": "archived",
  "version": 5,
  "published_at": "2026-11-27T09:12:00Z",
  "archived_at": "2026-11-28T08:00:00Z"
}
```

## Restore a collection

Bring an archived collection back to active, at the version it had.

`POST /v1/collections/{collection_id}/restore`. Who may: Owner, Admin and Analyst. CLI: `kontiga collections restore <collection_id>`. MCP tool: `restore_collection`.

**Parameters**
- `collection_id` (id (col_), required): An archived collection. In the path.

**Returns** collection: The collection, active again. Its state, version, published_at and archived_at among its fields.

API:

```bash
curl -X POST https://api.kontiga.com/v1/collections/col_5Gk3Tm7/restore \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga collections restore col_5Gk3Tm7
```

MCP tool `restore_collection`:

```json
{
  "name": "restore_collection",
  "arguments": {
    "collection_id": "col_5Gk3Tm7"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.collections.restore("col_5Gk3Tm7");
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.collections.restore("col_5Gk3Tm7")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Collections.Restore(ctx, "col_5Gk3Tm7")
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.collections().restore("col_5Gk3Tm7");
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Collections.RestoreAsync("col_5Gk3Tm7");
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->collections->restore('col_5Gk3Tm7');
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.collections.restore("col_5Gk3Tm7")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .collections()
    .restore("col_5Gk3Tm7".into())
    .await?;
```

Response, 200 OK:

```json
{
  "id": "col_5Gk3Tm7",
  "object": "collection",
  "name": "Mortgage application",
  "description": "Identity, income and address for a mortgage of up to 35 years.",
  "requirements": [
    {
      "id": "rqm_1Pa6Ws3",
      "key": "passport_or_national_id_card",
      "kind": "identity",
      "title": "Passport or national ID card",
      "instructions": "Valid for at least 30 more days",
      "accepts": [
        {
          "type": "passport"
        },
        {
          "type": "id_card"
        }
      ],
      "required": true,
      "group": null,
      "asked_when": null
    },
    {
      "id": "rqm_4Yc2Hn8",
      "key": "payslips",
      "kind": "document",
      "title": "Payslips",
      "instructions": "The last 3 months, one each",
      "accepts": [
        {
          "type": "payslip"
        }
      ],
      "required": true
    },
    {
      "id": "rqm_7Lq9Dz1",
      "key": "bank_statements",
      "kind": "document",
      "title": "Bank statements",
      "instructions": "The last 3 months, the account the salary is paid into",
      "accepts": [
        {
          "type": "bank_statements"
        }
      ],
      "required": true
    },
    {
      "id": "rqm_2Bv5Kt6",
      "key": "proof_of_address",
      "kind": "document",
      "title": "Proof of address",
      "instructions": "A statement or a bill, dated in the last 3 months",
      "accepts": [
        {
          "type": "bank_statements"
        },
        {
          "type": "invoice"
        }
      ],
      "required": false
    }
  ],
  "channel": "email_and_sms",
  "reminders": {
    "first_after_days": 2,
    "then_every_days": 3,
    "before_expiry": true,
    "max": 4
  },
  "reminders_in_words": "After 2 days, then every 3 days, and the day before the link expires. At most 4.",
  "expiry_days": 14,
  "cases_using": 38,
  "policy_ids": [
    "pol_8Hm3Qr5"
  ],
  "requirement_policy_ids": {
    "rqm_4Yc2Hn8": [
      "pol_8Hm3Qr5"
    ]
  },
  "created_at": "2026-09-02T08:15:40Z",
  "updated_at": "2026-11-28T08:30:00Z",
  "state": "active",
  "version": 5,
  "published_at": "2026-11-27T09:12:00Z",
  "archived_at": null
}
```

## The checklist, groups and conditions

A collection's checklist is an ordered list of entries. Each entry is a requirement (a `document`, a `question` or an `identity` step) or a group of alternatives, satisfied when `choose` of its members are. Any entry may carry `when`, the condition it is asked under: `{field, op, value}`, or `all`, `any` or `not` of conditions. The field is `answer.<question key>` (a question asked earlier in the checklist), `party.role`, `context.<key>` (a value the request was sent with) or `person.country`. The operators are `equals`, `not_equals`, `in`, `not_in`, `contains`, `gt`, `gte`, `lt`, `lte`, `is_empty` and `not_empty`. A title or an instruction is written per language, `{"en": "Payslip", "sv": "Lönespecifikation"}`; the person reads it in their language, or in the collection's default language when it is not written in theirs.

Read the checklist whole, change it, and save it back whole: a requirement sent without an `id` is given one (or keeps the id of the requirement with the same `key`), the ones that stay keep theirs, so requests and reuse keep recognising them, and an id the collection never held is replaced. Leave `checklist` out to change only the `name` or the `description`. A text past its length (a name 120 characters, a description 500, a title, an option or a placeholder 200, instructions 2,000) is refused with `400` at its path and code `too_long`, and nothing is saved; so is a collection that would take more than 128 KB, and a workspace holds at most 1,000 collections. A workspace's collections store at most 256 MB, drafts and published versions together: past it, a save, a publish or a new collection is refused with `400` code `storage_full`, and deleting collections no request used makes room. A save changes the draft only. `unpublished` says the draft differs from the published version, and `problems` lists what publishing would refuse for, each with its path (`checklist[1].group.choose`), so you can fix them before you publish. Send the `revision` you read back with the save (in the body, or as the `If-Match` header): when someone changed the checklist since, the save is refused with `409 collection_changed`, nothing is written, and `error.details.current` holds the checklist as it now stands. A field an entry does not take is refused at its path.

## Read a collection's checklist

A collection's checklist as its draft stands, in Kontiga's own language: every requirement with its kind, title, instructions, rules and strictness, the groups of alternatives with how many to choose, and the condition each entry is asked under. Says whether the draft differs from the published version, and the problems publishing it would refuse for.

`GET /v1/collections/{collection_id}/checklist`. Who may: Owner, Admin, Analyst, Developer and Viewer. CLI: `kontiga collections checklist <collection_id>`. MCP tool: `get_collection_checklist`.

**Parameters**
- `collection_id` (id (col_), required): The collection whose checklist to read. Nothing changes. In the path.

**Returns** collection checklist: The draft's checklist, its revision, its name and default language, whether it is unpublished, and every problem with its path, code and message.

API:

```bash
curl -X GET https://api.kontiga.com/v1/collections/col_5Gk3Tm7/checklist \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga collections checklist col_5Gk3Tm7
```

MCP tool `get_collection_checklist`:

```json
{
  "name": "get_collection_checklist",
  "arguments": {
    "collection_id": "col_5Gk3Tm7"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.collections.checklist("col_5Gk3Tm7");
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.collections.checklist("col_5Gk3Tm7")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Collections.Checklist(ctx, "col_5Gk3Tm7")
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.collections().checklist("col_5Gk3Tm7");
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Collections.ChecklistAsync("col_5Gk3Tm7");
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->collections->checklist('col_5Gk3Tm7');
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.collections.checklist("col_5Gk3Tm7")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .collections()
    .checklist("col_5Gk3Tm7".into())
    .await?;
```

Response, 200 OK:

```json
{
  "object": "collection_checklist",
  "collection_id": "col_5Gk3Tm7",
  "revision": "1795691520318402",
  "state": "active",
  "version": 5,
  "unpublished": true,
  "name": "Motor claim",
  "description": "What we ask a policyholder for after an accident",
  "default_language": "en",
  "checklist": [
    { "id": "rqm_2Pd7Xc4Lb9", "key": "police_attended", "kind": "question", "title": { "en": "Did the police attend?", "sv": "Var polisen på plats?" }, "required": true, "question": { "type": "yes_no" } },
    { "id": "rqm_8Kt3Wm6Hq1", "key": "police_report", "kind": "document", "title": { "en": "Police report" }, "required": true, "when": { "field": "answer.police_attended", "op": "equals", "value": true }, "accepts": [{ "type": "letter" }] },
    { "group": {
        "key": "repair_cost",
        "title": { "en": "What the repair costs" },
        "choose": 1,
        "members": [
          { "id": "rqm_5Fb2Nv8Ry4", "key": "repair_estimate", "kind": "document", "title": { "en": "Repair estimate" }, "accepts": [{ "type": "invoice" }] },
          { "id": "rqm_9Gc4Pz1Ts7", "key": "garage_invoice", "kind": "document", "title": { "en": "Garage invoice" }, "accepts": [{ "type": "invoice" }] }
        ]
    } }
  ],
  "problems": [],
  "updated_at": "2026-11-30T10:04:00Z"
}
```

## Save a collection's checklist

Replace a collection's checklist whole, in its draft: add, remove and order requirements, group alternatives, and set when each entry is asked. A requirement sent without an id is given one; one sent with its id keeps it. Published versions never change, so requests sent and open keep theirs; publish the draft to send it. Answers the checklist with the problems publishing would refuse for.

`PUT /v1/collections/{collection_id}/checklist`. Who may: Owner, Admin and Analyst. CLI: `kontiga collections save-checklist <collection_id> --checklist <json> [--name <name>] [--description <text>] [--default-language <locale>] [--revision <revision>]`. MCP tool: `save_collection_checklist`.

**Parameters**
- `collection_id` (id (col_), required): The collection to change. In the path.
- `checklist` (array of record): Every entry, in order: requirements and `{group: {...}}` entries. Leave out `id` for a requirement you add. Leave `checklist` out to change only the name or the description. At most 50 items.
- `name` (string): Optional: the collection's new name. At most 120 characters.
- `description` (string): Optional: its new description. At most 500 characters.
- `default_language` (enum): Optional: the language a text falls back to, one of the 12. One of `en`, `pt`, `es`, `ar`, `zht`, `zhs`, `fr`, `de`, `ja`, `hi`, `ru`, `sv`.
- `revision` (string): Optional: the `revision` you read. A save over a checklist changed since is refused with `collection_changed`.

**Returns** collection checklist: The draft's checklist as saved, with the ids given to what was added, its new revision and every problem publishing would refuse for.

API:

```bash
curl -X PUT https://api.kontiga.com/v1/collections/col_5Gk3Tm7/checklist \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "checklist": [
      {
        "id": "rqm_2Pd7Xc4Lb9",
        "key": "police_attended",
        "kind": "question",
        "title": {
          "en": "Did the police attend?"
        },
        "question": {
          "type": "yes_no"
        }
      },
      {
        "key": "police_report",
        "kind": "document",
        "title": {
          "en": "Police report"
        },
        "when": {
          "field": "answer.police_attended",
          "op": "equals",
          "value": true
        },
        "accepts": [
          {
            "type": "letter"
          }
        ]
      },
      {
        "group": {
          "key": "repair_cost",
          "title": {
            "en": "What the repair costs"
          },
          "choose": 1,
          "members": [
            {
              "id": "rqm_5Fb2Nv8Ry4",
              "key": "repair_estimate",
              "kind": "document",
              "title": {
                "en": "Repair estimate"
              },
              "accepts": [
                {
                  "type": "invoice"
                }
              ]
            },
            {
              "id": "rqm_9Gc4Pz1Ts7",
              "key": "garage_invoice",
              "kind": "document",
              "title": {
                "en": "Garage invoice"
              },
              "accepts": [
                {
                  "type": "invoice"
                }
              ]
            }
          ]
        }
      }
    ]
  }'
```

CLI:

```bash
kontiga collections save-checklist col_5Gk3Tm7 \
  --checklist '[{"id":"rqm_2Pd7Xc4Lb9","key":"police_attended","kind":"question","title":{"en":"Did the police attend?"},"question":{"type":"yes_no"}},{"key":"police_report","kind":"document","title":{"en":"Police report"},"when":{"field":"answer.police_attended","op":"equals","value":true},"accepts":[{"type":"letter"}]},{"group":{"key":"repair_cost","title":{"en":"What the repair costs"},"choose":1,"members":[{"id":"rqm_5Fb2Nv8Ry4","key":"repair_estimate","kind":"document","title":{"en":"Repair estimate"},"accepts":[{"type":"invoice"}]},{"id":"rqm_9Gc4Pz1Ts7","key":"garage_invoice","kind":"document","title":{"en":"Garage invoice"},"accepts":[{"type":"invoice"}]}]}}]'
```

MCP tool `save_collection_checklist`:

```json
{
  "name": "save_collection_checklist",
  "arguments": {
    "collection_id": "col_5Gk3Tm7",
    "checklist": [
      {
        "id": "rqm_2Pd7Xc4Lb9",
        "key": "police_attended",
        "kind": "question",
        "title": {
          "en": "Did the police attend?"
        },
        "question": {
          "type": "yes_no"
        }
      },
      {
        "key": "police_report",
        "kind": "document",
        "title": {
          "en": "Police report"
        },
        "when": {
          "field": "answer.police_attended",
          "op": "equals",
          "value": true
        },
        "accepts": [
          {
            "type": "letter"
          }
        ]
      },
      {
        "group": {
          "key": "repair_cost",
          "title": {
            "en": "What the repair costs"
          },
          "choose": 1,
          "members": [
            {
              "id": "rqm_5Fb2Nv8Ry4",
              "key": "repair_estimate",
              "kind": "document",
              "title": {
                "en": "Repair estimate"
              },
              "accepts": [
                {
                  "type": "invoice"
                }
              ]
            },
            {
              "id": "rqm_9Gc4Pz1Ts7",
              "key": "garage_invoice",
              "kind": "document",
              "title": {
                "en": "Garage invoice"
              },
              "accepts": [
                {
                  "type": "invoice"
                }
              ]
            }
          ]
        }
      }
    ]
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.collections.saveChecklist("col_5Gk3Tm7", {
  checklist: [{ id: "rqm_2Pd7Xc4Lb9", key: "police_attended", kind: "question", title: { en: "Did the police attend?" }, question: { type: "yes_no" } }, { key: "police_report", kind: "document", title: { en: "Police report" }, when: { field: "answer.police_attended", op: "equals", value: true }, accepts: [{ type: "letter" }] }, { group: { key: "repair_cost", title: { en: "What the repair costs" }, choose: 1, members: [{ id: "rqm_5Fb2Nv8Ry4", key: "repair_estimate", kind: "document", title: { en: "Repair estimate" }, accepts: [{ type: "invoice" }] }, { id: "rqm_9Gc4Pz1Ts7", key: "garage_invoice", kind: "document", title: { en: "Garage invoice" }, accepts: [{ type: "invoice" }] }] } }],
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.collections.save_checklist("col_5Gk3Tm7", checklist=[{"id": "rqm_2Pd7Xc4Lb9", "key": "police_attended", "kind": "question", "title": {"en": "Did the police attend?"}, "question": {"type": "yes_no"}}, {"key": "police_report", "kind": "document", "title": {"en": "Police report"}, "when": {"field": "answer.police_attended", "op": "equals", "value": True}, "accepts": [{"type": "letter"}]}, {"group": {"key": "repair_cost", "title": {"en": "What the repair costs"}, "choose": 1, "members": [{"id": "rqm_5Fb2Nv8Ry4", "key": "repair_estimate", "kind": "document", "title": {"en": "Repair estimate"}, "accepts": [{"type": "invoice"}]}, {"id": "rqm_9Gc4Pz1Ts7", "key": "garage_invoice", "kind": "document", "title": {"en": "Garage invoice"}, "accepts": [{"type": "invoice"}]}]}}])
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Collections.SaveChecklist(ctx, "col_5Gk3Tm7", &kontiga.CollectionsSaveChecklistParams{
	Checklist: []any{map[string]any{"id": "rqm_2Pd7Xc4Lb9", "key": "police_attended", "kind": "question", "title": map[string]any{"en": "Did the police attend?"}, "question": map[string]any{"type": "yes_no"}}, map[string]any{"key": "police_report", "kind": "document", "title": map[string]any{"en": "Police report"}, "when": map[string]any{"field": "answer.police_attended", "op": "equals", "value": true}, "accepts": []any{map[string]any{"type": "letter"}}}, map[string]any{"group": map[string]any{"key": "repair_cost", "title": map[string]any{"en": "What the repair costs"}, "choose": 1, "members": []any{map[string]any{"id": "rqm_5Fb2Nv8Ry4", "key": "repair_estimate", "kind": "document", "title": map[string]any{"en": "Repair estimate"}, "accepts": []any{map[string]any{"type": "invoice"}}}, map[string]any{"id": "rqm_9Gc4Pz1Ts7", "key": "garage_invoice", "kind": "document", "title": map[string]any{"en": "Garage invoice"}, "accepts": []any{map[string]any{"type": "invoice"}}}}}}},
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.collections().saveChecklist("col_5Gk3Tm7", CollectionsSaveChecklistParams.builder()
    .checklist(List.of(Map.of("id", "rqm_2Pd7Xc4Lb9", "key", "police_attended", "kind", "question", "title", Map.of("en", "Did the police attend?"), "question", Map.of("type", "yes_no")), Map.of("key", "police_report", "kind", "document", "title", Map.of("en", "Police report"), "when", Map.of("field", "answer.police_attended", "op", "equals", "value", true), "accepts", List.of(Map.of("type", "letter"))), Map.of("group", Map.of("key", "repair_cost", "title", Map.of("en", "What the repair costs"), "choose", 1, "members", List.of(Map.of("id", "rqm_5Fb2Nv8Ry4", "key", "repair_estimate", "kind", "document", "title", Map.of("en", "Repair estimate"), "accepts", List.of(Map.of("type", "invoice"))), Map.of("id", "rqm_9Gc4Pz1Ts7", "key", "garage_invoice", "kind", "document", "title", Map.of("en", "Garage invoice"), "accepts", List.of(Map.of("type", "invoice"))))))))
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Collections.SaveChecklistAsync("col_5Gk3Tm7", new CollectionsSaveChecklistOptions
{
    Checklist = new object[] { new Dictionary<string, object> { ["id"] = "rqm_2Pd7Xc4Lb9", ["key"] = "police_attended", ["kind"] = "question", ["title"] = new Dictionary<string, object> { ["en"] = "Did the police attend?" }, ["question"] = new Dictionary<string, object> { ["type"] = "yes_no" } }, new Dictionary<string, object> { ["key"] = "police_report", ["kind"] = "document", ["title"] = new Dictionary<string, object> { ["en"] = "Police report" }, ["when"] = new Dictionary<string, object> { ["field"] = "answer.police_attended", ["op"] = "equals", ["value"] = true }, ["accepts"] = new object[] { new Dictionary<string, object> { ["type"] = "letter" } } }, new Dictionary<string, object> { ["group"] = new Dictionary<string, object> { ["key"] = "repair_cost", ["title"] = new Dictionary<string, object> { ["en"] = "What the repair costs" }, ["choose"] = 1, ["members"] = new object[] { new Dictionary<string, object> { ["id"] = "rqm_5Fb2Nv8Ry4", ["key"] = "repair_estimate", ["kind"] = "document", ["title"] = new Dictionary<string, object> { ["en"] = "Repair estimate" }, ["accepts"] = new object[] { new Dictionary<string, object> { ["type"] = "invoice" } } }, new Dictionary<string, object> { ["id"] = "rqm_9Gc4Pz1Ts7", ["key"] = "garage_invoice", ["kind"] = "document", ["title"] = new Dictionary<string, object> { ["en"] = "Garage invoice" }, ["accepts"] = new object[] { new Dictionary<string, object> { ["type"] = "invoice" } } } } } } },
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->collections->saveChecklist('col_5Gk3Tm7', [
    'checklist' => [['id' => 'rqm_2Pd7Xc4Lb9', 'key' => 'police_attended', 'kind' => 'question', 'title' => ['en' => 'Did the police attend?'], 'question' => ['type' => 'yes_no']], ['key' => 'police_report', 'kind' => 'document', 'title' => ['en' => 'Police report'], 'when' => ['field' => 'answer.police_attended', 'op' => 'equals', 'value' => true], 'accepts' => [['type' => 'letter']]], ['group' => ['key' => 'repair_cost', 'title' => ['en' => 'What the repair costs'], 'choose' => 1, 'members' => [['id' => 'rqm_5Fb2Nv8Ry4', 'key' => 'repair_estimate', 'kind' => 'document', 'title' => ['en' => 'Repair estimate'], 'accepts' => [['type' => 'invoice']]], ['id' => 'rqm_9Gc4Pz1Ts7', 'key' => 'garage_invoice', 'kind' => 'document', 'title' => ['en' => 'Garage invoice'], 'accepts' => [['type' => 'invoice']]]]]]],
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.collections.save_checklist("col_5Gk3Tm7", checklist: [{ id: "rqm_2Pd7Xc4Lb9", key: "police_attended", kind: "question", title: { en: "Did the police attend?" }, question: { type: "yes_no" } }, { key: "police_report", kind: "document", title: { en: "Police report" }, when: { field: "answer.police_attended", op: "equals", value: true }, accepts: [{ type: "letter" }] }, { group: { key: "repair_cost", title: { en: "What the repair costs" }, choose: 1, members: [{ id: "rqm_5Fb2Nv8Ry4", key: "repair_estimate", kind: "document", title: { en: "Repair estimate" }, accepts: [{ type: "invoice" }] }, { id: "rqm_9Gc4Pz1Ts7", key: "garage_invoice", kind: "document", title: { en: "Garage invoice" }, accepts: [{ type: "invoice" }] }] } }])
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .collections()
    .save_checklist("col_5Gk3Tm7".into(), kontiga::collections::SaveChecklistParams {
        checklist: vec![serde_json::json!({"id":"rqm_2Pd7Xc4Lb9","key":"police_attended","kind":"question","title":{"en":"Did the police attend?"},"question":{"type":"yes_no"}}), serde_json::json!({"key":"police_report","kind":"document","title":{"en":"Police report"},"when":{"field":"answer.police_attended","op":"equals","value":true},"accepts":[{"type":"letter"}]}), serde_json::json!({"group":{"key":"repair_cost","title":{"en":"What the repair costs"},"choose":1,"members":[{"id":"rqm_5Fb2Nv8Ry4","key":"repair_estimate","kind":"document","title":{"en":"Repair estimate"},"accepts":[{"type":"invoice"}]},{"id":"rqm_9Gc4Pz1Ts7","key":"garage_invoice","kind":"document","title":{"en":"Garage invoice"},"accepts":[{"type":"invoice"}]}]}})],
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "object": "collection_checklist",
  "collection_id": "col_5Gk3Tm7",
  "revision": "1795691520318402",
  "state": "active",
  "version": 5,
  "unpublished": true,
  "name": "Motor claim",
  "description": "What we ask a policyholder for after an accident",
  "default_language": "en",
  "checklist": [
    { "id": "rqm_2Pd7Xc4Lb9", "key": "police_attended", "kind": "question", "title": { "en": "Did the police attend?", "sv": "Var polisen på plats?" }, "required": true, "question": { "type": "yes_no" } },
    { "id": "rqm_8Kt3Wm6Hq1", "key": "police_report", "kind": "document", "title": { "en": "Police report" }, "required": true, "when": { "field": "answer.police_attended", "op": "equals", "value": true }, "accepts": [{ "type": "letter" }] },
    { "group": {
        "key": "repair_cost",
        "title": { "en": "What the repair costs" },
        "choose": 1,
        "members": [
          { "id": "rqm_5Fb2Nv8Ry4", "key": "repair_estimate", "kind": "document", "title": { "en": "Repair estimate" }, "accepts": [{ "type": "invoice" }] },
          { "id": "rqm_9Gc4Pz1Ts7", "key": "garage_invoice", "kind": "document", "title": { "en": "Garage invoice" }, "accepts": [{ "type": "invoice" }] }
        ]
    } }
  ],
  "problems": [],
  "updated_at": "2026-11-30T10:04:00Z"
}
```
