curl --request POST \
--url https://app.thinnest.ai/api/v1/agents/{id}/knowledge \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "Sky Towers price list",
"text": "A 2 BHK at Sky Towers starts at 82 lakh. A 3 BHK starts at 1.1 crore. Possession is December 2027."
}
'{
"id": "doc_f7413c2a-9d0e-4b6f-8a21-3e5c7d9b1f04",
"title": "Sky Towers price list",
"type": "text",
"source": "pasted",
"status": "ready",
"error": null,
"createdAt": "2026-10-06T09:41:58.307Z",
"passages": 3
}Add Knowledge Document
Adds a web page (url) or pasted text to what the agent knows. A page is fetched and indexed before this answers, so a slow site is a slow request; passages says how much was indexed. A page that cannot be read is answered 422 with the reason and the failed document it left behind, which you can delete. Files are uploaded in the console. A build key may do this.
curl --request POST \
--url https://app.thinnest.ai/api/v1/agents/{id}/knowledge \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "Sky Towers price list",
"text": "A 2 BHK at Sky Towers starts at 82 lakh. A 3 BHK starts at 1.1 crore. Possession is December 2027."
}
'{
"id": "doc_f7413c2a-9d0e-4b6f-8a21-3e5c7d9b1f04",
"title": "Sky Towers price list",
"type": "text",
"source": "pasted",
"status": "ready",
"error": null,
"createdAt": "2026-10-06T09:41:58.307Z",
"passages": 3
}Authorizations
Your API key (ta_live_…) from Settings → API keys, sent as Authorization: Bearer <key>. Keep it on a server: it can message every customer you have. A key is full, build or read-only; a request its level does not allow is refused with 403.
Headers
Developers only: the customer workspace this request acts in — its org_… id from POST /customers. Leave it out to act in your own workspace.
"org_3fKq9TzQ1mN8vB2xR7cLpA"
Path Parameters
The agent's id (ag_…).
Body
Send url, or text with an optional title — not both.
A web page to fetch and index. Must start with http:// or https://.
Text to index, up to 200,000 characters. Trimmed.
200000A title for text; cut to 200 characters. Left out, it is Pasted text. Ignored with url, whose title comes from the page.
200Response
The document, indexed and ready to cite.
The document just added, with how many passages were indexed from it.
The document's id.
Its title: the one you sent, the page's own, or Pasted text.
Where it came from.
url, text The address for a url, pasted for text.
Always ready on success.
ready Always null on success.
When it was added.
How many passages were indexed.
x >= 1