Skip to main content
POST

Authorizations

Authorization
string
header
required

A project API key, created in the dashboard.

Headers

Idempotency-Key
string

A unique key that makes the request safe to retry, such as a V4 UUID. 1 to 255 printable ASCII characters.

Required string length: 1 - 255

Body

application/json

A type, and the object with the same name.

agent_id
string
required
Maximum string length: 64
type
enum<string>
required

The types you can add a source as. link is a web page, fetched when the source trains. text and faq are content you send. document is a file you upload first with Create a document upload. Zoho Desk, Zendesk, Notion, and SharePoint sources are added in the dashboard.

Available options:
link,
text,
faq,
document

Required if type is link, and not allowed otherwise.

text
object
required if type = text

Required if type is text, and not allowed otherwise.

faq
object
required if type = faq

Required if type is faq, and not allowed otherwise.

document
object
required if type = document

Required if type is document, and not allowed otherwise.

Response

The new source, with status: pending. A document is checked against the limit of 5 million characters per document and the characters left when it trains, and fails if it has too many.

object
any
required
id
string
required
Example:

"0d1f6a3e-5b2c-4e8f-9a7d-3c6b1e2f4a5d"

agent
object
required

The agent this belongs to.

type
enum<string>
required

link is a web page, fetched when the source trains. text and faq are content you send. document is a file you upload first with Create a document upload. zoho, zendesk, notion, and sharepoint are Zoho Desk articles, Zendesk articles, Notion pages, and SharePoint files, added in the dashboard through a connection. The API can list, resync, and delete them, and change their auto_sync, but can't add them or change their content.

Available options:
link,
text,
faq,
document,
zoho,
zendesk,
notion,
sharepoint
status
enum<string>
required

pending sources are waiting to train, processing sources are training, processed sources are used in replies, and failed sources couldn't be trained. For failed sources, error says why.

Available options:
pending,
processing,
processed,
failed
error
string | null
required

Why training failed, if status is failed.

characters
integer | null
required

The number of the plan's knowledge base characters the source uses. For links, documents, and connected sources, known once the source is trained.

resync_pending
boolean
required

Whether the source is queued to retrain after a resync, edit, or auto-sync.

last_synced_at
string<date-time> | null
required

Time at which the source was last trained.

created_at
string<date-time> | null
required
updated_at
string<date-time> | null
required

Only for link sources.

text
object

Only for text sources.

faq
object

Only for faq sources.

document
object

Only for document sources.

zoho
object

Only for zoho sources.

zendesk
object

Only for zendesk sources.

notion
object

Only for notion sources.

sharepoint
object

Only for sharepoint sources.