Developers / Agents

Add text knowledge to an agent

POST https://api.echonova.ai/v1/agents/{agentId}/knowledge/text

Adds a text source to the workspace knowledge and to this agent. It is indexed in the background; GET /v1/agents/{agentId}/knowledge shows its status. An empty wallet answers 402. At most 20 calls a minute per key. Needs the agents:write scope on the key. Indexing uses workspace credits and does not count against an API key's credit limit.

Headers

Authorization string Required

Bearer, a space, then your API key, which starts with ek_. Create keys in the portal under Developers, API Keys.

Path parameters

agentId string Required

The agent id, as GET /v1/agents returned it.

Request body

application/json

name string Required

The source name.

1 to 200 characters
content string Required

The text the agent can answer from.

1 to 50000 characters

Response

200 application/json Every response uses this envelope.

data object

The result.

success boolean

true for a successful call.

statusCode integer

Repeats the HTTP status.

errorMessage string or null

null on success.

Errors

Same envelope, with success false and data null. All errors

POST /v1/agents/{agentId}/knowledge/text

curl -X POST "https://api.echonova.ai/v1/agents/{agentId}/knowledge/text" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Opening hours","content":"We are open Sunday to Thursday, 9 am to 5 pm."}'

{
  "data": {
    "id": "6653a1b2c3d4e5f6a7b8c9d0",
    "name": "Price list",
    "kind": "file",
    "status": "ready"
  },
  "success": true,
  "statusCode": 200,
  "errorMessage": null
}