Skip to content
AnytimeReply

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}/sources
200 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

typestring
URL (one page), CRAWL (website), SITEMAP, FILE, TEXT, SHOPIFY or NOTION.
statusstring
PENDING → PROCESSING → READY, or FAILED (see error).
charsnumber
Characters of text learned (counts toward your plan's training limit).
pagesnumber
Pages or items read.

Add a source

POST/api/v1/agents/{id}/sources

Training starts in the background; poll the list until status is READY.

Text

Body

typestringrequired
TEXT
titlestringrequired
1–200 characters.
contentstringrequired
At 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

typestringrequired
URL (one page), CRAWL (follow links across the site), SITEMAP (a sitemap.xml) or SHOPIFY (a store address).
urlstringrequired
A 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

StatusError
400Validation errors, e.g. content: String must contain at least 10 character(s) or an invalid url
403Training limit of your plan reached
404Agent not found
413Body larger than 7 MB
Was this page helpful?
Still stuck? Contact us