> ## Documentation Index
> Fetch the complete documentation index at: https://docs.decimal.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Knowledge gaps API

> Read the changes Decimal proposes to your knowledge base and docs, and approve or reject them.

When the [Knowledge Gap Agent](https://docs.decimal.app/knowledge-base/kb-gap-detection.md) finds an answer that isn't written down, it proposes a change: a new or updated article in your knowledge base or helpdesk, or a pull request to your docs repository. Each proposal is a **gap**. The Knowledge gaps API lets you read them and decide on them from your own tools.

| Endpoint | Scope |
| - | - |
| [List gaps](https://docs.decimal.app/api-reference/knowledge-gaps/list-gaps.md) | `gaps:read` |
| [Get a gap](https://docs.decimal.app/api-reference/knowledge-gaps/get-a-gap.md) | `gaps:read` |
| [Approve a gap](https://docs.decimal.app/api-reference/knowledge-gaps/approve-a-gap.md) | `gaps:write` |
| [Reject a gap](https://docs.decimal.app/api-reference/knowledge-gaps/reject-a-gap.md) | `gaps:write` |

Knowledge gaps are enabled for some organizations. Without them, listing gaps returns `403` with code `forbidden`. Approving and rejecting also need the Growth plan or higher, and return `402` without it.

## Gaps

| Field | Meaning |
| - | - |
| `status` | `in_review` until someone decides, then `applied` or `rejected` |
| `target` | Where the change goes: `internal_kb`, `zendesk`, `intercom`, `pylon`, or `github` |
| `files` | The proposed change |
| `article_id` | The knowledge article it changes, or `null` for a new article |
| `created_article_id`, `pull_request_id` | What applying it created: a new article, or a [pull request](https://docs.decimal.app/api-reference/pull-requests/overview.md) for `github` gaps |
| `ticket_id` | The Decimal ticket it was found on |

`GET /v0/gaps` returns gaps newest first. Filter with `status` and `target`, and page with `limit` and `starting_after`.

```bash theme={null}
curl "https://api.getdecimal.ai/v0/gaps?status=in_review" \
  -H "Authorization: Bearer sk-de-..."
```

## Approve or reject

Only `in_review` gaps can be decided:

* **Approve** applies the change to the knowledge base it targets and returns the gap as `applied`. `github` gaps can't be approved here, since they arrive as pull requests: review and merge those on GitHub. Approving one returns `400`.
* **Reject** returns the gap as `rejected`, and it's never applied.

A gap that's already applied or rejected returns `409` with code `conflict`. Read it again before retrying.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.