Skip to main content
POST
/
agents
/
{agentId}
/
sources
Create source
curl --request POST \
  --url https://www.chatbase.co/api/v2/agents/{agentId}/sources \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "type": "text",
  "name": "<string>",
  "content": "<string>"
}
'
{
  "id": "<string>",
  "name": "<string>",
  "size": 123,
  "createdAt": "<string>",
  "metadata": {
    "type": "individual"
  }
}

Authorizations

Authorization
string
header
required

API key from your account settings

Path Parameters

agentId
string
required

The agent ID

Minimum string length: 1
Example:

"5QHA6VB-DIAbBhxwqxfdi"

Body

application/json
type
enum<string>
required
Available options:
text
name
string
required
Required string length: 1 - 100
content
string
required
Required string length: 1 - 1048576

Response

Source created

id
string
required

Source ID

type
enum<string>
required

Source type

Available options:
link,
file,
qna,
notionPage,
text
name
string | null
required

Source name or URL

size
number
required

Source size in bytes

createdAt
string
required

ISO 8601 creation timestamp

status
enum<string>
required

Training status of the source

Available options:
untrained,
trained,
toBeDeleted,
updated
metadata
object
required

Link-specific metadata. Present only for type="link".