---
title: "Analyze KB Gaps"
method: POST
path: "/voice/knowledge-base/{agentId}/gaps/analyze"
tags: ["Voice Agent Intelligence"]
---

# Analyze KB Gaps

`POST /voice/knowledge-base/{agentId}/gaps/analyze`

## Request

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

### Analyze KB Gaps

Requires the OWNER or ADMIN role. Triggers gap analysis over this agent's recent calls in the background and returns immediately -- new gaps appear in the list once analysis finishes, which is not synchronous with this response.

## Path parameters

- `agentId` string, required

## Response `200`

OK

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

## Other responses

- `403`: Caller's role is not OWNER or ADMIN
- `404`: Agent not found

---

[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)
