# Add an answer to a knowledge base

`POST https://app.whatsetter.com/api/v1/knowledge-bases/{id}/answers`

Adds a question/answer pair. The agents that answer from this base can
use it on their next reply. `question` holds 1 to 1000 characters,
`answer` 1 to 4000: a longer text is refused, never cut. A base holds
up to 200 answers, and adding one needs a paid plan.
Requires scope `knowledge:write`.

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | string | yes |  |

## Request body

| Field | Type | Required | Description |
|---|---|---|---|
| `question` | string | yes |  |
| `answer` | string | yes |  |

```json
{
  "question": "How much is the trial session?",
  "answer": "The trial session is free, with no commitment."
}
```

## Example request

```bash
curl --request POST \
  --url 'https://app.whatsetter.com/api/v1/knowledge-bases/{id}/answers' \
  --header 'Authorization: Bearer ws_live_…'
  --header 'Content-Type: application/json' \
  --data '{"question":"How much is the trial session?","answer":"The trial session is free, with no commitment."}'
```

## Responses

### 201: The answer

```json
{
  "data": {
    "id": "68e3a90f0026d1e4b7a2",
    "question": "How much is the trial session?",
    "answer": "The trial session is free, with no commitment.",
    "created_at": "2026-10-08T14:20:05.000+00:00",
    "updated_at": "2026-10-08T14:20:05.000+00:00"
  }
}
```

### 401: Missing, unknown or revoked API key

```json
{
  "error": {
    "code": "",
    "message": ""
  }
}
```

### 402: The plan does not add knowledge, or the base is full

```json
{
  "error": {
    "code": "plan_limit_reached",
    "message": "Adding knowledge needs a paid plan. Existing answers can still be read, corrected and removed."
  }
}
```

### 403: The key lacks the required scope (`insufficient_scope`), the plan does not have this part of the API (`not_in_plan`), or Instagram is not enabled on the workspace (`instagram_not_enabled`, Instagram routes)

```json
{
  "error": {
    "code": "",
    "message": ""
  }
}
```

### 404: Resource not found in this workspace

```json
{
  "error": {
    "code": "",
    "message": ""
  }
}
```

### 422: Missing, empty or too long `question` or `answer`

```json
{
  "error": {
    "code": "validation_error",
    "message": "\"answer\" is required (1 to 4000 characters)."
  }
}
```

### 502: The knowledge store did not accept the answer (nothing was saved)

```json
{
  "error": {
    "code": "",
    "message": ""
  }
}
```


Source: https://docs.whatsetter.com/api-reference/operations/createknowledgeanswer/
