REST endpoints
Knowledge sources
List an agent's data sources with their training status, and add text, pages, websites, sitemaps or Shopify stores.
Send your API key in the Authorization: Bearer af_live_… header. See Authentication.
List sources
GET
/api/v1/agents/{id}/sources200 OK
{
"data": [
{
"id": "s1…",
"type": "CRAWL",
"title": "example.com (crawl)",
"url": "https://example.com",
"status": "READY",
"error": null,
"chars": 184220,
"pages": 42,
"last_trained_at": "2026-10-18T23:05:10.000Z",
"created_at": "2026-05-02T08:15:00.000Z"
}
]
}Fields
typestringURL (one page), CRAWL (website), SITEMAP, FILE, TEXT, SHOPIFY or NOTION.statusstringPENDING → PROCESSING → READY, or FAILED (see error).charsnumberCharacters of text learned (counts toward your plan's training limit).
pagesnumberPages or items read.
Add a source
POST
/api/v1/agents/{id}/sourcesTraining starts in the background; poll the list until status is READY.
Text
Body
typestringrequiredTEXTtitlestringrequired1–200 characters.
contentstringrequiredAt least 10 characters (up to 2,000,000). Markdown headings help.
Shell
curl https://anytimereply.com/api/v1/agents/AGENT_ID/sources \
-H "Authorization: Bearer af_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"type": "TEXT", "title": "Delivery policy", "content": "We deliver across Bangladesh in 2–4 days. Inside Dhaka: ৳70."}'Page, website, sitemap or Shopify store
Body
typestringrequiredURL (one page), CRAWL (follow links across the site), SITEMAP (a sitemap.xml) or SHOPIFY (a store address).urlstringrequiredA full URL starting with
https:// or http://.JSON
{ "type": "CRAWL", "url": "https://example.com" }200 OK
{
"data": {
"id": "s2…",
"type": "CRAWL",
"title": "example.com (crawl)",
"url": "https://example.com",
"status": "PENDING",
"created_at": "2026-10-19T09:20:00.000Z"
}
}Crawls follow your plan's pages-per-crawl limit. Files and Notion can only be added in the dashboard.
Errors
| Status | Error |
|---|---|
400 | Validation errors, e.g. content: String must contain at least 10 character(s) or an invalid url |
403 | Training limit of your plan reached |
404 | Agent not found |
413 | Body larger than 7 MB |
Was this page helpful?
Still stuck? Contact us