Skip to content

Agents (Domain)

Last updated: 2026-03-15


A Live Agent (referred to as “Agent” in the UI) is a workspace-scoped, AI-powered runtime entity that handles inbound conversations on Chatti Live channels (Facebook Messenger, WhatsApp, Web Chat, SMS). Each agent is bound to exactly one Knowledge Base and can be linked to up to four channel connections simultaneously.

Agents are not Comment Responder entities. Comment Responder (social-comments, review-platforms) operates independently and does not use the Live Agent system.


Scope model: workspace-first with global hub

Section titled “Scope model: workspace-first with global hub”

Agents are workspace-scoped objects. Every agent belongs to exactly one workspace (via its KB → workspace chain). The global /account/agents page is an aggregated read-only hub that lists agents across all workspaces the authenticated user can access. All create/edit/delete actions are performed within workspace context.

SurfacePurposeScope
/account/agentsGlobal hub: list, search, filter, navigate to agentCross-workspace (read + navigate)
/account/workspaces/[id] → Agents tabWorkspace-scoped list + full CRUDSingle workspace
Agent edit modal/drawerFull agent configurationSingle agent within workspace

Rationale: Enterprise operators need a cross-workspace view to audit agent status at a glance. But all mutations are workspace-scoped to preserve isolation invariants. The global hub never exposes agents from workspaces the user cannot access.


draft → inactive → active
deprecated (soft-delete; v2)
StateAPI valueMeaning
draft"draft"Agent created but KB is incomplete (KB status = incomplete). Cannot be activated.
inactive"inactive"Agent is configured and KB is complete, but not currently listening on any channel.
active"active"Agent is listening on ≥ 1 channel connection. Conversations are routed to this agent.

An agent cannot transition to active unless ALL of the following are true:

  1. knowledgeBaseId is set and the referenced KB has status = "complete".
  2. At least one channel connection is linked (channelIds.length >= 1).
  3. All linked channel connections have status = "connected" (healthy).
  4. Agent name is non-empty.

If any prerequisite is unmet, the API must reject the status update with 422 Unprocessable Entity and a structured error body (see Error Contract).

FromToTriggerAllowed
draftinactiveKB becomes completeAutomatic (system)
inactiveactiveUser activatesManual (user)
activeinactiveUser deactivatesManual (user)
activedraftKB reverts to incompleteAutomatic (system)
anydeletedUser destroysManual (user); requires inactive or draft state

Deleting an active agent is blocked. The user must deactivate first.


The agent entity exists and its KB is complete. The agent is capable of handling conversations but may not yet be listening. Maps to state inactive or active.

A channel connection (ChannelConnection) with status = "connected" exists and is linked to this agent via channelIds. The connection credential is valid and the platform integration is healthy.

The agent is in active state AND the specific channel connection is in channelIds AND that connection has status = "connected". Only in this state does the agent actually receive and respond to inbound messages on that channel.


ConstraintRule
Total channel links per agentMaximum 4 (channelIds.length <= 4)
Per channel typeNo per-type cap in v1
Minimum to activate1

Rationale: The total cap of 4 ensures reasonable scope per agent. No per-type uniqueness is enforced in v1; an operator may link multiple connections of the same channel type if needed.


RuleDetail
CardinalityEach agent is assigned to exactly one KB (knowledgeBaseId is required and non-nullable).
KB must be workspace-scopedThe assigned KB must belong to the same workspace as the agent. Cross-workspace KB assignment is forbidden.
ReassignmentAllowed at any time when agent is inactive or draft. Reassigning an active agent is blocked — deactivate first.
KB deletionCannot delete a KB that has ≥ 1 agent assigned (any state). The user must reassign or delete all agents first.
Multi-KB per agentNot supported in v1. One agent = one KB.
Multiple agents per KBAllowed. Multiple agents can reference the same KB (e.g., one agent per channel type, all sharing one KB).

EntityID conventionNameStatus
Workspacews-1 (or server-generated)“My Workspace”active
Knowledge Basekb-default-1 (or server-generated)“My Knowledge Base”incomplete
Agentagent-default-1 (or server-generated)“My Agent”draft

The default agent is linked to the default KB. No channels are linked at creation. The agent remains in draft state until the KB is completed and at least one channel is connected.

  • Workspace: active, no channels connected
  • KB: incomplete (no brand personality fields filled)
  • Agent: draft (KB incomplete, no channels)

Idempotent backfill rule for existing users

Section titled “Idempotent backfill rule for existing users”

On backfill for existing users:

  1. Ensure each workspace knowledge base has at least one agent.
  2. For each KB, assign existing Agent-managed channels (facebook-messenger, web-chat, whatsapp, sms) linked to that KB into KB-scoped agents.
  3. Respect max 4 channel links per agent by creating additional KB-scoped agents as needed.
  4. Keep the process idempotent: reruns do not duplicate already-covered assignments.

FieldTypeRequiredNotes
idstringYesServer-generated UUID
namestringYesDisplay name; 1–80 chars
workspaceIdstringYesParent workspace; immutable after creation
knowledgeBaseIdstringYesMust belong to same workspace
status"draft" | "inactive" | "active"YesLifecycle state
channelIdsstring[]YesArray of ChannelConnection IDs; max 4 total; no per-type cap in v1
iconstring | nullNoURL to uploaded agent icon image
integrationConfigAgentIntegrationConfig | nullNoPer-channel integration settings (see below)
createdAtstring (ISO 8601)YesServer-set
updatedAtstring (ISO 8601)YesServer-set

AgentIntegrationConfig (per-channel settings)

Section titled “AgentIntegrationConfig (per-channel settings)”
interface AgentIntegrationConfig {
webChat?: {
primaryColor?: string; // hex color
welcomeMessage?: string; // max 500 chars
autoVisibility?: boolean; // show widget automatically
visibilityDelay?: number; // seconds before auto-show
};
messenger?: {
welcomeMessage?: string;
iceBreakers?: string[]; // max 5 items
};
whatsapp?: {
welcomeMessage?: string;
};
sms?: {
welcomeMessage?: string;
};
}
RelationshipConstraint
Agent → WorkspaceN:1; workspace is immutable after creation
Agent → KBN:1; KB must be in same workspace; one KB per agent
Agent → ChannelConnection1:N (max 4 total); each connection must be in same workspace and can belong to only one agent
KB → Agent1:N; KB can have multiple agents
Workspace → Agent1:N; no hard cap per workspace in v1
FieldRuleError code
nameRequired, 1–80 chars, non-empty after trimAGENT_NAME_REQUIRED, AGENT_NAME_TOO_LONG
knowledgeBaseIdMust reference existing KB in same workspaceKB_NOT_FOUND, KB_WORKSPACE_MISMATCH
channelIdsMax 4 items total; each must be valid ChannelConnection ID in same workspace; no per-type cap in v1; a connection ID cannot be assigned to multiple agentsCHANNEL_LIMIT_EXCEEDED, CHANNEL_NOT_FOUND, CHANNEL_WORKSPACE_MISMATCH, CHANNEL_ALREADY_ASSIGNED
Status → activeKB must be complete; ≥ 1 channel connectedKB_INCOMPLETE, NO_CHANNELS_CONNECTED
DeleteAgent must be inactive or draftAGENT_ACTIVE_DELETE_BLOCKED
KB deleteNo agents assignedKB_HAS_AGENTS

All validation errors return 422 Unprocessable Entity:

{
"error": {
"code": "AGENT_NAME_REQUIRED",
"message": "Agent name is required.",
"field": "name"
}
}

For activation failures:

{
"error": {
"code": "KB_INCOMPLETE",
"message": "The assigned knowledge base must be complete before activating this agent.",
"field": "knowledgeBaseId"
}
}

https://api-dev.conversioniq.ai/v1

All agent API calls must include the workspace context header:

X-Workspace-ID: {workspaceId}

The backend uses this header to scope queries and enforce isolation. Requests without a valid X-Workspace-ID that match the authenticated user’s accessible workspaces must return 403 Forbidden.

UI ActionMethodEndpointNotes
List agents (global hub)GET/live-agentsNo X-Workspace-ID; returns all accessible agents
List agents (workspace-scoped)GET/live-agents?workspaceId={id}Filter by workspace
Create agentPOST/live-agentsRequires X-Workspace-ID
Get agent detailGET/live-agents/{liveAgent}
Update agent (general/config)PUT/live-agents/{liveAgent}Full update
Activate / deactivatePATCH/live-agents/{liveAgent}/statusBody: { "status": "active" | "inactive" }
Update integration configPUT/live-agents/{liveAgent}/integration-configWeb/Messenger/WhatsApp/SMS settings
Upload agent iconPOST/live-agents/{liveAgent}/integration-iconMultipart form; returns { iconUrl }
Delete agentDELETE/live-agents/{liveAgent}Agent must be inactive/draft
Create session (Chatti Live)POST/agents/{agentId}/sessionsUsed by Chatti Live runtime; not from /account/agents UI

Pagination / filter / search contract (list endpoint)

Section titled “Pagination / filter / search contract (list endpoint)”

Query parameters for GET /live-agents:

ParameterTypeDescription
workspaceIdstringFilter to single workspace
status"draft" | "inactive" | "active"Filter by lifecycle state
searchstringFull-text search on agent name
pagenumber1-indexed page number (default: 1)
perPagenumberItems per page (default: 20, max: 100)
sortBy"name" | "status" | "createdAt" | "updatedAt"Sort field (default: updatedAt)
sortDir"asc" | "desc"Sort direction (default: desc)

Response envelope:

{
"data": [ /* Agent[] */ ],
"meta": {
"total": 42,
"page": 1,
"perPage": 20,
"totalPages": 3
}
}

  • Chatti Live – Agents — The /chatti-live/agents route concept is deprecated. Agent management is now exclusively at /account/agents and the workspace Agents tab. The Chatti Live section handles conversation routing only, not agent configuration.