# Policies API

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

A policy is a named group of your own policy documents, such as an income verification standard, read into numbered passages. Link a policy to a collection, one requirement or a workflow step, and each document there is checked against it: where one falls short, the finding quotes the passage and says what is missing. A finding decides nothing by itself.

Updated November 29, 2026

## The policy object

- `id` (string): The policy's id, starting with `pol_`.
- `name` (string): Its name.
- `owner` (string): The team that keeps it, in your words.
- `documents` (array): Its documents, each with its version, the date it applies from, its state (`processing`, `ready` or `failed`) and its numbered passages.
- `links` (array): What it is linked to: a `collection`, a `requirement` or a `workflow_step`, by id.
- `linked_to` (array): The same links in words, with where each opens in the console.
- `counts` (object): Its documents by state, its passages, its links and its open findings.

**A policy**

```json
{
  "id": "pol_8Hm3Qr5",
  "object": "policy",
  "mode": "live",
  "name": "Income verification standard",
  "description": "What a payslip and a bank statement must show before income is accepted.",
  "owner": "Credit risk",
  "documents": [
    {
      "id": "ks_4Rb7Tn2",
      "title": "Income verification standard",
      "version": "3.1",
      "effective_date": "2026-09-01",
      "file_name": "income-verification-standard-v3.1.pdf",
      "pages": 12,
      "state": "ready",
      "error": null,
      "passages": [
        {
          "id": "psg_6Lc2Wv9",
          "number": "3.2",
          "heading": "Payslips",
          "text": "A payslip shows the employer's name and tax number, the employee's name, the pay period and the net pay."
        }
      ],
      "added_at": "2026-09-01T08:30:00Z"
    }
  ],
  "links": [
    { "target": "collection", "id": "col_5Gk3Tm7" },
    { "target": "requirement", "id": "rqm_4Yc2Hn8" },
    { "target": "workflow_step", "id": "stp_5Kw9Ld2" }
  ],
  "linked_to": [
    { "target": "collection", "id": "col_5Gk3Tm7", "label": "Mortgage application", "parent": null, "href": "/console/settings/collections/col_5Gk3Tm7" },
    { "target": "requirement", "id": "rqm_4Yc2Hn8", "label": "Payslips", "parent": "Mortgage application", "href": "/console/settings/collections/col_5Gk3Tm7" },
    { "target": "workflow_step", "id": "stp_5Kw9Ld2", "label": "Check every document", "parent": "Mortgage review", "href": "/console/settings/workflows/wf_3Kd8Pn2" }
  ],
  "counts": { "documents": 1, "ready": 1, "processing": 0, "failed": 0, "passages": 41, "links": 3, "open_findings": 2 },
  "created_at": "2026-09-01T08:30:00Z",
  "updated_at": "2026-11-20T15:41:02Z"
}
```

## Create a policy

A new named group in the Policies library, for the documents that say what meets policy.

`POST /v1/policies`. Who may: Owner, Admin and Developer. CLI: `kontiga policies create --name <name> [--description <text>] [--owner <team>]`. MCP tool: `create_policy`.

**Parameters**
- `name` (string, required): Its name. At most 120 characters.
- `description` (string, default ""): What it covers. At most 500 characters.
- `owner` (string, default ""): The team that keeps it. At most 80 characters.

**Returns** policy: The policy, with no documents yet.

API:

```bash
curl -X POST https://api.kontiga.com/v1/policies \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Proof of address standard",
    "description": "Which documents prove an address, and how recent they must be.",
    "owner": "Compliance"
  }'
```

CLI:

```bash
kontiga policies create \
  --name 'Proof of address standard' \
  --description 'Which documents prove an address, and how recent they must be.' \
  --owner Compliance
```

MCP tool `create_policy`:

```json
{
  "name": "create_policy",
  "arguments": {
    "name": "Proof of address standard",
    "description": "Which documents prove an address, and how recent they must be.",
    "owner": "Compliance"
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.policies.create({
  name: "Proof of address standard",
  description: "Which documents prove an address, and how recent they must be.",
  owner: "Compliance",
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.policies.create(
    name="Proof of address standard",
    description="Which documents prove an address, and how recent they must be.",
    owner="Compliance",
)
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Policies.Create(ctx, &kontiga.PoliciesCreateParams{
	Name:        "Proof of address standard",
	Description: "Which documents prove an address, and how recent they must be.",
	Owner:       "Compliance",
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.policies().create(PoliciesCreateParams.builder()
    .name("Proof of address standard")
    .description("Which documents prove an address, and how recent they must be.")
    .owner("Compliance")
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Policies.CreateAsync(new PoliciesCreateOptions
{
    Name = "Proof of address standard",
    Description = "Which documents prove an address, and how recent they must be.",
    Owner = "Compliance",
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->policies->create([
    'name' => 'Proof of address standard',
    'description' => 'Which documents prove an address, and how recent they must be.',
    'owner' => 'Compliance',
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.policies.create(
  name: "Proof of address standard",
  description: "Which documents prove an address, and how recent they must be.",
  owner: "Compliance"
)
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .policies()
    .create(kontiga::policies::CreateParams {
        name: "Proof of address standard".into(),
        description: "Which documents prove an address, and how recent they must be.".into(),
        owner: "Compliance".into(),
        ..Default::default()
    })
    .await?;
```

Response, 201 Created:

```json
{
  "id": "pol_2Vk9Hs4",
  "object": "policy",
  "mode": "live",
  "name": "Proof of address standard",
  "description": "Which documents prove an address, and how recent they must be.",
  "owner": "Compliance",
  "documents": [],
  "links": [],
  "linked_to": [],
  "counts": { "documents": 0, "ready": 0, "processing": 0, "failed": 0, "passages": 0, "links": 0, "open_findings": 0 },
  "created_at": "2026-11-27T11:20:00Z",
  "updated_at": "2026-11-27T11:20:00Z"
}
```

## List policies

The Policies library: each policy with its documents, where it is linked, and its open findings.

`GET /v1/policies`. Who may: Owner, Admin, Analyst, Developer and Viewer. CLI: `kontiga policies list`. MCP tool: `list_policies`.

**Parameters**

**Returns** list of policies: The policies, newest change first.

API:

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

CLI:

```bash
kontiga policies list
```

MCP tool `list_policies`:

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

TypeScript:

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

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

Python:

```python
from kontiga import Kontiga

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

Go:

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

Java:

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

.NET:

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

PHP:

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

Ruby:

```ruby
require "kontiga"

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

Rust:

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

Response, 200 OK:

```json
{
  "items": [
    {
      "id": "pol_2Vk9Hs4",
      "object": "policy",
      "name": "Proof of address standard",
      "owner": "Compliance",
      "counts": { "documents": 1, "ready": 0, "processing": 1, "failed": 0, "passages": 0, "links": 0, "open_findings": 0 }
    },
    {
      "id": "pol_8Hm3Qr5",
      "object": "policy",
      "name": "Income verification standard",
      "owner": "Credit risk",
      "counts": { "documents": 1, "ready": 1, "processing": 0, "failed": 0, "passages": 41, "links": 3, "open_findings": 2 }
    }
  ],
  "next_cursor": null
}
```

## Read a policy

One policy: its documents with version, effective date and numbered passages, its links, and the documents that fall short of it.

`GET /v1/policies/{policy_id}`. Who may: Owner, Admin, Analyst, Developer and Viewer. CLI: `kontiga policies get <policy_id>`. MCP tool: `get_policy`.

**Parameters**
- `policy_id` (id (pol_), required): The policy to read. In the path.

**Returns** policy: The policy as it stands.

API:

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

CLI:

```bash
kontiga policies get pol_8Hm3Qr5
```

MCP tool `get_policy`:

```json
{
  "name": "get_policy",
  "arguments": {
    "policy_id": "pol_8Hm3Qr5"
  }
}
```

TypeScript:

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

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

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.policies.get("pol_8Hm3Qr5")
```

Go:

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

Java:

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

.NET:

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

PHP:

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

Ruby:

```ruby
require "kontiga"

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

Rust:

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

Response, 200 OK:

```json
{
  "id": "pol_8Hm3Qr5",
  "object": "policy",
  "mode": "live",
  "name": "Income verification standard",
  "description": "What a payslip and a bank statement must show before income is accepted.",
  "owner": "Credit risk",
  "documents": [
    {
      "id": "ks_4Rb7Tn2",
      "title": "Income verification standard",
      "version": "3.1",
      "effective_date": "2026-09-01",
      "file_name": "income-verification-standard-v3.1.pdf",
      "pages": 12,
      "state": "ready",
      "error": null,
      "passages": [
        {
          "id": "psg_6Lc2Wv9",
          "number": "3.2",
          "heading": "Payslips",
          "text": "A payslip shows the employer's name and tax number, the employee's name, the pay period and the net pay."
        }
      ],
      "added_at": "2026-09-01T08:30:00Z"
    }
  ],
  "links": [
    { "target": "collection", "id": "col_5Gk3Tm7" },
    { "target": "requirement", "id": "rqm_4Yc2Hn8" },
    { "target": "workflow_step", "id": "stp_5Kw9Ld2" }
  ],
  "linked_to": [
    { "target": "collection", "id": "col_5Gk3Tm7", "label": "Mortgage application", "parent": null, "href": "/console/settings/collections/col_5Gk3Tm7" },
    { "target": "requirement", "id": "rqm_4Yc2Hn8", "label": "Payslips", "parent": "Mortgage application", "href": "/console/settings/collections/col_5Gk3Tm7" },
    { "target": "workflow_step", "id": "stp_5Kw9Ld2", "label": "Check every document", "parent": "Mortgage review", "href": "/console/settings/workflows/wf_3Kd8Pn2" }
  ],
  "counts": { "documents": 1, "ready": 1, "processing": 0, "failed": 0, "passages": 41, "links": 3, "open_findings": 2 },
  "created_at": "2026-09-01T08:30:00Z",
  "updated_at": "2026-11-20T15:41:02Z"
}
```

## Add a policy document

Add a document to a policy, with its version and the date it applies from; it is read into numbered passages.

`POST /v1/policies/{policy_id}/sources`. Who may: Owner, Admin and Developer. CLI: `kontiga policies add-document <policy_id> <file> --title <title> --version <version> --effective-date <yyyy-mm-dd>`. MCP tool: `add_policy_document`.

**Parameters**
- `policy_id` (id (pol_), required): The policy to add it to. In the path.
- `title` (string, required): The document's title. At most 160 characters.
- `version` (string, required): Its version, as the document numbers it. At most 32 characters.
- `effective_date` (string, required): The day it applies from, `yyyy-mm-dd`.
- `file_name` (string): The file's name, when you send a file. At most 255 characters.
- `text` (string): The document's text, when you send it as text. At most 200,000 characters.

**Returns** policy: The policy, with the document processing.

API:

```bash
curl -X POST https://api.kontiga.com/v1/policies/pol_2Vk9Hs4/sources \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Proof of address standard",
    "version": "1.0",
    "effective_date": "2026-12-01",
    "file_name": "proof-of-address-standard.pdf"
  }'
```

CLI:

```bash
kontiga policies add-document pol_2Vk9Hs4 proof-of-address-standard.pdf \
  --title 'Proof of address standard' \
  --version 1.0 \
  --effective-date 2026-12-01
```

MCP tool `add_policy_document`:

```json
{
  "name": "add_policy_document",
  "arguments": {
    "policy_id": "pol_2Vk9Hs4",
    "title": "Proof of address standard",
    "version": "1.0",
    "effective_date": "2026-12-01",
    "file_name": "proof-of-address-standard.pdf"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";
import { openAsBlob } from "node:fs";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.policies.addDocument("pol_2Vk9Hs4", {
  file: await openAsBlob("pol_2Vk9Hs4"),
  title: "Proof of address standard",
  version: "1.0",
  effective_date: "2026-12-01",
  file_name: "proof-of-address-standard.pdf",
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.policies.add_document(
    "pol_2Vk9Hs4",
    file=open("pol_2Vk9Hs4", "rb"),
    title="Proof of address standard",
    version="1.0",
    effective_date="2026-12-01",
    file_name="proof-of-address-standard.pdf",
)
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Policies.AddDocument(ctx, "pol_2Vk9Hs4", &kontiga.PoliciesAddDocumentParams{
	File:          kontiga.FileFromPath("pol_2Vk9Hs4"),
	Title:         "Proof of address standard",
	Version:       "1.0",
	EffectiveDate: "2026-12-01",
	FileName:      "proof-of-address-standard.pdf",
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.policies().addDocument("pol_2Vk9Hs4", PoliciesAddDocumentParams.builder()
    .file(Path.of("pol_2Vk9Hs4"))
    .title("Proof of address standard")
    .version("1.0")
    .effectiveDate("2026-12-01")
    .fileName("proof-of-address-standard.pdf")
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Policies.AddDocumentAsync("pol_2Vk9Hs4", new PoliciesAddDocumentOptions
{
    File = File.OpenRead("pol_2Vk9Hs4"),
    Title = "Proof of address standard",
    Version = "1.0",
    EffectiveDate = "2026-12-01",
    FileName = "proof-of-address-standard.pdf",
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->policies->addDocument('pol_2Vk9Hs4', [
    'file' => fopen('pol_2Vk9Hs4', 'r'),
    'title' => 'Proof of address standard',
    'version' => '1.0',
    'effective_date' => '2026-12-01',
    'file_name' => 'proof-of-address-standard.pdf',
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.policies.add_document(
  "pol_2Vk9Hs4",
  file: File.open("pol_2Vk9Hs4"),
  title: "Proof of address standard",
  version: "1.0",
  effective_date: "2026-12-01",
  file_name: "proof-of-address-standard.pdf"
)
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .policies()
    .add_document("pol_2Vk9Hs4".into(), kontiga::policies::AddDocumentParams {
        file: kontiga::File::open("pol_2Vk9Hs4").await?,
        title: "Proof of address standard".into(),
        version: "1.0".into(),
        effective_date: "2026-12-01".into(),
        file_name: "proof-of-address-standard.pdf".into(),
        ..Default::default()
    })
    .await?;
```

Response, 201 Created:

```json
{
  "id": "pol_2Vk9Hs4",
  "object": "policy",
  "mode": "live",
  "name": "Proof of address standard",
  "documents": [
    {
      "id": "ks_9Pd3Xa6",
      "title": "Proof of address standard",
      "version": "1.0",
      "effective_date": "2026-12-01",
      "file_name": "proof-of-address-standard.pdf",
      "pages": 0,
      "state": "processing",
      "error": null,
      "passages": [],
      "added_at": "2026-11-27T11:22:41Z"
    }
  ],
  "counts": { "documents": 1, "ready": 0, "processing": 1, "failed": 0, "passages": 0, "links": 0, "open_findings": 0 }
}
```

## Link a policy

Check the documents of a collection, a requirement or a workflow step against a policy.

`POST /v1/policies/{policy_id}/links`. Who may: Owner, Admin and Developer. CLI: `kontiga policies link <policy_id> --target <collection|requirement|workflow_step> --target-id <id>`. MCP tool: `link_policy`.

**Parameters**
- `policy_id` (id (pol_), required): The policy. In the path.
- `target` (enum, required): What to check against it: a whole collection, one requirement, or one workflow step. One of `collection`, `requirement`, `workflow_step`.
- `target_id` (string, required): Its id: a `col_`, `rqm_` or `stp_` id.

**Returns** policy: The policy with the link added.

API:

```bash
curl -X POST https://api.kontiga.com/v1/policies/pol_8Hm3Qr5/links \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "target": "requirement",
    "target_id": "rqm_4Yc2Hn8"
  }'
```

CLI:

```bash
kontiga policies link pol_8Hm3Qr5 \
  --target requirement \
  --target-id rqm_4Yc2Hn8
```

MCP tool `link_policy`:

```json
{
  "name": "link_policy",
  "arguments": {
    "policy_id": "pol_8Hm3Qr5",
    "target": "requirement",
    "target_id": "rqm_4Yc2Hn8"
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.policies.link("pol_8Hm3Qr5", {
  target: "requirement",
  target_id: "rqm_4Yc2Hn8",
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.policies.link(
    "pol_8Hm3Qr5",
    target="requirement",
    target_id="rqm_4Yc2Hn8",
)
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Policies.Link(ctx, "pol_8Hm3Qr5", &kontiga.PoliciesLinkParams{
	Target:   "requirement",
	TargetId: "rqm_4Yc2Hn8",
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.policies().link("pol_8Hm3Qr5", PoliciesLinkParams.builder()
    .target("requirement")
    .targetId("rqm_4Yc2Hn8")
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Policies.LinkAsync("pol_8Hm3Qr5", new PoliciesLinkOptions
{
    Target = "requirement",
    TargetId = "rqm_4Yc2Hn8",
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->policies->link('pol_8Hm3Qr5', [
    'target' => 'requirement',
    'target_id' => 'rqm_4Yc2Hn8',
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.policies.link(
  "pol_8Hm3Qr5",
  target: "requirement",
  target_id: "rqm_4Yc2Hn8"
)
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .policies()
    .link("pol_8Hm3Qr5".into(), kontiga::policies::LinkParams {
        target: "requirement".into(),
        target_id: "rqm_4Yc2Hn8".into(),
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "id": "pol_8Hm3Qr5",
  "object": "policy",
  "mode": "live",
  "name": "Income verification standard",
  "description": "What a payslip and a bank statement must show before income is accepted.",
  "owner": "Credit risk",
  "documents": [
    {
      "id": "ks_4Rb7Tn2",
      "title": "Income verification standard",
      "version": "3.1",
      "effective_date": "2026-09-01",
      "file_name": "income-verification-standard-v3.1.pdf",
      "pages": 12,
      "state": "ready",
      "error": null,
      "passages": [
        {
          "id": "psg_6Lc2Wv9",
          "number": "3.2",
          "heading": "Payslips",
          "text": "A payslip shows the employer's name and tax number, the employee's name, the pay period and the net pay."
        }
      ],
      "added_at": "2026-09-01T08:30:00Z"
    }
  ],
  "links": [
    { "target": "collection", "id": "col_5Gk3Tm7" },
    { "target": "requirement", "id": "rqm_4Yc2Hn8" },
    { "target": "workflow_step", "id": "stp_5Kw9Ld2" }
  ],
  "linked_to": [
    { "target": "collection", "id": "col_5Gk3Tm7", "label": "Mortgage application", "parent": null, "href": "/console/settings/collections/col_5Gk3Tm7" },
    { "target": "requirement", "id": "rqm_4Yc2Hn8", "label": "Payslips", "parent": "Mortgage application", "href": "/console/settings/collections/col_5Gk3Tm7" },
    { "target": "workflow_step", "id": "stp_5Kw9Ld2", "label": "Check every document", "parent": "Mortgage review", "href": "/console/settings/workflows/wf_3Kd8Pn2" }
  ],
  "counts": { "documents": 1, "ready": 1, "processing": 0, "failed": 0, "passages": 41, "links": 3, "open_findings": 2 },
  "created_at": "2026-09-01T08:30:00Z",
  "updated_at": "2026-11-20T15:41:02Z"
}
```

## Unlink a policy

Stop checking a collection, a requirement or a workflow step against a policy.

`DELETE /v1/policies/{policy_id}/links/{target_id}`. Who may: Owner, Admin and Developer. CLI: `kontiga policies unlink <policy_id> --target <collection|requirement|workflow_step> --target-id <id>`. MCP tool: `unlink_policy`.

**Parameters**
- `policy_id` (id (pol_), required): The policy. In the path.
- `target` (enum, required): What the link is to. One of `collection`, `requirement`, `workflow_step`.
- `target_id` (string, required): Its id. In the path.

**Returns** policy: The policy with the link removed.

API:

```bash
curl -X DELETE "https://api.kontiga.com/v1/policies/pol_8Hm3Qr5/links/rqm_4Yc2Hn8?target=requirement" \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga policies unlink pol_8Hm3Qr5 \
  --target requirement \
  --target-id rqm_4Yc2Hn8
```

MCP tool `unlink_policy`:

```json
{
  "name": "unlink_policy",
  "arguments": {
    "policy_id": "pol_8Hm3Qr5",
    "target": "requirement",
    "target_id": "rqm_4Yc2Hn8"
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.policies.unlink("pol_8Hm3Qr5", "rqm_4Yc2Hn8", {
  target: "requirement",
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.policies.unlink(
    "pol_8Hm3Qr5",
    "rqm_4Yc2Hn8",
    target="requirement",
)
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Policies.Unlink(ctx, "pol_8Hm3Qr5", "rqm_4Yc2Hn8", &kontiga.PoliciesUnlinkParams{
	Target: "requirement",
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.policies().unlink("pol_8Hm3Qr5", "rqm_4Yc2Hn8", PoliciesUnlinkParams.builder()
    .target("requirement")
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Policies.UnlinkAsync("pol_8Hm3Qr5", "rqm_4Yc2Hn8", new PoliciesUnlinkOptions
{
    Target = "requirement",
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->policies->unlink('pol_8Hm3Qr5', 'rqm_4Yc2Hn8', [
    'target' => 'requirement',
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.policies.unlink(
  "pol_8Hm3Qr5",
  "rqm_4Yc2Hn8",
  target: "requirement"
)
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .policies()
    .unlink("pol_8Hm3Qr5".into(), "rqm_4Yc2Hn8".into(), kontiga::policies::UnlinkParams {
        target: "requirement".into(),
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "id": "pol_8Hm3Qr5",
  "object": "policy",
  "mode": "live",
  "name": "Income verification standard",
  "description": "What a payslip and a bank statement must show before income is accepted.",
  "owner": "Credit risk",
  "documents": [
    {
      "id": "ks_4Rb7Tn2",
      "title": "Income verification standard",
      "version": "3.1",
      "effective_date": "2026-09-01",
      "file_name": "income-verification-standard-v3.1.pdf",
      "pages": 12,
      "state": "ready",
      "error": null,
      "passages": [
        {
          "id": "psg_6Lc2Wv9",
          "number": "3.2",
          "heading": "Payslips",
          "text": "A payslip shows the employer's name and tax number, the employee's name, the pay period and the net pay."
        }
      ],
      "added_at": "2026-09-01T08:30:00Z"
    }
  ],
  "links": [
    { "target": "collection", "id": "col_5Gk3Tm7" },
    { "target": "requirement", "id": "rqm_4Yc2Hn8" },
    { "target": "workflow_step", "id": "stp_5Kw9Ld2" }
  ],
  "linked_to": [
    { "target": "collection", "id": "col_5Gk3Tm7", "label": "Mortgage application", "parent": null, "href": "/console/settings/collections/col_5Gk3Tm7" },
    { "target": "requirement", "id": "rqm_4Yc2Hn8", "label": "Payslips", "parent": "Mortgage application", "href": "/console/settings/collections/col_5Gk3Tm7" },
    { "target": "workflow_step", "id": "stp_5Kw9Ld2", "label": "Check every document", "parent": "Mortgage review", "href": "/console/settings/workflows/wf_3Kd8Pn2" }
  ],
  "counts": { "documents": 1, "ready": 1, "processing": 0, "failed": 0, "passages": 41, "links": 3, "open_findings": 2 },
  "created_at": "2026-09-01T08:30:00Z",
  "updated_at": "2026-11-20T15:41:02Z"
}
```

## Search a policy

The numbered passages of a policy that match a few words, best first, each with the document and the version it is in.

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

**Parameters**
- `policy_id` (id (pol_), required): The policy to search. In the path.
- `query` (string, required): A few words. At most 200 characters.
- `top_k` (integer): The most passages to answer, 1 to 20.

**Returns** policy search: The passages that match, best first, with their document, version and effective date.

API:

```bash
curl -X POST https://api.kontiga.com/v1/policies/pol_8Hm3Qr5/search \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "employer tax number",
    "top_k": 5
  }'
```

CLI:

```bash
kontiga policies search pol_8Hm3Qr5 \
  --query 'employer tax number' \
  --top-k 5
```

MCP tool `search_policy`:

```json
{
  "name": "search_policy",
  "arguments": {
    "policy_id": "pol_8Hm3Qr5",
    "query": "employer tax number",
    "top_k": 5
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.policies.search("pol_8Hm3Qr5", {
  query: "employer tax number",
  top_k: 5,
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.policies.search(
    "pol_8Hm3Qr5",
    query="employer tax number",
    top_k=5,
)
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Policies.Search(ctx, "pol_8Hm3Qr5", &kontiga.PoliciesSearchParams{
	Query: "employer tax number",
	TopK:  5,
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.policies().search("pol_8Hm3Qr5", PoliciesSearchParams.builder()
    .query("employer tax number")
    .topK(5)
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Policies.SearchAsync("pol_8Hm3Qr5", new PoliciesSearchOptions
{
    Query = "employer tax number",
    TopK = 5,
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->policies->search('pol_8Hm3Qr5', [
    'query' => 'employer tax number',
    'top_k' => 5,
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.policies.search(
  "pol_8Hm3Qr5",
  query: "employer tax number",
  top_k: 5
)
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .policies()
    .search("pol_8Hm3Qr5".into(), kontiga::policies::SearchParams {
        query: "employer tax number".into(),
        top_k: 5,
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "object": "policy_search",
  "policy_id": "pol_8Hm3Qr5",
  "query": "employer tax number",
  "passages": [
    {
      "document_id": "ks_4Rb7Tn2",
      "document_title": "Income verification standard",
      "version": "3.1",
      "effective_date": "2026-09-01",
      "passage": {
        "id": "psg_6Lc2Wv9",
        "number": "3.2",
        "heading": "Payslips",
        "text": "A payslip shows the employer's name and tax number, the employee's name, the pay period and the net pay."
      }
    }
  ]
}
```

## List the findings that cite a policy

Every document that fell short of a policy, newest first: the passage it quotes, what is missing and where, with the case and the person.

`GET /v1/policies/{policy_id}/findings`. Who may: Owner, Admin, Analyst, Developer and Viewer. CLI: `kontiga policies findings <policy_id> [--open-only] [--limit <n>]`. MCP tool: `list_policy_findings`.

**Parameters**
- `policy_id` (id (pol_), required): The policy. In the path.
- `open_only` (boolean): Only findings not reviewed yet.
- `limit` (integer): How many to answer, 1 to 200.

**Returns** list of policy findings: The findings that quote the policy, newest document first.

API:

```bash
curl -X GET "https://api.kontiga.com/v1/policies/pol_8Hm3Qr5/findings?open_only=true" \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga policies findings pol_8Hm3Qr5 --open-only
```

MCP tool `list_policy_findings`:

```json
{
  "name": "list_policy_findings",
  "arguments": {
    "policy_id": "pol_8Hm3Qr5",
    "open_only": true
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.policies.findings("pol_8Hm3Qr5", {
  open_only: true,
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.policies.findings("pol_8Hm3Qr5", open_only=True)
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Policies.Findings(ctx, "pol_8Hm3Qr5", &kontiga.PoliciesFindingsParams{
	OpenOnly: true,
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.policies().findings("pol_8Hm3Qr5", PoliciesFindingsParams.builder()
    .openOnly(true)
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Policies.FindingsAsync("pol_8Hm3Qr5", new PoliciesFindingsOptions
{
    OpenOnly = true,
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->policies->findings('pol_8Hm3Qr5', [
    'open_only' => true,
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.policies.findings("pol_8Hm3Qr5", open_only: true)
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .policies()
    .findings("pol_8Hm3Qr5".into(), kontiga::policies::FindingsParams {
        open_only: true,
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "items": [
    {
      "document_id": "doc_7Qe1Mw4",
      "document_title": "Payslip, September 2026",
      "received_at": "2026-11-24T09:30:58Z",
      "case_id": "case_7Kq2Xw9",
      "case_reference": "APP-20418",
      "case_title": "Mortgage application, 14 Harbour Row",
      "person_name": "Marta Kowalczyk",
      "finding": {
        "id": "pfn_3Tz8Bk5",
        "policy_id": "pol_8Hm3Qr5",
        "policy_name": "Income verification standard",
        "source_id": "ks_4Rb7Tn2",
        "source_title": "Income verification standard, version 3.1",
        "passage_id": "psg_6Lc2Wv9",
        "passage_number": "3.2",
        "quote": "A payslip shows the employer's name and tax number, the employee's name, the pay period and the net pay.",
        "missing": "The employer's tax number is not on the payslip.",
        "where": "Page 1, the header",
        "reviewed": false
      }
    }
  ],
  "next_cursor": null
}
```
