---
title: "Add a Knowledge answer"
method: POST
path: "/api/agent-answers"
tags: ["agent_answers"]
---

# Add a Knowledge answer

`POST /api/agent-answers`

## Request

- Base URL: `https://beta.getsales.io/unibox/v1`
- URL: `https://beta.getsales.io/unibox/v1/api/agent-answers`
- Auth: HTTP bearer and API key in header `Team-SID`

Add an answer to the Knowledge by hand: the question as leads put it, up to twelve more ways they ask it, and the answer. Its source reads manual; it is embedded in seconds, the AI SDR answers from it on the next reply that asks, and an open missing_answer hint with the same question resolves by itself. The fix for a missing_answer hint.

Contract:
- MCP tool `create_agent_answer`, registry package `mcp.unibox/agent_answers`, mount `unibox.knowledge`.
- Operation `create`, response envelope `create`.
- Flags: none.

## Request body

- CreateAgentAnswerRequest: Request body of `create_agent_answer`.
  - `agent_sid` string: The AI SDR it is made for (ub_ag_…, block 10, 2026-10-30); left out, the team's default agent.
  - `question` string, required: When they ask: the question as leads put it (a hint's subject fits it).
  - `phrasings` string[]: The ways leads put the question, up to twelve, each up to 200 chars; the question itself and repeats are dropped.
  - `answer` string, required: It answers: the text the reply states as a fact.

## Response `200`

`create` success envelope.

- CreateAgentAnswerResponse
  - `success` true, required
  - `operation` 'create', required
  - `item` object, required
    - `sid` string, required: Answer sid (ub_an_…).
    - `team_sid` string, required: Owning team (ts_tm_…, external - gs.service.id).
    - `agent_sid` string, required: The team's agent (ub_ag_…).
    - `question` string, required: When they ask: the question as leads put it, up to 500 chars.
    - `answer` string, required: It answers: the text, up to 1200 chars; the reply states it as a fact.
    - `source` object, required: Where it was read from: a document with its page, its passage and (a website) the page's address, or manual.
      - `kind` 'document' | 'manual', required: document: read from a Knowledge document by the parse; manual: typed by hand (who and when: created_by, created_at).
      - `source_sid` string, nullable, required: The document (ub_as_…) for a document answer; null for manual.
      - `page` integer, nullable, required: The document's page it was read from.
      - `passage_from` integer, nullable, required: The passage's start offset in the document's text.
      - `passage_to` integer, nullable, required: The passage's end offset.
      - `passage` string, nullable, required: The passage it was read from, up to 1200 chars.
      - `url` string, nullable, required: A website page's address, when the document is a website (block AC3, 2026-10-26); null otherwise.
    - `created_by` object, required: Who typed it, or who applied the parse that read it.
      - `actor_type` 'user' | 'support' | 'api_key' | 'system' | 'agent', required
      - `actor_sid` string, nullable, required
      - `team_sid` string, required
      - `actor_name` string, nullable: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
      - `oauth_client_sid` string, nullable: The acting OAuth client (id_oc_*); null off the OAuth path.
      - `reason` string, nullable: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
      - `permissions` object, required: Internal audit context: the grant set the actor held at write time. Not a contract.
      - `cluster_id` integer, nullable: Internal audit context: the cluster that served the write.
      - `trace_id` string, nullable: Internal audit context: the trace id of the request that wrote the row.
    - `phrasings` string[], required: The ways leads put the question, up to twelve, each up to 200 chars; never the question itself. Embedded with it.
    - `attachment` object, nullable, required: The file that goes out with the answer and when; null when none. Attached in the studio.
      - `name` string, required: The file's name as uploaded.
      - `mime` string, required: Its type.
      - `bytes` integer, required: Its size.
      - `when` 'always' | 'on_request', required: always: with every reply that uses the answer; on_request: only when the lead asks for the file.
    - `embedding_state` 'pending' | 'ready' | 'failed', required: ready when the pick reads it; pending right after a write, until the vector is written.
    - `embedding_model` string, nullable, required: provider/model that wrote the vector; null while pending.
    - `created_at` string, required: ISO 8601 UTC.
    - `updated_at` string, required: ISO 8601 UTC.
  - `already_exists` boolean, required
  - `meta` object, required
    - `trace_id` string, required: UUID v7; same 128-bit value as the X-Trace-Id header.
    - `span_id` string, required: 16 hex chars, root span of this request.
    - `timestamp` string, required: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
    - `duration_ms` integer, required: Server-side wall clock.
    - `team_sid` string, nullable: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
    - `actor_type` string, nullable: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.

## Other responses

- `4XX`: MCP error envelope. `error.code` is one of validation_failed, nothing_to_update, not_found, relation_not_found, invalid_transition, limit_exceeded, payment_required, duplicate_rejected, conflict, delete_blocked, unauthorized, forbidden, rate_limited, not_implemented.
- `5XX`: MCP error envelope with `error.code` internal_error or service_unavailable.

---

[API](https://skmtc.dev/getsales/apis/getsales-public-contract-gs-service-unibox.md) - [All operations](https://skmtc.dev/getsales/apis/getsales-public-contract-gs-service-unibox/llms.txt) - [OpenAPI document](https://skmtc.dev/getsales/apis/getsales-public-contract-gs-service-unibox/revisions/8f1bc317897f?raw)
