Skip to main content
POST
Add Knowledge

Overview

Saves a piece of text to a knowledge collection so the assistant can recall it. Pass document_id to add to an existing document instead of creating a new one.
Changes data, so it needs a key that isn’t read-only.
Operation name: knowledge.add.

Authorization

string
required
Your Composer API key

Headers

string
required
Must be set to application/json

Body

string
required
The text to save.
Example
string
The assistant this knowledge is for.
Example
string
The collection to add to. Default semantic.
string
A title, when creating a new document.
Example
string
Add to this existing document instead of creating one.
object
Extra details returned with the text when it is recalled, such as its source.
Example Request

Response

string
The document the text was saved to.
string
The id of the saved piece.
Example Success Response

Example cURL

cURL

Error Codes