Agent Delete Impact
Two read-only endpoints behind the Delete agent dialog. Together they say exactly what deleting an agent takes away, and which of its linked knowledge bases the caller may choose to delete as well. Neither endpoint deletes anything. They are split by ownership: the bot service reports what happens to the agent (its public link and channels), the knowledge service reports the knowledge bases — including its own verdict on whether the caller may delete each one.All API requests require a valid JWT token in the
Authorization: Bearer <token> header. The API Gateway decodes the JWT and forwards auth context (user-id, organization-id, user-email, x-platform-role, x-org-role) as headers to downstream services.delete permission on the agent — the same check DELETE /api/bots/:id applies. A caller who cannot delete the agent gets 403 (or 404 for an agent outside their organization) and learns nothing about what deleting it would do. Org owners, admins and members hold delete on every agent in their organization; a viewer needs an explicit grant.
What deleting an agent does
Agent delete is a soft delete (bots.deleted_at is set; no row is removed). Nothing is erased; these things stop working:
Deleting a knowledge base is a hard delete: the KB, its documents, sources, vectors and graph data are removed, it stops counting toward your plan, and its links to agents are removed with it. Any other agent that used it keeps working without it.
Get agent impact
Path Parameters
string
required
Agent UUID.
Response (200)
object
{(id, name, status, organizationId)}object | null
{slug} when the agent is live at /a/:slug and through the web widget;
otherwise null.array
One entry per connected channel:
{(id, type, label, isActive)}. type is
whatsapp or whatsapp_business today; label is the display phone number
when one is stored.number
Conversations that are kept after the delete.
404 when the agent does not exist or is already deleted.
Get knowledge base impact
Path Parameters
string
required
Agent UUID.
Response (200)
array
Every knowledge base linked to the agent, in the agent’s organization:
id,name,documentCount,sourceCountotherAgentCount— every other live agent in the KB’s organization that uses itotherAgents— up to five of them by{ id, name }canDelete— the knowledge service’s own verdict forDELETE /api/knowledge/kb/:idfor this callercannotDeleteReason— whycanDeleteis false, in plain words; otherwisenull
boolean
true when the agent links more than 100 knowledge bases and the list was cut.otherAgentCount > 0 is shared: deleting it would break those agents, so the dialog shows it but does not let you tick it.
Deleting an agent with some of its knowledge bases
There is no bulk endpoint. The dialog runs the ordinary routes in order, so every delete keeps its own permission check and audit entry:DELETE /api/bots/:id— if this fails, nothing else is attempted.DELETE /api/knowledge/kb/:idonce per chosen knowledge base.
agent.delete, knowledge_base.delete) under the organization that owned the resource.
