# Case tags

> 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/case-tags

A tag is a marker your team puts on cases: one of nine colours with an optional name, such as a red Fraud review or a green Income verified. A workspace holds up to 100. A tag is archived rather than deleted, so it stays on its cases and in their history, and it can be brought back. What a document's checks find is a finding, not a tag.

Updated November 28, 2026

## The tag object

- `id` (string): The tag's id, starting with `ctag_`.
- `color` (enum): `red`, `green`, `orange`, `blue`, `yellow`, `purple`, `pink`, `cyan` or `gray`.
- `name` (string): At most 50 characters, or empty for a tag of a colour alone. A name is unique per colour, and each colour has at most one tag with no name.
- `cases_count` (integer): How many cases carry it now.
- `archived_at` (string): When it was archived; `null` while it is in use. An archived tag is out of every picker and stays on its cases.

**A tag**

```json
{
  "id": "ctag_6Rm2Kp8",
  "object": "tag",
  "color": "yellow",
  "name": "Second look",
  "cases_count": 4,
  "archived_at": null,
  "created_at": "2026-09-12T10:04:00Z",
  "updated_at": "2026-09-12T10:04:00Z"
}
```

Refusals

| Message | When |
| --- | --- |
| `Name too long (max 50 characters)` | The name has more than 50 characters. |
| `Name cannot contain control characters` | The name holds an invisible or control character. |
| `Name has already been taken` | Another tag of the same colour has this name. |
| `Name empty tag already exists for this color` | The colour already has a tag with no name. |
| `Tag limit reached (max 100 per workspace)` | The workspace holds 100 tags in use. Archived tags do not count. |
| `This tag is archived. Bring it back before you put it on a case.` | The tag is archived. |

## List tags

Every tag of the workspace with its colour, its name and how many cases carry it, ordered by colour and then name; archived tags only when asked for.

`GET /v1/tags`. Who may: Owner, Admin, Analyst and Viewer; Developer in test mode. CLI: `kontiga tags list [--include-archived]`. MCP tool: `list_tags`.

**Parameters**
- `include_archived` (boolean, default false): Also answer archived tags.

**Returns** list of tags: The workspace's tags, by colour and then name, each with how many cases carry it.

API:

```bash
curl -X GET "https://api.kontiga.com/v1/tags?include_archived=false" \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga tags list --include-archived=false
```

MCP tool `list_tags`:

```json
{
  "name": "list_tags",
  "arguments": {
    "include_archived": false
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.tags.list({
  include_archived: false,
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.tags.list(include_archived=False)
```

Go:

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

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.tags().list(TagsListParams.builder()
    .includeArchived(false)
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Tags.ListAsync(new TagsListOptions
{
    IncludeArchived = false,
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->tags->list([
    'include_archived' => false,
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.tags.list(include_archived: false)
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .tags()
    .list(kontiga::tags::ListParams {
        include_archived: false,
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "items": [
    { "id": "ctag_1Hw7Tr3", "object": "tag", "color": "red", "name": "Fraud review", "cases_count": 6, "archived_at": null },
    { "id": "ctag_4Nb9Lc2", "object": "tag", "color": "green", "name": "Income verified", "cases_count": 18, "archived_at": null },
    { "id": "ctag_8Ks1Dq6", "object": "tag", "color": "orange", "name": "Waiting on broker", "cases_count": 3, "archived_at": null },
    { "id": "ctag_2Vt5Hm9", "object": "tag", "color": "blue", "name": "Priority", "cases_count": 5, "archived_at": null },
    { "id": "ctag_6Rm2Kp8", "object": "tag", "color": "yellow", "name": "Second look", "cases_count": 4, "archived_at": null }
  ],
  "next_cursor": null
}
```

## Create a tag

A new tag in one of the nine colours, with a name of at most 50 characters or none; given a case, it is put on that case at once.

`POST /v1/tags`. Who may: Owner, Admin and Analyst; Developer in test mode. CLI: `kontiga tags create --color <red|green|orange|blue|yellow|purple|pink|cyan|gray> [--name <name>] [--case-id <case_id>]`. MCP tool: `create_tag`.

**Parameters**
- `color` (enum, required): One of the nine colours.
- `name` (string, default ""): At most 50 characters, or empty.
- `case_id` (id (case_)): A case to put the new tag on at once.

**Returns** tag: The new tag, with how many cases carry it.

API:

```bash
curl -X POST https://api.kontiga.com/v1/tags \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "color": "cyan",
    "name": "Self-employed",
    "case_id": "case_7Kq2Xw9"
  }'
```

CLI:

```bash
kontiga tags create \
  --color cyan \
  --name Self-employed \
  --case-id case_7Kq2Xw9
```

MCP tool `create_tag`:

```json
{
  "name": "create_tag",
  "arguments": {
    "color": "cyan",
    "name": "Self-employed",
    "case_id": "case_7Kq2Xw9"
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.tags.create({
  color: "cyan",
  name: "Self-employed",
  case_id: "case_7Kq2Xw9",
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.tags.create(
    color="cyan",
    name="Self-employed",
    case_id="case_7Kq2Xw9",
)
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Tags.Create(ctx, &kontiga.TagsCreateParams{
	Color:  "cyan",
	Name:   "Self-employed",
	CaseId: "case_7Kq2Xw9",
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.tags().create(TagsCreateParams.builder()
    .color("cyan")
    .name("Self-employed")
    .caseId("case_7Kq2Xw9")
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Tags.CreateAsync(new TagsCreateOptions
{
    Color = "cyan",
    Name = "Self-employed",
    CaseId = "case_7Kq2Xw9",
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->tags->create([
    'color' => 'cyan',
    'name' => 'Self-employed',
    'case_id' => 'case_7Kq2Xw9',
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.tags.create(
  color: "cyan",
  name: "Self-employed",
  case_id: "case_7Kq2Xw9"
)
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .tags()
    .create(kontiga::tags::CreateParams {
        color: "cyan".into(),
        name: "Self-employed".into(),
        case_id: "case_7Kq2Xw9".into(),
        ..Default::default()
    })
    .await?;
```

Response, 201 Created:

```json
{
  "id": "ctag_9Fd4Wn1",
  "object": "tag",
  "color": "cyan",
  "name": "Self-employed",
  "cases_count": 1,
  "archived_at": null,
  "created_at": "2026-11-26T09:41:00Z",
  "updated_at": "2026-11-26T09:41:00Z"
}
```

## Change a tag

A tag's new name or colour, under the same rules as a new tag; every case that carries it shows the change.

`PATCH /v1/tags/{tag_id}`. Who may: Owner, Admin and Analyst; Developer in test mode. CLI: `kontiga tags update <tag_id> [--name <name>] [--color <red|green|orange|blue|yellow|purple|pink|cyan|gray>]`. MCP tool: `update_tag`.

**Parameters**
- `tag_id` (id (ctag_), required): The tag to change. In the path.
- `name` (string): Its new name, under the same rules as a new tag.
- `color` (enum): Its new colour. One of `red`, `green`, `orange`, `blue`, `yellow`, `purple`, `pink`, `cyan`, `gray`.

**Returns** tag: The tag as it is now.

API:

```bash
curl -X PATCH https://api.kontiga.com/v1/tags/ctag_6Rm2Kp8 \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Second look by a lead"
  }'
```

CLI:

```bash
kontiga tags update ctag_6Rm2Kp8 --name 'Second look by a lead'
```

MCP tool `update_tag`:

```json
{
  "name": "update_tag",
  "arguments": {
    "tag_id": "ctag_6Rm2Kp8",
    "name": "Second look by a lead"
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.tags.update("ctag_6Rm2Kp8", {
  name: "Second look by a lead",
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.tags.update("ctag_6Rm2Kp8", name="Second look by a lead")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Tags.Update(ctx, "ctag_6Rm2Kp8", &kontiga.TagsUpdateParams{
	Name: "Second look by a lead",
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.tags().update("ctag_6Rm2Kp8", TagsUpdateParams.builder()
    .name("Second look by a lead")
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Tags.UpdateAsync("ctag_6Rm2Kp8", new TagsUpdateOptions
{
    Name = "Second look by a lead",
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->tags->update('ctag_6Rm2Kp8', [
    'name' => 'Second look by a lead',
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.tags.update("ctag_6Rm2Kp8", name: "Second look by a lead")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .tags()
    .update("ctag_6Rm2Kp8".into(), kontiga::tags::UpdateParams {
        name: "Second look by a lead".into(),
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "id": "ctag_6Rm2Kp8",
  "object": "tag",
  "color": "yellow",
  "name": "Second look by a lead",
  "cases_count": 4,
  "archived_at": null,
  "created_at": "2026-09-12T10:04:00Z",
  "updated_at": "2026-11-26T09:43:00Z"
}
```

## Archive a tag

Takes a tag out of every picker; the cases that carry it keep it, and it can be brought back.

`POST /v1/tags/{tag_id}/archive`. Who may: Owner, Admin and Analyst; Developer in test mode. CLI: `kontiga tags archive <tag_id>`. MCP tool: `archive_tag`.

**Parameters**
- `tag_id` (id (ctag_), required): The tag to archive. In the path.

**Returns** tag: The tag, archived.

API:

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

CLI:

```bash
kontiga tags archive ctag_3Qx8Vb5
```

MCP tool `archive_tag`:

```json
{
  "name": "archive_tag",
  "arguments": {
    "tag_id": "ctag_3Qx8Vb5"
  }
}
```

TypeScript:

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

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

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.tags.archive("ctag_3Qx8Vb5")
```

Go:

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

Java:

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

.NET:

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

PHP:

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

Ruby:

```ruby
require "kontiga"

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

Rust:

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

Response, 200 OK:

```json
{
  "id": "ctag_3Qx8Vb5",
  "object": "tag",
  "color": "gray",
  "name": "Q3 file audit",
  "cases_count": 7,
  "archived_at": "2026-11-26T09:44:00Z",
  "created_at": "2026-06-29T08:00:00Z",
  "updated_at": "2026-11-26T09:44:00Z"
}
```

## Bring back a tag

An archived tag in the pickers again, on the cases it was on.

`POST /v1/tags/{tag_id}/restore`. Who may: Owner, Admin and Analyst; Developer in test mode. CLI: `kontiga tags restore <tag_id>`. MCP tool: `restore_tag`.

**Parameters**
- `tag_id` (id (ctag_), required): The archived tag to bring back. In the path.

**Returns** tag: The tag, back in use.

API:

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

CLI:

```bash
kontiga tags restore ctag_3Qx8Vb5
```

MCP tool `restore_tag`:

```json
{
  "name": "restore_tag",
  "arguments": {
    "tag_id": "ctag_3Qx8Vb5"
  }
}
```

TypeScript:

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

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

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.tags.restore("ctag_3Qx8Vb5")
```

Go:

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

Java:

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

.NET:

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

PHP:

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

Ruby:

```ruby
require "kontiga"

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

Rust:

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

Response, 200 OK:

```json
{
  "id": "ctag_3Qx8Vb5",
  "object": "tag",
  "color": "gray",
  "name": "Q3 file audit",
  "cases_count": 7,
  "archived_at": null,
  "created_at": "2026-06-29T08:00:00Z",
  "updated_at": "2026-11-26T09:45:00Z"
}
```

## List the tags on cases

Which case carries which tag, who put it there and when: for some cases, for some tags, or for the whole workspace.

`GET /v1/case_tags`. Who may: Owner, Admin, Analyst and Viewer; Developer in test mode. CLI: `kontiga case-tags list [--case-id <case_id>,...] [--tag-id <tag_id>,...]`. MCP tool: `list_case_tags`.

**Parameters**
- `case_id` (array of id (case_)): Only these cases. Left out with `tag_id` too, the whole workspace. At most 500 items.
- `tag_id` (array of id (ctag_)): Only these tags. At most 100 items.

**Returns** list of case tags: One row per tag on a case, with who put it there and when.

API:

```bash
curl -X GET "https://api.kontiga.com/v1/case_tags?case_id=case_7Kq2Xw9" \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga case-tags list --case-id case_7Kq2Xw9
```

MCP tool `list_case_tags`:

```json
{
  "name": "list_case_tags",
  "arguments": {
    "case_id": [
      "case_7Kq2Xw9"
    ]
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.caseTags.list({
  case_id: ["case_7Kq2Xw9"],
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.case_tags.list(case_id=["case_7Kq2Xw9"])
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.CaseTags.List(ctx, &kontiga.CaseTagsListParams{
	CaseId: []string{"case_7Kq2Xw9"},
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.caseTags().list(CaseTagsListParams.builder()
    .caseId(List.of("case_7Kq2Xw9"))
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.CaseTags.ListAsync(new CaseTagsListOptions
{
    CaseId = new[] { "case_7Kq2Xw9" },
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->caseTags->list([
    'case_id' => ['case_7Kq2Xw9'],
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.case_tags.list(case_id: ["case_7Kq2Xw9"])
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .case_tags()
    .list(kontiga::case_tags::ListParams {
        case_id: vec!["case_7Kq2Xw9".into()],
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "items": [
    { "case_id": "case_7Kq2Xw9", "tag_id": "ctag_6Rm2Kp8", "attached_at": "2026-11-25T15:02:00Z", "attached_by": "mem_3Rt8Lp2" },
    { "case_id": "case_7Kq2Xw9", "tag_id": "ctag_2Vt5Hm9", "attached_at": "2026-11-24T09:20:00Z", "attached_by": null }
  ],
  "next_cursor": null
}
```

## Tag a case

Puts a tag on a case. A tag already there stays as it was.

`POST /v1/cases/{case_id}/tags`. Who may: Owner, Admin and Analyst; Developer in test mode. CLI: `kontiga cases tag <case_id> --tag-id <tag_id>`. MCP tool: `tag_case`.

**Parameters**
- `case_id` (id (case_), required): The case to tag. In the path.
- `tag_id` (id (ctag_), required): The tag to put on it.

**Returns** tag: The tag, with how many cases carry it now.

API:

```bash
curl -X POST https://api.kontiga.com/v1/cases/case_7Kq2Xw9/tags \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tag_id": "ctag_6Rm2Kp8"
  }'
```

CLI:

```bash
kontiga cases tag case_7Kq2Xw9 --tag-id ctag_6Rm2Kp8
```

MCP tool `tag_case`:

```json
{
  "name": "tag_case",
  "arguments": {
    "case_id": "case_7Kq2Xw9",
    "tag_id": "ctag_6Rm2Kp8"
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.caseTags.attach("case_7Kq2Xw9", {
  tag_id: "ctag_6Rm2Kp8",
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.case_tags.attach("case_7Kq2Xw9", tag_id="ctag_6Rm2Kp8")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.CaseTags.Attach(ctx, "case_7Kq2Xw9", &kontiga.CaseTagsAttachParams{
	TagId: "ctag_6Rm2Kp8",
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.caseTags().attach("case_7Kq2Xw9", CaseTagsAttachParams.builder()
    .tagId("ctag_6Rm2Kp8")
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.CaseTags.AttachAsync("case_7Kq2Xw9", new CaseTagsAttachOptions
{
    TagId = "ctag_6Rm2Kp8",
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->caseTags->attach('case_7Kq2Xw9', [
    'tag_id' => 'ctag_6Rm2Kp8',
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.case_tags.attach("case_7Kq2Xw9", tag_id: "ctag_6Rm2Kp8")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .case_tags()
    .attach("case_7Kq2Xw9".into(), kontiga::case_tags::AttachParams {
        tag_id: "ctag_6Rm2Kp8".into(),
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "id": "ctag_6Rm2Kp8",
  "object": "tag",
  "color": "yellow",
  "name": "Second look",
  "cases_count": 5,
  "archived_at": null,
  "created_at": "2026-09-12T10:04:00Z",
  "updated_at": "2026-09-12T10:04:00Z"
}
```

## Take a tag off a case

Takes a tag off a case; nothing changes when the case did not carry it.

`DELETE /v1/cases/{case_id}/tags/{tag_id}`. Who may: Owner, Admin and Analyst; Developer in test mode. CLI: `kontiga cases untag <case_id> --tag-id <tag_id>`. MCP tool: `untag_case`.

**Parameters**
- `case_id` (id (case_), required): The case. In the path.
- `tag_id` (id (ctag_), required): The tag to take off it. In the path.

**Returns** nothing: Nothing: the case no longer carries the tag.

API:

```bash
curl -X DELETE https://api.kontiga.com/v1/cases/case_7Kq2Xw9/tags/ctag_6Rm2Kp8 \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga cases untag case_7Kq2Xw9 --tag-id ctag_6Rm2Kp8
```

MCP tool `untag_case`:

```json
{
  "name": "untag_case",
  "arguments": {
    "case_id": "case_7Kq2Xw9",
    "tag_id": "ctag_6Rm2Kp8"
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.caseTags.detach("case_7Kq2Xw9", "ctag_6Rm2Kp8");
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.case_tags.detach("case_7Kq2Xw9", "ctag_6Rm2Kp8")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.CaseTags.Detach(ctx, "case_7Kq2Xw9", "ctag_6Rm2Kp8")
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.caseTags().detach("case_7Kq2Xw9", "ctag_6Rm2Kp8");
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.CaseTags.DetachAsync("case_7Kq2Xw9", "ctag_6Rm2Kp8");
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->caseTags->detach('case_7Kq2Xw9', 'ctag_6Rm2Kp8');
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.case_tags.detach("case_7Kq2Xw9", "ctag_6Rm2Kp8")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .case_tags()
    .detach("case_7Kq2Xw9".into(), "ctag_6Rm2Kp8".into())
    .await?;
```

Taking a tag off answers `204 No Content`, whether or not the case carried it.

## Tag many cases

Puts one tag on many cases, or takes it off them, in one call: what the case list does with the cases chosen.

`POST /v1/case_tags/bulk`. Who may: Owner, Admin and Analyst; Developer in test mode. CLI: `kontiga cases tag-many --case-ids <case_id>,... --tag-id <tag_id> [--action <attach|detach>]`. MCP tool: `tag_cases`.

**Parameters**
- `case_ids` (array of id (case_), required): The cases, as the case list chose them. At most 500 items.
- `tag_id` (id (ctag_), required): The tag.
- `action` (enum, default "attach"): Put the tag on the cases, or take it off them. One of `attach`, `detach`.

**Returns** bulk tag result: The tag, how many cases changed, and how many were already as asked.

API:

```bash
curl -X POST https://api.kontiga.com/v1/case_tags/bulk \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "case_ids": [
      "case_7Kq2Xw9",
      "case_4Pm1Zr6",
      "case_2Ht6Ns3",
      "case_9Lc4Bx8"
    ],
    "tag_id": "ctag_2Vt5Hm9",
    "action": "attach"
  }'
```

CLI:

```bash
kontiga cases tag-many \
  --case-ids case_7Kq2Xw9,case_4Pm1Zr6,case_2Ht6Ns3,case_9Lc4Bx8 \
  --tag-id ctag_2Vt5Hm9 \
  --action attach
```

MCP tool `tag_cases`:

```json
{
  "name": "tag_cases",
  "arguments": {
    "case_ids": [
      "case_7Kq2Xw9",
      "case_4Pm1Zr6",
      "case_2Ht6Ns3",
      "case_9Lc4Bx8"
    ],
    "tag_id": "ctag_2Vt5Hm9",
    "action": "attach"
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.caseTags.bulk({
  case_ids: ["case_7Kq2Xw9", "case_4Pm1Zr6", "case_2Ht6Ns3", "case_9Lc4Bx8"],
  tag_id: "ctag_2Vt5Hm9",
  action: "attach",
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.case_tags.bulk(
    case_ids=["case_7Kq2Xw9", "case_4Pm1Zr6", "case_2Ht6Ns3", "case_9Lc4Bx8"],
    tag_id="ctag_2Vt5Hm9",
    action="attach",
)
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.CaseTags.Bulk(ctx, &kontiga.CaseTagsBulkParams{
	CaseIds: []string{"case_7Kq2Xw9", "case_4Pm1Zr6", "case_2Ht6Ns3", "case_9Lc4Bx8"},
	TagId:   "ctag_2Vt5Hm9",
	Action:  "attach",
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.caseTags().bulk(CaseTagsBulkParams.builder()
    .caseIds(List.of("case_7Kq2Xw9", "case_4Pm1Zr6", "case_2Ht6Ns3", "case_9Lc4Bx8"))
    .tagId("ctag_2Vt5Hm9")
    .action("attach")
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.CaseTags.BulkAsync(new CaseTagsBulkOptions
{
    CaseIds = new[] { "case_7Kq2Xw9", "case_4Pm1Zr6", "case_2Ht6Ns3", "case_9Lc4Bx8" },
    TagId = "ctag_2Vt5Hm9",
    Action = "attach",
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->caseTags->bulk([
    'case_ids' => ['case_7Kq2Xw9', 'case_4Pm1Zr6', 'case_2Ht6Ns3', 'case_9Lc4Bx8'],
    'tag_id' => 'ctag_2Vt5Hm9',
    'action' => 'attach',
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.case_tags.bulk(
  case_ids: ["case_7Kq2Xw9", "case_4Pm1Zr6", "case_2Ht6Ns3", "case_9Lc4Bx8"],
  tag_id: "ctag_2Vt5Hm9",
  action: "attach"
)
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .case_tags()
    .bulk(kontiga::case_tags::BulkParams {
        case_ids: vec!["case_7Kq2Xw9".into(), "case_4Pm1Zr6".into(), "case_2Ht6Ns3".into(), "case_9Lc4Bx8".into()],
        tag_id: "ctag_2Vt5Hm9".into(),
        action: "attach".into(),
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "object": "bulk_tag_result",
  "tag": { "id": "ctag_2Vt5Hm9", "object": "tag", "color": "blue", "name": "Priority", "cases_count": 8 },
  "action": "attach",
  "changed": 3,
  "unchanged": 1
}
```
