REST API
Everything the console can do, over HTTP. Most people don’t need this — point a coding agent at the MCP + skills and describe the task. Call it directly when you’re building your own backend.
New to this? A “coding agent” — Claude Code, Cursor, Codex — is an AI that writes code for you.
Base URL https://api.agent4.io/v1. Every tenant endpoint authenticates with your API key:
X-API-Key: tk_… # or: Authorization: Bearer tk_…
Generate a key in the console under Settings → Security — the plaintext is shown once, at creation. Every endpoint below lists its parameters, request body and response, generated from the live spec: openapi.json · interactive /docs.
Agents
An agent is soul + task + tools + skills + knowledge_bases. System tools (current_time, ip_geo, weather) are enabled by default on new agents.
GET/agentsList your agents (name, alias, published).
List your agents (name, alias, published).
| published | query | boolean | optional |
| name | string | required | Name |
| id | string | required | Id |
| alias | string? | optional | Alias |
| published | boolean | optional | Published |
| source | string | optional | Source |
| model | string? | optional | Model |
| task | string? | optional | Task |
| tools_count | integer | optional | Tools Count |
| skills_count | integer | optional | Skills Count |
| tools | string[] | optional | Tools |
| skills | string[] | optional | Skills |
| knowledge_bases | string[] | optional | Knowledge Bases |
[
{
"name": "string",
"id": "string",
"alias": "string",
"published": true,
"source": "string",
"model": "string",
"task": "string",
"tools_count": 0,
"skills_count": 0,
"tools": [
"string"
],
"skills": [
"string"
],
"knowledge_bases": [
"string"
]
}
]DELETE/agents/{name}Delete an agent.
Delete an agent.
| name | path | string | required |
Response 204 — No Content (success, empty body).
GET/agents/{name}Get one agent's full configuration.
Get one agent's full configuration.
| name | path | string | required |
| name | string | required | Name |
| id | string? | optional | Id |
| alias | string? | optional | Alias |
| soul | string | required | Soul |
| task | string | required | Task |
| tools | string[] | required | Tools |
| skills | string[] | optional | Skills |
| knowledge_bases | string[] | optional | Knowledge Bases |
| history_window | integer? | optional | History Window |
| max_output_tokens | integer? | optional | Max Output Tokens |
| tool_call_max_tokens | integer? | optional | Tool Call Max Tokens |
| model | string? | optional | Model |
| published | boolean | optional | Published |
| greeting | string? | optional | Greeting |
| auto_greeting | boolean | optional | Auto Greeting |
| auto_suggest | boolean | optional | Auto Suggest |
| suggest_prompt | string? | optional | Suggest Prompt |
| ask_forms | boolean | optional | Ask Forms |
| proactive_cta | boolean | optional | Proactive Cta |
| cta_prompt | string? | optional | Cta Prompt |
| no_match_reply | string? | optional | No Match Reply |
| reasoning | boolean | optional | Reasoning |
| grounding_required | boolean | optional | Grounding Required |
| injection_guard | boolean | optional | Injection Guard |
| public_sources | boolean | optional | Public Sources |
| ambiguity_check | boolean | optional | Ambiguity Check |
| deep_research | boolean | optional | Deep Research |
| on_demand_context | boolean | optional | On Demand Context |
| menu_items | string[]? | optional | Menu Items |
| source | string | required | Source |
{
"name": "string",
"id": "string",
"alias": "string",
"soul": "string",
"task": "string",
"tools": [
"string"
],
"skills": [
"string"
],
"knowledge_bases": [
"string"
],
"history_window": 0,
"max_output_tokens": 0,
"tool_call_max_tokens": 0,
"model": "string",
"published": true,
"greeting": "string",
"auto_greeting": true,
"auto_suggest": true,
"suggest_prompt": "string",
"ask_forms": true,
"proactive_cta": true,
"cta_prompt": "string",
"no_match_reply": "string",
"reasoning": true,
"grounding_required": true,
"injection_guard": true,
"public_sources": true,
"ambiguity_check": true,
"deep_research": true,
"on_demand_context": true,
"menu_items": [
"string"
],
"source": "string"
}PATCH/agents/{name}Partial update — only the fields you send change; the rest are left as-is.
Partial update — only the fields you send change; the rest are left as-is.
| name | path | string | required |
| soul | string? | optional | Soul |
| task | string? | optional | Task |
| tools | string[]? | optional | Tools |
| tools_add | string[]? | optional | Tools Add |
| tools_remove | string[]? | optional | Tools Remove |
| skills | string[]? | optional | Skills |
| skills_add | string[]? | optional | Skills Add |
| skills_remove | string[]? | optional | Skills Remove |
| knowledge_bases | string[]? | optional | Knowledge Bases |
| knowledge_bases_add | string[]? | optional | Knowledge Bases Add |
| knowledge_bases_remove | string[]? | optional | Knowledge Bases Remove |
| history_window | integer? | optional | History Window |
| max_output_tokens | integer? | optional | Max Output Tokens |
| tool_call_max_tokens | integer? | optional | Tool Call Max Tokens |
| model | string? | optional | Model |
| published | boolean? | optional | Published |
| greeting | string? | optional | Greeting |
| auto_greeting | boolean? | optional | Auto Greeting |
| auto_suggest | boolean? | optional | Auto Suggest |
| suggest_prompt | string? | optional | Suggest Prompt |
| ask_forms | boolean? | optional | Ask Forms |
| proactive_cta | boolean? | optional | Proactive Cta |
| cta_prompt | string? | optional | Cta Prompt |
| no_match_reply | string? | optional | No Match Reply |
| reasoning | boolean? | optional | Reasoning |
| grounding_required | boolean? | optional | Grounding Required |
| injection_guard | boolean? | optional | Injection Guard |
| public_sources | boolean? | optional | Public Sources |
| ambiguity_check | boolean? | optional | Ambiguity Check |
| deep_research | boolean? | optional | Deep Research |
| on_demand_context | boolean? | optional | On Demand Context |
| menu_items | string[]? | optional | Menu Items |
{
"soul": "string",
"task": "string",
"tools": [
"string"
],
"tools_add": [
"string"
],
"tools_remove": [
"string"
],
"skills": [
"string"
],
"skills_add": [
"string"
],
"skills_remove": [
"string"
],
"knowledge_bases": [
"string"
],
"knowledge_bases_add": [
"string"
],
"knowledge_bases_remove": [
"string"
],
"history_window": 0,
"max_output_tokens": 0,
"tool_call_max_tokens": 0,
"model": "string",
"published": true,
"greeting": "string",
"auto_greeting": true,
"auto_suggest": true,
"suggest_prompt": "string",
"ask_forms": true,
"proactive_cta": true,
"cta_prompt": "string",
"no_match_reply": "string",
"reasoning": true,
"grounding_required": true,
"injection_guard": true,
"public_sources": true,
"ambiguity_check": true,
"deep_research": true,
"on_demand_context": true,
"menu_items": [
"string"
]
}| name | string | required | Name |
| id | string? | optional | Id |
| alias | string? | optional | Alias |
| soul | string | required | Soul |
| task | string | required | Task |
| tools | string[] | required | Tools |
| skills | string[] | optional | Skills |
| knowledge_bases | string[] | optional | Knowledge Bases |
| history_window | integer? | optional | History Window |
| max_output_tokens | integer? | optional | Max Output Tokens |
| tool_call_max_tokens | integer? | optional | Tool Call Max Tokens |
| model | string? | optional | Model |
| published | boolean | optional | Published |
| greeting | string? | optional | Greeting |
| auto_greeting | boolean | optional | Auto Greeting |
| auto_suggest | boolean | optional | Auto Suggest |
| suggest_prompt | string? | optional | Suggest Prompt |
| ask_forms | boolean | optional | Ask Forms |
| proactive_cta | boolean | optional | Proactive Cta |
| cta_prompt | string? | optional | Cta Prompt |
| no_match_reply | string? | optional | No Match Reply |
| reasoning | boolean | optional | Reasoning |
| grounding_required | boolean | optional | Grounding Required |
| injection_guard | boolean | optional | Injection Guard |
| public_sources | boolean | optional | Public Sources |
| ambiguity_check | boolean | optional | Ambiguity Check |
| deep_research | boolean | optional | Deep Research |
| on_demand_context | boolean | optional | On Demand Context |
| menu_items | string[]? | optional | Menu Items |
| source | string | required | Source |
{
"name": "string",
"id": "string",
"alias": "string",
"soul": "string",
"task": "string",
"tools": [
"string"
],
"skills": [
"string"
],
"knowledge_bases": [
"string"
],
"history_window": 0,
"max_output_tokens": 0,
"tool_call_max_tokens": 0,
"model": "string",
"published": true,
"greeting": "string",
"auto_greeting": true,
"auto_suggest": true,
"suggest_prompt": "string",
"ask_forms": true,
"proactive_cta": true,
"cta_prompt": "string",
"no_match_reply": "string",
"reasoning": true,
"grounding_required": true,
"injection_guard": true,
"public_sources": true,
"ambiguity_check": true,
"deep_research": true,
"on_demand_context": true,
"menu_items": [
"string"
],
"source": "string"
}curl -X PATCH https://api.agent4.io/v1/agents/advisor -H "X-API-Key: $KEY" \
-H 'Content-Type: application/json' -d '{"knowledge_bases":["company-policy"],"grounding_required":true}'POST/agents/{name}Create an agent (409 if it exists).
Create an agent (409 if it exists).
| name | path | string | required |
| soul | string | optional | Soul |
| task | string | optional | Task |
| tools | string[] | optional | Tools |
| skills | string[] | optional | Skills |
| knowledge_bases | string[] | optional | Knowledge Bases |
| history_window | integer? | optional | History Window |
| max_output_tokens | integer? | optional | Max Output Tokens |
| tool_call_max_tokens | integer? | optional | |
| model | string? | optional | Model |
| published | boolean | optional | Published |
| greeting | string? | optional | Greeting |
| auto_greeting | boolean | optional | Auto Greeting |
| auto_suggest | boolean | optional | Auto Suggest |
| suggest_prompt | string? | optional | Suggest Prompt |
| ask_forms | boolean | optional | Ask Forms |
| proactive_cta | boolean | optional | Proactive Cta |
| cta_prompt | string? | optional | Cta Prompt |
| no_match_reply | string? | optional | No Match Reply |
| reasoning | boolean | optional | Reasoning |
| grounding_required | boolean | optional | Grounding Required |
| injection_guard | boolean | optional | Injection Guard |
| public_sources | boolean | optional | Public Sources |
| ambiguity_check | boolean | optional | Ambiguity Check |
| deep_research | boolean | optional | Deep Research |
| on_demand_context | boolean | optional | On Demand Context |
| menu_items | string[]? | optional | Menu Items |
{
"soul": "string",
"task": "string",
"tools": [
"string"
],
"skills": [
"string"
],
"knowledge_bases": [
"string"
],
"history_window": 0,
"max_output_tokens": 0,
"tool_call_max_tokens": 0,
"model": "string",
"published": true,
"greeting": "string",
"auto_greeting": true,
"auto_suggest": true,
"suggest_prompt": "string",
"ask_forms": true,
"proactive_cta": true,
"cta_prompt": "string",
"no_match_reply": "string",
"reasoning": true,
"grounding_required": true,
"injection_guard": true,
"public_sources": true,
"ambiguity_check": true,
"deep_research": true,
"on_demand_context": true,
"menu_items": [
"string"
]
}| name | string | required | Name |
| id | string? | optional | Id |
| alias | string? | optional | Alias |
| soul | string | required | Soul |
| task | string | required | Task |
| tools | string[] | required | Tools |
| skills | string[] | optional | Skills |
| knowledge_bases | string[] | optional | Knowledge Bases |
| history_window | integer? | optional | History Window |
| max_output_tokens | integer? | optional | Max Output Tokens |
| tool_call_max_tokens | integer? | optional | Tool Call Max Tokens |
| model | string? | optional | Model |
| published | boolean | optional | Published |
| greeting | string? | optional | Greeting |
| auto_greeting | boolean | optional | Auto Greeting |
| auto_suggest | boolean | optional | Auto Suggest |
| suggest_prompt | string? | optional | Suggest Prompt |
| ask_forms | boolean | optional | Ask Forms |
| proactive_cta | boolean | optional | Proactive Cta |
| cta_prompt | string? | optional | Cta Prompt |
| no_match_reply | string? | optional | No Match Reply |
| reasoning | boolean | optional | Reasoning |
| grounding_required | boolean | optional | Grounding Required |
| injection_guard | boolean | optional | Injection Guard |
| public_sources | boolean | optional | Public Sources |
| ambiguity_check | boolean | optional | Ambiguity Check |
| deep_research | boolean | optional | Deep Research |
| on_demand_context | boolean | optional | On Demand Context |
| menu_items | string[]? | optional | Menu Items |
| source | string | required | Source |
{
"name": "string",
"id": "string",
"alias": "string",
"soul": "string",
"task": "string",
"tools": [
"string"
],
"skills": [
"string"
],
"knowledge_bases": [
"string"
],
"history_window": 0,
"max_output_tokens": 0,
"tool_call_max_tokens": 0,
"model": "string",
"published": true,
"greeting": "string",
"auto_greeting": true,
"auto_suggest": true,
"suggest_prompt": "string",
"ask_forms": true,
"proactive_cta": true,
"cta_prompt": "string",
"no_match_reply": "string",
"reasoning": true,
"grounding_required": true,
"injection_guard": true,
"public_sources": true,
"ambiguity_check": true,
"deep_research": true,
"on_demand_context": true,
"menu_items": [
"string"
],
"source": "string"
}curl -X POST https://api.agent4.io/v1/agents/advisor -H "X-API-Key: $KEY" \
-H 'Content-Type: application/json' \
-d '{"soul":"You are a loan advisor","task":"Answer from the knowledge base; never quote a rate.","tools":["web_search"],"knowledge_bases":["company-policy"],"published":true}'PUT/agents/{name}Create or replace — full-replace semantics; send every field you want to keep.
Create or replace — full-replace semantics; send every field you want to keep.
| name | path | string | required |
| soul | string | optional | Soul |
| task | string | optional | Task |
| tools | string[] | optional | Tools |
| skills | string[] | optional | Skills |
| knowledge_bases | string[] | optional | Knowledge Bases |
| history_window | integer? | optional | History Window |
| max_output_tokens | integer? | optional | Max Output Tokens |
| tool_call_max_tokens | integer? | optional | |
| model | string? | optional | Model |
| published | boolean | optional | Published |
| greeting | string? | optional | Greeting |
| auto_greeting | boolean | optional | Auto Greeting |
| auto_suggest | boolean | optional | Auto Suggest |
| suggest_prompt | string? | optional | Suggest Prompt |
| ask_forms | boolean | optional | Ask Forms |
| proactive_cta | boolean | optional | Proactive Cta |
| cta_prompt | string? | optional | Cta Prompt |
| no_match_reply | string? | optional | No Match Reply |
| reasoning | boolean | optional | Reasoning |
| grounding_required | boolean | optional | Grounding Required |
| injection_guard | boolean | optional | Injection Guard |
| public_sources | boolean | optional | Public Sources |
| ambiguity_check | boolean | optional | Ambiguity Check |
| deep_research | boolean | optional | Deep Research |
| on_demand_context | boolean | optional | On Demand Context |
| menu_items | string[]? | optional | Menu Items |
{
"soul": "string",
"task": "string",
"tools": [
"string"
],
"skills": [
"string"
],
"knowledge_bases": [
"string"
],
"history_window": 0,
"max_output_tokens": 0,
"tool_call_max_tokens": 0,
"model": "string",
"published": true,
"greeting": "string",
"auto_greeting": true,
"auto_suggest": true,
"suggest_prompt": "string",
"ask_forms": true,
"proactive_cta": true,
"cta_prompt": "string",
"no_match_reply": "string",
"reasoning": true,
"grounding_required": true,
"injection_guard": true,
"public_sources": true,
"ambiguity_check": true,
"deep_research": true,
"on_demand_context": true,
"menu_items": [
"string"
]
}| name | string | required | Name |
| id | string? | optional | Id |
| alias | string? | optional | Alias |
| soul | string | required | Soul |
| task | string | required | Task |
| tools | string[] | required | Tools |
| skills | string[] | optional | Skills |
| knowledge_bases | string[] | optional | Knowledge Bases |
| history_window | integer? | optional | History Window |
| max_output_tokens | integer? | optional | Max Output Tokens |
| tool_call_max_tokens | integer? | optional | Tool Call Max Tokens |
| model | string? | optional | Model |
| published | boolean | optional | Published |
| greeting | string? | optional | Greeting |
| auto_greeting | boolean | optional | Auto Greeting |
| auto_suggest | boolean | optional | Auto Suggest |
| suggest_prompt | string? | optional | Suggest Prompt |
| ask_forms | boolean | optional | Ask Forms |
| proactive_cta | boolean | optional | Proactive Cta |
| cta_prompt | string? | optional | Cta Prompt |
| no_match_reply | string? | optional | No Match Reply |
| reasoning | boolean | optional | Reasoning |
| grounding_required | boolean | optional | Grounding Required |
| injection_guard | boolean | optional | Injection Guard |
| public_sources | boolean | optional | Public Sources |
| ambiguity_check | boolean | optional | Ambiguity Check |
| deep_research | boolean | optional | Deep Research |
| on_demand_context | boolean | optional | On Demand Context |
| menu_items | string[]? | optional | Menu Items |
| source | string | required | Source |
{
"name": "string",
"id": "string",
"alias": "string",
"soul": "string",
"task": "string",
"tools": [
"string"
],
"skills": [
"string"
],
"knowledge_bases": [
"string"
],
"history_window": 0,
"max_output_tokens": 0,
"tool_call_max_tokens": 0,
"model": "string",
"published": true,
"greeting": "string",
"auto_greeting": true,
"auto_suggest": true,
"suggest_prompt": "string",
"ask_forms": true,
"proactive_cta": true,
"cta_prompt": "string",
"no_match_reply": "string",
"reasoning": true,
"grounding_required": true,
"injection_guard": true,
"public_sources": true,
"ambiguity_check": true,
"deep_research": true,
"on_demand_context": true,
"menu_items": [
"string"
],
"source": "string"
}GET/agents/{name}/aliasGet the agent's public human-readable slug + its full URL prefix.
Get the agent's public human-readable slug + its full URL prefix.
| name | path | string | required |
| alias | string? | optional | Alias |
| url | string? | optional | Url |
| url_prefix | string | optional | Url Prefix |
{
"alias": "string",
"url": "string",
"url_prefix": "string"
}PUT/agents/{name}/aliasSet (or clear) the alias — the memorable public URL segment; validated + unique per tenant.
Set (or clear) the alias — the memorable public URL segment; validated + unique per tenant.
| name | path | string | required |
| alias | string? | optional | Alias |
{
"alias": "string"
}| alias | string? | optional | Alias |
| url | string? | optional | Url |
| url_prefix | string | optional | Url Prefix |
{
"alias": "string",
"url": "string",
"url_prefix": "string"
}curl -X PUT https://api.agent4.io/v1/agents/advisor/alias -H "X-API-Key: $KEY" \
-H 'Content-Type: application/json' -d '{"alias":"advisor"}'POST/agents/{name}/cloneCopy an agent into a new draft (unpublished, no alias).
Copy an agent into a new draft (unpublished, no alias).
| name | path | string | required |
| name | string | required | Name |
| id | string? | optional | Id |
| alias | string? | optional | Alias |
| soul | string | required | Soul |
| task | string | required | Task |
| tools | string[] | required | Tools |
| skills | string[] | optional | Skills |
| knowledge_bases | string[] | optional | Knowledge Bases |
| history_window | integer? | optional | History Window |
| max_output_tokens | integer? | optional | Max Output Tokens |
| tool_call_max_tokens | integer? | optional | Tool Call Max Tokens |
| model | string? | optional | Model |
| published | boolean | optional | Published |
| greeting | string? | optional | Greeting |
| auto_greeting | boolean | optional | Auto Greeting |
| auto_suggest | boolean | optional | Auto Suggest |
| suggest_prompt | string? | optional | Suggest Prompt |
| ask_forms | boolean | optional | Ask Forms |
| proactive_cta | boolean | optional | Proactive Cta |
| cta_prompt | string? | optional | Cta Prompt |
| no_match_reply | string? | optional | No Match Reply |
| reasoning | boolean | optional | Reasoning |
| grounding_required | boolean | optional | Grounding Required |
| injection_guard | boolean | optional | Injection Guard |
| public_sources | boolean | optional | Public Sources |
| ambiguity_check | boolean | optional | Ambiguity Check |
| deep_research | boolean | optional | Deep Research |
| on_demand_context | boolean | optional | On Demand Context |
| menu_items | string[]? | optional | Menu Items |
| source | string | required | Source |
{
"name": "string",
"id": "string",
"alias": "string",
"soul": "string",
"task": "string",
"tools": [
"string"
],
"skills": [
"string"
],
"knowledge_bases": [
"string"
],
"history_window": 0,
"max_output_tokens": 0,
"tool_call_max_tokens": 0,
"model": "string",
"published": true,
"greeting": "string",
"auto_greeting": true,
"auto_suggest": true,
"suggest_prompt": "string",
"ask_forms": true,
"proactive_cta": true,
"cta_prompt": "string",
"no_match_reply": "string",
"reasoning": true,
"grounding_required": true,
"injection_guard": true,
"public_sources": true,
"ambiguity_check": true,
"deep_research": true,
"on_demand_context": true,
"menu_items": [
"string"
],
"source": "string"
}GET/agents/{name}/exportExport a portable agent JSON (config only; no tenant/version).
Export a portable agent JSON (config only; no tenant/version).
| name | path | string | required |
| schema_version | integer | required | Schema Version |
| kind | string | optional | Kind |
| name | string | required | Name |
| soul | string | optional | Soul |
| task | string | optional | Task |
| tools | string[] | optional | Tools |
| skills | string[] | optional | Skills |
| knowledge_bases | string[] | optional | Knowledge Bases |
| history_window | integer? | optional | History Window |
| max_output_tokens | integer? | optional | Max Output Tokens |
| tool_call_max_tokens | integer? | optional | Tool Call Max Tokens |
| model | string? | optional | Model |
| greeting | string? | optional | Greeting |
| auto_greeting | boolean | optional | Auto Greeting |
| auto_suggest | boolean | optional | Auto Suggest |
| suggest_prompt | string? | optional | Suggest Prompt |
| ask_forms | boolean | optional | Ask Forms |
| proactive_cta | boolean | optional | Proactive Cta |
| cta_prompt | string? | optional | Cta Prompt |
| no_match_reply | string? | optional | No Match Reply |
| reasoning | boolean | optional | Reasoning |
| grounding_required | boolean | optional | Grounding Required |
{
"schema_version": 0,
"kind": "string",
"name": "string",
"soul": "string",
"task": "string",
"tools": [
"string"
],
"skills": [
"string"
],
"knowledge_bases": [
"string"
],
"history_window": 0,
"max_output_tokens": 0,
"tool_call_max_tokens": 0,
"model": "string",
"greeting": "string",
"auto_greeting": true,
"auto_suggest": true,
"suggest_prompt": "string",
"ask_forms": true,
"proactive_cta": true,
"cta_prompt": "string",
"no_match_reply": "string",
"reasoning": true,
"grounding_required": true
}POST/agents/{name}/preview-planPreview Plan
Preview Plan
| name | path | string | required |
| goal | string | required | Goal |
{
"goal": "string"
}| plan | object | required | Plan |
| backend | string | required | Backend |
| warnings | string[] | required | Warnings |
{
"plan": {},
"backend": "string",
"warnings": [
"string"
]
}GET/agents/{name}/pwaGet Agent Pwa
Get Agent Pwa
| name | path | string | required |
| install_prompt | string | optional | Install Prompt |
| favicon_url | string? | optional | Favicon Url |
| icon192_url | string? | optional | Icon192 Url |
| icon512_url | string? | optional | Icon512 Url |
| icon_maskable_url | string? | optional | Icon Maskable Url |
{
"install_prompt": "string",
"favicon_url": "string",
"icon192_url": "string",
"icon512_url": "string",
"icon_maskable_url": "string"
}PATCH/agents/{name}/pwaPatch Agent Pwa
Patch Agent Pwa
| name | path | string | required |
| install_prompt | string? | optional | Install Prompt |
{
"install_prompt": "string"
}| install_prompt | string | optional | Install Prompt |
| favicon_url | string? | optional | Favicon Url |
| icon192_url | string? | optional | Icon192 Url |
| icon512_url | string? | optional | Icon512 Url |
| icon_maskable_url | string? | optional | Icon Maskable Url |
{
"install_prompt": "string",
"favicon_url": "string",
"icon192_url": "string",
"icon512_url": "string",
"icon_maskable_url": "string"
}DELETE/agents/{name}/pwa/iconClear Agent Pwa Icon
Clear Agent Pwa Icon
| name | path | string | required |
| install_prompt | string | optional | Install Prompt |
| favicon_url | string? | optional | Favicon Url |
| icon192_url | string? | optional | Icon192 Url |
| icon512_url | string? | optional | Icon512 Url |
| icon_maskable_url | string? | optional | Icon Maskable Url |
{
"install_prompt": "string",
"favicon_url": "string",
"icon192_url": "string",
"icon512_url": "string",
"icon_maskable_url": "string"
}POST/agents/{name}/pwa/iconUpload Agent Pwa Icon
Upload Agent Pwa Icon
| name | path | string | required |
| file | string | required | File |
{
"file": "string"
}| install_prompt | string | optional | Install Prompt |
| favicon_url | string? | optional | Favicon Url |
| icon192_url | string? | optional | Icon192 Url |
| icon512_url | string? | optional | Icon512 Url |
| icon_maskable_url | string? | optional | Icon Maskable Url |
{
"install_prompt": "string",
"favicon_url": "string",
"icon192_url": "string",
"icon512_url": "string",
"icon_maskable_url": "string"
}GET/agents/{name}/revisionsConfiguration revision history.
Configuration revision history.
| name | path | string | required |
| id | string | required | Id |
| created_at | string | required | Created At |
| actor | string? | optional | Actor |
| snapshot | object | required | Snapshot |
[
{
"id": "string",
"created_at": "string",
"actor": "string",
"snapshot": {}
}
]POST/agents/{name}/revisions/{rev_id}/restoreRestore the agent to an earlier revision.
Restore the agent to an earlier revision.
| name | path | string | required | |
| rev_id | path | string | required |
| name | string | required | Name |
| id | string? | optional | Id |
| alias | string? | optional | Alias |
| soul | string | required | Soul |
| task | string | required | Task |
| tools | string[] | required | Tools |
| skills | string[] | optional | Skills |
| knowledge_bases | string[] | optional | Knowledge Bases |
| history_window | integer? | optional | History Window |
| max_output_tokens | integer? | optional | Max Output Tokens |
| tool_call_max_tokens | integer? | optional | Tool Call Max Tokens |
| model | string? | optional | Model |
| published | boolean | optional | Published |
| greeting | string? | optional | Greeting |
| auto_greeting | boolean | optional | Auto Greeting |
| auto_suggest | boolean | optional | Auto Suggest |
| suggest_prompt | string? | optional | Suggest Prompt |
| ask_forms | boolean | optional | Ask Forms |
| proactive_cta | boolean | optional | Proactive Cta |
| cta_prompt | string? | optional | Cta Prompt |
| no_match_reply | string? | optional | No Match Reply |
| reasoning | boolean | optional | Reasoning |
| grounding_required | boolean | optional | Grounding Required |
| injection_guard | boolean | optional | Injection Guard |
| public_sources | boolean | optional | Public Sources |
| ambiguity_check | boolean | optional | Ambiguity Check |
| deep_research | boolean | optional | Deep Research |
| on_demand_context | boolean | optional | On Demand Context |
| menu_items | string[]? | optional | Menu Items |
| source | string | required | Source |
{
"name": "string",
"id": "string",
"alias": "string",
"soul": "string",
"task": "string",
"tools": [
"string"
],
"skills": [
"string"
],
"knowledge_bases": [
"string"
],
"history_window": 0,
"max_output_tokens": 0,
"tool_call_max_tokens": 0,
"model": "string",
"published": true,
"greeting": "string",
"auto_greeting": true,
"auto_suggest": true,
"suggest_prompt": "string",
"ask_forms": true,
"proactive_cta": true,
"cta_prompt": "string",
"no_match_reply": "string",
"reasoning": true,
"grounding_required": true,
"injection_guard": true,
"public_sources": true,
"ambiguity_check": true,
"deep_research": true,
"on_demand_context": true,
"menu_items": [
"string"
],
"source": "string"
}POST/agents/{name}/test-planner-triggerTest Planner Trigger
Test Planner Trigger
| name | path | string | required |
| messages | string[] | required | Messages |
| samples | integer | optional | Samples |
| expect | boolean? | optional | Expect |
{
"messages": [
"string"
],
"samples": 0,
"expect": true
}| triggered | integer | required | Triggered |
| samples | integer | required | Samples |
| goals | string[] | required | Goals |
| domain | string | required | Domain |
| matched | boolean? | optional | Matched |
{
"triggered": 0,
"samples": 0,
"goals": [
"string"
],
"domain": "string",
"matched": true
}POST/agents/{name}/test-triggerDry-run a tool-call trigger test: replays your messages against the production prompt assembly, tool schemas and model routing, and reports per-sample whether the expected tool was actually called — plus claimed_without_call (the model said "noted" without calling). Tools are NOT executed and no session is stored; tokens count toward your quota. loaded=false tests the skill description (first turn), loaded=true simulates post-load_skill (tests instructions). Caps: messages ≤ 5, samples ≤ 5.
Dry-run a tool-call trigger test: replays your messages against the production prompt assembly, tool schemas and model routing, and reports per-sample whether the expected tool was actually called — plus claimed_without_call (the model said "noted" without calling). Tools are NOT executed and no session is stored; tokens count toward your quota. loaded=false tests the skill description (first turn), loaded=true simulates post-load_skill (tests instructions). Caps: messages ≤ 5, samples ≤ 5.
| name | path | string | required |
| messages | string[] | required | Messages |
| expect_tool | string? | optional | Expect Tool |
| samples | integer | optional | Samples |
| loaded | boolean | optional | Loaded |
| skill | string? | optional | Skill |
{
"messages": [
"string"
],
"expect_tool": "string",
"samples": 0,
"loaded": true,
"skill": "string"
}Response 200 · object — unstructured JSON (no fixed schema).
curl -X POST https://api.agent4.io/v1/agents/advisor/test-trigger -H "X-API-Key: $KEY" \
-H 'Content-Type: application/json' \
-d '{"messages":["My phone is 555 0123, call me back"],"expect_tool":"save_contact","samples":3,"loaded":true}'POST/agents/importImport an exported agent JSON as a new agent.
Import an exported agent JSON as a new agent.
| schema_version | integer | optional | Schema Version |
| kind | string | optional | Kind |
| name | string | required | Name |
| soul | string | optional | Soul |
| task | string | optional | Task |
| tools | string[] | optional | Tools |
| skills | string[] | optional | Skills |
| knowledge_bases | string[] | optional | Knowledge Bases |
| history_window | integer? | optional | History Window |
| max_output_tokens | integer? | optional | Max Output Tokens |
| tool_call_max_tokens | integer? | optional | Tool Call Max Tokens |
| model | string? | optional | Model |
| greeting | string? | optional | Greeting |
| auto_greeting | boolean | optional | Auto Greeting |
| auto_suggest | boolean | optional | Auto Suggest |
| suggest_prompt | string? | optional | Suggest Prompt |
| ask_forms | boolean | optional | Ask Forms |
| proactive_cta | boolean | optional | Proactive Cta |
| cta_prompt | string? | optional | Cta Prompt |
| no_match_reply | string? | optional | No Match Reply |
| reasoning | boolean | optional | Reasoning |
| grounding_required | boolean | optional | Grounding Required |
| override_name | string? | optional | Override Name |
{
"schema_version": 0,
"kind": "string",
"name": "string",
"soul": "string",
"task": "string",
"tools": [
"string"
],
"skills": [
"string"
],
"knowledge_bases": [
"string"
],
"history_window": 0,
"max_output_tokens": 0,
"tool_call_max_tokens": 0,
"model": "string",
"greeting": "string",
"auto_greeting": true,
"auto_suggest": true,
"suggest_prompt": "string",
"ask_forms": true,
"proactive_cta": true,
"cta_prompt": "string",
"no_match_reply": "string",
"reasoning": true,
"grounding_required": true,
"override_name": "string"
}| name | string | required | Name |
| id | string? | optional | Id |
| alias | string? | optional | Alias |
| soul | string | required | Soul |
| task | string | required | Task |
| tools | string[] | required | Tools |
| skills | string[] | optional | Skills |
| knowledge_bases | string[] | optional | Knowledge Bases |
| history_window | integer? | optional | History Window |
| max_output_tokens | integer? | optional | Max Output Tokens |
| tool_call_max_tokens | integer? | optional | Tool Call Max Tokens |
| model | string? | optional | Model |
| published | boolean | optional | Published |
| greeting | string? | optional | Greeting |
| auto_greeting | boolean | optional | Auto Greeting |
| auto_suggest | boolean | optional | Auto Suggest |
| suggest_prompt | string? | optional | Suggest Prompt |
| ask_forms | boolean | optional | Ask Forms |
| proactive_cta | boolean | optional | Proactive Cta |
| cta_prompt | string? | optional | Cta Prompt |
| no_match_reply | string? | optional | No Match Reply |
| reasoning | boolean | optional | Reasoning |
| grounding_required | boolean | optional | Grounding Required |
| injection_guard | boolean | optional | Injection Guard |
| public_sources | boolean | optional | Public Sources |
| ambiguity_check | boolean | optional | Ambiguity Check |
| deep_research | boolean | optional | Deep Research |
| on_demand_context | boolean | optional | On Demand Context |
| menu_items | string[]? | optional | Menu Items |
| source | string | required | Source |
{
"name": "string",
"id": "string",
"alias": "string",
"soul": "string",
"task": "string",
"tools": [
"string"
],
"skills": [
"string"
],
"knowledge_bases": [
"string"
],
"history_window": 0,
"max_output_tokens": 0,
"tool_call_max_tokens": 0,
"model": "string",
"published": true,
"greeting": "string",
"auto_greeting": true,
"auto_suggest": true,
"suggest_prompt": "string",
"ask_forms": true,
"proactive_cta": true,
"cta_prompt": "string",
"no_match_reply": "string",
"reasoning": true,
"grounding_required": true,
"injection_guard": true,
"public_sources": true,
"ambiguity_check": true,
"deep_research": true,
"on_demand_context": true,
"menu_items": [
"string"
],
"source": "string"
}Knowledge bases
Grounded, per-tenant sources, auto-retrieved every turn. Names are normalised to url-safe slugs on creation — use the returned name for documents, search and attaching.
GET/knowledge-basesList knowledge bases (with document / chunk counts).
List knowledge bases (with document / chunk counts).
| name | string | required | Name |
| kind | string | optional | Kind |
| instructions | string | required | Instructions |
| description | string | required | Description |
| max_distance | number? | required | Max Distance |
| top_k | integer? | optional | Top K |
| rerank | boolean | optional | Rerank |
| recall_eval | boolean | optional | Recall Eval |
| documents | integer | optional | Documents |
| chunks | integer | optional | Chunks |
| chunk_spread | integer[]? | optional | Chunk Spread |
| edited_chunks | integer | optional | Edited Chunks |
[
{
"name": "string",
"kind": "string",
"instructions": "string",
"description": "string",
"max_distance": 0,
"top_k": 0,
"rerank": true,
"recall_eval": true,
"documents": 0,
"chunks": 0,
"chunk_spread": [
0
],
"edited_chunks": 0
}
]DELETE/knowledge-bases/{name}Delete a KB and everything derived from it.
Delete a KB and everything derived from it.
| name | path | string | required |
Response 204 — No Content (success, empty body).
GET/knowledge-bases/{name}Get a KB's config (instructions, description, relevance floor).
Get a KB's config (instructions, description, relevance floor).
| name | path | string | required |
| name | string | required | Name |
| kind | string | optional | Kind |
| instructions | string | required | Instructions |
| description | string | required | Description |
| max_distance | number? | required | Max Distance |
| top_k | integer? | optional | Top K |
| rerank | boolean | optional | Rerank |
| recall_eval | boolean | optional | Recall Eval |
| documents | integer | optional | Documents |
| chunks | integer | optional | Chunks |
| chunk_spread | integer[]? | optional | Chunk Spread |
| edited_chunks | integer | optional | Edited Chunks |
{
"name": "string",
"kind": "string",
"instructions": "string",
"description": "string",
"max_distance": 0,
"top_k": 0,
"rerank": true,
"recall_eval": true,
"documents": 0,
"chunks": 0,
"chunk_spread": [
0
],
"edited_chunks": 0
}PATCH/knowledge-bases/{name}Patch Kb
Patch Kb
| name | path | string | required |
| instructions | string? | optional | Instructions |
| description | string? | optional | Description |
| max_distance | number? | optional | Max Distance |
| top_k | integer? | optional | Top K |
| rerank | boolean? | optional | Rerank |
| recall_eval | boolean? | optional | Recall Eval |
{
"instructions": "string",
"description": "string",
"max_distance": 0,
"top_k": 0,
"rerank": true,
"recall_eval": true
}| name | string | required | Name |
| kind | string | optional | Kind |
| instructions | string | required | Instructions |
| description | string | required | Description |
| max_distance | number? | required | Max Distance |
| top_k | integer? | optional | Top K |
| rerank | boolean | optional | Rerank |
| recall_eval | boolean | optional | Recall Eval |
| documents | integer | optional | Documents |
| chunks | integer | optional | Chunks |
| chunk_spread | integer[]? | optional | Chunk Spread |
| edited_chunks | integer | optional | Edited Chunks |
{
"name": "string",
"kind": "string",
"instructions": "string",
"description": "string",
"max_distance": 0,
"top_k": 0,
"rerank": true,
"recall_eval": true,
"documents": 0,
"chunks": 0,
"chunk_spread": [
0
],
"edited_chunks": 0
}POST/knowledge-bases/{name}Create a KB (name in the path is slugified; returned name is canonical).
Create a KB (name in the path is slugified; returned name is canonical).
| name | path | string | required |
| instructions | string | optional | Instructions |
| description | string | optional | Description |
| max_distance | number? | optional | Max Distance |
| top_k | integer? | optional | Top K |
| rerank | boolean | optional | Rerank |
| recall_eval | boolean | optional | Recall Eval |
| kind | string | optional | Kind |
{
"instructions": "string",
"description": "string",
"max_distance": 0,
"top_k": 0,
"rerank": true,
"recall_eval": true,
"kind": "string"
}| name | string | required | Name |
| kind | string | optional | Kind |
| instructions | string | required | Instructions |
| description | string | required | Description |
| max_distance | number? | required | Max Distance |
| top_k | integer? | optional | Top K |
| rerank | boolean | optional | Rerank |
| recall_eval | boolean | optional | Recall Eval |
| documents | integer | optional | Documents |
| chunks | integer | optional | Chunks |
| chunk_spread | integer[]? | optional | Chunk Spread |
| edited_chunks | integer | optional | Edited Chunks |
{
"name": "string",
"kind": "string",
"instructions": "string",
"description": "string",
"max_distance": 0,
"top_k": 0,
"rerank": true,
"recall_eval": true,
"documents": 0,
"chunks": 0,
"chunk_spread": [
0
],
"edited_chunks": 0
}curl -X POST https://api.agent4.io/v1/knowledge-bases/company-policy -H "X-API-Key: $KEY" \
-H 'Content-Type: application/json' -d '{"instructions":"Authoritative current policy; overrides industry norms."}'PUT/knowledge-bases/{name}Update a KB's config.
Update a KB's config.
| name | path | string | required |
| instructions | string | optional | Instructions |
| description | string | optional | Description |
| max_distance | number? | optional | Max Distance |
| top_k | integer? | optional | Top K |
| rerank | boolean | optional | Rerank |
| recall_eval | boolean | optional | Recall Eval |
| kind | string | optional | Kind |
{
"instructions": "string",
"description": "string",
"max_distance": 0,
"top_k": 0,
"rerank": true,
"recall_eval": true,
"kind": "string"
}| name | string | required | Name |
| kind | string | optional | Kind |
| instructions | string | required | Instructions |
| description | string | required | Description |
| max_distance | number? | required | Max Distance |
| top_k | integer? | optional | Top K |
| rerank | boolean | optional | Rerank |
| recall_eval | boolean | optional | Recall Eval |
| documents | integer | optional | Documents |
| chunks | integer | optional | Chunks |
| chunk_spread | integer[]? | optional | Chunk Spread |
| edited_chunks | integer | optional | Edited Chunks |
{
"name": "string",
"kind": "string",
"instructions": "string",
"description": "string",
"max_distance": 0,
"top_k": 0,
"rerank": true,
"recall_eval": true,
"documents": 0,
"chunks": 0,
"chunk_spread": [
0
],
"edited_chunks": 0
}GET/knowledge-bases/{name}/chunks/{chunk_id}Get Kb Chunk
Get Kb Chunk
| name | path | string | required | |
| chunk_id | path | string | required |
| id | string | required | Id |
| content | string | required | Content |
| index_text | string? | optional | Index Text |
| doc_id | string? | optional | Doc Id |
| doc_title | string? | optional | Doc Title |
| source | string? | optional | Source |
| edited_at | string? | optional | Edited At |
{
"id": "string",
"content": "string",
"index_text": "string",
"doc_id": "string",
"doc_title": "string",
"source": "string",
"edited_at": "string"
}PATCH/knowledge-bases/{name}/chunks/{chunk_id}Edit Kb Chunk
Edit Kb Chunk
| name | path | string | required | |
| chunk_id | path | string | required |
| content | string? | optional | Content |
| index_text | string? | optional | Index Text |
{
"content": "string",
"index_text": "string"
}| id | string | required | Id |
| content | string | required | Content |
| index_text | string? | optional | Index Text |
| doc_id | string? | optional | Doc Id |
| doc_title | string? | optional | Doc Title |
| source | string? | optional | Source |
| edited_at | string? | optional | Edited At |
{
"id": "string",
"content": "string",
"index_text": "string",
"doc_id": "string",
"doc_title": "string",
"source": "string",
"edited_at": "string"
}POST/knowledge-bases/{name}/chunks/searchSearch Kb Chunks
Search Kb Chunks
| name | path | string | required |
| chunk_id | string? | optional | Chunk Id |
| source | string? | optional | Source |
| text | string? | optional | Text |
| limit | integer | optional | Limit |
| edited_only | boolean | optional | Edited Only |
{
"chunk_id": "string",
"source": "string",
"text": "string",
"limit": 0,
"edited_only": true
}| id | string | required | Id |
| content | string | required | Content |
| index_text | string? | optional | Index Text |
| doc_id | string? | optional | Doc Id |
| doc_title | string? | optional | Doc Title |
| source | string? | optional | Source |
| edited_at | string? | optional | Edited At |
[
{
"id": "string",
"content": "string",
"index_text": "string",
"doc_id": "string",
"doc_title": "string",
"source": "string",
"edited_at": "string"
}
]GET/knowledge-bases/{name}/documentsList documents (optionally ?tag=).
List documents (optionally ?tag=).
| name | path | string | required | |
| tag | query | string? | optional |
| id | string | required | Id |
| title | string | required | Title |
| source | string? | required | Source |
| tags | string[] | optional | Tags |
| chunks | integer | optional | Chunks |
[
{
"id": "string",
"title": "string",
"source": "string",
"tags": [
"string"
],
"chunks": 0
}
]POST/knowledge-bases/{name}/documentsAdd a text document (chunked + embedded synchronously).
Add a text document (chunked + embedded synchronously).
| name | path | string | required |
| title | string | required | Title |
| content | string | required | Content |
| source | string? | optional | Source |
| no_chunk | boolean | optional | No Chunk |
{
"title": "string",
"content": "string",
"source": "string",
"no_chunk": true
}| document_id | string | required | Document Id |
| chunks | integer | required | Chunks |
| imported | integer | optional | Imported |
| chunked_anyway | string[] | optional | Chunked Anyway |
{
"document_id": "string",
"chunks": 0,
"imported": 0,
"chunked_anyway": [
"string"
]
}DELETE/knowledge-bases/{name}/documents/{doc_id}Delete a document (and its chunks).
Delete a document (and its chunks).
| name | path | string | required | |
| doc_id | path | string | required |
Response 204 — No Content (success, empty body).
GET/knowledge-bases/{name}/documents/{doc_id}/chunksList Document Chunks
List Document Chunks
| name | path | string | required | |
| doc_id | path | string | required |
| id | string | required | Id |
| content | string | required | Content |
| index_text | string? | optional | Index Text |
| doc_id | string? | optional | Doc Id |
| doc_title | string? | optional | Doc Title |
| source | string? | optional | Source |
| edited_at | string? | optional | Edited At |
[
{
"id": "string",
"content": "string",
"index_text": "string",
"doc_id": "string",
"doc_title": "string",
"source": "string",
"edited_at": "string"
}
]PATCH/knowledge-bases/{name}/documents/{doc_id}/tagsSet a document's organisation tags.
Set a document's organisation tags.
| name | path | string | required | |
| doc_id | path | string | required |
| tags | string[] | required | Tags |
{
"tags": [
"string"
]
}| id | string | required | Id |
| title | string | required | Title |
| source | string? | required | Source |
| tags | string[] | optional | Tags |
| chunks | integer | optional | Chunks |
{
"id": "string",
"title": "string",
"source": "string",
"tags": [
"string"
],
"chunks": 0
}POST/knowledge-bases/{name}/documents/inspectInspect Upload
Inspect Upload
| name | path | string | required |
| file | string | required | File |
{
"file": "string"
}Response 200 · object — unstructured JSON (no fixed schema).
POST/knowledge-bases/{name}/documents/uploadUpload a file (pdf/docx/md/html/txt) or a zip of a folder — subfolders are walked.
Upload a file (pdf/docx/md/html/txt) or a zip of a folder — subfolders are walked.
| name | path | string | required |
| file | string | required | File |
| title | string? | optional | Title |
| no_chunk | boolean | optional | No Chunk |
{
"file": "string",
"title": "string",
"no_chunk": true
}| document_id | string | required | Document Id |
| chunks | integer | required | Chunks |
| imported | integer | optional | Imported |
| chunked_anyway | string[] | optional | Chunked Anyway |
{
"document_id": "string",
"chunks": 0,
"imported": 0,
"chunked_anyway": [
"string"
]
}curl -X POST "https://api.agent4.io/v1/knowledge-bases/company-policy/documents/upload" \ -H "X-API-Key: $KEY" -F "file=@/path/to/policy.pdf"
POST/knowledge-bases/{name}/documents/upload/streamUpload Kb Archive Stream
Upload Kb Archive Stream
| name | path | string | required |
| file | string | required | File |
| no_chunk | boolean | optional | No Chunk |
{
"file": "string",
"no_chunk": true
}Response 200 · any
"…"
GET/knowledge-bases/{name}/indexGet Kb Index
Get Kb Index
| name | path | string | required |
Response 200 · object — unstructured JSON (no fixed schema).
POST/knowledge-bases/{name}/index/buildBuild Kb Index
Build Kb Index
| name | path | string | required |
Response 200 · object — unstructured JSON (no fixed schema).
POST/knowledge-bases/{name}/index/schemaPatch Kb Index Schema
Patch Kb Index Schema
| name | path | string | required |
| request | string | required | Request |
| apply | boolean | optional | Apply |
{
"request": "string",
"apply": true
}Response 200 · object — unstructured JSON (no fixed schema).
GET/knowledge-bases/{name}/productsList catalog products (kind=catalog KB).
List catalog products (kind=catalog KB).
| name | path | string | required |
| id | string | required | Id |
| name | string | required | Name |
| description | string | required | Description |
| price | string? | required | Price |
| availability | string? | required | Availability |
| category | string? | required | Category |
| tags | string[] | required | Tags |
| image_url | string? | required | Image Url |
| image_urls | string[] | required | Image Urls |
| link | string? | required | Link |
| source | string | required | Source |
[
{
"id": "string",
"name": "string",
"description": "string",
"price": "string",
"availability": "string",
"category": "string",
"tags": [
"string"
],
"image_url": "string",
"image_urls": [
"string"
],
"link": "string",
"source": "string"
}
]POST/knowledge-bases/{name}/productsAdd a product to a catalog KB.
Add a product to a catalog KB.
| name | path | string | required |
| name | string | required | Name |
| description | string | optional | Description |
| price | string? | optional | Price |
| availability | string? | optional | Availability |
| category | string? | optional | Category |
| tags | string[] | optional | Tags |
| image_url | string? | optional | Image Url |
| image_urls | string[] | optional | Image Urls |
| link | string? | optional | Link |
{
"name": "string",
"description": "string",
"price": "string",
"availability": "string",
"category": "string",
"tags": [
"string"
],
"image_url": "string",
"image_urls": [
"string"
],
"link": "string"
}| id | string | required | Id |
| name | string | required | Name |
| description | string | required | Description |
| price | string? | required | Price |
| availability | string? | required | Availability |
| category | string? | required | Category |
| tags | string[] | required | Tags |
| image_url | string? | required | Image Url |
| image_urls | string[] | required | Image Urls |
| link | string? | required | Link |
| source | string | required | Source |
{
"id": "string",
"name": "string",
"description": "string",
"price": "string",
"availability": "string",
"category": "string",
"tags": [
"string"
],
"image_url": "string",
"image_urls": [
"string"
],
"link": "string",
"source": "string"
}DELETE/knowledge-bases/{name}/products/{product_id}Delete a product.
Delete a product.
| name | path | string | required | |
| product_id | path | string | required |
Response 204 — No Content (success, empty body).
PUT/knowledge-bases/{name}/products/{product_id}Update a product.
Update a product.
| name | path | string | required | |
| product_id | path | string | required |
| name | string | required | Name |
| description | string | optional | Description |
| price | string? | optional | Price |
| availability | string? | optional | Availability |
| category | string? | optional | Category |
| tags | string[] | optional | Tags |
| image_url | string? | optional | Image Url |
| image_urls | string[] | optional | Image Urls |
| link | string? | optional | Link |
{
"name": "string",
"description": "string",
"price": "string",
"availability": "string",
"category": "string",
"tags": [
"string"
],
"image_url": "string",
"image_urls": [
"string"
],
"link": "string"
}| id | string | required | Id |
| name | string | required | Name |
| description | string | required | Description |
| price | string? | required | Price |
| availability | string? | required | Availability |
| category | string? | required | Category |
| tags | string[] | required | Tags |
| image_url | string? | required | Image Url |
| image_urls | string[] | required | Image Urls |
| link | string? | required | Link |
| source | string | required | Source |
{
"id": "string",
"name": "string",
"description": "string",
"price": "string",
"availability": "string",
"category": "string",
"tags": [
"string"
],
"image_url": "string",
"image_urls": [
"string"
],
"link": "string",
"source": "string"
}POST/knowledge-bases/{name}/products/importBulk-import products.
Bulk-import products.
| name | path | string | required |
| url | string? | optional | Url |
| file | string? | optional | File |
{
"url": "string",
"file": "string"
}Response 200 · object — unstructured JSON (no fixed schema).
POST/knowledge-bases/{name}/purgePurge Kb
Purge Kb
| name | path | string | required |
| confirm_name | string | required | Confirm Name |
{
"confirm_name": "string"
}Response 200 · object — unstructured JSON (no fixed schema).
POST/knowledge-bases/{name}/searchSearch — the same retrieval a live chat uses; verify a real question retrieves before relying on it.
Search — the same retrieval a live chat uses; verify a real question retrieves before relying on it.
| name | path | string | required |
| query | string | required | Query |
| k | integer? | optional | K |
{
"query": "string",
"k": 0
}| kb | string | required | Kb |
| content | string | required | Content |
| distance | number | required | Distance |
| index_text | string? | optional | Index Text |
[
{
"kb": "string",
"content": "string",
"distance": 0,
"index_text": "string"
}
]curl -X POST "https://api.agent4.io/v1/knowledge-bases/company-policy/search" -H "X-API-Key: $KEY" \
-H 'Content-Type: application/json' -d '{"query":"late fee"}'POST/manage/knowledge-bases/{name}/crawlStart crawling a website into the KB (discovery only; no tokens spent yet).
Start crawling a website into the KB (discovery only; no tokens spent yet).
| name | path | string | required |
| url | string | required | Url |
| path_prefix | string? | optional | Path Prefix |
| max_depth | integer | optional | Max Depth |
| max_pages | integer | optional | Max Pages |
{
"url": "string",
"path_prefix": "string",
"max_depth": 0,
"max_pages": 0
}| id | string | required | Id |
| knowledge_base | string | required | Knowledge Base |
| start_url | string | required | Start Url |
| status | string | required | Status |
| error_code | string? | required | Error Code |
| error | string? | required | Error |
| discovered | integer | required | Discovered |
| fetched | integer | required | Fetched |
| embedded | integer | required | Embedded |
| skipped | integer | required | Skipped |
| flagged | integer | required | Flagged |
| total_chars | integer | required | Total Chars |
| estimated_tokens | integer | required | Estimated Tokens |
| tokens_used | integer | required | Tokens Used |
| created_at | string | required | Created At |
| finished_at | string? | required | Finished At |
{
"id": "string",
"knowledge_base": "string",
"start_url": "string",
"status": "string",
"error_code": "string",
"error": "string",
"discovered": 0,
"fetched": 0,
"embedded": 0,
"skipped": 0,
"flagged": 0,
"total_chars": 0,
"estimated_tokens": 0,
"tokens_used": 0,
"created_at": "string",
"finished_at": "string"
}GET/manage/knowledge-bases/{name}/graph3D projection (knowledge starmap) of the KB's chunks.
3D projection (knowledge starmap) of the KB's chunks.
| name | path | string | required | |
| limit | query | integer? | optional | |
| refresh | query | boolean | optional | |
| q | query | string | optional | |
| stream | query | boolean | optional |
Response 200 · object — unstructured JSON (no fixed schema).
Skills
Load-on-demand procedures. description says WHEN (one line, in the prompt every turn); instructions is the full guide (fetched only when the skill loads).
GET/skillsList skills.
List skills.
| name | string | required | Name |
| description | string | required | Description |
| instructions | string | required | Instructions |
| tools | string[] | required | Tools |
| knowledge_bases | string[] | optional | Knowledge Bases |
| model | string? | optional | Model |
| menu_label | string? | optional | Menu Label |
| menu_prompt | string? | optional | Menu Prompt |
| menu_anchors | string? | optional | Menu Anchors |
| warnings | object[] | optional | Warnings |
[
{
"name": "string",
"description": "string",
"instructions": "string",
"tools": [
"string"
],
"knowledge_bases": [
"string"
],
"model": "string",
"menu_label": "string",
"menu_prompt": "string",
"menu_anchors": "string",
"warnings": [
{}
]
}
]DELETE/skills/{name}Delete a skill.
Delete a skill.
| name | path | string | required |
Response 204 — No Content (success, empty body).
GET/skills/{name}Get a skill (with full instructions).
Get a skill (with full instructions).
| name | path | string | required |
| name | string | required | Name |
| description | string | required | Description |
| instructions | string | required | Instructions |
| tools | string[] | required | Tools |
| knowledge_bases | string[] | optional | Knowledge Bases |
| model | string? | optional | Model |
| menu_label | string? | optional | Menu Label |
| menu_prompt | string? | optional | Menu Prompt |
| menu_anchors | string? | optional | Menu Anchors |
| warnings | object[] | optional | Warnings |
{
"name": "string",
"description": "string",
"instructions": "string",
"tools": [
"string"
],
"knowledge_bases": [
"string"
],
"model": "string",
"menu_label": "string",
"menu_prompt": "string",
"menu_anchors": "string",
"warnings": [
{}
]
}PATCH/skills/{name}Partial update (404 if it does not exist).
Partial update (404 if it does not exist).
| name | path | string | required |
| description | string? | optional | Description |
| instructions | string? | optional | Instructions |
| tools | string[]? | optional | Tools |
| tools_add | string[]? | optional | Tools Add |
| tools_remove | string[]? | optional | Tools Remove |
| knowledge_bases | string[]? | optional | Knowledge Bases |
| model | string? | optional | Model |
| menu_label | string? | optional | Menu Label |
| menu_prompt | string? | optional | Menu Prompt |
| menu_anchors | string? | optional | Menu Anchors |
{
"description": "string",
"instructions": "string",
"tools": [
"string"
],
"tools_add": [
"string"
],
"tools_remove": [
"string"
],
"knowledge_bases": [
"string"
],
"model": "string",
"menu_label": "string",
"menu_prompt": "string",
"menu_anchors": "string"
}| name | string | required | Name |
| description | string | required | Description |
| instructions | string | required | Instructions |
| tools | string[] | required | Tools |
| knowledge_bases | string[] | optional | Knowledge Bases |
| model | string? | optional | Model |
| menu_label | string? | optional | Menu Label |
| menu_prompt | string? | optional | Menu Prompt |
| menu_anchors | string? | optional | Menu Anchors |
| warnings | object[] | optional | Warnings |
{
"name": "string",
"description": "string",
"instructions": "string",
"tools": [
"string"
],
"knowledge_bases": [
"string"
],
"model": "string",
"menu_label": "string",
"menu_prompt": "string",
"menu_anchors": "string",
"warnings": [
{}
]
}POST/skills/{name}Create a skill.
Create a skill.
| name | path | string | required |
| description | string | optional | Description |
| instructions | string | optional | Instructions |
| tools | string[] | optional | Tools |
| knowledge_bases | string[] | optional | Knowledge Bases |
| model | string? | optional | Model |
| menu_label | string? | optional | Menu Label |
| menu_prompt | string? | optional | Menu Prompt |
| menu_anchors | string? | optional | Menu Anchors |
{
"description": "string",
"instructions": "string",
"tools": [
"string"
],
"knowledge_bases": [
"string"
],
"model": "string",
"menu_label": "string",
"menu_prompt": "string",
"menu_anchors": "string"
}| name | string | required | Name |
| description | string | required | Description |
| instructions | string | required | Instructions |
| tools | string[] | required | Tools |
| knowledge_bases | string[] | optional | Knowledge Bases |
| model | string? | optional | Model |
| menu_label | string? | optional | Menu Label |
| menu_prompt | string? | optional | Menu Prompt |
| menu_anchors | string? | optional | Menu Anchors |
| warnings | object[] | optional | Warnings |
{
"name": "string",
"description": "string",
"instructions": "string",
"tools": [
"string"
],
"knowledge_bases": [
"string"
],
"model": "string",
"menu_label": "string",
"menu_prompt": "string",
"menu_anchors": "string",
"warnings": [
{}
]
}curl -X POST https://api.agent4.io/v1/skills/booking -H "X-API-Key: $KEY" -H 'Content-Type: application/json' \
-d '{"description":"Use when the visitor wants to book.","instructions":"Collect party size, date+time, duration; never confirm the slot."}'PUT/skills/{name}Replace a skill.
Replace a skill.
| name | path | string | required |
| description | string | optional | Description |
| instructions | string | optional | Instructions |
| tools | string[] | optional | Tools |
| knowledge_bases | string[] | optional | Knowledge Bases |
| model | string? | optional | Model |
| menu_label | string? | optional | Menu Label |
| menu_prompt | string? | optional | Menu Prompt |
| menu_anchors | string? | optional | Menu Anchors |
{
"description": "string",
"instructions": "string",
"tools": [
"string"
],
"knowledge_bases": [
"string"
],
"model": "string",
"menu_label": "string",
"menu_prompt": "string",
"menu_anchors": "string"
}| name | string | required | Name |
| description | string | required | Description |
| instructions | string | required | Instructions |
| tools | string[] | required | Tools |
| knowledge_bases | string[] | optional | Knowledge Bases |
| model | string? | optional | Model |
| menu_label | string? | optional | Menu Label |
| menu_prompt | string? | optional | Menu Prompt |
| menu_anchors | string? | optional | Menu Anchors |
| warnings | object[] | optional | Warnings |
{
"name": "string",
"description": "string",
"instructions": "string",
"tools": [
"string"
],
"knowledge_bases": [
"string"
],
"model": "string",
"menu_label": "string",
"menu_prompt": "string",
"menu_anchors": "string",
"warnings": [
{}
]
}GET/skills/{name}/revisionsSkill revision history.
Skill revision history.
| name | path | string | required |
| id | string | required | Id |
| created_at | string | required | Created At |
| actor | string? | optional | Actor |
| snapshot | object | required | Snapshot |
[
{
"id": "string",
"created_at": "string",
"actor": "string",
"snapshot": {}
}
]POST/skills/{name}/revisions/{rev_id}/restoreRestore a skill revision.
Restore a skill revision.
| name | path | string | required | |
| rev_id | path | string | required |
| name | string | required | Name |
| description | string | required | Description |
| instructions | string | required | Instructions |
| tools | string[] | required | Tools |
| knowledge_bases | string[] | optional | Knowledge Bases |
| model | string? | optional | Model |
| menu_label | string? | optional | Menu Label |
| menu_prompt | string? | optional | Menu Prompt |
| menu_anchors | string? | optional | Menu Anchors |
| warnings | object[] | optional | Warnings |
{
"name": "string",
"description": "string",
"instructions": "string",
"tools": [
"string"
],
"knowledge_bases": [
"string"
],
"model": "string",
"menu_label": "string",
"menu_prompt": "string",
"menu_anchors": "string",
"warnings": [
{}
]
}Storylines
Multi-step, stateful, guided flows (a graph of nodes with conditional exits). See the cookbook for the graph shape.
GET/storylinesList storylines (optionally ?agent=).
List storylines (optionally ?agent=).
| agent | query | string? | optional |
| id | string | required | Id |
| agent_name | string | required | Agent Name |
| key | string | required | Key |
| name | string | required | Name |
| description | string | required | Description |
| graph | object | required | Graph |
| profile_schema | object | required | Profile Schema |
| status | string | required | Status |
| published_revision_id | string? | required | Published Revision Id |
| is_default | boolean | required | Is Default |
| user_visibility | string | required | User Visibility |
| entry | string | optional | Entry |
| display_name | string | optional | Display Name |
| allow_exit | boolean | optional | Allow Exit |
| show_profile | boolean | optional | Show Profile |
| on_complete | string | required | On Complete |
| allow_agent_enroll | boolean | required | Allow Agent Enroll |
| enroll_trigger | string | required | Enroll Trigger |
| concurrency | string | optional | Concurrency |
| next_storyline_id | string? | required | Next Storyline Id |
| position | integer | required | Position |
| version | integer | required | Version |
| updated_at | string | required | Updated At |
[
{
"id": "string",
"agent_name": "string",
"key": "string",
"name": "string",
"description": "string",
"graph": {},
"profile_schema": {},
"status": "string",
"published_revision_id": "string",
"is_default": true,
"user_visibility": "string",
"entry": "string",
"display_name": "string",
"allow_exit": true,
"show_profile": true,
"on_complete": "string",
"allow_agent_enroll": true,
"enroll_trigger": "string",
"concurrency": "string",
"next_storyline_id": "string",
"position": 0,
"version": 0,
"updated_at": "string"
}
]POST/storylinesCreate a Storyline draft.
Create a Storyline draft.
| agent_name | string | required | Agent Name |
| key | string | required | Key |
| name | string | optional | Name |
| description | string | optional | Description |
| graph | object | optional | Graph |
| profile_schema | object | optional | Profile Schema |
| is_default | boolean | optional | Is Default |
| user_visibility | string | optional | User Visibility |
| learner_visibility | string? | optional | Learner Visibility |
| entry | string | optional | Entry |
| display_name | string | optional | Display Name |
| allow_exit | boolean | optional | Allow Exit |
| show_profile | boolean | optional | Show Profile |
| on_complete | string | optional | On Complete |
| allow_agent_enroll | boolean | optional | Allow Agent Enroll |
| enroll_trigger | string | optional | Enroll Trigger |
| concurrency | string | optional | Concurrency |
| next_storyline_id | string? | optional | Next Storyline Id |
| position | integer | optional | Position |
| expected_version | integer? | optional | Expected Version |
{
"agent_name": "string",
"key": "string",
"name": "string",
"description": "string",
"graph": {},
"profile_schema": {},
"is_default": true,
"user_visibility": "string",
"learner_visibility": "string",
"entry": "string",
"display_name": "string",
"allow_exit": true,
"show_profile": true,
"on_complete": "string",
"allow_agent_enroll": true,
"enroll_trigger": "string",
"concurrency": "string",
"next_storyline_id": "string",
"position": 0,
"expected_version": 0
}| id | string | required | Id |
| agent_name | string | required | Agent Name |
| key | string | required | Key |
| name | string | required | Name |
| description | string | required | Description |
| graph | object | required | Graph |
| profile_schema | object | required | Profile Schema |
| status | string | required | Status |
| published_revision_id | string? | required | Published Revision Id |
| is_default | boolean | required | Is Default |
| user_visibility | string | required | User Visibility |
| entry | string | optional | Entry |
| display_name | string | optional | Display Name |
| allow_exit | boolean | optional | Allow Exit |
| show_profile | boolean | optional | Show Profile |
| on_complete | string | required | On Complete |
| allow_agent_enroll | boolean | required | Allow Agent Enroll |
| enroll_trigger | string | required | Enroll Trigger |
| concurrency | string | optional | Concurrency |
| next_storyline_id | string? | required | Next Storyline Id |
| position | integer | required | Position |
| version | integer | required | Version |
| updated_at | string | required | Updated At |
{
"id": "string",
"agent_name": "string",
"key": "string",
"name": "string",
"description": "string",
"graph": {},
"profile_schema": {},
"status": "string",
"published_revision_id": "string",
"is_default": true,
"user_visibility": "string",
"entry": "string",
"display_name": "string",
"allow_exit": true,
"show_profile": true,
"on_complete": "string",
"allow_agent_enroll": true,
"enroll_trigger": "string",
"concurrency": "string",
"next_storyline_id": "string",
"position": 0,
"version": 0,
"updated_at": "string"
}DELETE/storylines/{storyline_id}Delete Storyline
Delete Storyline
| storyline_id | path | string | required |
Response 204 — No Content (success, empty body).
GET/storylines/{storyline_id}Get Storyline
Get Storyline
| storyline_id | path | string | required |
| id | string | required | Id |
| agent_name | string | required | Agent Name |
| key | string | required | Key |
| name | string | required | Name |
| description | string | required | Description |
| graph | object | required | Graph |
| profile_schema | object | required | Profile Schema |
| status | string | required | Status |
| published_revision_id | string? | required | Published Revision Id |
| is_default | boolean | required | Is Default |
| user_visibility | string | required | User Visibility |
| entry | string | optional | Entry |
| display_name | string | optional | Display Name |
| allow_exit | boolean | optional | Allow Exit |
| show_profile | boolean | optional | Show Profile |
| on_complete | string | required | On Complete |
| allow_agent_enroll | boolean | required | Allow Agent Enroll |
| enroll_trigger | string | required | Enroll Trigger |
| concurrency | string | optional | Concurrency |
| next_storyline_id | string? | required | Next Storyline Id |
| position | integer | required | Position |
| version | integer | required | Version |
| updated_at | string | required | Updated At |
{
"id": "string",
"agent_name": "string",
"key": "string",
"name": "string",
"description": "string",
"graph": {},
"profile_schema": {},
"status": "string",
"published_revision_id": "string",
"is_default": true,
"user_visibility": "string",
"entry": "string",
"display_name": "string",
"allow_exit": true,
"show_profile": true,
"on_complete": "string",
"allow_agent_enroll": true,
"enroll_trigger": "string",
"concurrency": "string",
"next_storyline_id": "string",
"position": 0,
"version": 0,
"updated_at": "string"
}PUT/storylines/{storyline_id}Update Storyline
Update Storyline
| storyline_id | path | string | required |
| agent_name | string | required | Agent Name |
| key | string | required | Key |
| name | string | optional | Name |
| description | string | optional | Description |
| graph | object | optional | Graph |
| profile_schema | object | optional | Profile Schema |
| is_default | boolean | optional | Is Default |
| user_visibility | string | optional | User Visibility |
| learner_visibility | string? | optional | Learner Visibility |
| entry | string | optional | Entry |
| display_name | string | optional | Display Name |
| allow_exit | boolean | optional | Allow Exit |
| show_profile | boolean | optional | Show Profile |
| on_complete | string | optional | On Complete |
| allow_agent_enroll | boolean | optional | Allow Agent Enroll |
| enroll_trigger | string | optional | Enroll Trigger |
| concurrency | string | optional | Concurrency |
| next_storyline_id | string? | optional | Next Storyline Id |
| position | integer | optional | Position |
| expected_version | integer? | optional | Expected Version |
{
"agent_name": "string",
"key": "string",
"name": "string",
"description": "string",
"graph": {},
"profile_schema": {},
"is_default": true,
"user_visibility": "string",
"learner_visibility": "string",
"entry": "string",
"display_name": "string",
"allow_exit": true,
"show_profile": true,
"on_complete": "string",
"allow_agent_enroll": true,
"enroll_trigger": "string",
"concurrency": "string",
"next_storyline_id": "string",
"position": 0,
"expected_version": 0
}| id | string | required | Id |
| agent_name | string | required | Agent Name |
| key | string | required | Key |
| name | string | required | Name |
| description | string | required | Description |
| graph | object | required | Graph |
| profile_schema | object | required | Profile Schema |
| status | string | required | Status |
| published_revision_id | string? | required | Published Revision Id |
| is_default | boolean | required | Is Default |
| user_visibility | string | required | User Visibility |
| entry | string | optional | Entry |
| display_name | string | optional | Display Name |
| allow_exit | boolean | optional | Allow Exit |
| show_profile | boolean | optional | Show Profile |
| on_complete | string | required | On Complete |
| allow_agent_enroll | boolean | required | Allow Agent Enroll |
| enroll_trigger | string | required | Enroll Trigger |
| concurrency | string | optional | Concurrency |
| next_storyline_id | string? | required | Next Storyline Id |
| position | integer | required | Position |
| version | integer | required | Version |
| updated_at | string | required | Updated At |
{
"id": "string",
"agent_name": "string",
"key": "string",
"name": "string",
"description": "string",
"graph": {},
"profile_schema": {},
"status": "string",
"published_revision_id": "string",
"is_default": true,
"user_visibility": "string",
"entry": "string",
"display_name": "string",
"allow_exit": true,
"show_profile": true,
"on_complete": "string",
"allow_agent_enroll": true,
"enroll_trigger": "string",
"concurrency": "string",
"next_storyline_id": "string",
"position": 0,
"version": 0,
"updated_at": "string"
}POST/storylines/{storyline_id}/cloneClone Storyline
Clone Storyline
| storyline_id | path | string | required |
| id | string | required | Id |
| agent_name | string | required | Agent Name |
| key | string | required | Key |
| name | string | required | Name |
| description | string | required | Description |
| graph | object | required | Graph |
| profile_schema | object | required | Profile Schema |
| status | string | required | Status |
| published_revision_id | string? | required | Published Revision Id |
| is_default | boolean | required | Is Default |
| user_visibility | string | required | User Visibility |
| entry | string | optional | Entry |
| display_name | string | optional | Display Name |
| allow_exit | boolean | optional | Allow Exit |
| show_profile | boolean | optional | Show Profile |
| on_complete | string | required | On Complete |
| allow_agent_enroll | boolean | required | Allow Agent Enroll |
| enroll_trigger | string | required | Enroll Trigger |
| concurrency | string | optional | Concurrency |
| next_storyline_id | string? | required | Next Storyline Id |
| position | integer | required | Position |
| version | integer | required | Version |
| updated_at | string | required | Updated At |
{
"id": "string",
"agent_name": "string",
"key": "string",
"name": "string",
"description": "string",
"graph": {},
"profile_schema": {},
"status": "string",
"published_revision_id": "string",
"is_default": true,
"user_visibility": "string",
"entry": "string",
"display_name": "string",
"allow_exit": true,
"show_profile": true,
"on_complete": "string",
"allow_agent_enroll": true,
"enroll_trigger": "string",
"concurrency": "string",
"next_storyline_id": "string",
"position": 0,
"version": 0,
"updated_at": "string"
}GET/storylines/{storyline_id}/enrollmentsList Enrollments
List Enrollments
| storyline_id | path | string | required |
| id | string | required | Id |
| user_id | string | required | User Id |
| current_node_key | string | required | Current Node Key |
| status | string | required | Status |
| entered_node_at | string | required | Entered Node At |
| updated_at | string | required | Updated At |
[
{
"id": "string",
"user_id": "string",
"current_node_key": "string",
"status": "string",
"entered_node_at": "string",
"updated_at": "string"
}
]POST/storylines/{storyline_id}/enrollments/migrateMigrate Enrollments
Migrate Enrollments
| storyline_id | path | string | required |
| action | string | required | Action |
| from_node | string? | optional | From Node |
| to_node | string? | optional | To Node |
{
"action": "string",
"from_node": "string",
"to_node": "string"
}Response 200 · object — unstructured JSON (no fixed schema).
GET/storylines/{storyline_id}/exportExport Storyline
Export Storyline
| storyline_id | path | string | required |
| schema_version | integer | required | Schema Version |
| kind | string | optional | Kind |
| key | string | required | Key |
| name | string | required | Name |
| description | string | required | Description |
| agent_name | string | required | Agent Name |
| graph | object | required | Graph |
| profile_schema | object | required | Profile Schema |
| is_default | boolean | required | Is Default |
| user_visibility | string | required | User Visibility |
| entry | string | optional | Entry |
| display_name | string | optional | Display Name |
| allow_exit | boolean | optional | Allow Exit |
| show_profile | boolean | optional | Show Profile |
| on_complete | string | required | On Complete |
| allow_agent_enroll | boolean | required | Allow Agent Enroll |
| enroll_trigger | string | required | Enroll Trigger |
{
"schema_version": 0,
"kind": "string",
"key": "string",
"name": "string",
"description": "string",
"agent_name": "string",
"graph": {},
"profile_schema": {},
"is_default": true,
"user_visibility": "string",
"entry": "string",
"display_name": "string",
"allow_exit": true,
"show_profile": true,
"on_complete": "string",
"allow_agent_enroll": true,
"enroll_trigger": "string"
}GET/storylines/{storyline_id}/funnelStoryline Funnel
Storyline Funnel
| storyline_id | path | string | required |
| nodes | object | required | Nodes |
{
"nodes": {}
}POST/storylines/{storyline_id}/publishPublish Storyline
Publish Storyline
| storyline_id | path | string | required |
| id | string | required | Id |
| agent_name | string | required | Agent Name |
| key | string | required | Key |
| name | string | required | Name |
| description | string | required | Description |
| graph | object | required | Graph |
| profile_schema | object | required | Profile Schema |
| status | string | required | Status |
| published_revision_id | string? | required | Published Revision Id |
| is_default | boolean | required | Is Default |
| user_visibility | string | required | User Visibility |
| entry | string | optional | Entry |
| display_name | string | optional | Display Name |
| allow_exit | boolean | optional | Allow Exit |
| show_profile | boolean | optional | Show Profile |
| on_complete | string | required | On Complete |
| allow_agent_enroll | boolean | required | Allow Agent Enroll |
| enroll_trigger | string | required | Enroll Trigger |
| concurrency | string | optional | Concurrency |
| next_storyline_id | string? | required | Next Storyline Id |
| position | integer | required | Position |
| version | integer | required | Version |
| updated_at | string | required | Updated At |
{
"id": "string",
"agent_name": "string",
"key": "string",
"name": "string",
"description": "string",
"graph": {},
"profile_schema": {},
"status": "string",
"published_revision_id": "string",
"is_default": true,
"user_visibility": "string",
"entry": "string",
"display_name": "string",
"allow_exit": true,
"show_profile": true,
"on_complete": "string",
"allow_agent_enroll": true,
"enroll_trigger": "string",
"concurrency": "string",
"next_storyline_id": "string",
"position": 0,
"version": 0,
"updated_at": "string"
}GET/storylines/{storyline_id}/revisionsList Revisions
List Revisions
| storyline_id | path | string | required |
| id | string | required | Id |
| version | integer | required | Version |
| actor | string? | required | Actor |
| created_at | string | required | Created At |
[
{
"id": "string",
"version": 0,
"actor": "string",
"created_at": "string"
}
]POST/storylines/{storyline_id}/unpublishUnpublish Storyline
Unpublish Storyline
| storyline_id | path | string | required |
| id | string | required | Id |
| agent_name | string | required | Agent Name |
| key | string | required | Key |
| name | string | required | Name |
| description | string | required | Description |
| graph | object | required | Graph |
| profile_schema | object | required | Profile Schema |
| status | string | required | Status |
| published_revision_id | string? | required | Published Revision Id |
| is_default | boolean | required | Is Default |
| user_visibility | string | required | User Visibility |
| entry | string | optional | Entry |
| display_name | string | optional | Display Name |
| allow_exit | boolean | optional | Allow Exit |
| show_profile | boolean | optional | Show Profile |
| on_complete | string | required | On Complete |
| allow_agent_enroll | boolean | required | Allow Agent Enroll |
| enroll_trigger | string | required | Enroll Trigger |
| concurrency | string | optional | Concurrency |
| next_storyline_id | string? | required | Next Storyline Id |
| position | integer | required | Position |
| version | integer | required | Version |
| updated_at | string | required | Updated At |
{
"id": "string",
"agent_name": "string",
"key": "string",
"name": "string",
"description": "string",
"graph": {},
"profile_schema": {},
"status": "string",
"published_revision_id": "string",
"is_default": true,
"user_visibility": "string",
"entry": "string",
"display_name": "string",
"allow_exit": true,
"show_profile": true,
"on_complete": "string",
"allow_agent_enroll": true,
"enroll_trigger": "string",
"concurrency": "string",
"next_storyline_id": "string",
"position": 0,
"version": 0,
"updated_at": "string"
}POST/storylines/{storyline_id}/validateValidate Storyline
Validate Storyline
| storyline_id | path | string | required |
| ok | boolean | required | Ok |
| errors | object[] | required | Errors |
{
"ok": true,
"errors": [
{}
]
}GET/storylines/featureStoryline Feature
Storyline Feature
Response 200 · object — unstructured JSON (no fixed schema).
POST/storylines/importImport a Storyline JSON as a draft.
Import a Storyline JSON as a draft.
| schema_version | integer | optional | Schema Version |
| key | string | optional | Key |
| name | string | optional | Name |
| description | string | optional | Description |
| agent_name | string | optional | Agent Name |
| graph | object | optional | Graph |
| profile_schema | object | optional | Profile Schema |
| user_visibility | string | optional | User Visibility |
| learner_visibility | string? | optional | Learner Visibility |
| entry | string | optional | Entry |
| display_name | string | optional | Display Name |
| allow_exit | boolean | optional | Allow Exit |
| show_profile | boolean | optional | Show Profile |
| on_complete | string | optional | On Complete |
| allow_agent_enroll | boolean | optional | Allow Agent Enroll |
| enroll_trigger | string | optional | Enroll Trigger |
| override_agent_name | string? | optional | Override Agent Name |
{
"schema_version": 0,
"key": "string",
"name": "string",
"description": "string",
"agent_name": "string",
"graph": {},
"profile_schema": {},
"user_visibility": "string",
"learner_visibility": "string",
"entry": "string",
"display_name": "string",
"allow_exit": true,
"show_profile": true,
"on_complete": "string",
"allow_agent_enroll": true,
"enroll_trigger": "string",
"override_agent_name": "string"
}| id | string | required | Id |
| agent_name | string | required | Agent Name |
| key | string | required | Key |
| name | string | required | Name |
| description | string | required | Description |
| graph | object | required | Graph |
| profile_schema | object | required | Profile Schema |
| status | string | required | Status |
| published_revision_id | string? | required | Published Revision Id |
| is_default | boolean | required | Is Default |
| user_visibility | string | required | User Visibility |
| entry | string | optional | Entry |
| display_name | string | optional | Display Name |
| allow_exit | boolean | optional | Allow Exit |
| show_profile | boolean | optional | Show Profile |
| on_complete | string | required | On Complete |
| allow_agent_enroll | boolean | required | Allow Agent Enroll |
| enroll_trigger | string | required | Enroll Trigger |
| concurrency | string | optional | Concurrency |
| next_storyline_id | string? | required | Next Storyline Id |
| position | integer | required | Position |
| version | integer | required | Version |
| updated_at | string | required | Updated At |
{
"id": "string",
"agent_name": "string",
"key": "string",
"name": "string",
"description": "string",
"graph": {},
"profile_schema": {},
"status": "string",
"published_revision_id": "string",
"is_default": true,
"user_visibility": "string",
"entry": "string",
"display_name": "string",
"allow_exit": true,
"show_profile": true,
"on_complete": "string",
"allow_agent_enroll": true,
"enroll_trigger": "string",
"concurrency": "string",
"next_storyline_id": "string",
"position": 0,
"version": 0,
"updated_at": "string"
}Your MCP servers & tools
Bring your own tools: register a remote MCP server, then attach its tools to an agent.
GET/mcp-serversList the MCP servers registered on your tenant (no secrets).
List the MCP servers registered on your tenant (no secrets).
| id | string | required | Id |
| name | string | required | Name |
| transport | string | required | Transport |
| enabled | boolean | required | Enabled |
| config | object | required | Config |
| status | string? | optional | Status |
| last_error | string? | optional | Last Error |
| discovered_tools | any[]? | optional | Discovered Tools |
| last_checked_at | string? | optional | Last Checked At |
| created_at | string | required | Created At |
| updated_at | string | required | Updated At |
[
{
"id": "string",
"name": "string",
"transport": "string",
"enabled": true,
"config": {},
"status": "string",
"last_error": "string",
"discovered_tools": [
"…"
],
"last_checked_at": "string",
"created_at": "string",
"updated_at": "string"
}
]POST/mcp-serversRegister a remote MCP server (transport: streamable_http | sse; stdio is rejected).
Register a remote MCP server (transport: streamable_http | sse; stdio is rejected).
| name | string | required | Name |
| transport | string | optional | Transport |
| config | object | optional | Config |
| enabled | boolean | optional | Enabled |
{
"name": "string",
"transport": "string",
"config": {},
"enabled": true
}| id | string | required | Id |
| name | string | required | Name |
| transport | string | required | Transport |
| enabled | boolean | required | Enabled |
| config | object | required | Config |
| status | string? | optional | Status |
| last_error | string? | optional | Last Error |
| discovered_tools | any[]? | optional | Discovered Tools |
| last_checked_at | string? | optional | Last Checked At |
| created_at | string | required | Created At |
| updated_at | string | required | Updated At |
{
"id": "string",
"name": "string",
"transport": "string",
"enabled": true,
"config": {},
"status": "string",
"last_error": "string",
"discovered_tools": [
"…"
],
"last_checked_at": "string",
"created_at": "string",
"updated_at": "string"
}curl -X POST https://api.agent4.io/v1/mcp-servers -H "X-API-Key: $KEY" -H 'Content-Type: application/json' \
-d '{"name":"my-tools","transport":"streamable_http","config":{"url":"https://tools.example.com/mcp"}}'DELETE/mcp-servers/{sid}Delete Server
Delete Server
| sid | path | string | required |
Response 204 — No Content (success, empty body).
PATCH/mcp-servers/{sid}Update Server
Update Server
| sid | path | string | required |
| name | string? | optional | Name |
| transport | string? | optional | Transport |
| config | object? | optional | Config |
| enabled | boolean? | optional | Enabled |
{
"name": "string",
"transport": "string",
"config": {},
"enabled": true
}| id | string | required | Id |
| name | string | required | Name |
| transport | string | required | Transport |
| enabled | boolean | required | Enabled |
| config | object | required | Config |
| status | string? | optional | Status |
| last_error | string? | optional | Last Error |
| discovered_tools | any[]? | optional | Discovered Tools |
| last_checked_at | string? | optional | Last Checked At |
| created_at | string | required | Created At |
| updated_at | string | required | Updated At |
{
"id": "string",
"name": "string",
"transport": "string",
"enabled": true,
"config": {},
"status": "string",
"last_error": "string",
"discovered_tools": [
"…"
],
"last_checked_at": "string",
"created_at": "string",
"updated_at": "string"
}POST/mcp-servers/{sid}/probeProbe Server
Probe Server
| sid | path | string | required |
| instruction | string | required | Instruction |
| tool | string? | optional | Tool |
| execute | boolean | optional | Execute |
{
"instruction": "string",
"tool": "string",
"execute": true
}| called | boolean | required | Called |
| tool | string? | optional | Tool |
| arguments | object? | optional | Arguments |
| executed | boolean | optional | Executed |
| result | string? | optional | Result |
| reply | string? | optional | Reply |
| error | string? | optional | Error |
{
"called": true,
"tool": "string",
"arguments": {},
"executed": true,
"result": "string",
"reply": "string",
"error": "string"
}GET/mcp-servers/{sid}/revealReveal Config
Reveal Config
| sid | path | string | required |
| config | object | required | Config |
{
"config": {}
}POST/mcp-servers/{sid}/testTest Server
Test Server
| sid | path | string | required |
| id | string | required | Id |
| name | string | required | Name |
| transport | string | required | Transport |
| enabled | boolean | required | Enabled |
| config | object | required | Config |
| status | string? | optional | Status |
| last_error | string? | optional | Last Error |
| discovered_tools | any[]? | optional | Discovered Tools |
| last_checked_at | string? | optional | Last Checked At |
| created_at | string | required | Created At |
| updated_at | string | required | Updated At |
{
"id": "string",
"name": "string",
"transport": "string",
"enabled": true,
"config": {},
"status": "string",
"last_error": "string",
"discovered_tools": [
"…"
],
"last_checked_at": "string",
"created_at": "string",
"updated_at": "string"
}POST/mcp-servers/test-configProbe a transport+config before saving (connect once, don't persist).
Probe a transport+config before saving (connect once, don't persist).
| transport | string | optional | Transport |
| config | object | optional | Config |
{
"transport": "string",
"config": {}
}| id | string | required | Id |
| name | string | required | Name |
| transport | string | required | Transport |
| enabled | boolean | required | Enabled |
| config | object | required | Config |
| status | string? | optional | Status |
| last_error | string? | optional | Last Error |
| discovered_tools | any[]? | optional | Discovered Tools |
| last_checked_at | string? | optional | Last Checked At |
| created_at | string | required | Created At |
| updated_at | string | required | Updated At |
{
"id": "string",
"name": "string",
"transport": "string",
"enabled": true,
"config": {},
"status": "string",
"last_error": "string",
"discovered_tools": [
"…"
],
"last_checked_at": "string",
"created_at": "string",
"updated_at": "string"
}Page playbooks
A per-page briefing (background, opener, suggested questions) chosen from the visitor's URL. Match rules are globs.
GET/manage/page-context-statsOpens and suggested-question clicks per playbook.
Opens and suggested-question clicks per playbook.
| days | query | integer | optional |
| key | string | required | Key |
| opened | integer | optional | Opened |
| question_clicks | integer | optional | Question Clicks |
| per_question | object | optional | Per Question |
[
{
"key": "string",
"opened": 0,
"question_clicks": 0,
"per_question": {}
}
]GET/manage/page-context-templatesStarter templates by page type.
Starter templates by page type.
| lang | query | string | optional |
| key | string | required | Key |
| label | string | required | Label |
| context_hint | string | required | Context Hint |
| questions | string[] | required | Questions |
[
{
"key": "string",
"label": "string",
"context_hint": "string",
"questions": [
"string"
]
}
]GET/manage/page-contextsList page playbooks (match rules, greeting mode, position).
List page playbooks (match rules, greeting mode, position).
| label | string | optional | Label |
| url_pattern | string? | optional | Url Pattern |
| context | string | optional | Context |
| greeting | string? | optional | Greeting |
| questions | string[]? | optional | Questions |
| greeting_mode | string | optional | Greeting Mode |
| is_default | boolean | optional | Is Default |
| position | integer | optional | Position |
| key | string | required | Key |
| generated_langs | string[] | optional | Generated Langs |
[
{
"label": "string",
"url_pattern": "string",
"context": "string",
"greeting": "string",
"questions": [
"string"
],
"greeting_mode": "string",
"is_default": true,
"position": 0,
"key": "string",
"generated_langs": [
"string"
]
}
]DELETE/manage/page-contexts/{key}Delete a playbook.
Delete a playbook.
| key | path | string | required |
Response 204 — No Content (success, empty body).
PUT/manage/page-contexts/{key}Create or replace a playbook (full-replace).
Create or replace a playbook (full-replace).
| key | path | string | required |
| label | string | optional | Label |
| url_pattern | string? | optional | Url Pattern |
| context | string | optional | Context |
| greeting | string? | optional | Greeting |
| questions | string[]? | optional | Questions |
| greeting_mode | string | optional | Greeting Mode |
| is_default | boolean | optional | Is Default |
| position | integer | optional | Position |
{
"label": "string",
"url_pattern": "string",
"context": "string",
"greeting": "string",
"questions": [
"string"
],
"greeting_mode": "string",
"is_default": true,
"position": 0
}| label | string | optional | Label |
| url_pattern | string? | optional | Url Pattern |
| context | string | optional | Context |
| greeting | string? | optional | Greeting |
| questions | string[]? | optional | Questions |
| greeting_mode | string | optional | Greeting Mode |
| is_default | boolean | optional | Is Default |
| position | integer | optional | Position |
| key | string | required | Key |
| generated_langs | string[] | optional | Generated Langs |
{
"label": "string",
"url_pattern": "string",
"context": "string",
"greeting": "string",
"questions": [
"string"
],
"greeting_mode": "string",
"is_default": true,
"position": 0,
"key": "string",
"generated_langs": [
"string"
]
}curl -X PUT https://api.agent4.io/v1/manage/page-contexts/pricing -H "X-API-Key: $KEY" \
-H 'Content-Type: application/json' -d '{"label":"Pricing","url_pattern":"*/pricing","context":"Visitors compare plans.","greeting_mode":"generated"}'GET/manage/page-contexts/resolveTest which playbook a URL hits (?url= or ?key=).
Test which playbook a URL hits (?url= or ?key=).
| url | query | string? | optional | |
| key | query | string? | optional |
| key | string? | optional | Key |
| label | string | optional | Label |
| matched_by | string | optional | Matched By |
{
"key": "string",
"label": "string",
"matched_by": "string"
}Long-document writing
A document type is a skeleton plus the information the agent must have before it writes. Publishing freezes a revision — a run in flight keeps the version it started with, so editing a type never renumbers a document someone is already reading. Visitors drive their own documents through the share API; this group is the tenant-side configuration and the operations board.
GET/manage/writingOperations board: status, progress, how long a run has been stuck, and why it failed. Returns no document text — the body is encrypted per end user and this endpoint has no key for it.
Operations board: status, progress, how long a run has been stuck, and why it failed. Returns no document text — the body is encrypted per end user and this endpoint has no key for it.
| limit | query | integer | optional |
| by_status | object | required | By Status |
| active_jobs | integer | optional | Active Jobs |
| stale_jobs | integer | optional | Stale Jobs |
| stuck | integer | optional | Stuck |
| waiting | integer | optional | Waiting |
| runs | RunRow[] | required | Runs |
{
"by_status": {},
"active_jobs": 0,
"stale_jobs": 0,
"stuck": 0,
"waiting": 0,
"runs": [
{}
]
}GET/writing-typesList your document types with how many documents each has produced.
List your document types with how many documents each has produced.
| id | string | required | Id |
| name | string | required | Name |
| display_name | string | optional | Display Name |
| description | string | optional | Description |
| agent_name | string? | optional | Agent Name |
| outline | object[] | optional | Outline |
| info_schema | object | optional | Info Schema |
| boundary | string | optional | Boundary |
| knowledge_bases | string[] | optional | Knowledge Bases |
| match_hints | string | optional | Match Hints |
| status | string | optional | Status |
| version | integer | optional | Version |
| runs | integer | optional | Runs |
| created_at | string | required | Created At |
| updated_at | string | required | Updated At |
[
{
"id": "string",
"name": "string",
"display_name": "string",
"description": "string",
"agent_name": "string",
"outline": [
{}
],
"info_schema": {},
"boundary": "string",
"knowledge_bases": [
"string"
],
"match_hints": "string",
"status": "string",
"version": 0,
"runs": 0,
"created_at": "string",
"updated_at": "string"
}
]DELETE/writing-types/{name}Delete a type. Documents already written from it are unaffected — they keep their own frozen copy.
Delete a type. Documents already written from it are unaffected — they keep their own frozen copy.
| name | path | string | required |
Response 204 — No Content (success, empty body).
GET/writing-types/{name}Get one type: skeleton, required information, writing boundary.
Get one type: skeleton, required information, writing boundary.
| name | path | string | required |
| id | string | required | Id |
| name | string | required | Name |
| display_name | string | optional | Display Name |
| description | string | optional | Description |
| agent_name | string? | optional | Agent Name |
| outline | object[] | optional | Outline |
| info_schema | object | optional | Info Schema |
| boundary | string | optional | Boundary |
| knowledge_bases | string[] | optional | Knowledge Bases |
| match_hints | string | optional | Match Hints |
| status | string | optional | Status |
| version | integer | optional | Version |
| runs | integer | optional | Runs |
| created_at | string | required | Created At |
| updated_at | string | required | Updated At |
{
"id": "string",
"name": "string",
"display_name": "string",
"description": "string",
"agent_name": "string",
"outline": [
{}
],
"info_schema": {},
"boundary": "string",
"knowledge_bases": [
"string"
],
"match_hints": "string",
"status": "string",
"version": 0,
"runs": 0,
"created_at": "string",
"updated_at": "string"
}PATCH/writing-types/{name}Partial update. Validation runs on the merged result, so a patch that only changes `needs` is still checked against the stored `info_schema`.
Partial update. Validation runs on the merged result, so a patch that only changes `needs` is still checked against the stored `info_schema`.
| name | path | string | required |
| display_name | string? | optional | Display Name |
| description | string? | optional | Description |
| agent_name | string? | optional | Agent Name |
| outline | object[]? | optional | Outline |
| info_schema | object? | optional | Info Schema |
| boundary | string? | optional | Boundary |
| knowledge_bases | string[]? | optional | Knowledge Bases |
| match_hints | string? | optional | Match Hints |
{
"display_name": "string",
"description": "string",
"agent_name": "string",
"outline": [
{}
],
"info_schema": {},
"boundary": "string",
"knowledge_bases": [
"string"
],
"match_hints": "string"
}| id | string | required | Id |
| name | string | required | Name |
| display_name | string | optional | Display Name |
| description | string | optional | Description |
| agent_name | string? | optional | Agent Name |
| outline | object[] | optional | Outline |
| info_schema | object | optional | Info Schema |
| boundary | string | optional | Boundary |
| knowledge_bases | string[] | optional | Knowledge Bases |
| match_hints | string | optional | Match Hints |
| status | string | optional | Status |
| version | integer | optional | Version |
| runs | integer | optional | Runs |
| created_at | string | required | Created At |
| updated_at | string | required | Updated At |
{
"id": "string",
"name": "string",
"display_name": "string",
"description": "string",
"agent_name": "string",
"outline": [
{}
],
"info_schema": {},
"boundary": "string",
"knowledge_bases": [
"string"
],
"match_hints": "string",
"status": "string",
"version": 0,
"runs": 0,
"created_at": "string",
"updated_at": "string"
}POST/writing-types/{name}Create a document type (409 if it exists). Validated on write: every `needs` key must exist in `info_schema`, field types must be text/number/date, section keys must be unique.
Create a document type (409 if it exists). Validated on write: every `needs` key must exist in `info_schema`, field types must be text/number/date, section keys must be unique.
| name | path | string | required |
| display_name | string | optional | Display Name |
| description | string | optional | Description |
| agent_name | string? | optional | Agent Name |
| outline | object[] | optional | Outline |
| info_schema | object | optional | Info Schema |
| boundary | string | optional | Boundary |
| knowledge_bases | string[] | optional | Knowledge Bases |
| match_hints | string | optional | Match Hints |
{
"display_name": "string",
"description": "string",
"agent_name": "string",
"outline": [
{}
],
"info_schema": {},
"boundary": "string",
"knowledge_bases": [
"string"
],
"match_hints": "string"
}| id | string | required | Id |
| name | string | required | Name |
| display_name | string | optional | Display Name |
| description | string | optional | Description |
| agent_name | string? | optional | Agent Name |
| outline | object[] | optional | Outline |
| info_schema | object | optional | Info Schema |
| boundary | string | optional | Boundary |
| knowledge_bases | string[] | optional | Knowledge Bases |
| match_hints | string | optional | Match Hints |
| status | string | optional | Status |
| version | integer | optional | Version |
| runs | integer | optional | Runs |
| created_at | string | required | Created At |
| updated_at | string | required | Updated At |
{
"id": "string",
"name": "string",
"display_name": "string",
"description": "string",
"agent_name": "string",
"outline": [
{}
],
"info_schema": {},
"boundary": "string",
"knowledge_bases": [
"string"
],
"match_hints": "string",
"status": "string",
"version": 0,
"runs": 0,
"created_at": "string",
"updated_at": "string"
}curl -X POST https://api.agent4.io/v1/writing-types/reg-submission -H "X-API-Key: $KEY" \
-H 'Content-Type: application/json' \
-d '{"display_name":"Regulatory submission","match_hints":"regulatory submission dossiers, technical files, CE or NMPA filings","boundary":"Never predict an approval outcome; never cite a regulation that is not yet in force.","info_schema":{"applicant_name":{"label":"Legal name of the applicant","type":"text","why":"It goes on the cover sheet; getting it wrong means refiling."}},"outline":[{"key":"applicant","title":"Applicant","requirements":"State the legal name, registered address and device class.","needs":["applicant_name"]}]}'PUT/writing-types/{name}Create or replace — full-replace semantics; a PUT without `outline` clears the skeleton.
Create or replace — full-replace semantics; a PUT without `outline` clears the skeleton.
| name | path | string | required |
| display_name | string | optional | Display Name |
| description | string | optional | Description |
| agent_name | string? | optional | Agent Name |
| outline | object[] | optional | Outline |
| info_schema | object | optional | Info Schema |
| boundary | string | optional | Boundary |
| knowledge_bases | string[] | optional | Knowledge Bases |
| match_hints | string | optional | Match Hints |
{
"display_name": "string",
"description": "string",
"agent_name": "string",
"outline": [
{}
],
"info_schema": {},
"boundary": "string",
"knowledge_bases": [
"string"
],
"match_hints": "string"
}| id | string | required | Id |
| name | string | required | Name |
| display_name | string | optional | Display Name |
| description | string | optional | Description |
| agent_name | string? | optional | Agent Name |
| outline | object[] | optional | Outline |
| info_schema | object | optional | Info Schema |
| boundary | string | optional | Boundary |
| knowledge_bases | string[] | optional | Knowledge Bases |
| match_hints | string | optional | Match Hints |
| status | string | optional | Status |
| version | integer | optional | Version |
| runs | integer | optional | Runs |
| created_at | string | required | Created At |
| updated_at | string | required | Updated At |
{
"id": "string",
"name": "string",
"display_name": "string",
"description": "string",
"agent_name": "string",
"outline": [
{}
],
"info_schema": {},
"boundary": "string",
"knowledge_bases": [
"string"
],
"match_hints": "string",
"status": "string",
"version": 0,
"runs": 0,
"created_at": "string",
"updated_at": "string"
}POST/writing-types/{name}/publishFreeze a revision and compute the matching vector. Only published types are matched automatically; runs already in flight keep the revision they started with.
Freeze a revision and compute the matching vector. Only published types are matched automatically; runs already in flight keep the revision they started with.
| name | path | string | required |
| id | string | required | Id |
| name | string | required | Name |
| display_name | string | optional | Display Name |
| description | string | optional | Description |
| agent_name | string? | optional | Agent Name |
| outline | object[] | optional | Outline |
| info_schema | object | optional | Info Schema |
| boundary | string | optional | Boundary |
| knowledge_bases | string[] | optional | Knowledge Bases |
| match_hints | string | optional | Match Hints |
| status | string | optional | Status |
| version | integer | optional | Version |
| runs | integer | optional | Runs |
| created_at | string | required | Created At |
| updated_at | string | required | Updated At |
{
"id": "string",
"name": "string",
"display_name": "string",
"description": "string",
"agent_name": "string",
"outline": [
{}
],
"info_schema": {},
"boundary": "string",
"knowledge_bases": [
"string"
],
"match_hints": "string",
"status": "string",
"version": 0,
"runs": 0,
"created_at": "string",
"updated_at": "string"
}GET/writing-types/{name}/revisionsPublished revision history.
Published revision history.
| name | path | string | required |
| id | string | required | Id |
| version | integer | required | Version |
| sections | integer | required | Sections |
| actor | string? | optional | Actor |
| created_at | string | required | Created At |
[
{
"id": "string",
"version": 0,
"sections": 0,
"actor": "string",
"created_at": "string"
}
]Scheduled tasks
GET/manage/scheduled-tasksList scheduled / follow-up tasks (metadata; instruction decrypted where possible).
List scheduled / follow-up tasks (metadata; instruction decrypted where possible).
| status | query | string? | optional | |
| limit | query | integer | optional | |
| cursor | query | string? | optional |
| items | ScheduledTaskOut[] | required | Items |
| next_cursor | string? | optional | Next Cursor |
{
"items": [
{}
],
"next_cursor": "string"
}POST/manage/scheduled-tasks/{task_id}/cancelCancel a pending task (409 if not pending).
Cancel a pending task (409 if not pending).
| task_id | path | string | required |
| id | string | required | Id |
| user_id | string | required | User Id |
| external_user_id | string? | optional | External User Id |
| space_id | string | required | Space Id |
| space_name | string? | optional | Space Name |
| session_id | string? | optional | Session Id |
| session_title | string? | optional | Session Title |
| agent | string? | optional | Agent |
| channel | string | required | Channel |
| kind | string | optional | Kind |
| title | string? | optional | Title |
| cron | string? | optional | Cron |
| status | string | required | Status |
| instruction | string? | optional | Instruction |
| run_at | string | required | Run At |
| created_at | string | required | Created At |
| last_error | string? | optional | Last Error |
{
"id": "string",
"user_id": "string",
"external_user_id": "string",
"space_id": "string",
"space_name": "string",
"session_id": "string",
"session_title": "string",
"agent": "string",
"channel": "string",
"kind": "string",
"title": "string",
"cron": "string",
"status": "string",
"instruction": "string",
"run_at": "string",
"created_at": "string",
"last_error": "string"
}End users, spaces & sessions
Directory and governance. Conversation content is read here (for the operator), not streamed to integrations. Deleting a user is a crypto-shred cascade.
GET/manage/agent-statsPer-agent usage: sessions, distinct people, last active.
Per-agent usage: sessions, distinct people, last active.
| rows | AgentStatRow[] | required | Rows |
{
"rows": [
{}
]
}GET/manage/agents/{name}/sessionsA given agent's sessions across users/spaces.
A given agent's sessions across users/spaces.
| name | path | string | required | |
| limit | query | integer | optional | |
| cursor | query | string? | optional |
| items | AgentSessionOut[] | required | Items |
| next_cursor | string? | optional | Next Cursor |
{
"items": [
{}
],
"next_cursor": "string"
}GET/manage/attachments/{aid}Fetch one decrypted attachment file (ownership-checked).
Fetch one decrypted attachment file (ownership-checked).
| aid | path | string | required |
Response 200 · any
"…"
GET/manage/crawlCurrent Crawl
Current Crawl
Response 200 · CrawlOut?
{}POST/manage/crawl/{job_id}/cancelCancel Crawl
Cancel Crawl
| job_id | path | string | required |
| id | string | required | Id |
| knowledge_base | string | required | Knowledge Base |
| start_url | string | required | Start Url |
| status | string | required | Status |
| error_code | string? | required | Error Code |
| error | string? | required | Error |
| discovered | integer | required | Discovered |
| fetched | integer | required | Fetched |
| embedded | integer | required | Embedded |
| skipped | integer | required | Skipped |
| flagged | integer | required | Flagged |
| total_chars | integer | required | Total Chars |
| estimated_tokens | integer | required | Estimated Tokens |
| tokens_used | integer | required | Tokens Used |
| created_at | string | required | Created At |
| finished_at | string? | required | Finished At |
{
"id": "string",
"knowledge_base": "string",
"start_url": "string",
"status": "string",
"error_code": "string",
"error": "string",
"discovered": 0,
"fetched": 0,
"embedded": 0,
"skipped": 0,
"flagged": 0,
"total_chars": 0,
"estimated_tokens": 0,
"tokens_used": 0,
"created_at": "string",
"finished_at": "string"
}POST/manage/crawl/{job_id}/confirmConfirm Crawl
Confirm Crawl
| job_id | path | string | required |
| id | string | required | Id |
| knowledge_base | string | required | Knowledge Base |
| start_url | string | required | Start Url |
| status | string | required | Status |
| error_code | string? | required | Error Code |
| error | string? | required | Error |
| discovered | integer | required | Discovered |
| fetched | integer | required | Fetched |
| embedded | integer | required | Embedded |
| skipped | integer | required | Skipped |
| flagged | integer | required | Flagged |
| total_chars | integer | required | Total Chars |
| estimated_tokens | integer | required | Estimated Tokens |
| tokens_used | integer | required | Tokens Used |
| created_at | string | required | Created At |
| finished_at | string? | required | Finished At |
{
"id": "string",
"knowledge_base": "string",
"start_url": "string",
"status": "string",
"error_code": "string",
"error": "string",
"discovered": 0,
"fetched": 0,
"embedded": 0,
"skipped": 0,
"flagged": 0,
"total_chars": 0,
"estimated_tokens": 0,
"tokens_used": 0,
"created_at": "string",
"finished_at": "string"
}GET/manage/crawl/{job_id}/pagesCrawl Pages
Crawl Pages
| job_id | path | string | required |
| url | string | required | Url |
| status | string | required | Status |
| title | string? | required | Title |
| chars | integer | required | Chars |
| review | string | required | Review |
| review_note | string? | required | Review Note |
| similar_to | string? | required | Similar To |
| error | string? | required | Error |
[
{
"url": "string",
"status": "string",
"title": "string",
"chars": 0,
"review": "string",
"review_note": "string",
"similar_to": "string",
"error": "string"
}
]DELETE/manage/documents/{doc_id}Delete a user document.
Delete a user document.
| doc_id | path | string | required |
Response 204 — No Content (success, empty body).
POST/manage/end-user-tokenMint an end-user token for an integration's user (proxy-mode SSO handshake).
Mint an end-user token for an integration's user (proxy-mode SSO handshake).
| external_user_id | string | required | External User Id |
| ttl | integer? | optional | Ttl |
{
"external_user_id": "string",
"ttl": 0
}| token | string | required | Token |
| external_user_id | string | required | External User Id |
| expires_in | integer | required | Expires In |
{
"token": "string",
"external_user_id": "string",
"expires_in": 0
}GET/manage/gapsList Gaps
List Gaps
| unread | query | boolean | optional | |
| limit | query | integer | optional |
| question | string | required | Question |
| times | integer | required | Times |
| last_at | string | required | Last At |
| agents | string[] | optional | Agents |
| read | boolean | optional | Read |
[
{
"question": "string",
"times": 0,
"last_at": "string",
"agents": [
"string"
],
"read": true
}
]GET/manage/gaps.csvExport Gaps
Export Gaps
| unread | query | boolean | optional | |
| limit | query | integer | optional |
Response 200 · any
"…"
POST/manage/gaps/readMark Gaps Read
Mark Gaps Read
| questions | string[] | required | Questions |
{
"questions": [
"string"
]
}Response 200 · object — unstructured JSON (no fixed schema).
DELETE/manage/memories/{mid}Delete one derived memory (governance).
Delete one derived memory (governance).
| mid | path | string | required |
Response 204 — No Content (success, empty body).
DELETE/manage/profiles/{pid}Clear a profile (regenerates over the next conversations).
Clear a profile (regenerates over the next conversations).
| pid | path | string | required |
Response 204 — No Content (success, empty body).
PUT/manage/profiles/{pid}Edit a user profile (re-encrypted).
Edit a user profile (re-encrypted).
| pid | path | string | required |
| content | string | required | Content |
{
"content": "string"
}| id | string | required | Id |
| agent_name | string | required | Agent Name |
| content | string? | optional | Content |
| updated_at | string | required | Updated At |
{
"id": "string",
"agent_name": "string",
"content": "string",
"updated_at": "string"
}GET/manage/reviewsList Reviews
List Reviews
| status | query | string | optional | |
| limit | query | integer | optional |
| id | string | required | Id |
| question | string | required | Question |
| answer | string | required | Answer |
| source_url | string? | required | Source Url |
| source_title | string? | required | Source Title |
| unsourced | string[] | optional | Unsourced |
| source_text | string? | optional | Source Text |
| agent_name | string? | required | Agent Name |
| kb_name | string? | required | Kb Name |
| status | string | required | Status |
| created_at | string | required | Created At |
[
{
"id": "string",
"question": "string",
"answer": "string",
"source_url": "string",
"source_title": "string",
"unsourced": [
"string"
],
"source_text": "string",
"agent_name": "string",
"kb_name": "string",
"status": "string",
"created_at": "string"
}
]POST/manage/reviews/{rid}/approveApprove Review
Approve Review
| rid | path | string | required |
| kb_name | string | required | Kb Name |
| title | string? | optional | Title |
| text | string? | optional | Text |
{
"kb_name": "string",
"title": "string",
"text": "string"
}| id | string | required | Id |
| question | string | required | Question |
| answer | string | required | Answer |
| source_url | string? | required | Source Url |
| source_title | string? | required | Source Title |
| unsourced | string[] | optional | Unsourced |
| source_text | string? | optional | Source Text |
| agent_name | string? | required | Agent Name |
| kb_name | string? | required | Kb Name |
| status | string | required | Status |
| created_at | string | required | Created At |
{
"id": "string",
"question": "string",
"answer": "string",
"source_url": "string",
"source_title": "string",
"unsourced": [
"string"
],
"source_text": "string",
"agent_name": "string",
"kb_name": "string",
"status": "string",
"created_at": "string"
}POST/manage/reviews/{rid}/draftDraft Review Entry
Draft Review Entry
| rid | path | string | required | |
| lang | query | string? | optional |
| text | string? | required | Text |
| reason | string? | optional | Reason |
{
"text": "string",
"reason": "string"
}POST/manage/reviews/{rid}/rejectReject Review
Reject Review
| rid | path | string | required |
| id | string | required | Id |
| question | string | required | Question |
| answer | string | required | Answer |
| source_url | string? | required | Source Url |
| source_title | string? | required | Source Title |
| unsourced | string[] | optional | Unsourced |
| source_text | string? | optional | Source Text |
| agent_name | string? | required | Agent Name |
| kb_name | string? | required | Kb Name |
| status | string | required | Status |
| created_at | string | required | Created At |
{
"id": "string",
"question": "string",
"answer": "string",
"source_url": "string",
"source_title": "string",
"unsourced": [
"string"
],
"source_text": "string",
"agent_name": "string",
"kb_name": "string",
"status": "string",
"created_at": "string"
}GET/manage/sessions/{sid}/attachmentsAttachments uploaded in a session (metadata).
Attachments uploaded in a session (metadata).
| sid | path | string | required |
| id | string | required | Id |
| mime | string | required | Mime |
| name | string | required | Name |
| created_at | string | required | Created At |
[
{
"id": "string",
"mime": "string",
"name": "string",
"created_at": "string"
}
]GET/manage/sessions/{sid}/messagesA session's messages (paged; decrypted for the operator).
A session's messages (paged; decrypted for the operator).
| sid | path | string | required | |
| limit | query | integer | optional | |
| cursor | query | string? | optional |
| items | MessageOut[] | required | Items |
| next_cursor | string? | optional | Next Cursor |
{
"items": [
{}
],
"next_cursor": "string"
}DELETE/manage/spaces/{sid}Delete a space and its knowledge/sessions (default space cannot be deleted).
Delete a space and its knowledge/sessions (default space cannot be deleted).
| sid | path | string | required |
Response 204 — No Content (success, empty body).
PATCH/manage/spaces/{sid}Rename a space.
Rename a space.
| sid | path | string | required |
| name | string | required | Name |
{
"name": "string"
}| id | string | required | Id |
| name | string | required | Name |
| is_default | boolean | required | Is Default |
{
"id": "string",
"name": "string",
"is_default": true
}GET/manage/spaces/{sid}/agentsAgents added to a space.
Agents added to a space.
| sid | path | string | required |
Response 200 · string[]
[ "string" ]
POST/manage/spaces/{sid}/agentsAdd an agent to a space.
Add an agent to a space.
| sid | path | string | required |
| name | string | required | Name |
{
"name": "string"
}Response 201 · string[]
[ "string" ]
DELETE/manage/spaces/{sid}/agents/{name}Remove an agent from a space.
Remove an agent from a space.
| sid | path | string | required | |
| name | path | string | required |
Response 204 — No Content (success, empty body).
GET/manage/spaces/{sid}/documentsDocuments in a space.
Documents in a space.
| sid | path | string | required | |
| limit | query | integer | optional | |
| cursor | query | string? | optional |
| items | DocumentOut[] | required | Items |
| next_cursor | string? | optional | Next Cursor |
{
"items": [
{}
],
"next_cursor": "string"
}GET/manage/spaces/{sid}/memoriesLong-term memories derived in a space (for governance).
Long-term memories derived in a space (for governance).
| sid | path | string | required |
| id | string | required | Id |
| kind | string | required | Kind |
| topic | string? | optional | Topic |
| importance | integer | required | Importance |
| content | string? | optional | Content |
| session_id | string? | optional | Session Id |
| created_at | string | required | Created At |
| updated_at | string? | optional | Updated At |
[
{
"id": "string",
"kind": "string",
"topic": "string",
"importance": 0,
"content": "string",
"session_id": "string",
"created_at": "string",
"updated_at": "string"
}
]GET/manage/spaces/{sid}/profilesPer-agent user profiles in a space.
Per-agent user profiles in a space.
| sid | path | string | required |
| id | string | required | Id |
| agent_name | string | required | Agent Name |
| content | string? | optional | Content |
| updated_at | string | required | Updated At |
[
{
"id": "string",
"agent_name": "string",
"content": "string",
"updated_at": "string"
}
]GET/manage/spaces/{sid}/sessionsSessions in a space.
Sessions in a space.
| sid | path | string | required | |
| limit | query | integer | optional | |
| cursor | query | string? | optional |
| items | SessionOut[] | required | Items |
| next_cursor | string? | optional | Next Cursor |
{
"items": [
{}
],
"next_cursor": "string"
}GET/manage/usersList end users (?q=, ?sort=recent|tokens24h; keyset paging).
List end users (?q=, ?sort=recent|tokens24h; keyset paging).
| limit | query | integer | optional | |
| cursor | query | string? | optional | |
| q | query | string? | optional | |
| sort | query | string | optional |
| items | UserOut[] | required | Items |
| next_cursor | string? | optional | Next Cursor |
{
"items": [
{}
],
"next_cursor": "string"
}curl "https://api.agent4.io/v1/manage/users?sort=tokens24h" -H "X-API-Key: $KEY"
DELETE/manage/users/{uid}Delete a user and all their data (crypto-shred cascade).
Delete a user and all their data (crypto-shred cascade).
| uid | path | string | required |
Response 204 — No Content (success, empty body).
GET/manage/users/{uid}One user's detail (profile, contact, spaces).
One user's detail (profile, contact, spaces).
| uid | path | string | required |
| id | string | required | Id |
| external_user_id | string | required | External User Id |
| pref_name | string? | optional | Pref Name |
| created_at | string | required | Created At |
| space_count | integer | optional | Space Count |
| session_count | integer | optional | Session Count |
| document_count | integer | optional | Document Count |
| auth | string | optional | Auth |
| string? | optional | ||
| email_verified | boolean? | optional | Email Verified |
| tokens_24h | integer | optional | Tokens 24H |
| spaces | SpaceOut[] | optional | Spaces |
| contact_email | string? | optional | Contact Email |
| contact_phone | string? | optional | Contact Phone |
| pref_city | string? | optional | Pref City |
| pref_timezone | string? | optional | Pref Timezone |
| recent_refs | object[] | optional | Recent Refs |
{
"id": "string",
"external_user_id": "string",
"pref_name": "string",
"created_at": "string",
"space_count": 0,
"session_count": 0,
"document_count": 0,
"auth": "string",
"email": "string",
"email_verified": true,
"tokens_24h": 0,
"spaces": [
{}
],
"contact_email": "string",
"contact_phone": "string",
"pref_city": "string",
"pref_timezone": "string",
"recent_refs": [
{}
]
}GET/manage/users/{uid}/documentsA user's uploaded documents.
A user's uploaded documents.
| uid | path | string | required | |
| limit | query | integer | optional | |
| cursor | query | string? | optional |
| items | DocumentOut[] | required | Items |
| next_cursor | string? | optional | Next Cursor |
{
"items": [
{}
],
"next_cursor": "string"
}GET/manage/users/{uid}/knowledge-graph3D projection of a user's memories / KB chunks.
3D projection of a user's memories / KB chunks.
| uid | path | string | required | |
| source | query | string | optional | |
| space_id | query | string? | optional | |
| limit | query | integer? | optional | |
| refresh | query | boolean | optional | |
| q | query | string | optional | |
| stream | query | boolean | optional |
Response 200 · object — unstructured JSON (no fixed schema).
GET/manage/users/{uid}/knowledge-graph/items/{item_id}User Graph Item
User Graph Item
| uid | path | string | required | |
| item_id | path | string | required | |
| source | query | string | optional |
Response 200 · object — unstructured JSON (no fixed schema).
POST/manage/users/{uid}/passwordAdmin-reset an email user's password (404 for non-email accounts).
Admin-reset an email user's password (404 for non-email accounts).
| uid | path | string | required |
| new_password | string | required | New Password |
{
"new_password": "string"
}Response 204 — No Content (success, empty body).
GET/manage/users/{uid}/sessionsA user's chat sessions (metadata; no message content).
A user's chat sessions (metadata; no message content).
| uid | path | string | required | |
| limit | query | integer | optional | |
| cursor | query | string? | optional |
| items | SessionOut[] | required | Items |
| next_cursor | string? | optional | Next Cursor |
{
"items": [
{}
],
"next_cursor": "string"
}POST/manage/users/{uid}/spacesCreate a space for a user.
Create a space for a user.
| uid | path | string | required |
| name | string | required | Name |
{
"name": "string"
}| id | string | required | Id |
| name | string | required | Name |
| is_default | boolean | required | Is Default |
{
"id": "string",
"name": "string",
"is_default": true
}GET/manage/users/{uid}/usagePer-user token usage time series.
Per-user token usage time series.
| uid | path | string | required | |
| hours | query | integer | optional | |
| days | query | integer | optional |
| points | object[] | required | Points |
| total_tokens | integer | required | Total Tokens |
{
"points": [
{}
],
"total_tokens": 0
}Usage & quota
Metadata only — token counts and event counts, never conversation content.
GET/manage/usageToken usage; ?group=total|agent|user|space|hour|day|week|model|kind.
Token usage; ?group=total|agent|user|space|hour|day|week|model|kind.
| group | query | string | optional | |
| since | query | string? | optional |
| group | string | required | Group |
| total | UsageRow | required | |
| rows | UsageRow[] | required | Rows |
{
"group": "string",
"total": {},
"rows": [
{}
]
}curl "https://api.agent4.io/v1/manage/usage?group=agent" -H "X-API-Key: $KEY"
GET/tenant/quotaQuota snapshot (used vs monthly ceiling) for banners/progress bars.
Quota snapshot (used vs monthly ceiling) for banners/progress bars.
Response 200 · object — unstructured JSON (no fixed schema).
Tenant settings & security
GET/tenant/auditAudit trail: every configuration change with who, when and before/after. Covers the console, this API and MCP alike. Filter with ?entity=agent|skill|knowledge_base|… , ?action= , ?q= (object name). Cursor-paged, newest first. There is no delete endpoint — entries are immutable by design.
Audit trail: every configuration change with who, when and before/after. Covers the console, this API and MCP alike. Filter with ?entity=agent|skill|knowledge_base|… , ?action= , ?q= (object name). Cursor-paged, newest first. There is no delete endpoint — entries are immutable by design.
| action | query | string? | optional | |
| entity | query | string? | optional | |
| q | query | string? | optional | |
| changes_only | query | boolean | optional | |
| date_from | query | string? | optional | |
| date_to | query | string? | optional | |
| limit | query | integer | optional | |
| offset | query | integer | optional | |
| cursor | query | string? | optional |
| items | TenantAuditOut[] | required | Items |
| next_cursor | string? | optional | Next Cursor |
| total | integer? | optional | Total |
{
"items": [
{}
],
"next_cursor": "string",
"total": 0
}curl "https://api.agent4.io/v1/tenant/audit?entity=agent&limit=50" -H "X-API-Key: $KEY"
GET/tenant/audit.csvThe same trail as a CSV download, taking the same filters. before/after are JSON so the file stays machine-readable. Use this to archive beyond the two-year retention.
The same trail as a CSV download, taking the same filters. before/after are JSON so the file stays machine-readable. Use this to archive beyond the two-year retention.
| action | query | string? | optional | |
| entity | query | string? | optional | |
| q | query | string? | optional | |
| changes_only | query | boolean | optional | |
| date_from | query | string? | optional | |
| date_to | query | string? | optional | |
| limit | query | integer | optional |
Response 200 · any
"…"
curl "https://api.agent4.io/v1/tenant/audit.csv?entity=agent" -H "X-API-Key: $KEY" -o audit.csv
DELETE/tenant/custom-domainDelete Custom Domain
Delete Custom Domain
Response 204 — No Content (success, empty body).
GET/tenant/custom-domainGet Custom Domain
Get Custom Domain
Response 200 · CustomDomainOut?
{}PUT/tenant/custom-domainSet Custom Domain
Set Custom Domain
| domain | string | required | Domain |
| agent_alias | string? | optional | Agent Alias |
{
"domain": "string",
"agent_alias": "string"
}| domain | string | required | Domain |
| agent_alias | string? | optional | Agent Alias |
| status | string | required | Status |
| cname_target | string | required | Cname Target |
| last_checked_at | string? | optional | Last Checked At |
| last_error | string? | optional | Last Error |
{
"domain": "string",
"agent_alias": "string",
"status": "string",
"cname_target": "string",
"last_checked_at": "string",
"last_error": "string"
}POST/tenant/custom-domain/checkCheck Custom Domain
Check Custom Domain
| domain | string | required | Domain |
| agent_alias | string? | optional | Agent Alias |
| status | string | required | Status |
| cname_target | string | required | Cname Target |
| last_checked_at | string? | optional | Last Checked At |
| last_error | string? | optional | Last Error |
{
"domain": "string",
"agent_alias": "string",
"status": "string",
"cname_target": "string",
"last_checked_at": "string",
"last_error": "string"
}GET/tenant/custom-domain/featureCustom Domain Feature
Custom Domain Feature
Response 200 · object — unstructured JSON (no fixed schema).
GET/tenant/keysList your API keys (metadata; never plaintext).
List your API keys (metadata; never plaintext).
| id | string | required | Id |
| name | string | optional | Name |
| revoked | boolean | required | Revoked |
| created_at | string | required | Created At |
[
{
"id": "string",
"name": "string",
"revoked": true,
"created_at": "string"
}
]POST/tenant/keysMint a new API key (plaintext returned once).
Mint a new API key (plaintext returned once).
| id | string | required | Id |
| api_key | string | required | Api Key |
{
"id": "string",
"api_key": "string"
}curl -X POST https://api.agent4.io/v1/tenant/keys -H "X-API-Key: $KEY" \
-H 'Content-Type: application/json' -d '{"name":"backend"}'DELETE/tenant/keys/{kid}Delete My Key
Delete My Key
| kid | path | string | required |
Response 204 — No Content (success, empty body).
POST/tenant/keys/{kid}/revokeRevoke a key (cannot revoke the last active one).
Revoke a key (cannot revoke the last active one).
| kid | path | string | required |
Response 204 — No Content (success, empty body).
GET/tenant/meYour tenant identity (id, name).
Your tenant identity (id, name).
| tenant_id | string | required | Tenant Id |
| name | string | required | Name |
| auth_mode | string | required | Auth Mode |
| alias | string? | optional | Alias |
| public_base | string? | optional | Public Base |
{
"tenant_id": "string",
"name": "string",
"auth_mode": "string",
"alias": "string",
"public_base": "string"
}DELETE/tenant/oauth/{provider}Clear a provider's credentials.
Clear a provider's credentials.
| provider | path | string | required |
Response 204 — No Content (success, empty body).
PUT/tenant/oauth/{provider}Set social-login credentials for a provider (google | twitter).
Set social-login credentials for a provider (google | twitter).
| provider | path | string | required |
| client_id | string | required | Client Id |
| client_secret | string | required | Client Secret |
{
"client_id": "string",
"client_secret": "string"
}Response 204 — No Content (success, empty body).
PUT/tenant/oauth/{provider}/enabledEnable / disable a provider (decoupled from whether creds are set).
Enable / disable a provider (decoupled from whether creds are set).
| provider | path | string | required |
| enabled | boolean | required | Enabled |
{
"enabled": true
}Response 204 — No Content (success, empty body).
GET/tenant/privacyGet privacy / BYOK settings.
Get privacy / BYOK settings.
| tenant_id | string | required | Tenant Id |
| privacy_mode | boolean | required | Privacy Mode |
| byok_provider | string? | optional | Byok Provider |
{
"tenant_id": "string",
"privacy_mode": true,
"byok_provider": "string"
}PUT/tenant/privacyUpdate privacy / BYOK settings.
Update privacy / BYOK settings.
| privacy_mode | boolean | required | Privacy Mode |
| byok_config | object? | optional | Byok Config |
{
"privacy_mode": true,
"byok_config": {}
}| tenant_id | string | required | Tenant Id |
| privacy_mode | boolean | required | Privacy Mode |
| byok_provider | string? | optional | Byok Provider |
{
"tenant_id": "string",
"privacy_mode": true,
"byok_provider": "string"
}GET/tenant/settingsGet tenant settings (name, alias, auth mode, profile, onboarding).
Get tenant settings (name, alias, auth mode, profile, onboarding).
| tenant_id | string | required | Tenant Id |
| name | string | required | Name |
| alias | string? | optional | Alias |
| alias_prefix | string | optional | Alias Prefix |
| auth_mode | string | required | Auth Mode |
| privacy_mode | boolean | required | Privacy Mode |
| status | string | required | Status |
| profile | object? | optional | Profile |
| onboarding_config | object? | optional | Onboarding Config |
| oauth | object[] | optional | Oauth |
| smtp | object? | optional | Smtp |
{
"tenant_id": "string",
"name": "string",
"alias": "string",
"alias_prefix": "string",
"auth_mode": "string",
"privacy_mode": true,
"status": "string",
"profile": {},
"onboarding_config": {},
"oauth": [
{}
],
"smtp": {}
}PATCH/tenant/settingsUpdate tenant settings.
Update tenant settings.
| name | string? | optional | Name |
| alias | string? | optional | Alias |
| auth_mode | string? | optional | Auth Mode |
| profile | object? | optional | Profile |
| onboarding_config | object? | optional | Onboarding Config |
{
"name": "string",
"alias": "string",
"auth_mode": "string",
"profile": {},
"onboarding_config": {}
}| tenant_id | string | required | Tenant Id |
| name | string | required | Name |
| alias | string? | optional | Alias |
| alias_prefix | string | optional | Alias Prefix |
| auth_mode | string | required | Auth Mode |
| privacy_mode | boolean | required | Privacy Mode |
| status | string | required | Status |
| profile | object? | optional | Profile |
| onboarding_config | object? | optional | Onboarding Config |
| oauth | object[] | optional | Oauth |
| smtp | object? | optional | Smtp |
{
"tenant_id": "string",
"name": "string",
"alias": "string",
"alias_prefix": "string",
"auth_mode": "string",
"privacy_mode": true,
"status": "string",
"profile": {},
"onboarding_config": {},
"oauth": [
{}
],
"smtp": {}
}POST/tenant/settings/logoUpload the login-page logo.
Upload the login-page logo.
| file | string | required | File |
{
"file": "string"
}Response 200 · object — unstructured JSON (no fixed schema).
PUT/tenant/settings/smtpSet tenant SMTP (password sealed with the platform KEK; empty host clears).
Set tenant SMTP (password sealed with the platform KEK; empty host clears).
| host | string | optional | Host |
| port | integer | optional | Port |
| user | string | optional | User |
| password | string? | optional | Password |
| from_addr | string | optional | From Addr |
| starttls | boolean | optional | Starttls |
{
"host": "string",
"port": 0,
"user": "string",
"password": "string",
"from_addr": "string",
"starttls": true
}| tenant_id | string | required | Tenant Id |
| name | string | required | Name |
| alias | string? | optional | Alias |
| alias_prefix | string | optional | Alias Prefix |
| auth_mode | string | required | Auth Mode |
| privacy_mode | boolean | required | Privacy Mode |
| status | string | required | Status |
| profile | object? | optional | Profile |
| onboarding_config | object? | optional | Onboarding Config |
| oauth | object[] | optional | Oauth |
| smtp | object? | optional | Smtp |
{
"tenant_id": "string",
"name": "string",
"alias": "string",
"alias_prefix": "string",
"auth_mode": "string",
"privacy_mode": true,
"status": "string",
"profile": {},
"onboarding_config": {},
"oauth": [
{}
],
"smtp": {}
}POST/tenant/settings/smtp/testSend a test email with the current SMTP config.
Send a test email with the current SMTP config.
| to | query | string | required |
Response 204 — No Content (success, empty body).
Building with a coding agent instead? The Cookbook has the same operations as ready-to-run recipes over MCP — no manual HTTP.