# Assistant

> 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/assistant

The console's assistant, on the API too. It reaches everything the member asking may read and nothing more, answers with the cases, documents, people and policy passages it rests on, and proposes every change for the member to confirm. A proposal runs only when it is confirmed, as that member and with their role checked again at that moment. Conversations are each member's own; nobody else sees them.

Updated November 28, 2026

## Citations and proposals

- An answer cites with markers such as `[[doc_3Tn8Wq5]]` or `[[pol_4Xw8Mn2#3.2]]`, one passage of a policy. Each marker is resolved in `citations`, with where it opens in the console.
- `steps` lists each read and action the answer called, by its registry id. A read the member may not make is refused, and says so.
- A proposed action carries the registry call it would make, every value in plain words, and a `fingerprint`: the SHA-256 of the tool and its arguments. Confirm sends the fingerprint back, so what runs is exactly what was shown.
- A proposal waits 15 minutes, then expires. It runs once, however often it is confirmed.

## Ask the assistant

Ask about anything in the workspace. The answer streams back, cites the cases, documents, people and policy passages it rests on, and proposes any change for you to confirm.

`POST /v1/assistant/messages`. Who may: Owner, Admin, Analyst, Developer, Viewer and Billing. CLI: `kontiga conversations ask <text> [--conversation-id <conversation_id>] [--screen <path>]`. MCP tool: `ask_assistant`.

**Parameters**
- `text` (string, required): The question, in the member's own words. At most 4,000 characters.
- `conversation_id` (id (cnv_)): The conversation to continue. Left out, a new one starts.
- `screen` (string): The console address the member asks from, so the assistant knows what they are looking at. At most 300 characters.

**Returns** conversation, answered: The conversation with your message and the answer; the answer also streams as server-sent events while it is written.

API:

```bash
curl -X POST https://api.kontiga.com/v1/assistant/messages \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Why is APP-20418 in review, and can it be approved?",
    "screen": "/console/cases/case_7Kq2Xw9"
  }'
```

CLI:

```bash
kontiga conversations ask 'Why is APP-20418 in review, and can it be approved?' \
  --screen /console/cases/case_7Kq2Xw9
```

MCP tool `ask_assistant`:

```json
{
  "name": "ask_assistant",
  "arguments": {
    "text": "Why is APP-20418 in review, and can it be approved?",
    "screen": "/console/cases/case_7Kq2Xw9"
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.conversations.ask({
  text: "Why is APP-20418 in review, and can it be approved?",
  screen: "/console/cases/case_7Kq2Xw9",
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.conversations.ask(text="Why is APP-20418 in review, and can it be approved?", screen="/console/cases/case_7Kq2Xw9")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Conversations.Ask(ctx, &kontiga.ConversationsAskParams{
	Text:   "Why is APP-20418 in review, and can it be approved?",
	Screen: "/console/cases/case_7Kq2Xw9",
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.conversations().ask(ConversationsAskParams.builder()
    .text("Why is APP-20418 in review, and can it be approved?")
    .screen("/console/cases/case_7Kq2Xw9")
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Conversations.AskAsync(new ConversationsAskOptions
{
    Text = "Why is APP-20418 in review, and can it be approved?",
    Screen = "/console/cases/case_7Kq2Xw9",
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->conversations->ask([
    'text' => 'Why is APP-20418 in review, and can it be approved?',
    'screen' => '/console/cases/case_7Kq2Xw9',
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.conversations.ask(text: "Why is APP-20418 in review, and can it be approved?", screen: "/console/cases/case_7Kq2Xw9")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .conversations()
    .ask(kontiga::conversations::AskParams {
        text: "Why is APP-20418 in review, and can it be approved?".into(),
        screen: "/console/cases/case_7Kq2Xw9".into(),
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "conversation": {
    "id": "cnv_8Hd3Wq6",
    "object": "conversation",
    "title": "Why is APP-20418 in review?",
    "context": { "path": "/console/cases/case_7Kq2Xw9", "title": "APP-20418", "entity_id": "case_7Kq2Xw9" },
    "created_at": "2026-11-26T09:30:04Z",
    "last_turn_at": "2026-11-26T09:30:11Z",
    "message_count": 2,
    "pending_actions": 1
  },
  "message": {
    "id": "msg_2Lq7Rc1",
    "role": "user",
    "text": "Why is APP-20418 in review, and can it be approved?",
    "screen": { "path": "/console/cases/case_7Kq2Xw9", "title": "APP-20418", "entity_id": "case_7Kq2Xw9" },
    "status": "complete",
    "created_at": "2026-11-26T09:30:04Z"
  },
  "answer": {
    "id": "msg_2Lq7Rd4",
    "role": "assistant",
    "text": "One document holds it: the October payslip [[doc_3Tn8Wq5]] has a finding on its net pay. The bank statement [[doc_6Pk2Hs9]] shows the same net pay arriving on 25 Oct, which is what the lending policy asks for [[pol_4Xw8Mn2#3.2]]. I can record Approved with that note; confirm to run it.",
    "status": "complete",
    "citations": [
      { "ref": "doc_3Tn8Wq5", "kind": "document", "id": "doc_3Tn8Wq5", "label": "Payslip, October 2026", "detail": "Review", "href": "/console/documents/doc_3Tn8Wq5" },
      { "ref": "doc_6Pk2Hs9", "kind": "document", "id": "doc_6Pk2Hs9", "label": "Bank statement, October 2026", "detail": "Trusted", "href": "/console/documents/doc_6Pk2Hs9" },
      { "ref": "pol_4Xw8Mn2#3.2", "kind": "policy", "id": "pol_4Xw8Mn2", "label": "Lending policy 3.2", "detail": "Proof of income", "href": "/console/settings/policies/pol_4Xw8Mn2" }
    ],
    "steps": [
      { "id": "stp_1", "surface_id": "cases.get", "title": "Read a case", "kind": "read", "status": "done", "note": null },
      { "id": "stp_2", "surface_id": "policies.search_all", "title": "Search the Policies library", "kind": "read", "status": "done", "note": null },
      { "id": "stp_3", "surface_id": "cases.decide", "title": "Decide a case", "kind": "action", "status": "proposed", "note": null }
    ],
    "action_ids": ["act_5Ns9Kd2"],
    "notices": [],
    "created_at": "2026-11-26T09:30:11Z"
  }
}
```

The answer also streams as server-sent events while it is written, so a page can show it as it comes. The stream ends with the whole answer, as above.

## List your conversations

Your conversations with the assistant, the newest first, each with its first question, the screen it began on, and the actions still waiting for you.

`GET /v1/assistant/conversations`. Who may: Owner, Admin, Analyst, Developer, Viewer and Billing. CLI: `kontiga conversations list [--limit <n>]`. MCP tool: `list_assistant_conversations`.

**Parameters**
- `limit` (integer): How many to answer, newest first. At least 1, at most 200.

**Returns** list of conversations: Your conversations, newest first; nobody else sees them.

API:

```bash
curl -X GET "https://api.kontiga.com/v1/assistant/conversations?limit=20" \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga conversations list --limit 20
```

MCP tool `list_assistant_conversations`:

```json
{
  "name": "list_assistant_conversations",
  "arguments": {
    "limit": 20
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.conversations.list({
  limit: 20,
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.conversations.list(limit=20)
```

Go:

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

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.conversations().list(ConversationsListParams.builder()
    .limit(20)
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Conversations.ListAsync(new ConversationsListOptions
{
    Limit = 20,
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->conversations->list([
    'limit' => 20,
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.conversations.list(limit: 20)
```

Rust:

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

Response, 200 OK:

```json
{
  "items": [
    {
      "id": "cnv_8Hd3Wq6",
      "object": "conversation",
      "title": "Why is APP-20418 in review?",
      "context": { "path": "/console/cases/case_7Kq2Xw9", "title": "APP-20418", "entity_id": "case_7Kq2Xw9" },
      "created_at": "2026-11-26T09:30:04Z",
      "last_turn_at": "2026-11-26T09:30:11Z",
      "message_count": 2,
      "pending_actions": 1,
      "preview": "One document holds it: the October payslip has a finding on its net pay."
    },
    {
      "id": "cnv_3Bv6Tq9",
      "object": "conversation",
      "title": "Which requests expire this week?",
      "context": { "path": "/console/requests", "title": "Requests", "entity_id": null },
      "created_at": "2026-11-25T14:02:40Z",
      "last_turn_at": "2026-11-25T14:03:02Z",
      "message_count": 2,
      "pending_actions": 0,
      "preview": "Four requests expire before Monday. Two are waiting on one document each"
    }
  ],
  "next_cursor": null
}
```

## Read a conversation

One of your conversations in full: every question and answer, the sources each answer cites, what it read, and each action it proposed with its state.

`GET /v1/assistant/conversations/{conversation_id}`. Who may: Owner, Admin, Analyst, Developer, Viewer and Billing. CLI: `kontiga conversations get <conversation_id>`. MCP tool: `get_assistant_conversation`.

**Parameters**
- `conversation_id` (id (cnv_), required): One of your conversations. In the path.

**Returns** conversation: The conversation with its messages, citations and proposed actions.

API:

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

CLI:

```bash
kontiga conversations get cnv_8Hd3Wq6
```

MCP tool `get_assistant_conversation`:

```json
{
  "name": "get_assistant_conversation",
  "arguments": {
    "conversation_id": "cnv_8Hd3Wq6"
  }
}
```

TypeScript:

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

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

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.conversations.get("cnv_8Hd3Wq6")
```

Go:

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

Java:

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

.NET:

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

PHP:

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

Ruby:

```ruby
require "kontiga"

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

Rust:

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

Response, 200 OK:

```json
{
  "id": "cnv_8Hd3Wq6",
  "object": "conversation",
  "title": "Why is APP-20418 in review?",
  "message_count": 2,
  "pending_actions": 1,
  "messages": [
    { "id": "msg_2Lq7Rc1", "role": "user", "text": "Why is APP-20418 in review, and can it be approved?", "status": "complete" },
    { "id": "msg_2Lq7Rd4", "role": "assistant", "text": "One document holds it: the October payslip [[doc_3Tn8Wq5]] …", "status": "complete", "action_ids": ["act_5Ns9Kd2"] }
  ],
  "actions": [
    {
      "id": "act_5Ns9Kd2",
      "surface_id": "cases.decide",
      "title": "Decide a case",
      "params": { "case_id": "case_7Kq2Xw9", "outcome": "approved", "note": "Net pay matches the bank statement of 25 Oct." },
      "lines": [
        { "label": "Case", "value": "APP-20418, Mortgage application, 14 Harbour Row" },
        { "label": "Outcome", "value": "Approved" },
        { "label": "Note", "value": "Net pay matches the bank statement of 25 Oct." }
      ],
      "why": "The only open finding is answered by the bank statement, as the policy asks.",
      "fingerprint": "3f9a2c71e4b85d06a1c7e9d2b4f8061c5e3a9d7b2c4f6e8a0b1d3c5e7f9a2b4c",
      "proposed_at": "2026-11-26T09:30:11Z",
      "expires_at": "2026-11-26T09:45:11Z",
      "state": "pending",
      "decided_at": null,
      "result": null
    }
  ]
}
```

## Delete a conversation

Delete one of your conversations and its messages. What it changed on a case stays on the case's timeline.

`DELETE /v1/assistant/conversations/{conversation_id}`. Who may: Owner, Admin, Analyst, Developer, Viewer and Billing. CLI: `kontiga conversations delete <conversation_id>`. MCP tool: `delete_assistant_conversation`.

**Parameters**
- `conversation_id` (id (cnv_), required): The conversation to delete. In the path.

**Returns** conversation, deleted: The conversation is gone from your history.

API:

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

CLI:

```bash
kontiga conversations delete cnv_3Bv6Tq9
```

MCP tool `delete_assistant_conversation`:

```json
{
  "name": "delete_assistant_conversation",
  "arguments": {
    "conversation_id": "cnv_3Bv6Tq9"
  }
}
```

TypeScript:

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

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

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.conversations.delete("cnv_3Bv6Tq9")
```

Go:

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

Java:

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

.NET:

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

PHP:

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

Ruby:

```ruby
require "kontiga"

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

Rust:

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

Response, 200 OK:

```json
{
  "id": "cnv_3Bv6Tq9",
  "object": "conversation",
  "deleted": true
}
```

## Confirm a proposed action

Run a change the assistant proposed, as you, with your role checked again now. It runs once, however often it is confirmed.

`POST /v1/assistant/actions/{action_id}/confirm`. Who may: Owner, Admin, Analyst, Developer, Viewer and Billing. CLI: `kontiga assistant-actions confirm <action_id> --fingerprint <sha256>`. MCP tool: `confirm_assistant_action`.

**Parameters**
- `action_id` (id (act_), required): The proposed action, from the answer's `action_ids`. In the path.
- `fingerprint` (string, required): The action's `fingerprint`, sent back unchanged. A different one is refused and nothing runs.

**Returns** proposed action, executed: The action with its state and what happened.

API:

```bash
curl -X POST https://api.kontiga.com/v1/assistant/actions/act_5Ns9Kd2/confirm \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "fingerprint": "3f9a2c71e4b85d06a1c7e9d2b4f8061c5e3a9d7b2c4f6e8a0b1d3c5e7f9a2b4c"
  }'
```

CLI:

```bash
kontiga assistant-actions confirm act_5Ns9Kd2 \
  --fingerprint 3f9a2c71e4b85d06a1c7e9d2b4f8061c5e3a9d7b2c4f6e8a0b1d3c5e7f9a2b4c
```

MCP tool `confirm_assistant_action`:

```json
{
  "name": "confirm_assistant_action",
  "arguments": {
    "action_id": "act_5Ns9Kd2",
    "fingerprint": "3f9a2c71e4b85d06a1c7e9d2b4f8061c5e3a9d7b2c4f6e8a0b1d3c5e7f9a2b4c"
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.assistantActions.confirm("act_5Ns9Kd2", {
  fingerprint: "3f9a2c71e4b85d06a1c7e9d2b4f8061c5e3a9d7b2c4f6e8a0b1d3c5e7f9a2b4c",
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.assistant_actions.confirm("act_5Ns9Kd2", fingerprint="3f9a2c71e4b85d06a1c7e9d2b4f8061c5e3a9d7b2c4f6e8a0b1d3c5e7f9a2b4c")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.AssistantActions.Confirm(ctx, "act_5Ns9Kd2", &kontiga.AssistantActionsConfirmParams{
	Fingerprint: "3f9a2c71e4b85d06a1c7e9d2b4f8061c5e3a9d7b2c4f6e8a0b1d3c5e7f9a2b4c",
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.assistantActions().confirm("act_5Ns9Kd2", AssistantActionsConfirmParams.builder()
    .fingerprint("3f9a2c71e4b85d06a1c7e9d2b4f8061c5e3a9d7b2c4f6e8a0b1d3c5e7f9a2b4c")
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.AssistantActions.ConfirmAsync("act_5Ns9Kd2", new AssistantActionsConfirmOptions
{
    Fingerprint = "3f9a2c71e4b85d06a1c7e9d2b4f8061c5e3a9d7b2c4f6e8a0b1d3c5e7f9a2b4c",
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->assistantActions->confirm('act_5Ns9Kd2', [
    'fingerprint' => '3f9a2c71e4b85d06a1c7e9d2b4f8061c5e3a9d7b2c4f6e8a0b1d3c5e7f9a2b4c',
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.assistant_actions.confirm("act_5Ns9Kd2", fingerprint: "3f9a2c71e4b85d06a1c7e9d2b4f8061c5e3a9d7b2c4f6e8a0b1d3c5e7f9a2b4c")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .assistant_actions()
    .confirm("act_5Ns9Kd2".into(), kontiga::assistant_actions::ConfirmParams {
        fingerprint: "3f9a2c71e4b85d06a1c7e9d2b4f8061c5e3a9d7b2c4f6e8a0b1d3c5e7f9a2b4c".into(),
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "id": "act_5Ns9Kd2",
  "object": "proposed_action",
  "surface_id": "cases.decide",
  "state": "executed",
  "decided_at": "2026-11-26T09:31:20Z",
  "result": "APP-20418 is decided: Approved, with your note.",
  "result_href": "/console/cases/case_7Kq2Xw9",
  "result_label": "APP-20418"
}
```

## Reject a proposed action

Turn down a change the assistant proposed. Nothing is sent and nothing changes.

`POST /v1/assistant/actions/{action_id}/reject`. Who may: Owner, Admin, Analyst, Developer, Viewer and Billing. CLI: `kontiga assistant-actions reject <action_id>`. MCP tool: `reject_assistant_action`.

**Parameters**
- `action_id` (id (act_), required): The proposed action to turn down. In the path.

**Returns** proposed action, rejected: The action, rejected.

API:

```bash
curl -X POST https://api.kontiga.com/v1/assistant/actions/act_5Ns9Kd2/reject \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga assistant-actions reject act_5Ns9Kd2
```

MCP tool `reject_assistant_action`:

```json
{
  "name": "reject_assistant_action",
  "arguments": {
    "action_id": "act_5Ns9Kd2"
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.assistantActions.reject("act_5Ns9Kd2");
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.assistant_actions.reject("act_5Ns9Kd2")
```

Go:

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

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.assistantActions().reject("act_5Ns9Kd2");
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.AssistantActions.RejectAsync("act_5Ns9Kd2");
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->assistantActions->reject('act_5Ns9Kd2');
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.assistant_actions.reject("act_5Ns9Kd2")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .assistant_actions()
    .reject("act_5Ns9Kd2".into())
    .await?;
```

Response, 200 OK:

```json
{
  "id": "act_5Ns9Kd2",
  "object": "proposed_action",
  "surface_id": "cases.decide",
  "state": "rejected",
  "decided_at": "2026-11-26T09:31:20Z",
  "result": null
}
```

## Search the Policies library

The numbered passages that match a few words across every policy you may read, or one policy, best first, each with its policy, document and version.

`POST /v1/policies/search`. Who may: Owner, Admin, Analyst, Developer and Viewer. CLI: `kontiga policies search-all --query <words> [--policy-id <policy_id>] [--top-k <n>]`. MCP tool: `search_policies`.

**Parameters**
- `query` (string, required): A few words, such as `proof of income self-employed`. At most 500 characters.
- `policy_id` (id (pol_)): Search one policy only.
- `top_k` (integer): How many passages to answer, best first. At least 1, at most 20.

**Returns** policy library search: The passages that match, best first, each with the marker an answer cites it by.

API:

```bash
curl -X POST https://api.kontiga.com/v1/policies/search \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "proof of income self-employed",
    "top_k": 5
  }'
```

CLI:

```bash
kontiga policies search-all \
  --query 'proof of income self-employed' \
  --top-k 5
```

MCP tool `search_policies`:

```json
{
  "name": "search_policies",
  "arguments": {
    "query": "proof of income self-employed",
    "top_k": 5
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.policies.searchAll({
  query: "proof of income self-employed",
  top_k: 5,
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.policies.search_all(query="proof of income self-employed", top_k=5)
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Policies.SearchAll(ctx, &kontiga.PoliciesSearchAllParams{
	Query: "proof of income self-employed",
	TopK:  5,
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.policies().searchAll(PoliciesSearchAllParams.builder()
    .query("proof of income self-employed")
    .topK(5)
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Policies.SearchAllAsync(new PoliciesSearchAllOptions
{
    Query = "proof of income self-employed",
    TopK = 5,
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->policies->searchAll([
    'query' => 'proof of income self-employed',
    'top_k' => 5,
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.policies.search_all(query: "proof of income self-employed", top_k: 5)
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .policies()
    .search_all(kontiga::policies::SearchAllParams {
        query: "proof of income self-employed".into(),
        top_k: 5,
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "object": "policy_library_search",
  "query": "proof of income self-employed",
  "policies_searched": 6,
  "passages": [
    {
      "ref": "pol_4Xw8Mn2#3.4",
      "policy_id": "pol_4Xw8Mn2",
      "policy_name": "Lending policy",
      "document_id": "ks_7Rb2Tc5",
      "document_title": "Retail lending policy",
      "version": "3.1",
      "effective_date": "2026-07-01",
      "passage": {
        "id": "psg_9Qd4Lw1",
        "number": "3.4",
        "heading": "Self-employed applicants",
        "text": "A self-employed applicant gives the last two annual accounts, or the tax assessments of the last two years, and bank statements for the last three months."
      }
    }
  ]
}
```
