Skip to main content
POST
Add a knowledge document

Authorizations

Authorization
string
header
required

An org API key: Authorization: Bearer phk_…

Headers

Phonely-Organization
string | null

Optional. Must be the key's org.

Path Parameters

id
string
required

The agent's ID.

Body

application/json
content
string
required

The document text in Markdown. Empty text is allowed.

Maximum string length: 2000000
name
string
required

The document name, 1–255 characters after trimming.

Required string length: 1 - 255
type
string
required

Create a text document. Files and websites have separate routes.

Allowed value: "document"

Response

Successful Response

Something an agent knows: a document, an uploaded file or a website page.

agent_id
string
required

The agent it belongs to.

content
string | null
required

The text the agent uses, in Markdown. null when there is none, as for most uploaded files.

id
string
required

The knowledge source's ID.

is_active
boolean
required

Whether the agent uses it on calls. A source can be turned off without deleting it.

name
string | null
required

The name shown in the web app. null when it has none.

object
string
default:knowledge_source
required

The type of this object, always knowledge_source.

Allowed value: "knowledge_source"
type
string
required

document is text written in the web app, file an uploaded file, website a scraped web page. Known values: document, file, website. More can be added, so handle values you don't recognize.

url
string | null
required

The page's address, for a website. null for other types.