Chatqus CRM API

WhatsappHealthBlocker

An entity Meta reports as limiting or blocking delivery.
entity_type
​string

PHONE_NUMBER, WABA, BUSINESS, APP or MESSAGE_TEMPLATE.

entity_id
​string
can_send_message
​string · enum

This entity's own verdict.

Enum values:
AVAILABLE
LIMITED
BLOCKED
UNKNOWN
error_code
​integer
description
​string
solution
​string

WhatsappAccountHealth

account_id
​string · uuid
display_name
​string
phone_number_id
​string
display_phone_number
​string
verified_name
​string
quality_rating
​string · enum
Enum values:
GREEN
YELLOW
RED
UNKNOWN
messaging_limit_tier
​string

Raw Meta tier code, read from the phone number's whatsapp_business_manager_messaging_limit field. Meta deprecated messaging_limit_tier on its side; this property keeps the name because it is this API's published contract.

messaging_limit_per_24h
​integer

The tier resolved to unique recipients reachable outside a customer service window per rolling 24 hours. Set per business portfolio and shared by every phone number in it. Null for TIER_UNLIMITED and for tiers Meta did not report - read it together with messaging_limit_tier to tell the two apart.

throughput_level
​string · enum
Enum values:
STANDARD
HIGH
NOT_APPLICABLE
UNKNOWN
operational_status
​string
name_status
​string
can_send_message
​string · enum
Enum values:
AVAILABLE
LIMITED
BLOCKED
UNKNOWN
severity
​string · enum
Enum values:
ok
warning
critical
checked_at
​string · date-time

ErrorResponse

​object · required

LoginRequest

email
​string · email · required
password
​string · minLength: 1 · required
totp_code
​string

TOTP authenticator code, when completing a TOTP-2FA login.

email_code
​string

The emailed OTP, when completing an email-2FA login.

request_email_code
​boolean

When true, ask the server to email an OTP instead of verifying a code on this request.

turnstile_token
​string

Cloudflare Turnstile token, when the CAPTCHA widget is enabled.

remember_me
​boolean

When true, issue a longer-lived "remember me" session (7 days, cookie Max-Age and JWT exp) instead of the default TTL. Only takes effect after 2FA succeeds; ignored on 2FA-challenge responses.

org_id
​string · uuid

Optional workspace hint: which organization to look the email up in first. Without it the server searches every tenant it has loaded and takes the first email match, which misses a workspace provisioned seconds ago on another replica and is ambiguous when the same email exists in several workspaces. Sent by the post-registration sign-in flow. Never bypasses the password or 2FA checks.

LoginResponse

token
​string · required

JWT token

​AgentPublic · required

AgentPublic

id
​string · uuid · required
email
​string · email · required
full_name
​string · required
role
​AgentRole · enum · required
Enum values:
admin
supervisor
agent
is_online
​boolean · required

AgentRole

string · enum
Enum values:
admin
supervisor
agent

SsoOptions

google_enabled
​boolean · required

True when platform-level Google SSO login is configured.

SsoDiscoverRequest

email
​string · email · required
turnstile_token
​string

Cloudflare Turnstile token, when the CAPTCHA widget is enabled.

SsoDiscoverResponse

sso_available
​boolean · required

True when an enabled company SSO provider accepts the email's domain.

start_url
​string · required

Relative URL that begins the company SSO flow (carries a single-use ticket). Null when no provider matches.

PasskeyChallenge

challenge_id
​string · uuid · required

Server-side ceremony id; echo it back on the matching verify call.

options
​object · required

WebAuthn options to pass to the browser (navigator.credentials.create for registration, navigator.credentials.get for login).

PasskeyPublic

id
​string · uuid · required
created_at
​string · date-time · required
device_label
​string

Friendly device name shown in the passkey list.

last_used_at
​string · date-time

SsoProviderPublic

id
​string · uuid · required
provider_name
​string · required
issuer_url
​string · required
client_id
​string · required
has_client_secret
​boolean · required

True when a client secret is stored. The secret itself is never returned.

allowed_email_domains
​string[] · required
enabled
​boolean · required
require_email_verified
​boolean · required
created_at
​string · date-time · required
updated_at
​string · date-time · required

CreateSsoProviderRequest

provider_name
​string · required
issuer_url
​string · required

OIDC issuer base URL (must serve an OIDC discovery document).

client_id
​string · required
client_secret
​string · required

Stored encrypted at rest; never returned by the API.

allowed_email_domains
​string[] · minItems: 1 · required
enabled
​boolean
Default: true
require_email_verified
​boolean
Default: true

UpdateSsoProviderRequest

All fields optional; an omitted or empty `client_secret` keeps the stored one (so the masked value can be round-tripped from the UI).
provider_name
​string
issuer_url
​string
client_id
​string
client_secret
​string
allowed_email_domains
​string[]
enabled
​boolean
require_email_verified
​boolean

ConversationStatus

string · enum
Enum values:
open
snoozed
resolved

The complete set of conversation states. Mirrors ConversationStatus in crates/omni-common/src/models/conversation.rs. pending and expired were removed by migrations/20260326000039_simplify_conversation_statuses.sql (pending → open, expired → resolved) and snoozed was added by migrations/20260519000012_conversation_snooze.sql. Passing a removed value as a status filter is rejected with 400 before the handler runs, because the query struct deserializes straight into this enum. A snoozed conversation is hidden from the inbox until snoozed_until passes, at which point it reopens automatically.

ConversationWithContact

id
​string · uuid · required
contact_id
​string · uuid · required
status
​ConversationStatus · enum · required

The complete set of conversation states. Mirrors ConversationStatus in crates/omni-common/src/models/conversation.rs. pending and expired were removed by migrations/20260326000039_simplify_conversation_statuses.sql (pending → open, expired → resolved) and snoozed was added by migrations/20260519000012_conversation_snooze.sql. Passing a removed value as a status filter is rejected with 400 before the handler runs, because the query struct deserializes straight into this enum. A snoozed conversation is hidden from the inbox until snoozed_until passes, at which point it reopens automatically.

Enum values:
open
snoozed
resolved
last_message_at
​string · date-time · required
unread_count
​integer · required
created_at
​string · date-time · required
updated_at
​string · date-time · required
contact_channel
​string · required

whatsapp, instagram, or email

assigned_agent_id
​string · uuid
assigned_agent_name
​string

Full name of the assigned agent (null when unassigned)

contact_name
​string
contact_phone
​string
​Assignee[]

All co-assignees (human agents and/or AI agent) attached to this conversation via the conversation_assignees junction, ordered by assignment time. assigned_agent_id remains the denormalized primary.

Assignee

kind
​string · enum · required

Discriminates human vs AI assignee

Enum values:
human
ai
agent_id
​string · uuid

Set when this assignee is a human agent

ai_agent_id
​string · uuid

Set when this assignee is an AI agent

name
​string

Display name of the human or AI agent

AssignAgentRequest

agent_id
​string · uuid

Set to null to unassign

AddAssigneeRequest

Exactly one of agent_id or ai_agent_id must be provided. Providing ai_agent_id hands the conversation off to AI and clears human assignees.
agent_id
​string · uuid

Human agent to add as co-assignee

ai_agent_id
​string · uuid

AI agent to hand the conversation off to

UpdateStatusRequest

status
​ConversationStatus · enum · required

The complete set of conversation states. Mirrors ConversationStatus in crates/omni-common/src/models/conversation.rs. pending and expired were removed by migrations/20260326000039_simplify_conversation_statuses.sql (pending → open, expired → resolved) and snoozed was added by migrations/20260519000012_conversation_snooze.sql. Passing a removed value as a status filter is rejected with 400 before the handler runs, because the query struct deserializes straight into this enum. A snoozed conversation is hidden from the inbox until snoozed_until passes, at which point it reopens automatically.

Enum values:
open
snoozed
resolved

MessageType

string · enum
Enum values:
text
image
document
template
audio
video
location
sticker

Mirrors MessageType in crates/omni-common/src/models/message.rs. contacts (a shared contact card) and postback (a tapped button) are emitted by the channel engines; unknown covers anything the parsers did not recognise. flow is an outbound WhatsApp Flow send (content follows FlowSendContent, requires wa_flows.send); flow_response is the matching inbound completion and is never sent by a caller — its content carries a masked summary only, never the customer's answers (see WhatsAppFlowCompletedEvent and GET /api/wa-flow-responses/{session_id} for the real values).

MessageDirection

string · enum
Enum values:
inbound
outbound

MessageStatus

string · enum
Enum values:
pending
sent
delivered
read
failed

MessageReaction

An emoji reaction added by an agent inside the CRM. Mirrors `MessageReaction` in `crates/omni-common/src/models/message.rs`.
emoji
​string · required
agent_id
​string · uuid · required
agent_name
​string · required

Denormalized display name, for tooltip rendering

created_at
​string · date-time · required

Message

A stored message, as returned by `GET /api/conversations/{id}/messages` and by `POST /api/conversations/{id}/messages`. Mirrors `Message` in `crates/omni-common/src/models/message.rs`.
conversation_id
​string · uuid · required
direction
​MessageDirection · enum · required
Enum values:
inbound
outbound
type
​MessageType · enum · required

Mirrors MessageType in crates/omni-common/src/models/message.rs. contacts (a shared contact card) and postback (a tapped button) are emitted by the channel engines; unknown covers anything the parsers did not recognise. flow is an outbound WhatsApp Flow send (content follows FlowSendContent, requires wa_flows.send); flow_response is the matching inbound completion and is never sent by a caller — its content carries a masked summary only, never the customer's answers (see WhatsAppFlowCompletedEvent and GET /api/wa-flow-responses/{session_id} for the real values).

Enum values:
text
image
document
template
audio
video
location
sticker
content
​required

Free-form JSON whose shape depends on type. READING a stored message: text lives under body. Every channel engine normalises inbound content to {"body": "..."} before storing it (see the parser modules in crates/chat-engine), and outbound text stored through this API arrives the same way from the first-party clients. The server's own reader, extract_content_text in crates/api-gateway/src/routes/messages/handlers.rs, tries body, then text, then caption, then subject — a consumer should do the same rather than reading one key. Email messages carry body, subject, html and text together. WRITING via SendMessageRequest: either key works. The WhatsApp sender reads text first and falls back to body (crates/message-sender/src/whatsapp.rs), and whichever you send is stored verbatim — so send body if you want reads and writes to agree.

status
​MessageStatus · enum · required
Enum values:
pending
sent
delivered
read
failed
created_at
​string · date-time · required
​object

MongoDB ObjectId in extended JSON — {"$oid": "<24-hex>"}, NOT a bare string. The server field is a bson::oid::ObjectId, which serializes to this wrapper object under serde_json. Note the asymmetry with MessageSearchResult._id, which IS a plain hex string: the search handler flattens it with oid.to_hex() while building the result. The same logical value therefore arrives in two different shapes depending on the endpoint. MessageListResponse.next_cursor and the cursor query parameter both use the plain hex form, so the value read from here must be unwrapped before it can be used as a cursor. Absent on a message whose id was never assigned (the field is skipped when null).

external_id
​string

The provider's own id for this message — a WhatsApp wamid.* from the Cloud API, a Meta message id for Instagram/Messenger, or the SMTP Message-ID for email. Distinct from _id, which is Omnistream's id and the one every REST endpoint takes and returns. Outbound messages are stored before the provider has assigned one, so this is null between the send call returning and the provider accepting the message (typically under a second). It is populated in place once message-sender gets the provider's response, and it is the key delivery receipts arrive under — see WebhookMessagePreview for how to correlate the two ids.

sender_phone
​string
sent_by_agent_id
​string · uuid

Agent who sent this outbound message. Absent on inbound and system-generated messages.

sent_by_agent_name
​string

Denormalized display name of the sending agent

​MessageReaction[]

CRM-internal agent reactions. Never forwarded to the external channel. Absent when nobody has reacted.

error_message
​string

Why delivery failed — human-readable, only set when status is failed

error_code
​string

Provider error code for the failure (e.g. "132001" from Meta)

error_source
​string

Origin of the failure ("meta", "smtp", or "system")

error_details
​object

Raw provider error object (sanitized), for support/debugging

MessageListResponse

​Message[] · required
has_more
​boolean · required
next_cursor
​string

MongoDB ObjectId hex for next page

MessageSearchResult

One hit from `GET /api/messages/search`. Deliberately NOT a `Message`: it carries a highlighted snippet and denormalised contact context, and has no delivery status, provider ID, or failure detail. Mirrors `MessageSearchResult` in `crates/omni-common/src/models/message.rs`.
_id
​string · required

MongoDB ObjectId as a plain 24-character hex string — the search handler flattens it with oid.to_hex(). This differs from Message._id, which is the extended-JSON object {"$oid": ...}.

conversation_id
​string · uuid · required
direction
​MessageDirection · enum · required
Enum values:
inbound
outbound
type
​MessageType · enum · required

Mirrors MessageType in crates/omni-common/src/models/message.rs. contacts (a shared contact card) and postback (a tapped button) are emitted by the channel engines; unknown covers anything the parsers did not recognise. flow is an outbound WhatsApp Flow send (content follows FlowSendContent, requires wa_flows.send); flow_response is the matching inbound completion and is never sent by a caller — its content carries a masked summary only, never the customer's answers (see WhatsAppFlowCompletedEvent and GET /api/wa-flow-responses/{session_id} for the real values).

Enum values:
text
image
document
template
audio
video
location
sticker
content
​required

Free-form JSON whose shape depends on type, copied verbatim from the stored message. Text lives under body; read body, text, caption, subject in that order. See Message.content.

snippet
​string · required

Matched text with <mark> tags around the search terms. Built from customer-supplied content — escape everything outside the marks before rendering.

created_at
​string · date-time · required
contact_name
​string
contact_phone
​string
channel
​string

whatsapp, instagram, email, or messenger

MessageSearchResponse

​MessageSearchResult[] · required
total
​integer · int64 · required
page
​integer · int64 · required
per_page
​integer · int64 · required

Page size actually applied, clamped to 50

total_pages
​integer · int64 · required

SendMessageRequest

type
​MessageType · enum · required

Mirrors MessageType in crates/omni-common/src/models/message.rs. contacts (a shared contact card) and postback (a tapped button) are emitted by the channel engines; unknown covers anything the parsers did not recognise. flow is an outbound WhatsApp Flow send (content follows FlowSendContent, requires wa_flows.send); flow_response is the matching inbound completion and is never sent by a caller — its content carries a masked summary only, never the customer's answers (see WhatsAppFlowCompletedEvent and GET /api/wa-flow-responses/{session_id} for the real values).

Enum values:
text
image
document
template
audio
video
location
sticker
content
​required

Free-form JSON. For text: {"text": "Hello"} or {"body": "Hello"} — the WhatsApp sender reads text first and falls back to body. For image: {"url": "...", "caption": "..."}. Whichever key you send is stored verbatim and read back on Message.content, so sending body keeps writes and reads on the same key that every inbound message already uses.

Contact

id
​string · uuid · required
channel_source
​string · required

whatsapp, instagram, or email

tags
​string[] · required

JSON array of tag strings

created_at
​string · date-time · required
updated_at
​string · date-time · required
phone_number
​string
name
​string
email
​string · email

ContactListResponse

Pagination envelope returned by `GET /api/contacts`. Mirrors the server's `PaginatedResponse<Contact>` — see `list_contacts` in `crates/api-gateway/src/routes/contacts.rs`.
​Contact[] · required
total
​integer · int64 · required

Matching contacts across all pages

page
​integer · int64 · required

1-based page number

per_page
​integer · int64 · required

Page size actually applied, clamped to 100

total_pages
​integer · int64 · required

UpdateContact

At least one field required.
name
​string
email
​string · email
tags
​string[]

CreateAgent

email
​string · email · required

Must contain @

password
​string · minLength: 8 · required
full_name
​string · minLength: 1 · required
role
​AgentRole · enum

Defaults to "agent" if omitted

Enum values:
admin
supervisor
agent

UpdateAgent

At least one field required.
email
​string · email

Admin only

full_name
​string · minLength: 1
role
​AgentRole · enum

Admin only

Enum values:
admin
supervisor
agent
password
​string · minLength: 8

UpdateAgentStatusRequest

is_online
​boolean · required

ConversationNote

id
​string · uuid · required
conversation_id
​string · uuid · required
agent_id
​string · uuid · required
content
​string · required
created_at
​string · date-time · required
updated_at
​string · date-time · required

NoteResponse

id
​string · uuid · required
conversation_id
​string · uuid · required
agent_id
​string · uuid · required
agent_name
​string · required
content
​string · required
created_at
​string · date-time · required
updated_at
​string · date-time · required

CreateNote

content
​string · minLength: 1 · required

UpdateNote

content
​string · minLength: 1 · required

QuickReply

id
​string · uuid · required
title
​string · required
content
​string · required
created_by
​string · uuid · required
created_at
​string · date-time · required
updated_at
​string · date-time · required
shortcut
​string
category_id
​string · uuid

FK to quick_reply_categories

CreateQuickReply

title
​string · minLength: 1 · required
content
​string · minLength: 1 · required
shortcut
​string
category_id
​string · uuid

UpdateQuickReply

title
​string
content
​string
shortcut
​string
category_id
​string · uuid

OverviewResponse

total_conversations
​integer · required
open_conversations
​integer · required
pending_conversations
​integer · required
resolved_conversations
​integer · required
total_contacts
​integer · required
total_agents
​integer · required
online_agents
​integer · required
messages_today
​integer · required
resolution_rate
​number · double · required

Percentage (0.0 - 100.0)

DayCount

date
​string · date · required

YYYY-MM-DD

count
​integer · required

TrendsResponse

period
​string · required

7d, 30d, or 90d

days
​integer · required
​DayCount[] · required
​DayCount[] · required

AgentMetric

agent_id
​string · required
full_name
​string · required
email
​string · required
is_online
​boolean · required
open_conversations
​integer · required
resolved_conversations
​integer · required
total_conversations
​integer · required

AgentMetricsResponse

​AgentMetric[] · required

ChannelMetric

channel
​string · required
contact_count
​integer · required
conversation_count
​integer · required

ChannelMetricsResponse

​ChannelMetric[] · required

HealthResponse

status
​string · enum · required
Enum values:
healthy
degraded
​object · required

MediaUploadResponse

media_id
​string · required
mime_type
​string · required
file_size
​integer · required
filename
​string · required

Division

id
​string · uuid · required
name
​string · required
description
​string · required
allocation_method
​string · enum · required
Enum values:
round_robin
least_load
is_active
​boolean · required
created_at
​string · date-time · required
updated_at
​string · date-time · required

DivisionWithCount

id
​string · uuid · required
name
​string · required
description
​string · required
allocation_method
​string · enum · required
Enum values:
round_robin
least_load
is_active
​boolean · required
created_at
​string · date-time · required
updated_at
​string · date-time · required
agent_count
​integer

CreateDivision

name
​string · minLength: 1 · required
description
​string
allocation_method
​string · enum
Enum values:
round_robin
least_load
Default: least_load

UpdateDivision

name
​string
description
​string
allocation_method
​string · enum
Enum values:
round_robin
least_load
is_active
​boolean

TransferConversationRequest

At least one of to_agent_id or to_division_id must be provided.
to_agent_id
​string · uuid
to_division_id
​string · uuid
note
​string

ConversationTransfer

id
​string · uuid · required
conversation_id
​string · uuid · required
transferred_by
​string · uuid · required
created_at
​string · date-time · required
from_agent_id
​string · uuid
to_agent_id
​string · uuid
to_division_id
​string · uuid
note
​string
from_agent_name
​string
to_agent_name
​string
to_division_name
​string
transferred_by_name
​string

BulkConversationRequest

conversation_ids
​string[] · minItems: 1 · maxItems: 100 · required
​required

UpdateTagsRequest

tags
​string[] · required

ScheduleMessageRequest

type
​string · required
content
​required

Free-form JSON message content

scheduled_at
​string · date-time · required

Must be in the future (UTC)

ScheduledMessage

id
​string · uuid · required
conversation_id
​string · uuid · required
scheduled_by
​string · uuid · required
msg_type
​string · required
content
​required
scheduled_at
​string · date-time · required
status
​string · enum · required
Enum values:
pending
sent
cancelled
failed
created_at
​string · date-time · required
error_message
​string
sent_at
​string · date-time
agent_name
​string

CsatSurvey

id
​string · uuid · required
conversation_id
​string · uuid · required
contact_id
​string · uuid · required
status
​string · enum · required
Enum values:
pending
rated
created_at
​string · date-time · required
agent_id
​string · uuid
rating
​integer · min: 1 · max: 5
comment
​string
rated_at
​string · date-time
agent_name
​string
contact_name
​string

SubmitCsatRequest

rating
​integer · min: 1 · max: 5 · required
comment
​string

CsatAnalyticsResponse

period
​string · required
​object · required
​object[] · required

SlaPolicy

id
​string · uuid · required
name
​string · required
first_response_time_secs
​integer · required
resolution_time_secs
​integer · required
warning_threshold_pct
​integer · required
priority
​integer · required
is_active
​boolean · required
is_default
​boolean · required
created_at
​string · date-time · required
updated_at
​string · date-time · required
description
​string
channel
​string
division_id
​string · uuid

CreateSlaPolicy

name
​string · minLength: 1 · required
description
​string
first_response_time_secs
​integer
Default: 300
resolution_time_secs
​integer
Default: 3600
warning_threshold_pct
​integer
Default: 80
priority
​integer
Default: 0
channel
​string
division_id
​string · uuid
is_default
​boolean
Default: false

UpdateSlaPolicy

name
​string
description
​string
first_response_time_secs
​integer
resolution_time_secs
​integer
warning_threshold_pct
​integer
priority
​integer
channel
​string
division_id
​string · uuid
is_active
​boolean
is_default
​boolean

SlaBreachLog

id
​string · uuid · required
conversation_id
​string · uuid · required
sla_policy_id
​string · uuid · required
breach_type
​string · enum · required
Enum values:
first_response
resolution
threshold_secs
​integer · required
actual_secs
​integer · required
breached_at
​string · date-time · required

ConversationSlaStatus

conversation_id
​string · uuid
policy_id
​string · uuid
policy_name
​string
frt_status
​string · enum

not_started means the conversation was business-initiated (outbound template/campaign) and the customer has not replied yet: the SLA clock is idle and elapsed fields are null.

Enum values:
not_started
ok
warning
breached
frt_elapsed_secs
​integer
frt_threshold_secs
​integer
resolution_status
​string · enum
Enum values:
not_started
ok
warning
breached
resolution_elapsed_secs
​integer
resolution_threshold_secs
​integer

Integration

id
​string · uuid · required
channel
​string · required

whatsapp, instagram, email, or messenger

is_active
​boolean · required
config
​object · required

Channel configuration (sensitive fields masked)

created_at
​string · date-time · required
updated_at
​string · date-time · required
division_id
​string · uuid

UpsertIntegration

is_active
​boolean
config
​object
division_id
​string · uuid

IntegrationAccount

id
​string · uuid · required
channel
​string · required

whatsapp, instagram, email, or messenger

account_key
​string · required

Unique key within a channel (e.g. wa-123456789)

display_name
​string · required
is_active
​boolean · required
is_default
​boolean · required
​object · required

Account configuration (sensitive fields masked). WhatsApp Business App coexistence accounts include initial_sync, which tracks the first contact/conversation/message sync after connection.

created_at
​string · date-time · required
updated_at
​string · date-time · required
division_id
​string · uuid
verify_token
​string
webhook_url
​string

Computed webhook URL for this account

WhatsappInitialSync

Initial WhatsApp Business App coexistence sync progress.
type
​string
status
​string · enum
Enum values:
waiting
syncing
completed
started_at
​string · date-time
last_event_at
​string · date-time
completed_at
​string · date-time
contacts_synced
​integer · min: 0
conversations_synced
​integer · min: 0
messages_synced
​integer · min: 0

CreateIntegrationAccount

channel
​string · required

whatsapp, instagram, email, or messenger

account_key
​string

Required for non-WhatsApp channels. Auto-derived from phone_number_id for WhatsApp.

display_name
​string
is_active
​boolean
Default: false
is_default
​boolean
Default: false
division_id
​string · uuid
config
​object

UpdateIntegrationAccount

account_key
​string
display_name
​string
is_active
​boolean
is_default
​boolean
division_id
​string · uuid
config
​object

WaTemplate

id
​string · uuid · required
waba_id
​string · required

WhatsApp Business Account ID

name
​string · required
language
​string · required

BCP-47 language code (e.g. id, en_US)

category
​string · enum · required
Enum values:
MARKETING
UTILITY
AUTHENTICATION
status
​string · enum · required
Enum values:
APPROVED
PENDING
REJECTED
PAUSED
DISABLED
components
​required

Meta template components array (HEADER, BODY, FOOTER, BUTTONS)

created_at
​string · date-time · required
updated_at
​string · date-time · required
meta_template_id
​string

Template ID assigned by Meta

header_media_url
​string

Public MinIO URL for the header media (IMAGE/VIDEO/DOCUMENT)

CreateWaTemplate

name
​string · required

Lowercase letters, numbers, and underscores only. Max 512 chars.

components
​required

Meta template components array

language
​string
Default: id
category
​string · enum
Enum values:
MARKETING
UTILITY
AUTHENTICATION
Default: MARKETING
integration_account_id
​string · uuid

Use specific WABA account. Falls back to META_WABA_ID env var.

FlowSendContent

flow_id
​string · uuid · required

wa_flows.id

cta
​string · maxLength: 30 · required

Button label, no emoji

body
​string · maxLength: 1024 · required
header
​string · maxLength: 60
footer
​string · maxLength: 60
screen
​string

Entry screen id; defaults to the first screen

data
​object

flow_action_payload.data (≤ 4 KB)

WaFlowSummary

id
​string · uuid
waba_id
​string
meta_flow_id
​string
name
​string
status
​string
categories
​string[]
​object[]
is_available
​boolean
last_synced_at
​string · date-time

WaFlowSyncOutcome

waba_id
​string
fetched
​integer
upserted
​integer
screens_updated
​integer
marked_unavailable
​integer
error
​string

Set only when the pass was PARTIAL — nothing was demoted and no success was stamped

warnings
​string[]

Per-Flow diagnostics from a pass that otherwise completed (for example a PUBLISHED Flow whose FLOW_JSON asset Meta does not expose). Distinct from error: the catalog was fully refreshed.

WaFlowSyncState

waba_id
​string
last_attempt_at
​string · date-time
last_success_at
​string · date-time
last_error
​string

WaFlowRevealedResponse

session_id
​string · uuid
conversation_id
​string · uuid
​object
completed_at
​string · date-time
response_hash
​string

SHA-256 hex of the delivered answers — the completion object with flow_token removed, serialised with sorted keys and no whitespace

​object

WhatsAppFlowCompletedEvent

Outgoing webhook body for `whatsapp.flow.completed` (HMAC-signed like every event).
event_type
​string · enum
Enum values:
whatsapp.flow.completed
timestamp
​string · date-time
​object

OutgoingWebhook

id
​string · uuid · required
name
​string · required
url
​string · required
events
​required

JSON array of subscribed event type strings

is_active
​boolean · required
consecutive_failures
​integer · required
created_at
​string · date-time · required
updated_at
​string · date-time · required
secret
​string · writeOnly

HMAC signing secret. Write-only — never returned in responses. The staged rotation secret (secret_next) is likewise never returned; a pending rotation is only visible via secret_rotated_at.

secret_rotated_at
​string · date-time

When the current secret-rotation overlap window started. Null when no rotation is in progress (cleared on complete, cancel, or the 24-hour auto-promote).

created_by
​string · uuid
last_triggered_at
​string · date-time
last_success_at
​string · date-time

CreateOutgoingWebhook

name
​string · minLength: 1 · required
url
​string · required

Must start with http:// or https://

secret
​string
events
​string[]

Valid types: message.received, message.sent, message.status, conversation.created, conversation.resolved, conversation.assigned, whatsapp.flow.completed, contact.created

UpdateOutgoingWebhook

name
​string
url
​string
secret
​string
events
​string[]
is_active
​boolean

WebhookPayload

oneOf
Exactly one variant must match.

Decision Table

VariantMatching Criteria
type = object · requires: event_type, timestamp, data
type = object · requires: event_type, timestamp, data
type = object · requires: event_type, timestamp, data
Properties for Variant 1:
The JSON body POSTed to a subscribed outgoing webhook, and the value stored in `WebhookDelivery.payload`. Signed with HMAC-SHA256 over the raw body; the hex digest arrives in `X-Omnistream-Signature`. During a secret rotation both the old and new signatures are sent, so verify against either.
event_type
​string · enum · required

Matches one of the values from GET /api/outgoing-webhooks/events.

Enum values:
message.received
message.sent
message.status
conversation.created
conversation.resolved
conversation.assigned
contact.created
timestamp
​string · date-time · required

When the originating event was published, not when it was delivered.

​WebhookEventData · required

WebhookAutomationPayload

Emitted when an automation rule is snoozed/unsnoozed or automation is globally paused/resumed. Carries no conversation or message.
event_type
​string · enum · required
Enum values:
automation.rule.snoozed
automation.rule.unsnoozed
automation.global.paused
automation.global.resumed
timestamp
​string · date-time · required
​object · required

Rule-scoped events carry rule_id / rule_name (plus snoozed_until on snooze); global events carry is_paused, pause_reason, paused_until and updated_by, and add auto: true when the resume was triggered by the schedule rather than by a person.

WebhookTestPayload

Sent by `POST /api/outgoing-webhooks/{id}/test`. Delivered with `X-Omnistream-Event: test`, which is not a subscribable event type.
event_type
​string · const · required
Const value: test
timestamp
​string · date-time · required
​object · required

WebhookEventPayload

The JSON body POSTed to a subscribed outgoing webhook, and the value stored in `WebhookDelivery.payload`. Signed with HMAC-SHA256 over the raw body; the hex digest arrives in `X-Omnistream-Signature`. During a secret rotation both the old and new signatures are sent, so verify against either.
event_type
​string · enum · required

Matches one of the values from GET /api/outgoing-webhooks/events.

Enum values:
message.received
message.sent
message.status
conversation.created
conversation.resolved
conversation.assigned
contact.created
timestamp
​string · date-time · required

When the originating event was published, not when it was delivered.

​WebhookEventData · required

WebhookEventData

conversation_id
​string · uuid · required

Identifies the thread, NOT the message. A conversation is per contact, so an invoice and a later reminder to the same customer share it — never use it to attribute a delivery receipt to a message.

contact_id
​string · uuid · required

Nil UUID on message.status, which is not tied to a contact lookup.

assigned_agent_id
​string · uuid
​object

Absent on conversation-level events that carry no message (conversation.resolved, conversation.assigned).

WebhookMessagePreview

Compact message summary embedded in a webhook event. ## Correlating with the send call This object carries two identifiers and they are not interchangeable: * `id` — Omnistream's message id, the same value the send call returned as `message_id`. This is the key to join on. * `external_id` — the provider's id (WhatsApp `wamid.*`, etc.). A consumer that stores `message_id` from the send response can match every subsequent `message.status` event on `id` alone. Storing `external_id` as well lets it also reconcile against anything read directly from the provider. Historical note: until August 2026, delivery receipts originating from a provider webhook (`delivered`, `read`, and provider-reported `failed`) put the provider id in `id` and omitted `external_id` entirely, leaving consumers with no joinable key. Receipts emitted by Omnistream itself (`sent`, locally-`failed`) always used the documented shape. A consumer that reads `id` first and falls back to `external_id` works against both.
id
​string · required

Omnistream's message id — a 24-character hex ObjectId, identical to the message_id returned by the send call and to Message._id.$oid.

direction
​string · enum · required

Always outbound on message.status.

Enum values:
inbound
outbound
msg_type
​string · required

The message type (text, image, template, …), or the literal status_update on a message.status event.

content_preview
​string · required

Truncated body for message events; on message.status it is the fixed string Message <status> and carries no customer content.

created_at
​string · date-time · required
external_id
​string

The provider's id for the same message (e.g. wamid.HBgMNjI4MTcyMzQzMjEw...). Omitted from the JSON entirely — not sent as null — when unknown, which is the case for an outbound message whose provider response has not arrived yet, and for a failed status raised before the message ever reached the provider.

status
​string · enum

Present only on message.status; its presence is what makes the event a delivery receipt rather than a conversation transition.

Enum values:
sent
delivered
read
failed
error_message
​string

Human-readable provider failure reason, on failed only.

error_code
​string

Provider error code as a string, e.g. 131042.

error_source
​string · enum

Which layer reported the failure.

Enum values:
meta
smtp
system

WebhookDelivery

id
​string · uuid · required
webhook_id
​string · uuid · required
event_type
​string · required
​WebhookPayload · required

The body of one webhook delivery. Which variant arrives is determined by event_type: conversation and message events use WebhookEventPayload, automation events use WebhookAutomationPayload, and the "Send Test" button uses WebhookTestPayload. Note that data.message is an object on conversation events but a plain string on the test event — branch on event_type before reading it.

status
​string · enum · required

pending = queued, awaiting the next scheduler tick; sending = claimed by a dispatcher worker (15-minute lease, reclaimed if the lease expires); success = delivered (HTTP 2xx); failed = last attempt failed but retries remain; dead_letter = terminal (attempts exhausted, webhook missing/inactive, or URL blocked) — never retried automatically, only a replay re-queues it.

Enum values:
pending
sending
success
failed
dead_letter
attempt
​integer · required
max_attempts
​integer · required

Delivery attempts before dead-lettering (default 8)

created_at
​string · date-time · required
http_status
​integer
response_body
​string
error_message
​string
next_retry_at
​string · date-time
completed_at
​string · date-time

WebhookDeliveryStats

total
​integer · required
success
​integer · required
failed
​integer · required

Failed but still retryable (attempt < max_attempts)

pending
​integer · required
dead_letter
​integer · required

Terminally failed deliveries awaiting replay or 30-day cleanup

avg_response_time_ms
​number

Average milliseconds between created_at and completed_at

RotateWebhookSecret

secret
​string · minLength: 16 · maxLength: 255

Optional custom secret (16–255 chars after trimming). Omit to have the server generate a 64-character lowercase-hex secret.

RotateWebhookSecretResult

id
​string · uuid · required
secret
​string · required

The new signing secret — shown once, never returned again

rotated_at
​string · date-time · required

Start of the dual-signature overlap window

overlap
​string · required

Human-readable note that the previous secret keeps working for up to 24 hours or until the rotation is completed

ReplayDeliveriesRequest

delivery_ids
​string[] · minItems: 1 · maxItems: 500 · required

Deliveries to replay; only failed/dead_letter rows are reset

ReplayResult

delivery_id
​string · uuid · required
status
​string · required

Always "queued" on success

message
​string · required

Role

id
​string · uuid · required
name
​string · required
description
​string · required
is_system
​boolean · required

Role bawaan sistem tidak dapat dihapus atau diubah namanya

created_at
​string · date-time · required
updated_at
​string · date-time · required

RoleWithPermissions

id
​string · uuid · required
name
​string · required
description
​string · required
is_system
​boolean · required

Role bawaan sistem tidak dapat dihapus atau diubah namanya

created_at
​string · date-time · required
updated_at
​string · date-time · required
permissions
​string[]

Daftar kode izin yang dimiliki role ini

Permission

id
​string · uuid · required
code
​string · required

Kode izin dalam format category.action, misal: campaigns.manage

name
​string · required
description
​string · required
category
​string · required

CreateRole

name
​string · minLength: 1 · required

Nama role (akan dinormalisasi ke huruf kecil). Tidak boleh sama dengan nama role sistem.

permissions
​string[] · required

Daftar kode izin yang akan diberikan ke role ini

description
​string

UpdateRole

name
​string

Tidak dapat diubah untuk role sistem

description
​string
permissions
​string[]

Menggantikan seluruh daftar izin role (replace, bukan merge)

ApiKey

id
​string · uuid · required
agent_id
​string · uuid · required
name
​string · required
key_type
​string · enum · required
Enum values:
rest
webhook_signing
key_prefix
​string · required

20 karakter pertama dari plaintext key (bukan rahasia); key lama tetap 12 karakter

scopes
​required

JSON array of scope strings

is_active
​boolean · required
created_at
​string · date-time · required
allowed_ips
​string[]

Source-IP allow list untuk key rest. Setiap entri berupa satu alamat IP (IPv4/IPv6) atau blok CIDR, mis. 203.0.113.10, 203.0.113.0/24, 2001:db8::/32. Array KOSONG (default) berarti key diterima dari IP mana pun. Bila tidak kosong, request dari IP di luar daftar ditolak dengan 401 generik sebelum handler dieksekusi.

last_used_at
​string · date-time
expires_at
​string · date-time
revoked_at
​string · date-time

ApiKeyCreateResponse

​ApiKey · required
plaintext_key
​string · required

Plaintext API key — hanya ditampilkan sekali saat pembuatan. Simpan dengan aman.

CreateApiKeyRequest

name
​string · minLength: 1 · required
key_type
​string · enum · required
Enum values:
rest
webhook_signing
expires_at
​string · date-time

Tanggal kedaluwarsa opsional (UTC)

allowed_ips
​string[]

Opsional. Source-IP allow list (single IP dan/atau CIDR, IPv4/IPv6) untuk key rest. Kosong/diabaikan berarti key diterima dari IP mana pun. Entri invalid, string kosong, atau daftar melebihi 50 entri ditolak dengan 422.

UpdateApiKeyRequest

allowed_ips
​string[] · required

Pengganti source-IP allow list. Array kosong menghapus pembatasan (key kembali diterima dari IP mana pun). Validasi sama dengan saat create. Update tidak me-rotate key.

Campaign

id
​string · uuid · required
name
​string · required
template_id
​string · uuid · required
status
​string · enum · required
Enum values:
draft
scheduled
sending
completed
failed
cancelled
total_recipients
​integer · required
sent_count
​integer · required
delivered_count
​integer · required
read_count
​integer · required
failed_count
​integer · required
created_by
​string · uuid · required
created_at
​string · date-time · required
updated_at
​string · date-time · required
scheduled_at
​string · date-time
integration_account_id
​string · uuid
source
​string · enum

How the campaign was created: manual (broadcast UI) or api (POST /api/messages/template).

Enum values:
manual
api

CampaignWithTemplate

id
​string · uuid · required
name
​string · required
template_id
​string · uuid · required
status
​string · enum · required
Enum values:
draft
scheduled
sending
completed
failed
cancelled
total_recipients
​integer · required
sent_count
​integer · required
delivered_count
​integer · required
read_count
​integer · required
failed_count
​integer · required
created_by
​string · uuid · required
created_at
​string · date-time · required
updated_at
​string · date-time · required
template_name
​string · required
template_language
​string · required
template_category
​string · enum · required

Meta template category, re-synced from Meta on every POST /api/wa-templates/sync.

Enum values:
MARKETING
UTILITY
AUTHENTICATION
scheduled_at
​string · date-time
integration_account_id
​string · uuid
source
​string · enum

How the campaign was created: manual (broadcast UI) or api (POST /api/messages/template).

Enum values:
manual
api

CampaignDetail

Response of GET /api/campaigns/{id}. A CampaignWithTemplate plus any payloads requested via `include`.
id
​string · uuid · required
name
​string · required
template_id
​string · uuid · required
status
​string · enum · required
Enum values:
draft
scheduled
sending
completed
failed
cancelled
total_recipients
​integer · required
sent_count
​integer · required
delivered_count
​integer · required
read_count
​integer · required
failed_count
​integer · required
created_by
​string · uuid · required
created_at
​string · date-time · required
updated_at
​string · date-time · required
template_name
​string · required
template_language
​string · required
template_category
​string · enum · required

Meta template category, re-synced from Meta on every POST /api/wa-templates/sync.

Enum values:
MARKETING
UTILITY
AUTHENTICATION
scheduled_at
​string · date-time
integration_account_id
​string · uuid
source
​string · enum

How the campaign was created: manual (broadcast UI) or api (POST /api/messages/template).

Enum values:
manual
api
​CampaignRecipient[]

First page of recipients, ordered by created_at ascending — identical to GET /api/campaigns/{id}/recipients?page=1. The key is ABSENT unless include=recipients was passed; an empty array means the campaign genuinely has no recipients. To detect further pages, compare total_recipients with this array's length and page through the recipients endpoint.

CreateCampaign

name
​string · minLength: 1 · required
template_id
​string · uuid · required

Template harus berstatus APPROVED

scheduled_at
​string · date-time
integration_account_id
​string · uuid

UpdateCampaign

Hanya campaign berstatus draft yang dapat diubah
name
​string
template_id
​string · uuid
scheduled_at
​string · date-time
integration_account_id
​string · uuid

CampaignRecipient

id
​string · uuid · required
campaign_id
​string · uuid · required
phone_number
​string · required
variables
​required

Variabel template per penerima, misal: {"1": "John", "2": "Order #123"}

status
​string · enum · required
Enum values:
pending
sent
delivered
read
failed
cancelled
created_at
​string · date-time · required
contact_id
​string · uuid
external_id
​string
error_message
​string
sent_at
​string · date-time
delivered_at
​string · date-time
read_at
​string · date-time
conversation_id
​string · uuid
mongo_message_id
​string
contact_name
​string

Name of the linked contact, if this recipient came from the contact list rather than a raw phone number.

message_preview
​string

Rendered message text sent to this recipient (template body with this recipient's variables substituted). Computed on read.

AddRecipientsPayload

Minimal satu dari contact_ids, tags, atau phone_numbers harus diisi
contact_ids
​string[]

Tambahkan penerima berdasarkan ID kontak

tags
​string[]

Tambahkan semua kontak dengan tag yang cocok

phone_numbers
​string[]

Tambahkan penerima langsung berdasarkan nomor telepon

variables
​

Pemetaan variabel per nomor telepon: {"628xxx": {"1": "John", "2": "#123"}}

PaginatedResponse

​array · required
total
​integer · int64 · required
page
​integer · int64 · required
per_page
​integer · int64 · required
total_pages
​integer · int64 · required

AutomationRule

id
​string · uuid · required
name
​string · required
description
​string · required
is_active
​boolean · required
trigger_type
​string · enum · required
Enum values:
conversation_created
message_received_inbound
status_changed
sla_breached
whatsapp_flow_completed
​object · required

Conditions for rule matching (empty = always match)

​object[] · required

Tagged-union array of automation actions

​object · required
​object · required
priority
​integer · required
rollout_percentage
​integer · min: 1 · max: 100 · required
stop_on_match
​boolean · required
cooldown_secs
​integer · required
created_at
​string · date-time · required
updated_at
​string · date-time · required
snoozed_until
​string · date-time
created_by
​string · uuid
updated_by
​string · uuid

CreateAutomationRule

name
​string · minLength: 1 · required
trigger_type
​string · enum · required
Enum values:
conversation_created
message_received_inbound
status_changed
sla_breached
whatsapp_flow_completed
​object[] · minItems: 1 · required
description
​string
is_active
​boolean
Default: true
conditions
​object
alert_settings
​object
schedule_settings
​object
priority
​integer
Default: 0
rollout_percentage
​integer · min: 1 · max: 100
Default: 100
stop_on_match
​boolean
Default: false
cooldown_secs
​integer
Default: 0

UpdateAutomationRule

name
​string
description
​string
is_active
​boolean
trigger_type
​string · enum
Enum values:
conversation_created
message_received_inbound
status_changed
sla_breached
whatsapp_flow_completed
conditions
​object
​object[]
alert_settings
​object
schedule_settings
​object
priority
​integer
rollout_percentage
​integer · min: 1 · max: 100
stop_on_match
​boolean
cooldown_secs
​integer

AutomationControl

singleton
​boolean · required
is_paused
​boolean · required
updated_at
​string · date-time · required
pause_reason
​string
paused_until
​string · date-time
updated_by
​string · uuid

AutomationRuleRun

id
​string · uuid · required
event_id
​string · uuid · required
rule_id
​string · uuid · required
conversation_id
​string · uuid · required
matched
​boolean · required
executed
​boolean · required
result
​object · required
created_at
​string · date-time · required
rule_name
​string

AutomationEventQueueItem

id
​string · uuid · required
event_type
​string · required
conversation_id
​string · uuid · required
payload
​object · required
payload_hash
​string · required

SHA-256 hex digest of the payload

source
​string · required
status
​string · enum · required
Enum values:
pending
processing
done
failed
attempts
​integer · required
available_at
​string · date-time · required
created_at
​string · date-time · required
contact_id
​string · uuid
processed_at
​string · date-time
error
​string

ChatExpirationRule

id
​string · uuid · required
channel
​string · enum · required
Enum values:
whatsapp
instagram
email
window_hours
​integer · required

Hours before the messaging window closes (0 = never expires)

auto_resolve
​boolean · required
block_text_after_window
​boolean · required
is_active
​boolean · required
created_at
​string · date-time · required
updated_at
​string · date-time · required

UpsertChatExpirationRule

window_hours
​integer · min: 0

Hours before window closes (0 = never expires)

auto_resolve
​boolean
block_text_after_window
​boolean
is_active
​boolean

RegisterRequest

org_name
​string · required

Name of the new organization

admin_email
​string · email · required

Email for the initial admin user

admin_password
​string · minLength: 6 · required

Password for the initial admin user (min 6 characters)

WorkingHours

id
​string · uuid · required
day_of_week
​integer · min: 0 · max: 6 · required

Day of the week (0 = Sunday, 6 = Saturday)

start_time
​string · time · required
end_time
​string · time · required
is_active
​boolean · required
created_at
​string · date-time · required
updated_at
​string · date-time · required
division_id
​string · uuid

DaySchedule

day_of_week
​integer · min: 0 · max: 6 · required
start_time
​string · required
end_time
​string · required
is_active
​boolean · required

UpsertWorkingHours

​DaySchedule[] · required

AppSetting

key
​string · required
value
​string · required
updated_at
​string · date-time · required

UpdateTimezone

timezone
​string · required

AiAgent

id
​string · uuid · required
name
​string · required
system_prompt
​string · required
model
​string · required
temperature
​number · double · required
max_tokens
​integer · required
is_active
​boolean · required
created_at
​string · date-time · required
updated_at
​string · date-time · required
welcome_message
​string
parent_agent_id
​string · uuid
daily_token_limit
​integer
max_conversation_turns
​integer

CreateAiAgent

name
​string · required
system_prompt
​string
model
​string
temperature
​number · double
max_tokens
​integer
welcome_message
​string
parent_agent_id
​string · uuid
daily_token_limit
​integer
max_conversation_turns
​integer

UpdateAiAgent

name
​string
system_prompt
​string
model
​string
temperature
​number · double
max_tokens
​integer
welcome_message
​string
is_active
​boolean
parent_agent_id
​string · uuid
daily_token_limit
​integer
max_conversation_turns
​integer

AiAgentAssignment

id
​string · uuid · required
ai_agent_id
​string · uuid · required
priority
​integer · required
is_active
​boolean · required
channel
​string · enum
Enum values:
whatsapp
instagram
email
messenger
division_id
​string · uuid

CreateAiAgentAssignment

channel
​string · enum
Enum values:
whatsapp
instagram
email
messenger
division_id
​string · uuid
priority
​integer

UpdateAiAgentAssignment

channel
​string · enum
Enum values:
whatsapp
instagram
email
messenger
division_id
​string · uuid
priority
​integer
is_active
​boolean

AiHandoffRule

id
​string · uuid · required
ai_agent_id
​string · uuid · required
rule_type
​string · enum · required
Enum values:
keyword
message_count
sentiment
explicit_request
location
topic
config
​object · required

Rule-specific configuration (e.g. keywords list, threshold)

stop_ai_after_handoff
​boolean · required
is_active
​boolean · required
target_division_id
​string · uuid
handoff_message
​string

Optional message sent to the customer when this rule fires (so the AI→human handoff isn't silent).

CreateAiHandoffRule

rule_type
​string · enum · required
Enum values:
keyword
message_count
sentiment
explicit_request
location
topic
config
​object
target_division_id
​string · uuid
stop_ai_after_handoff
​boolean
handoff_message
​string

Optional message sent to the customer when this rule fires.

UpdateAiHandoffRule

rule_type
​string · enum
Enum values:
keyword
message_count
sentiment
explicit_request
location
topic
config
​object
target_division_id
​string · uuid
stop_ai_after_handoff
​boolean
is_active
​boolean
handoff_message
​string

AiKnowledgeSource

id
​string · uuid · required
ai_agent_id
​string · uuid · required
name
​string · required
source_type
​string · enum · required
Enum values:
text
file
website
qna
product
chunk_count
​integer · required
status
​string · enum · required
Enum values:
pending
processing
ready
failed
created_at
​string · date-time · required
content
​string
file_url
​string
original_filename
​string
website_url
​string
status_message
​string

CreateAiKnowledgeSource

name
​string · required
source_type
​string · enum · required
Enum values:
text
file
website
qna
product
content
​string
file_url
​string
original_filename
​string
website_url
​string

AiKnowledgeQna

id
​string · uuid · required
knowledge_source_id
​string · uuid · required
question
​string · required
answer
​string · required

CreateAiKnowledgeQna

question
​string · required
answer
​string · required

AiProduct

id
​string · uuid · required
ai_agent_id
​string · uuid · required
name
​string · required
metadata
​object · required

Arbitrary JSON metadata for the product

is_active
​boolean · required
created_at
​string · date-time · required
description
​string
price
​string · decimal

Product price as a decimal string

weight
​string · decimal

Product weight as a decimal string

CreateAiProduct

name
​string · required
description
​string
price
​string · decimal
weight
​string · decimal
metadata
​object

UpdateAiProduct

name
​string
description
​string
price
​string · decimal
weight
​string · decimal
metadata
​object
is_active
​boolean

AiOrchestrationRule

id
​string · uuid · required
parent_agent_id
​string · uuid · required
target_agent_id
​string · uuid · required
condition_prompt
​string · required

Prompt evaluated to decide whether to route to target agent

priority
​integer · required
is_active
​boolean · required

CreateAiOrchestrationRule

target_agent_id
​string · uuid · required
condition_prompt
​string · required
priority
​integer

UpdateAiOrchestrationRule

target_agent_id
​string · uuid
condition_prompt
​string
priority
​integer
is_active
​boolean

AiEvaluation

id
​string · uuid · required
conversation_id
​string · uuid · required
message_id
​string · required

MongoDB message ID

original_response
​string · required
corrected_response
​string · required
context_message_ids
​string[] · required

MongoDB IDs of the messages providing the correction's context. The UI records exactly one — the nearest preceding inbound (customer) message — which is the trigger embedded for retrieval.

evaluated_by
​string · uuid · required

Agent who performed the evaluation

ai_agent_id
​string · uuid · required

AI agent this correction trains, resolved when the evaluation is created. Null when no agent could be resolved for the conversation; such a correction is never indexed.

index_status
​string · enum · required

Vector-indexing lifecycle. Only ready means the AI is using this correction. skipped is terminal ("nothing to index" — no AI agent, or no customer message to match against); error is retryable.

Enum values:
pending
processing
ready
error
skipped
index_status_message
​string · required

Why the correction is not ready (skip reason or failure cause)

indexed_at
​string · date-time · required

When the correction was last embedded into the agent's vector store

created_at
​string · date-time · required
updated_at
​string · date-time · required

CreateAiEvaluation

conversation_id
​string · uuid · required
message_id
​string · required
original_response
​string · required
corrected_response
​string · required
context_message_ids
​string[]

UpdateAiEvaluation

corrected_response
​string
context_message_ids
​string[]

AiUsageDailySummary

date
​string · date · required
prompt_tokens
​integer · int64 · required
completion_tokens
​integer · int64 · required
total_tokens
​integer · int64 · required
total_cost
​string · decimal · required

Estimated cost in USD

request_count
​integer · int64 · required

TestChatRequest

​TestChatMessage[] · required
temperature
​number · double

TestChatMessage

role
​string · enum · required
Enum values:
user
assistant
system
content
​string · required

DeleteResponse

deleted
​boolean · required

Organization

id
​string · uuid · required
name
​string · required
slug
​string · required
status
​string · enum · required
Enum values:
provisioning
active
suspended
mongo_database
​string · required
schema_version
​integer · required
created_at
​string · date-time · required
updated_at
​string · date-time · required
limits
​object

Resource limits (max_agents, max_contacts, max_messages_month)

country
​string

ISO country code (e.g. ID, US)

CreateOrganization

name
​string · required
slug
​string · required

URL-safe identifier for the tenant

limits
​object
country
​string
admin_email
​string · email
admin_password
​string

UpdateOrganization

name
​string
limits
​object
status
​string · enum
Enum values:
active
suspended

TenantUsage

id
​string · uuid · required
org_id
​string · uuid · required
agent_count
​integer · required
contact_count
​integer · required
messages_this_month
​integer · int64 · required
active_integrations
​integer · required
usage_month
​string · date · required
updated_at
​string · date-time · required

TenantWithUsage

Organization record enriched with current usage metrics
id
​string · uuid · required
name
​string · required
slug
​string · required
status
​string · enum · required
Enum values:
provisioning
active
suspended
mongo_database
​string · required
schema_version
​integer · required
created_at
​string · date-time · required
updated_at
​string · date-time · required
limits
​object

Resource limits (max_agents, max_contacts, max_messages_month)

country
​string

ISO country code (e.g. ID, US)

​TenantUsage

SystemHealth

status
​string · enum · required
Enum values:
ok
degraded
​object · required
​object · required
​object · required
​object · required

BillingPlan

id
​string · uuid · required
name
​string · required
slug
​string · required
currency
​string · required
base_price_monthly
​integer · int64 · required
base_price_annual
​integer · int64 · required
per_agent_price
​integer · int64 · required
overage_message_price
​integer · int64 · required
limits
​object · required

Plan resource limits (max_agents, max_contacts, max_messages_month, max_channels, max_ai_agents)

features
​object · required

Feature flags (ai_agent, api_access, dedicated_support)

is_active
​boolean · required

Lifecycle/soft-delete flag only; visibility is controlled by is_public, not is_active

is_public
​boolean · required

Public plans appear in tenant self-service; unlisted plans (false) are visible to super-admins only

Default: true
billing_mode
​string · enum · required

billable plans can be subscribed to by tenants and count toward revenue; non_billable plans are super-admin-assigned and excluded from MRR (never inferred from a zero price)

Enum values:
billable
non_billable
Default: billable
sort_order
​integer · required
created_at
​string · date-time · required
updated_at
​string · date-time · required

CreateBillingPlan

name
​string · required
slug
​string · required
base_price_monthly
​integer · int64 · required
per_agent_price
​integer · int64 · required
overage_message_price
​integer · int64 · required
limits
​object · required
features
​object · required
currency
​string
Default: IDR
base_price_annual
​integer · int64
is_public
​boolean

Public (tenant self-service visible) vs unlisted (super-admin only)

Default: true
billing_mode
​string · enum

billable or non_billable; invalid values are rejected with 400

Enum values:
billable
non_billable
Default: billable
sort_order
​integer

UpdateBillingPlan

name
​string
slug
​string
currency
​string
base_price_monthly
​integer · int64
base_price_annual
​integer · int64
per_agent_price
​integer · int64
overage_message_price
​integer · int64
limits
​object
features
​object
is_active
​boolean
is_public
​boolean

Public (tenant self-service visible) vs unlisted (super-admin only)

billing_mode
​string · enum

billable or non_billable; invalid values are rejected with 400

Enum values:
billable
non_billable
sort_order
​integer

BillingCoupon

id
​string · uuid · required
code
​string · required
discount_type
​string · enum · required
Enum values:
percentage
fixed
discount_value
​integer · int64 · required
currency
​string · required
current_uses
​integer · required
valid_from
​string · date-time · required
is_active
​boolean · required
created_at
​string · date-time · required
max_uses
​integer
valid_until
​string · date-time
applicable_plans
​string[]

CreateBillingCoupon

code
​string · required
discount_type
​string · enum · required
Enum values:
percentage
fixed
discount_value
​integer · int64 · required
currency
​string
Default: IDR
max_uses
​integer
valid_from
​string · date-time
valid_until
​string · date-time
applicable_plans
​string[]

BillingAddon

id
​string · uuid · required
name
​string · required
slug
​string · required
price_monthly
​integer · int64 · required
price_annual
​integer · int64 · required
unit
​string · required

Pricing unit (e.g. flat, per agent)

is_active
​boolean · required
sort_order
​integer · required
created_at
​string · date-time · required
updated_at
​string · date-time · required
description
​string

CreateBillingAddon

name
​string · required
slug
​string · required
price_monthly
​integer · int64 · required
description
​string
price_annual
​integer · int64
unit
​string
Default: flat
sort_order
​integer

UpdateBillingAddon

name
​string
description
​string
price_monthly
​integer · int64
price_annual
​integer · int64
is_active
​boolean
sort_order
​integer

Subscription

id
​string · uuid · required
org_id
​string · uuid · required
plan_id
​string · uuid · required
status
​string · enum · required
Enum values:
trial
active
past_due
cancelled
suspended
billing_period
​string · enum · required
Enum values:
monthly
annual
cancel_at_period_end
​boolean · required
created_at
​string · date-time · required
updated_at
​string · date-time · required
trial_ends_at
​string · date-time
current_period_start
​string · date-time
current_period_end
​string · date-time
payment_gateway
​string
gateway_customer_id
​string
gateway_subscription_id
​string

CurrentPlan

Current subscription with embedded plan details
id
​string · uuid · required
org_id
​string · uuid · required
plan_id
​string · uuid · required
status
​string · enum · required
Enum values:
trial
active
past_due
cancelled
suspended
billing_period
​string · enum · required
Enum values:
monthly
annual
cancel_at_period_end
​boolean · required
created_at
​string · date-time · required
updated_at
​string · date-time · required
plan_name
​string · required
limits
​object · required
features
​object · required
trial_ends_at
​string · date-time
current_period_start
​string · date-time
current_period_end
​string · date-time
payment_gateway
​string
gateway_customer_id
​string
gateway_subscription_id
​string

BillingInvoice

id
​string · uuid · required
org_id
​string · uuid · required
invoice_number
​string · required
currency
​string · required
subtotal
​integer · int64 · required
tax
​integer · int64 · required
total
​integer · int64 · required
status
​string · enum · required
Enum values:
open
paid
past_due
void
refunded
partially_refunded
​object[] · required
retry_count
​integer · required
created_at
​string · date-time · required
subscription_id
​string · uuid
pdf_url
​string
gateway_invoice_id
​string
payment_url
​string
last_retry_at
​string · date-time
paid_at
​string · date-time
due_date
​string · date

BillingUsage

org_id
​string · uuid · required
agent_count
​integer · required
contact_count
​integer · required
messages_this_month
​integer · int64 · required
active_integrations
​integer · required
usage_month
​string · date · required
limits
​object · required

Plan limits for comparison

PaymentMethod

id
​string · uuid · required
org_id
​string · uuid · required
gateway
​string · required
gateway_payment_method_id
​string · required
type
​string · required

Payment method type (e.g. credit_card, e_wallet, virtual_account, bank_transfer)

label
​string · required
is_default
​boolean · required
created_at
​string · date-time · required

AddPaymentMethod

gateway
​string · required
gateway_payment_method_id
​string · required
type
​string · required

Payment method type (e.g. credit_card, e_wallet, virtual_account)

label
​string · required
is_default
​boolean

SubscriptionAddon

id
​string · uuid · required
subscription_id
​string · uuid · required
addon_id
​string · uuid · required
quantity
​integer · required
created_at
​string · date-time · required

SubscriptionAddonDetail

id
​string · uuid · required
addon_id
​string · uuid · required
name
​string · required
slug
​string · required
price_monthly
​integer · int64 · required
quantity
​integer · required
created_at
​string · date-time · required

MrrSummary

total_mrr
​integer · int64 · required

Total monthly recurring revenue. Subscriptions on non_billable plans are excluded.

active_subscriptions
​integer · int64 · required
trial_subscriptions
​integer · int64 · required
past_due_subscriptions
​integer · int64 · required
non_billable_subscriptions
​integer · int64 · required

Count of active subscriptions on non_billable plans (excluded from total_mrr)

currency
​string · required

RevenueByPlan

plan_id
​string · uuid · required
plan_name
​string · required
billing_mode
​string · enum · required
Enum values:
billable
non_billable
subscriber_count
​integer · int64 · required
monthly_revenue
​integer · int64 · required

Zeroed for non_billable plans (they never contribute revenue)

currency
​string · required

MonthlyRevenue

month
​string · date · required
total_revenue
​integer · int64 · required
invoice_count
​integer · int64 · required
paid_count
​integer · int64 · required

ChurnMetrics

cancelled_this_month
​integer · int64 · required
suspended_this_month
​integer · int64 · required
new_subscriptions_this_month
​integer · int64 · required
active_at_start_of_month
​integer · int64 · required

BillingAnalyticsDashboard

​MrrSummary · required
​RevenueByPlan[] · required
​MonthlyRevenue[] · required
​ChurnMetrics · required