Build assistants without the console
Everything the AvA Console does to assistants, plugins and knowledge bases, it does through these endpoints. Same API, same auth, same account — one scoped key and you can provision a whole tenant from your own CI.
One base URL, one header
Every endpoint on this page is JSON over HTTPS and takes a single Authorization header. There is no SDK to install and no handshake to complete.
https://avaai.pathor.in/api/v1Authorization: Bearer ava_ai_…application/jsonExcept the knowledge-base file upload, which is multipart.
# Never inline the key. Read it from the environment.
export AVA_API_KEY="ava_ai_live_xxxxxxxxxxxxxxxxxxxx"
curl 'https://avaai.pathor.in/api/v1/kb' \
-H "Authorization: Bearer $AVA_API_KEY"/:sessionId or /:userId. They are vestigial — the caller is resolved from the bearer and the segment is ignored. Send any non-empty value; the console sends the literal string :dummyData.An API key is a non-human teammate
A key carries the same per-module capability map a person on your team does. You decide, per module, whether it can read, write or manage — so the string sitting in somebody's CI config can only do the one job it was issued for.
Console → API keys → Create. Pick a preset or set each module by hand.
Assistants & knowledge covers everything on this page. Leave campaigns and WhatsApp at No access unless you need them.
Defaults to Never. A dated key is one you find out about before somebody else does.
Read the 403, it tells you what to fix
Every endpoint on this page names the module and level it needs. When a key falls short the response says which module, what was required and what the key actually holds — you do not have to guess.
| Status | code | What happened |
|---|---|---|
| 401 | invalid bearer token | The key does not exist, or the header was not sent as Bearer <key>. |
| 403 | key_revoked | The key was revoked in the console. Revoking takes effect on the next request — reissue rather than trying to un-revoke. |
| 403 | key_expired | The key passed its expiry. The message carries the date it lapsed. |
| 403 | route_forbidden | No key may ever reach this route — key management, team, profile writes, payments, platform admin. Not a scope you can grant yourself out of. |
| 403 | scope_denied | The key is valid but holds a lower level in this module than the request needs. The body names module, required and held. |
| 403 | route_not_in_scope_table | A scoped key hit a route with no rule. Scoped keys fail closed by design: a route added tomorrow is not inherited by every key issued today. |
{
"auth": false,
"success": false,
"code": "scope_denied",
"module": "assistants",
"required": "manage",
"held": "edit",
"message": "This API key has \"edit\" access to Assistants and this request needs \"manage\"."
}Empty account to grounded assistant
Four calls, in this order. The ordering is the part worth copying: an assistant can be attached to a knowledge base only after both exist, and the retrieval query at the end is how you check it is actually being shown what you think it is.
# 1 — a knowledge base
curl -X POST 'https://avaai.pathor.in/api/v1/kb' \
-H "Authorization: Bearer $AVA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Orion product docs"}'
# → { "status": "ok", "kbId": "3f6b1c22-…" }
# 2 — put something in it
curl -X POST 'https://avaai.pathor.in/api/v1/kb/3f6b1c22-…/ingest-text' \
-H "Authorization: Bearer $AVA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"title":"Returns policy","text":"Orion accepts returns within 30 days…"}'
# 3 — an assistant (voice id from GET /users/get_voice_clone)
curl -X POST 'https://avaai.pathor.in/api/v1/persona/enterprise/createPersona' \
-H "Authorization: Bearer $AVA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name":"Orion Support",
"customPersonaId":"orion-support",
"isPublic":false,
"voice":"66f1c0a4e2b1a90012ab34cd",
"tags":["Support"],
"base_sys_prompt":"Answer billing and delivery questions from the attached knowledge base."
}'
# 4 — wire them together
curl -X POST 'https://avaai.pathor.in/api/v1/kb/3f6b1c22-…/personas/orion-support' \
-H "Authorization: Bearer $AVA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"grounding_mode":"supplemental","enabled":true}'
# check what it will actually retrieve
curl -X POST 'https://avaai.pathor.in/api/v1/kb/3f6b1c22-…/query' \
-H "Authorization: Bearer $AVA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query":"how long do I have to return something","topK":3}'An assistant is a prompt, a voice, a set of plugins and a set of knowledge bases. Everything else in this reference hangs off one — plugins give it hands, knowledge bases give it facts.
Path parameters
sessionId | Vestigial. The handler reads the caller from the bearer and ignores this segment — send any non-empty value. The console sends the literal string :dummyData. |
Query parameters
isPublicprivate | public | all | private is what the console shows: assistants this account owns or was granted. public is the shared catalog. Default all |
isMainAgentall | true | false | false narrows to agentic tools — assistants that exist to be called by another assistant rather than talked to. Default all |
osstring | Comma-separated targets: nt, android, web. Ignored when the request carries a browser Origin header — from a browser the server always widens this to web,nt,android, so a filtered list needs a server-side call. Default nt |
pagenumber | — Default 1 |
limitnumber | — Default 50 |
retcount | Send ret=count to get the total back without the documents. |
- This response carries no `status` field — unlike most of the API. Branch on the HTTP status, and treat a body with no
allPersonasarray as a failure rather than as an empty account.
curl -X POST 'https://avaai.pathor.in/api/v1/persona/enterprise/getAllPersonas/:dummyData?isPublic=private&isMainAgent=all&os=nt&page=1&limit=20' \
-H "Authorization: Bearer $AVA_API_KEY"{
"allPersonas": [
{
"_id": "66f2a1b4c5d6e70012345678",
"customPersonaId": "orion-support",
"name": "Orion Support",
"title": "Customer support specialist",
"isPublic": false,
"voice": "66f1c0a4e2b1a90012ab34cd",
"os": [
"nt"
],
"Is_main_agent": true,
"attached_kbs": [
{
"kbId": "3f6b1c22-8f0e-4a71-9a2e-5c1d0f9b7a13",
"enabled": true,
"grounding_mode": "supplemental"
}
],
"createdAt": "2026-07-02T09:14:22.104Z"
}
],
"totalPersonas": 42,
"currentPage": 1,
"totalPages": 3
}Query parameters
searchreqstring | — |
isMainAgentall | true | false | — Default all |
osstring | — Default nt |
pagenumber | — Default 1 |
limitnumber | — Default 30 |
curl -X POST 'https://avaai.pathor.in/api/v1/persona/enterprise/searchPersonas?search=support&isMainAgent=all&os=nt&page=1&limit=20' \
-H "Authorization: Bearer $AVA_API_KEY"{
"status": true,
"allPersonas": [
{
"_id": "66f2a1b4c5d6e70012345678",
"customPersonaId": "orion-support",
"name": "Orion Support"
}
],
"totalPersonas": 3,
"currentPage": 1,
"totalPages": 1
}Path parameters
sessionId | Vestigial, as above. Any non-empty value. |
personaId | The customPersonaId — the readable id you chose at creation, not the Mongo _id. |
- The document is under `personaData`, not
persona— and the list endpoints return theirs underallPersonas. Three names, one object; this is the API's oldest wart. - An id the account cannot see answers 400, not 404. The server does not distinguish “no such assistant” from “not yours”.
curl -X POST 'https://avaai.pathor.in/api/v1/persona/enterprise/getPersona/:dummyData/orion-support' \
-H "Authorization: Bearer $AVA_API_KEY"{
"status": true,
"personaData": {
"_id": "66f2a1b4c5d6e70012345678",
"customPersonaId": "orion-support",
"name": "Orion Support",
"base_sys_prompt": "You handle billing and delivery questions for Orion…",
"voice": "66f1c0a4e2b1a90012ab34cd",
"accessible_plugin": [],
"attached_kbs": [
{
"kbId": "3f6b1c22-8f0e-4a71-9a2e-5c1d0f9b7a13",
"enabled": true,
"grounding_mode": "supplemental"
}
]
}
}Body
namereqstring | Display name. |
customPersonaIdreqstring | Your own stable id — slug-like, unique platform-wide. Every later call uses this, so pick something you will not want to rename. |
isPublicreqboolean | Listed in the shared catalog. false for anything account-specific. Must be present — an omitted isPublic is a 400, not a default. |
voicereqstring | A voice _id from the voice catalog below. Required even for a text-only assistant. |
tagsreqstring[] | Send an array, even an empty one. General is appended server-side if you leave it out. |
base_sys_promptstring | The system prompt. Capped at 5,000 characters for Android-only assistants and silently truncated past it. |
titlestring | One-line role description shown under the name. |
personalitystring | Free text, max 2,100 characters. Longer is a 400. |
genderstring | — |
languagesstring[] | — |
behaviorstring[] | — |
osstring[] | Target platforms: nt, android, web. An android-only assistant takes the 5,000-character prompt cap. |
Is_main_agentboolean | True for an assistant people talk to. Capital I — that is the wire name. |
is_agentic_toolboolean | True when this assistant exists to be called by another one. |
accessible_pluginstring[] | Plugin _ids this assistant may run. |
authorised_users_emailstring[] | Emails granted access. Each address is sent an invitation when the assistant is created. |
logostring | Absolute image URL. |
voice_languagestring | Accent code, e.g. en-IN. |
- A duplicate customPersonaId comes back as 404 with
persona already exists with …— an unusual status for a conflict, but that is what the server sends. - The response does not echo the created document. Follow with Get one assistant if you need it.
curl -X POST 'https://avaai.pathor.in/api/v1/persona/enterprise/createPersona' \
-H "Authorization: Bearer $AVA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Orion Support",
"customPersonaId": "orion-support",
"title": "Customer support specialist",
"isPublic": false,
"voice": "66f1c0a4e2b1a90012ab34cd",
"voice_language": "en-IN",
"gender": "female",
"languages": [
"english"
],
"tags": [
"Support"
],
"behavior": [
"calm",
"precise"
],
"base_sys_prompt": "You handle billing and delivery questions for Orion. Answer from the attached knowledge base. Confirm the order number before quoting any refund amount.",
"personality": "Warm, brisk, never over-promises.",
"os": [
"nt"
],
"Is_main_agent": true,
"is_agentic_tool": false,
"accessible_plugin": [],
"authorised_users_email": [],
"logo": "https://cdn.example.com/orion.png"
}'{
"status": true,
"message": "New persona has been created"
}Body
personaIdreqstring | The customPersonaId. Named personaId in this body only; everywhere else that name means the Mongo _id. |
base_sys_promptstring | Replaced wholesale. |
os · languages · tags · behavior · hobbies · accessible_rag_foldersstring[] or string | An array REPLACES the field. A bare string APPENDS to it. Sending tags: "Support" adds one tag; sending tags: ["Support"] makes Support the only tag. |
accessible_pluginstring[] or string | Inverted from the fields above, and easy to get wrong: an array ADDS the plugin ids, a bare string REMOVES that one plugin. |
namestring | — |
titlestring | — |
isPublicboolean | — |
voicestring | — |
logostring | — |
- A personaId the key's account does not own returns 400
unauthorized user, not 404 — the server will not confirm whether the assistant exists.
curl -X PUT 'https://avaai.pathor.in/api/v1/persona/enterprise/updatePersona' \
-H "Authorization: Bearer $AVA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"personaId": "orion-support",
"base_sys_prompt": "You handle billing and delivery questions for Orion. Confirm the order number before quoting any refund amount.",
"tags": [
"Support",
"Billing"
]
}'{
"status": true,
"message": "Persona has been updated!"
}Path parameters
sessionId | Vestigial. Any non-empty value. |
personaId | The customPersonaId. |
- Written to your account's activity trail as
assistant.deleted, with the name captured before the delete so the entry still reads sensibly afterwards.
curl -X DELETE 'https://avaai.pathor.in/api/v1/persona/enterprise/deletePersona/:dummyData/orion-support' \
-H "Authorization: Bearer $AVA_API_KEY"{
"status": true,
"message": "Persona has been deleted!"
}Path parameters
personaId | The Mongo _id here — the one route in this section that does not take customPersonaId. A non-ObjectId value is rejected with a 400. |
Body
newOwnerEmailreqstring | Must already have an account. |
keepAccessboolean | Leave yourself on the assistant as a full-access editor. Default false |
curl -X POST 'https://avaai.pathor.in/api/v1/persona/enterprise/transferOwnership/66f2a1b4c5d6e70012345678' \
-H "Authorization: Bearer $AVA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"newOwnerEmail": "ops@example.com",
"keepAccess": true
}'{
"status": true,
"message": "Ownership of \"Orion Support\" transferred to ops@example.com",
"note": "You retain full-access editor rights"
}Query parameters
titlestring | Narrow to one voice by exact title. Omit for the whole catalog. |
- The array is under `data`, and the
_id— notvoice_id— is whatcreatePersonawants for itsvoicefield.voice_idis the upstream provider's own id and the assistant routes will not accept it. - Lives under the Voices module, not Assistants — a key scoped to assistants alone gets a 403 here. The Assistants & knowledge preset already includes Voices at Read.
curl -X GET 'https://avaai.pathor.in/api/v1/users/get_voice_clone' \
-H "Authorization: Bearer $AVA_API_KEY"{
"status": true,
"message": "voice_clone fetched successfully",
"data": [
{
"_id": "66f1c0a4e2b1a90012ab34cd",
"title": "Aria",
"gender": "female",
"voice_language": "en-IN",
"voice_provider": "cartesia",
"voice_type": "non-custom",
"isPublic": true,
"voice_sample_uri": "https://cdn.example.com/voices/aria.mp3"
}
]
}A plugin is a function definition the model is shown plus a Python body that runs when it decides to call it. Authoring one is a write; deleting one can break every assistant referencing it, so it takes Full control.
Path parameters
userId | Vestigial, like the assistant routes: the caller comes from the bearer. Any non-empty value. |
Query parameters
isPublicpublic | private | all | private is the account's own catalog. Default all |
statusall | approved | pending | — Default all |
osstring | nt, android, web, or all. Default all |
pagenumber | — Default 1 |
limitnumber | — Default 50 |
- The collection key is `plugin`, singular — not
plugins. Every list endpoint in this section uses it. - An empty result is shaped differently:
{ status: "true", message: "No plugin found", tags: […] }with no `plugin` key at all. Read it asdata.plugin || []rather than indexing straight into it. func_runandfunc_schemacome back AES-encrypted. The console decrypts them in the browser; from a server you would need to do the same. Everything else on the document is plain.
curl -X POST 'https://avaai.pathor.in/api/v1/users/enterprise/getallplugin/:dummyData?isPublic=private&status=all&os=all&page=1&limit=20' \
-H "Authorization: Bearer $AVA_API_KEY"{
"totalPlugins": 12,
"totalPages": 1,
"currentPage": 1,
"plugin": [
{
"_id": "66f3b2c5d6e7f80012345679",
"title": "order_lookup",
"name": "Order lookup",
"tags": [
"commerce"
],
"isPublic": false,
"creator": "Orion Ltd",
"os": [
"nt"
]
}
],
"tags": [
"new",
"all",
"connected"
]
}Query parameters
titlereqstring | The plugin's unique title — its identity, not its display name. |
statusis the string"true"on this endpoint, not the boolean the assistant routes return. Do not branch on it — branch on the HTTP status.
curl -X POST 'https://avaai.pathor.in/api/v1/users/enterprise/getPlugin?title=order_lookup' \
-H "Authorization: Bearer $AVA_API_KEY"{
"status": "true",
"plugin": {
"_id": "66f3b2c5d6e7f80012345679",
"title": "order_lookup",
"name": "Order lookup",
"human_description": "Looks up an order by its reference number.",
"isPublic": false,
"isOwner": true
}
}Query parameters
searchreqstring | — |
osstring | — Default all |
pagenumber | — Default 1 |
limitnumber | — Default 20 |
- Same empty-result shape as the list: no
pluginkey when nothing matched.
curl -X POST 'https://avaai.pathor.in/api/v1/users/enterprise/searchPlugin?search=order&os=all&page=1&limit=20' \
-H "Authorization: Bearer $AVA_API_KEY"{
"totalPlugins": 1,
"totalPages": 1,
"currentPage": 1,
"plugin": [
{
"_id": "66f3b2c5d6e7f80012345679",
"title": "order_lookup"
}
],
"tags": [
"new",
"all",
"connected"
]
}Body
titlereqstring | Unique identity, snake_case by convention. Also the function name the model calls. |
namereqstring | Display name. |
tagsreqstring[] | — |
authentication_requiredreqboolean | When true, connection_url becomes required too. |
osreqstring[] | Platforms the plugin can run on: nt, android, web. |
human_descriptionreqstring | What it does, for the person browsing the catalog. |
ai_descriptionreqstring | What it does, for the model deciding whether to call it. Say when to call it and what comes back — this is the text the assistant reasons over. |
parametersreqobject | JSON-Schema object describing the arguments. |
func_schemareqstring | The tool schema the model is shown, as a JSON string. |
func_runreqstring | The Python body. Must define def _run(self, …) whose parameters match your schema. Encrypted at rest. |
isPublicreqboolean | Publish to the platform-wide catalog. |
isAnonymousreqboolean | Hide the author's name on the catalog card. |
connection_urlstring | OAuth / connection endpoint. Required when authentication_required is true. |
logostring | Absolute image URL. |
is_agentic_toolobject | { status, object } — defaults to { status: false, object: null }. |
- A missing required field returns 404 with a single message naming all of them at once. A duplicate title returns 400.
- Titles are reserved platform-wide.
browser_searchandcode_interpreterare AvA's built-ins and are rejected outright.
curl -X POST 'https://avaai.pathor.in/api/v1/plugin/enterprise/createGlobalPlugin' \
-H "Authorization: Bearer $AVA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "order_lookup",
"name": "Order lookup",
"tags": [
"commerce"
],
"authentication_required": false,
"os": [
"nt"
],
"human_description": "Looks up an order by its reference number.",
"ai_description": "Call this when the customer gives an order number and wants its status. Returns the status string and the courier's tracking URL.",
"parameters": {
"type": "object",
"properties": {
"order_id": {
"type": "string",
"description": "The customer's order reference."
}
},
"required": [
"order_id"
]
},
"func_schema": "{\"name\":\"order_lookup\",\"description\":\"Look up an order by reference\",\"parameters\":{\"type\":\"object\",\"properties\":{\"order_id\":{\"type\":\"string\"}},\"required\":[\"order_id\"]}}",
"func_run": "def _run(self, order_id):\n import requests\n r = requests.get(f\"https://api.example.com/orders/{order_id}\")\n r.raise_for_status()\n data = r.json()\n return {\"status\": data[\"status\"], \"tracking_url\": data[\"tracking_url\"]}\n",
"isPublic": false,
"isAnonymous": false,
"logo": "https://cdn.example.com/plugins/order-lookup.png"
}'{
"status": true,
"message": "plugin created successfully"
}Body
titlereqstring | Identifies the plugin. Cannot itself be changed here. |
namestring | — |
human_descriptionstring | — |
ai_descriptionstring | — |
parametersobject | — |
func_schemastring | — |
func_runstring | — |
isPublicboolean | — |
tagsstring[] | — |
osstring[] | — |
logostring | — |
- Sending any of
_id,userId,status,appVersion,createdAtor__vis rejected with 404Invalid Body. Strip a document you fetched before you send it back.
curl -X PUT 'https://avaai.pathor.in/api/v1/plugin/enterprise/updateGlobalPlugin' \
-H "Authorization: Bearer $AVA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "order_lookup",
"ai_description": "Call this when the customer gives an order number. Returns the status, the courier and the tracking URL."
}'{
"status": true,
"message": "plugin updated successfully"
}Body
titlereqstring | — |
- Check List assistants for
accessible_pluginreferences first — nothing blocks the delete, and the assistants simply stop being able to call it.
curl -X DELETE 'https://avaai.pathor.in/api/v1/plugin/enterprise/deleteGlobalPlugin' \
-H "Authorization: Bearer $AVA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "order_lookup"
}'{
"status": true,
"message": "plugin deleted successfully"
}A knowledge base is a set of documents, chunked and embedded, that an attached assistant retrieves from at answer time. You can query one directly — the fastest way to find out whether an assistant is being shown what you think it is.
liveSourcesCountcounts inline-tier documents — the ones that sit in the assistant's context every turn instead of being retrieved. They are the expensive ones, which is why they are counted apart from the rest.sharedis true for a base another account owns and granted to you.
curl -X GET 'https://avaai.pathor.in/api/v1/kb' \
-H "Authorization: Bearer $AVA_API_KEY"{
"status": "ok",
"kbs": [
{
"kbId": "3f6b1c22-8f0e-4a71-9a2e-5c1d0f9b7a13",
"name": "Orion product docs",
"description": "Public manuals and the returns policy.",
"docsCount": 14,
"totalSize": 2841203,
"liveSourcesCount": 1,
"autoRefresh": {
"enabled": false,
"intervalDays": 3,
"lastRefreshedAt": null,
"nextRefreshAt": null
},
"createdAt": "2026-06-19T11:02:41.882Z",
"shared": false
}
]
}Body
namereqstring | — |
descriptionstring | — Default "" |
- Answers 201, not 200 — the only endpoint in this reference that does. Branch on
res.ok, not onstatus === 200.
curl -X POST 'https://avaai.pathor.in/api/v1/kb' \
-H "Authorization: Bearer $AVA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Orion product docs",
"description": "Public manuals and the returns policy."
}'{
"status": "ok",
"kbId": "3f6b1c22-8f0e-4a71-9a2e-5c1d0f9b7a13",
"name": "Orion product docs",
"description": "Public manuals and the returns policy."
}Path parameters
kbId | — |
curl -X DELETE 'https://avaai.pathor.in/api/v1/kb/3f6b1c22-8f0e-4a71-9a2e-5c1d0f9b7a13' \
-H "Authorization: Bearer $AVA_API_KEY"{
"status": "ok",
"deleted": true,
"kbId": "3f6b1c22-8f0e-4a71-9a2e-5c1d0f9b7a13"
}Path parameters
kbId | — |
Body
textreqstring | The document body. |
titlereqstring | How it is listed, and what a retrieval cites. |
mimeTypestring | — Default text/plain |
sourcestring | Free-text provenance label kept on the document. Default manual |
modeauto | vector | inline | vector chunks and embeds it for retrieval. inline keeps it whole and hands it to the assistant every turn — right for a short policy, expensive for a manual. auto decides on length. Default auto |
- An inline-tier document answers with
{ docId, mode, inlineChars, digestMethod, crawledChars }instead ofchunksCreated.
curl -X POST 'https://avaai.pathor.in/api/v1/kb/3f6b1c22-8f0e-4a71-9a2e-5c1d0f9b7a13/ingest-text' \
-H "Authorization: Bearer $AVA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Returns policy 2026",
"text": "Orion accepts returns within 30 days of delivery, provided the item is unused and in its original packaging. Refunds are issued to the original payment method within 5 working days of the item reaching our warehouse.",
"mimeType": "text/plain",
"source": "handbook",
"mode": "auto"
}'{
"status": "ok",
"docId": "b81e5c0a-7d33-4f2e-9c11-2a4f6d8e0b55",
"chunksCreated": 3,
"title": "Returns policy 2026",
"kbId": "3f6b1c22-8f0e-4a71-9a2e-5c1d0f9b7a13"
}Path parameters
kbId | — |
Body
urlreqstring | — |
titlestring | Defaults to the page title. |
- A JavaScript-rendered page usually yields nothing useful. Extract the text yourself and use Ingest text when that happens.
curl -X POST 'https://avaai.pathor.in/api/v1/kb/3f6b1c22-8f0e-4a71-9a2e-5c1d0f9b7a13/ingest-url' \
-H "Authorization: Bearer $AVA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/returns",
"title": "Returns policy"
}'{
"status": "ok",
"docId": "c92f6d1b-8e44-4a3f-8d22-3b5e7f9a1c66",
"mode": "vector",
"chunksCreated": 5,
"title": "Returns policy",
"url": "https://example.com/returns",
"kbId": "3f6b1c22-8f0e-4a71-9a2e-5c1d0f9b7a13"
}Path parameters
kbId | — |
Form fields
filereqfile | The multipart file part. |
titlestring | Defaults to the filename. |
- A scanned PDF has no extractable text layer and ingests as an empty document. The console OCRs those in the browser before sending; from a server, OCR first and use Ingest text.
- Not runnable from the playground — it needs a real multipart body. The snippets below are complete.
curl -X POST 'https://avaai.pathor.in/api/v1/kb/3f6b1c22-8f0e-4a71-9a2e-5c1d0f9b7a13/ingest' \
-H "Authorization: Bearer $AVA_API_KEY" \
-F "file=@./document.pdf" \
-F "title=Orion manual"{
"status": "ok",
"docId": "d03a7e2c-9f55-4b40-9e33-4c6f80ab2d77",
"chunksCreated": 41,
"title": "orion-manual.pdf",
"kbId": "3f6b1c22-8f0e-4a71-9a2e-5c1d0f9b7a13"
}Path parameters
kbId | — |
curl -X GET 'https://avaai.pathor.in/api/v1/kb/3f6b1c22-8f0e-4a71-9a2e-5c1d0f9b7a13/documents' \
-H "Authorization: Bearer $AVA_API_KEY"{
"status": "ok",
"kbId": "3f6b1c22-8f0e-4a71-9a2e-5c1d0f9b7a13",
"documents": [
{
"docId": "b81e5c0a-7d33-4f2e-9c11-2a4f6d8e0b55",
"title": "Returns policy 2026",
"source": "handbook",
"mimeType": "text/plain",
"chunksCount": 3,
"fileSize": 1420,
"mode": "vector",
"createdAt": "2026-07-11T08:20:14.512Z"
}
]
}Path parameters
kbId | — |
docId | — |
curl -X DELETE 'https://avaai.pathor.in/api/v1/kb/3f6b1c22-8f0e-4a71-9a2e-5c1d0f9b7a13/documents/b81e5c0a-7d33-4f2e-9c11-2a4f6d8e0b55' \
-H "Authorization: Bearer $AVA_API_KEY"{
"status": "ok",
"deleted": true,
"docId": "b81e5c0a-7d33-4f2e-9c11-2a4f6d8e0b55",
"kbId": "3f6b1c22-8f0e-4a71-9a2e-5c1d0f9b7a13"
}Path parameters
kbId | — |
Body
queryreqstring | Natural language. |
topKnumber | Chunks to return. Capped at 20. Default 5 |
- A read behind a POST, so it needs only Read on Knowledge Base despite the verb.
- Chunks whose document has since been deleted are filtered out of the result rather than returned as orphans.
curl -X POST 'https://avaai.pathor.in/api/v1/kb/3f6b1c22-8f0e-4a71-9a2e-5c1d0f9b7a13/query' \
-H "Authorization: Bearer $AVA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "How long do I have to return something?",
"topK": 3
}'{
"status": "ok",
"kbId": "3f6b1c22-8f0e-4a71-9a2e-5c1d0f9b7a13",
"results": [
{
"text": "Orion accepts returns within 30 days of delivery, provided the item is unused…",
"score": 0.8821,
"docTitle": "Returns policy 2026",
"docId": "b81e5c0a-7d33-4f2e-9c11-2a4f6d8e0b55",
"chunkIndex": 0
}
]
}Path parameters
kbId | — |
curl -X GET 'https://avaai.pathor.in/api/v1/kb/3f6b1c22-8f0e-4a71-9a2e-5c1d0f9b7a13/stats' \
-H "Authorization: Bearer $AVA_API_KEY"{
"status": "ok",
"kbId": "3f6b1c22-8f0e-4a71-9a2e-5c1d0f9b7a13",
"documentsCount": 14,
"vectorCount": 312
}Path parameters
personaId | The customPersonaId. |
curl -X GET 'https://avaai.pathor.in/api/v1/kb/persona/orion-support' \
-H "Authorization: Bearer $AVA_API_KEY"{
"status": "ok",
"personaId": "orion-support",
"kbs": [
{
"kbId": "3f6b1c22-8f0e-4a71-9a2e-5c1d0f9b7a13",
"enabled": true,
"grounding_mode": "supplemental",
"name": "Orion product docs",
"description": "Public manuals and the returns policy.",
"docsCount": 14,
"totalSize": 2841203
}
]
}Path parameters
kbId | — |
personaId | — |
Body
grounding_modestrict | supplemental | strict confines the assistant to what it retrieves and makes it say so when it finds nothing. supplemental lets it answer from its own knowledge as well. Default supplemental |
enabledboolean | — Default true |
- An assistant may hold at most three knowledge bases. A fourth is a 400. Merge related material into one base rather than splitting it finely.
- Re-posting a base that is already attached updates it instead, and answers
updated: truerather thanattached: true.
curl -X POST 'https://avaai.pathor.in/api/v1/kb/3f6b1c22-8f0e-4a71-9a2e-5c1d0f9b7a13/personas/orion-support' \
-H "Authorization: Bearer $AVA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"grounding_mode": "supplemental",
"enabled": true
}'{
"status": "ok",
"kbId": "3f6b1c22-8f0e-4a71-9a2e-5c1d0f9b7a13",
"personaId": "orion-support",
"grounding_mode": "supplemental",
"enabled": true,
"attached": true
}Path parameters
kbId | — |
personaId | — |
Body
grounding_modestrict | supplemental | — |
enabledboolean | — |
curl -X PATCH 'https://avaai.pathor.in/api/v1/kb/3f6b1c22-8f0e-4a71-9a2e-5c1d0f9b7a13/personas/orion-support' \
-H "Authorization: Bearer $AVA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"grounding_mode": "strict"
}'{
"status": "ok",
"kbId": "3f6b1c22-8f0e-4a71-9a2e-5c1d0f9b7a13",
"personaId": "orion-support",
"updated": true
}Path parameters
kbId | — |
personaId | — |
- Only Read & write, not Full control — detaching an assistant destroys nothing, so it is not held to the same bar as deleting a base.
curl -X DELETE 'https://avaai.pathor.in/api/v1/kb/3f6b1c22-8f0e-4a71-9a2e-5c1d0f9b7a13/personas/orion-support' \
-H "Authorization: Bearer $AVA_API_KEY"{
"status": "ok",
"kbId": "3f6b1c22-8f0e-4a71-9a2e-5c1d0f9b7a13",
"personaId": "orion-support",
"detached": true
}Path parameters
kbId | — |
Body
enabledreqboolean | — |
intervalDaysnumber | Use with intervalHours. |
intervalHoursnumber | — |
curl -X PATCH 'https://avaai.pathor.in/api/v1/kb/3f6b1c22-8f0e-4a71-9a2e-5c1d0f9b7a13/auto-refresh' \
-H "Authorization: Bearer $AVA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"enabled": true,
"intervalDays": 7,
"intervalHours": 0
}'{
"status": "ok",
"kbId": "3f6b1c22-8f0e-4a71-9a2e-5c1d0f9b7a13",
"autoRefresh": {
"enabled": true,
"intervalDays": 7,
"lastRefreshedAt": null,
"nextRefreshAt": "2026-08-27T09:00:00.000Z"
}
}Path parameters
kbId | — |
- Only URL-sourced documents are re-crawled. An uploaded file or pasted text has no source to re-fetch, so it is left alone.
curl -X POST 'https://avaai.pathor.in/api/v1/kb/3f6b1c22-8f0e-4a71-9a2e-5c1d0f9b7a13/refresh-now' \
-H "Authorization: Bearer $AVA_API_KEY"{
"status": "ok",
"kbId": "3f6b1c22-8f0e-4a71-9a2e-5c1d0f9b7a13",
"refreshedDocs": 4,
"autoRefresh": {
"enabled": true,
"intervalDays": 7,
"lastRefreshedAt": "2026-08-20T09:41:02.771Z",
"nextRefreshAt": "2026-08-27T09:41:02.771Z"
},
"message": "Successfully re-indexed 4 URL document(s)."
}Events (webhooks)
Results always stay in the AvA console. An account can also add up to five https addresses of its own (Integrations → Send events to your system). AvA then POSTs each event there, signed, retried when the endpoint is down, with a delivery log in the console. Nothing is sent until one is added, and where events go is set by a person in the console, never with an API key.
Headers on every delivery
content-type | application/json |
x-ava-signature | sha256=<hex HMAC-SHA256 of the exact body, keyed with the destination's signing secret> |
x-ava-event-id | evt_… — the same on every retry of one event. Use it to ignore a repeat. |
x-ava-event-type | call.completed |
x-ava-delivery-attempt | 1 on the first send, 2 on the first retry, … |
user-agent | AvA-Events/1.0 |
Delivery and retries
- AvA waits about 20 seconds after a call ends, so the summary and recording are ready, then sends one event per call.
- Your endpoint has 10 seconds to answer with a 2xx.
- A timeout, a 429 or a 5xx is tried again, up to 8 times over about two hours (first retry after 1 minute). Any other answer is not retried.
- x-ava-event-id stays the same on every retry, so your system can ignore a repeat.
- The recording link works for 15 minutes. For later, fetch recording.api_url with an AvA API key.
- A failure never switches the destination off and never affects the call.
- The delivery log keeps 30 days.
- recording.url works for 15 minutes from when that delivery was sent. To fetch the audio later, call recording.api_url with an AvA API key (journeys: view for journey calls, campaigns: view for the rest); add ?redirect=1 to go straight to the file.
Envelope
id | string | evt_… (equals x-ava-event-id). |
type | string | The event, e.g. call.completed. |
api_version | string | The payload's version (2026-10-16). It changes only for something a receiver must handle. |
created_at | ISO 8601 | When AvA noted the event. |
account_id | string | The AvA account it belongs to. |
test | boolean | true for Send test event: a made-up call. |
data | object | The event's own fields (below). |
call.completed· A call finished
Every AI call, whatever placed it: a campaign, a journey step, a quick dial, or somebody calling one of your numbers. Answered or not (status says which; a destination can ask for answered calls only). Sent once per call, about 20 seconds after it ends, so the summary and recording are ready.
data.call_id | string | The carrier's call id. The same id the call's recording and the console use. |
data.direction | outbound | inbound | Whether AvA rang them or they rang you. |
data.source | object | What placed the call: kind (campaign, journey, quick_dial, inbound) and the campaign or journey (id, name, run_id, step_id). Fields that do not apply are null. |
data.status | answered | voicemail | no_answer | busy | failed | unknown | How the call went, one vocabulary for every kind of call. |
data.carrier_status | string | null | The carrier's own words for how the call ended, when it sent them. |
data.duration_sec | number | null | Whole seconds of the call. 0 when nobody answered. |
data.started_at / ended_at | ISO 8601 | null | When the call started and ended (UTC). |
data.from / to | E.164 | null | The two numbers in full, e.g. +919812345678. |
data.assistant | object | null | The assistant on the call (id, name), when known. |
data.summary | string | null | One line from AvA's post-call analysis. |
data.sentiment | positive | neutral | negative | mixed | null | How the person sounded. |
data.outcome | string | null | Whether the call's goal was reached, as the analysis judged it. |
data.disconnect_reason | string | null | Why the call ended, when AvA knows. |
data.cut_off | boolean | null | true when the call was cut off rather than ended by either side. |
data.transcript | array | null | [{role: caller | assistant, text}]. Only when the destination has "Include the transcript" on. |
data.recording | object | available; url (signed, works for 15 minutes from when the event was sent); expires_at; api_url (a fresh link, with an AvA API key). Never the audio itself. |
data.message | object | null | A recording / spoken-message call (no assistant): kind (recording | speech), played_to_end, played_sec, length_sec. null on an assistant call. |
{
"id": "evt_6f1c2a9b3d4e5f6a7b8c9d0e",
"type": "call.completed",
"api_version": "2026-10-16",
"created_at": "2026-10-16T12:12:00.000Z",
"account_id": "64b0f1c2a9b3d4e5f6a7b8c9",
"test": false,
"data": {
"call_id": "CA1f0e2d3c4b5a69788",
"direction": "outbound",
"source": {
"kind": "journey",
"campaign_id": null,
"campaign_name": null,
"journey_id": "66f0a1b2c3d4e5f6a7b8c9d0",
"journey_name": "Camera alert: call the site manager",
"run_id": "66f0a1b2c3d4e5f6a7b8c9d1",
"step_id": "call-1"
},
"status": "answered",
"carrier_status": "NORMAL_CLEARING",
"duration_sec": 74,
"started_at": "2026-10-16T12:10:21.000Z",
"ended_at": "2026-10-16T12:11:35.000Z",
"from": "+918045678900",
"to": "+919812345678",
"assistant": {
"id": "66f0a1b2c3d4e5f6a7b8c9d2",
"name": "Site alerts"
},
"summary": "The site manager will check the camera at gate 2 within ten minutes.",
"sentiment": "positive",
"outcome": "yes",
"disconnect_reason": "The person said goodbye",
"cut_off": false,
"transcript": null,
"recording": {
"available": true,
"url": "https://userdocbucket.s3.ap-south-1.amazonaws.com/…&X-Amz-Expires=900…",
"expires_at": "2026-10-16T12:27:00.000Z",
"api_url": "https://avaai.pathor.in/api/v1/journey/enterprise/calls/CA1f0e2d3c4b5a69788/recording"
},
"message": null
}
}// Node.js (Express). Use the RAW body: re-serialised JSON will not match.
const crypto = require("crypto");
app.post("/ava-events", express.raw({ type: "application/json" }), (req, res) => {
const expected = "sha256=" + crypto
.createHmac("sha256", process.env.AVA_EVENTS_SECRET)
.update(req.body) // the exact bytes AvA sent
.digest("hex");
const got = req.get("x-ava-signature") || "";
const valid = got.length === expected.length &&
crypto.timingSafeEqual(Buffer.from(got), Buffer.from(expected));
if (!valid) return res.status(401).end();
const event = JSON.parse(req.body);
// x-ava-event-id is the same on every retry: ignore one you have already handled.
res.status(200).end();
});# Python (Flask)
import hashlib, hmac, os
from flask import Flask, request, abort
app = Flask(__name__)
@app.post("/ava-events")
def ava_events():
body = request.get_data() # the exact bytes AvA sent
expected = "sha256=" + hmac.new(os.environ["AVA_EVENTS_SECRET"].encode(), body, hashlib.sha256).hexdigest()
if not hmac.compare_digest(expected, request.headers.get("x-ava-signature", "")):
abort(401)
event = request.get_json()
# x-ava-event-id is the same on every retry: ignore one you have already handled.
return "", 200Machine-readable copies of this page
This page is a disclosure UI — fetch its HTML and you get thirty summaries with the detail still collapsed. If you are an agent, or you are handing this reference to one, use one of these instead. Both are generated from the same catalog, so they can never fall behind what is rendered above.
/api-docs/llms.txtThe complete reference as flat markdown — every parameter, sample and caveat, nothing behind a click. Each heading carries a permalink back into this page, so anything read there can be cited as a link.
/api-docs/openapi.jsonOpenAPI 3.1 for the same endpoints — load it into Postman, an SDK generator or a tool-calling harness. Every operation carries an x-ava-scope extension naming the key scope it needs, so you can work that out before the 403 rather than after it.
Addressing this page directly
Every section and every endpoint has a stable fragment. Link straight to the one that matters instead of asking someone to scroll.
/api-docs#knowledge-base | A whole section |
/api-docs#kb.query | One endpoint, arriving already expanded |
/api-docs?q=ingest | A search — shareable as a result list |
/api-docs?try=kb.query | The playground, open on that endpoint |
/api-docs?expand=all | Every endpoint expanded, for scraping or printing |