---
title: "Add Gap To KB"
method: POST
path: "/voice/knowledge-base/{agentId}/gaps/{gapId}/add"
tags: ["Voice Agent Intelligence"]
---

# Add Gap To KB

`POST /voice/knowledge-base/{agentId}/gaps/{gapId}/add`

## Request

- Base URL: `https://api.speakai.co/v1`
- URL: `https://api.speakai.co/v1/voice/knowledge-base/{agentId}/gaps/{gapId}/add`
- Auth: API key in header `x-speakai-key` and API key in header `x-access-token`

### Add Gap To Knowledge Base

Requires the OWNER or ADMIN role. Writes the gap's answer (or your override) into the agent's knowledge base as a new document, and marks the gap added. Fails with 409 if the gap was already added or dismissed, or if the agent has no knowledge base collection to write into.

## Path parameters

- `agentId` string, required
- `gapId` string, required

## Request body

- object
  - `answer` string: Overrides suggestedAnswer. Optional.
  - `title` string: Overrides suggestedTitle. Optional.

## Response `200`

OK

- object
  - `status` 'success'
  - `message` string

## Other responses

- `403`: Caller's role is not OWNER or ADMIN
- `404`: Gap not found
- `409`: Conflict

---

[API](https://skmtc.dev/speakai/apis/speak-ai-api.md) · [All operations](https://skmtc.dev/speakai/apis/speak-ai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/speakai/apis/speak-ai-api/revisions/52d777e6d46e?raw)
