Add text
Add a raw text snippet directly to an AI Agent’s knowledge base. This is useful for adding private information, internal policies, or any custom content that isn’t available on a public webpage.
POST
/knowledge-base/add-textRequest parameters
Section titled “Request parameters”Body
agent_idstringrequiredThe UUID of the agent to add this source to.
titlestringrequiredA descriptive title for this text snippet (e.g. “Refund Policy”).
contentstringrequiredThe full text content to add to the knowledge base.
Headers
AuthorizationstringrequiredYour API Key formatted as Bearer sk_live_…
Response
Section titled “Response”Returns the newly created data source object with status pending. The content will be automatically processed in the background.
curl -X POST https://app.picobot.dev/api/knowledge-base/add-text \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{"agent_id": "91981020-f783-4544-ad96-39857ac589cb", "title": "Refund Policy", "content": "We offer a 30-day money-back guarantee..."}'fetch('https://app.picobot.dev/api/knowledge-base/add-text', { method: 'POST', headers: { 'Authorization': 'Bearer <token>', 'Content-Type': 'application/json' }, body: JSON.stringify({ agent_id: '91981020-f783-4544-ad96-39857ac589cb', title: 'Refund Policy', content: 'We offer a 30-day money-back guarantee...' })}).then(res => res.json()).then(console.log);import requests
headers = { "Authorization": "Bearer <token>" }response = requests.post( "https://app.picobot.dev/api/knowledge-base/add-text", headers=headers, json={ "agent_id": "91981020-f783-4544-ad96-39857ac589cb", "title": "Refund Policy", "content": "We offer a 30-day money-back guarantee..." })print(response.json()){ "data": { "id": "ds-0002-0000-0000-0000-000000000002", "type": "text", "title": "Refund Policy", "status": "pending", "created_at": "2024-06-14T10:00:00+00:00" }}