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
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. Refused with 404 (Workspace not found.) when the id is unknown, is not one of your customers, or is not an org_… id; 410 when that customer was deleted (restore it with POST /customers/{id}/restore until it is erased); 403 when the key belongs to one customer workspace (it cannot act as another); 400 when your workspace is not a developer workspace. /customers/* and GET /customers/usage are your own workspace's and refuse the header with 400: call them without it.
"org_3fKq9TzQ1mN8vB2xR7cLpA"
Body
Send url, or text with an optional title — not both.
Text to index, up to 200,000 characters. Trimmed.
200000Response
The document, indexed and ready to cite.
The document just added, with how many passages were indexed from it.