OmniStream Docs
  • Panduan Pengguna
  • Developer
  • API Reference
Information
Auth
    Login with email and passwordpostGet current agent profilegetLogout (clears cookie)postIssue a fresh JWT for the current sessiongetRegister a new tenant organizationpost
Conversations
    List conversationsgetGet a single conversationgetAssign or unassign an agentpatchUpdate conversation statuspatchMark conversation as readpostExpire stale conversationspostUpdate conversation tagspatchTakeover a conversationpostBulk conversation actionspost
Messages
    List messages in a conversationgetSend an outbound messagepostSearch messages across conversationsget
Contacts
    List contactsgetGet a contact by IDgetUpdate a contactpatchList conversations for a contactget
Agents
    List all agentsgetCreate a new agentpostGet an agent by IDgetDelete an agentdeleteUpdate an agentpatchToggle agent online/offline statuspatch
Notes
    List notes for a conversationgetCreate a notepostDelete a notedeleteUpdate a notepatch
Quick Replies
    List all quick repliesgetCreate a quick replypostDelete a quick replydeleteUpdate a quick replypatchExport quick replies as CSVgetImport quick replies from CSVpostRecord usage of a quick replypostAdd quick reply to favoritespostRemove quick reply from favoritesdelete
Analytics
    Dashboard overview KPIsgetConversation and message trendsgetPer-agent workload metricsgetPer-channel metricsgetCSAT analyticsgetWhatsApp message analyticsgetWhatsApp conversation analyticsgetWhatsApp template analyticsget
Media
    Upload a media filepostDownload or proxy a media filegetUpload a file to S3/MinIOpost
Divisions
    List divisionsgetCreate a divisionpostGet a division with agentsgetDelete a divisiondeleteUpdate a divisionpatchList agents in a divisiongetAssign agents to a divisionpostRemove agents from a divisiondelete
Transfers
    Transfer a conversationpostList transfer history for a conversationget
Scheduled Messages
    Schedule a message for future deliverypostList scheduled messages for a conversationgetCancel a scheduled messagedelete
CSAT
    Get CSAT survey for a conversationgetCreate a CSAT survey for a conversationpostSubmit a CSAT ratingpatchCSAT analyticsget
SLA
    List SLA policiesgetCreate an SLA policypostDelete an SLA policydeleteUpdate an SLA policypatchList SLA breaches for a policygetGet SLA status for a conversationget
Outgoing Webhooks
    List outgoing webhooksgetCreate an outgoing webhookpostList available webhook event typesgetDelete an outgoing webhookdeleteUpdate an outgoing webhookpatchList deliveries for a webhookgetSend a test event to the webhookpost
Campaigns
    List campaignsgetCreate a new campaign (draft)postGet a campaigngetDelete a draft campaigndeleteUpdate a draft campaignpatchList campaign recipientsgetAdd recipients to a campaignpostClear all recipients from a campaigndeleteSend or schedule a campaignpostCancel a campaignpost
Integrations
    List all channel integrationsgetGet a single integration by channelgetCreate or update an integration (upsert)putDelete an integrationdeleteList integration accountsgetCreate an integration accountpostGet an integration account by IDgetDelete an integration accountdeleteUpdate an integration accountpatchSet an integration account as the default for its channelpostFetch WhatsApp account health from Meta Graph APIgetGet WhatsApp Embedded Signup configgetComplete WhatsApp Embedded SignuppostGet Instagram OAuth app configgetConnect Instagram account via OAuthpostGet Messenger OAuth app configgetConnect Messenger via Facebook Login OAuthpostSubscribe selected Facebook Pages to Messenger webhookspostDisconnect a Messenger pagepostGet Messenger persistent menugetSet or delete Messenger persistent menupost
Activity Logs
    List activity logsget
WA Templates
    List WhatsApp message templatesgetCreate a WhatsApp message templatepostSync templates from MetapostGet a WhatsApp template by IDgetDelete a WhatsApp template (local only)deleteUpdate template header media URLpatch
Webhooks
    Meta webhook verificationgetReceive Meta webhook (WhatsApp + Instagram)postReceive inbound email webhookpostMeta webhook verification for MessengergetReceive Messenger inbound webhook eventspostMeta webhook verification for InstagramgetReceive Instagram inbound webhook eventspost
Roles
    List all roles with permissionsgetCreate a custom rolepostGet a single role with permissionsgetDelete a custom roledeleteUpdate a rolepatchList all available permissionsget
API Keys
    List caller's API keysgetCreate a new API keypostRevoke an API keydelete
Health
    API Gateway health checkget
Automation
    List automation rulesgetCreate an automation rulepostList snoozed automation rulesgetSnooze multiple automation rulespostAutomation stats overviewgetAutomation stats time seriesgetAutomation alert statsgetDry-run an automation rule against a test payloadpostGet an automation rule by IDgetDelete an automation ruledeleteUpdate an automation rulepatchToggle automation rule active statepostSnooze an automation rule until a given timepostUnsnooze an automation rulepostGet stats for a specific automation rulegetGet time series stats for a specific automation rulegetGet the effective state of an automation rulegetUpdate alert settings for an automation rulepatchUpdate schedule settings for an automation rulepatchUpdate rollout percentage for an automation rulepatchPreview upcoming schedule windows for an automation rulegetGet global automation control stategetUpdate global automation control statepatchList automation rule runsgetExport automation runs as CSVgetList automation runs for a specific rulegetList automation runs for a specific eventgetGet a single automation run by IDgetGet replay context for an automation rungetList automation event queue itemsgetAutomation event queue statsgetExport automation events as CSVgetRetry all failed automation eventspostClean up old failed automation eventspostList automation events for a conversationgetList automation events for a rulegetList automation events by payload fingerprintgetGet a single automation event by IDgetRetry a single automation eventpostReprocess an automation event with the current rule setpostGet automation worker metricsget
Chat Expiration
    List chat expiration rulesgetUpsert a chat expiration rule for a channelput
AI Agents
    List all AI agentsgetCreate a new AI agentpostGet an AI agent by IDgetUpdate an AI agentputDelete an AI agentdeleteToggle AI agent active stateputList AI agent assignmentsgetCreate an AI agent assignmentpostUpdate an AI agent assignmentputDelete an AI agent assignmentdeleteList handoff rules for an AI agentgetCreate a handoff rulepostUpdate a handoff ruleputDelete a handoff ruledeleteGet daily usage stats for an AI agentgetList knowledge sources for an AI agentgetAdd a knowledge sourcepostDelete a knowledge sourcedeleteReprocess a knowledge sourcepostList QnA pairs for a knowledge sourcegetAdd a QnA pairpostDelete a QnA pairdeleteList products for an AI agentgetCreate a productpostBulk import productspostUpdate a productputDelete a productdeleteList orchestration rulesgetCreate an orchestration rulepostUpdate an orchestration ruleputDelete an orchestration ruledeleteList evaluations for an AI agentgetCreate an AI response evaluationpostUpdate an AI evaluationputDelete an AI evaluationdeleteGet aggregated AI usage summarygetSend a test message to an AI agentpost
Working Hours
    List global working hoursgetUpsert global working hoursputList division working hoursgetUpsert division working hours overrideputDelete division working hours overridedeleteGet tenant timezonegetUpdate tenant timezoneputCheck working hours status (public)get
Super Admin
    Super-admin loginpostList all tenant organizationsgetProvision a new tenantpostGet a tenant organizationgetSuspend a tenant organizationdeleteUpdate a tenant organizationpatchImpersonate a tenant adminpostList all tenants with usage statisticsgetSystem health checkgetList super-admin accountsgetCreate a super-admin accountpostDelete a super-admin accountdeleteReset a super-admin's passwordpostList tenant usersgetReset a tenant user's passwordpostSuspend a tenant userpostActivate a tenant userpostImpersonate a tenant userpost
Billing Admin
    List all billing plansgetCreate a billing planpostGet a billing plan by IDgetDelete a billing plandeleteUpdate a billing planpatchList all couponsgetCreate a couponpostDelete a coupondeleteUpdate a couponpatchList all add-onsgetCreate an add-onpostDelete an add-ondeleteUpdate an add-onpatchCombined analytics dashboardgetMonthly recurring revenue summarygetRevenue breakdown by plangetMonthly revenue over time (last 12 months)getChurn metrics for current monthgetRefund an invoicepost
Billing
    Get current subscription and plangetList available billing plansgetSubscribe to a planpostUpgrade or downgrade subscription planpostCancel subscriptionpostGet current month's usagegetList invoicesgetDownload invoice PDFgetList payment methodsgetAdd a payment methodpostDelete a payment methoddeleteValidate a coupon codepostList available add-onsgetList attached add-onsgetAttach an add-on to subscriptionpostDetach an add-on from subscriptiondelete
Schemas
OmniStream CRM API
OmniStream CRM API

Super Admin

Endpoint

Platform super-admin tenant management, health, impersonation, and user management


Super-admin login

POST
https://api-chat.bara.my.id
/api/super-admin/login

Authenticate a super-admin and return a JWT token (8-hour expiry).

Super-admin login › Request Body

email
​string · email · required
password
​string · required

Super-admin login › Responses

JWT token

token
​string
POST/api/super-admin/login
curl --request POST \ --url https://api-chat.bara.my.id/api/super-admin/login \ --header 'Content-Type: application/json' \ --data ' { "email": "test@example.com", "password": "password" } '
shell
Example Request Body
{ "email": "test@example.com", "password": "password" }
json
Example Responses
{ "token": "token" }
json
application/json

List all tenant organizations

GET
https://api-chat.bara.my.id
/api/super-admin/tenants

Returns all registered organizations. Requires super-admin auth.

List all tenant organizations › Responses

200

Array of organizations

​object[]
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)

GET/api/super-admin/tenants
curl --request GET \ --url https://api-chat.bara.my.id/api/super-admin/tenants
shell
Example Responses
[ { "id": "00000000-0000-0000-0000-000000000000", "name": "name", "slug": "slug", "status": "provisioning", "mongo_database": "mongo_database", "limits": {}, "country": "country", "schema_version": 0, "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" } ]
json
application/json

Provision a new tenant

POST
https://api-chat.bara.my.id
/api/super-admin/tenants

Create a new tenant organization with its own databases. Requires super-admin auth.

Provision a new tenant › Request Body

name
​string · required
slug
​string · required

URL-safe identifier for the tenant

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

Provision a new tenant › Responses

200

Created organization (provisioning in background)

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)

POST/api/super-admin/tenants
curl --request POST \ --url https://api-chat.bara.my.id/api/super-admin/tenants \ --header 'Content-Type: application/json' \ --data ' { "name": "name", "slug": "slug", "limits": {}, "country": "country", "admin_email": "test@example.com", "admin_password": "admin_password" } '
shell
Example Request Body
{ "name": "name", "slug": "slug", "limits": {}, "country": "country", "admin_email": "test@example.com", "admin_password": "admin_password" }
json
Example Responses
{ "id": "00000000-0000-0000-0000-000000000000", "name": "name", "slug": "slug", "status": "provisioning", "mongo_database": "mongo_database", "limits": {}, "country": "country", "schema_version": 0, "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" }
json
application/json

Get a tenant organization

GET
https://api-chat.bara.my.id
/api/super-admin/tenants/{id}

Get a tenant organization › path Parameters

id
​string · uuid · required

Get a tenant organization › Responses

Organization details

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)

GET/api/super-admin/tenants/{id}
curl --request GET \ --url https://api-chat.bara.my.id/api/super-admin/tenants/:id
shell
Example Responses
{ "id": "00000000-0000-0000-0000-000000000000", "name": "name", "slug": "slug", "status": "provisioning", "mongo_database": "mongo_database", "limits": {}, "country": "country", "schema_version": 0, "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" }
json
application/json

Suspend a tenant organization

DELETE
https://api-chat.bara.my.id
/api/super-admin/tenants/{id}

Soft-delete by setting status to suspended. Requires super-admin auth.

Suspend a tenant organization › path Parameters

id
​string · uuid · required

Suspend a tenant organization › Responses

Tenant suspended

status
​string
DELETE/api/super-admin/tenants/{id}
curl --request DELETE \ --url https://api-chat.bara.my.id/api/super-admin/tenants/:id
shell
Example Responses
{ "status": "suspended" }
json
application/json

Update a tenant organization

PATCH
https://api-chat.bara.my.id
/api/super-admin/tenants/{id}

Update name, limits, or status. Requires super-admin auth.

Update a tenant organization › path Parameters

id
​string · uuid · required

Update a tenant organization › Request Body

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

Update a tenant organization › Responses

Updated 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)

PATCH/api/super-admin/tenants/{id}
curl --request PATCH \ --url https://api-chat.bara.my.id/api/super-admin/tenants/:id \ --header 'Content-Type: application/json' \ --data ' { "name": "name", "limits": {}, "status": "active" } '
shell
Example Request Body
{ "name": "name", "limits": {}, "status": "active" }
json
Example Responses
{ "id": "00000000-0000-0000-0000-000000000000", "name": "name", "slug": "slug", "status": "provisioning", "mongo_database": "mongo_database", "limits": {}, "country": "country", "schema_version": 0, "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" }
json
application/json

Impersonate a tenant admin

POST
https://api-chat.bara.my.id
/api/super-admin/tenants/{id}/impersonate

Generate a 15-minute JWT scoped to the tenant's admin role.

Impersonate a tenant admin › path Parameters

id
​string · uuid · required

Impersonate a tenant admin › Responses

Impersonation token

token
​string
org_id
​string · uuid
org_slug
​string
expires_in_seconds
​integer
POST/api/super-admin/tenants/{id}/impersonate
curl --request POST \ --url https://api-chat.bara.my.id/api/super-admin/tenants/:id/impersonate
shell
Example Responses
{ "token": "token", "org_id": "00000000-0000-0000-0000-000000000000", "org_slug": "org_slug", "expires_in_seconds": 900 }
json
application/json

List all tenants with usage statistics

GET
https://api-chat.bara.my.id
/api/super-admin/usage

Returns all organizations enriched with current usage metrics.

List all tenants with usage statistics › Responses

200

Array of tenants with usage

​object[]
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)

​object
GET/api/super-admin/usage
curl --request GET \ --url https://api-chat.bara.my.id/api/super-admin/usage
shell
Example Responses
[ { "id": "00000000-0000-0000-0000-000000000000", "name": "name", "slug": "slug", "status": "provisioning", "mongo_database": "mongo_database", "limits": {}, "country": "country", "schema_version": 0, "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z", "usage": { "id": "00000000-0000-0000-0000-000000000000", "org_id": "00000000-0000-0000-0000-000000000000", "agent_count": 0, "contact_count": 0, "messages_this_month": 0, "active_integrations": 0, "usage_month": "2024-08-25", "updated_at": "2024-08-25T15:00:00Z" } } ]
json
application/json

System health check

GET
https://api-chat.bara.my.id
/api/super-admin/health

Health check for all infrastructure components (PostgreSQL, MongoDB, Redis, Kafka, MinIO) and microservices (webhook-ingestor, ws-server, ai-agent, billing-service). Also reports platform integration status and tenant counts.

System health check › Responses

200

System health report

status
​string · enum · required
Enum values:
ok
degraded
​object · required
​object · required
​object · required
​object · required
GET/api/super-admin/health
curl --request GET \ --url https://api-chat.bara.my.id/api/super-admin/health
shell
Example Responses
{ "status": "ok", "infrastructure": { "control_plane": { "status": "up" }, "postgres": { "status": "up" }, "mongodb": { "status": "up" }, "redis": { "status": "up" }, "kafka": { "status": "up" }, "minio": { "status": "up" } }, "microservices": { "api_gateway": { "status": "status" }, "webhook_ingestor": { "status": "status" }, "ws_server": { "status": "status" }, "chat_engine": { "status": "status" }, "message_sender": { "status": "status" }, "ai_agent": { "status": "status" }, "billing_service": { "status": "status" } }, "platforms": { "whatsapp": { "status": "active" }, "instagram": { "status": "active" }, "messenger": { "status": "active" }, "email": { "status": "active" } }, "tenants": { "total": 0, "active": 0, "suspended": 0 } }
json
application/json

List super-admin accounts

GET
https://api-chat.bara.my.id
/api/super-admin/admins

List super-admin accounts › Responses

200

Array of super-admin accounts (password excluded)

​object[]
id
​string · uuid
email
​string · email
name
​string
created_at
​string · date-time
GET/api/super-admin/admins
curl --request GET \ --url https://api-chat.bara.my.id/api/super-admin/admins
shell
Example Responses
[ { "id": "00000000-0000-0000-0000-000000000000", "email": "test@example.com", "name": "name", "created_at": "2024-08-25T15:00:00Z" } ]
json
application/json

Create a super-admin account

POST
https://api-chat.bara.my.id
/api/super-admin/admins

Create a super-admin account › Request Body

email
​string · email · required
name
​string · required
password
​string · minLength: 8 · required

Create a super-admin account › Responses

Created super-admin

id
​string · uuid
email
​string
name
​string
POST/api/super-admin/admins
curl --request POST \ --url https://api-chat.bara.my.id/api/super-admin/admins \ --header 'Content-Type: application/json' \ --data ' { "email": "test@example.com", "name": "name", "password": "password" } '
shell
Example Request Body
{ "email": "test@example.com", "name": "name", "password": "password" }
json
Example Responses
{ "id": "00000000-0000-0000-0000-000000000000", "email": "email", "name": "name" }
json
application/json

Delete a super-admin account

DELETE
https://api-chat.bara.my.id
/api/super-admin/admins/{id}

Cannot delete your own account.

Delete a super-admin account › path Parameters

id
​string · uuid · required

Delete a super-admin account › Responses

Deleted

status
​string
DELETE/api/super-admin/admins/{id}
curl --request DELETE \ --url https://api-chat.bara.my.id/api/super-admin/admins/:id
shell
Example Responses
{ "status": "deleted" }
json
application/json

Reset a super-admin's password

POST
https://api-chat.bara.my.id
/api/super-admin/admins/{id}/reset-password

Reset a super-admin's password › path Parameters

id
​string · uuid · required

Reset a super-admin's password › Request Body

new_password
​string · minLength: 8 · required

Reset a super-admin's password › Responses

Password reset

status
​string
POST/api/super-admin/admins/{id}/reset-password
curl --request POST \ --url https://api-chat.bara.my.id/api/super-admin/admins/:id/reset-password \ --header 'Content-Type: application/json' \ --data ' { "new_password": "new_password" } '
shell
Example Request Body
{ "new_password": "new_password" }
json
Example Responses
{ "status": "password_reset" }
json
application/json

List tenant users

GET
https://api-chat.bara.my.id
/api/super-admin/users

List agents in a tenant, optionally filtered by search term.

List tenant users › query Parameters

tenant_id
​string · uuid · required
search
​string

Filter by email or name (ILIKE)

List tenant users › Responses

200

Array of tenant users

​object[]
id
​string · uuid
email
​string
full_name
​string
role
​string
is_online
​boolean
last_seen_at
​string · date-time
created_at
​string · date-time
GET/api/super-admin/users
curl --request GET \ --url 'https://api-chat.bara.my.id/api/super-admin/users?tenant_id=%3Cstring%3E'
shell
Example Responses
[ { "id": "00000000-0000-0000-0000-000000000000", "email": "email", "full_name": "full_name", "role": "role", "is_online": true, "last_seen_at": "2024-08-25T15:00:00Z", "created_at": "2024-08-25T15:00:00Z" } ]
json
application/json

Reset a tenant user's password

POST
https://api-chat.bara.my.id
/api/super-admin/users/{id}/reset-password

Reset a tenant user's password › path Parameters

id
​string · uuid · required

Reset a tenant user's password › query Parameters

tenant_id
​string · uuid · required

Reset a tenant user's password › Request Body

new_password
​string · minLength: 8 · required

Reset a tenant user's password › Responses

200

Password reset

status
​string
POST/api/super-admin/users/{id}/reset-password
curl --request POST \ --url 'https://api-chat.bara.my.id/api/super-admin/users/:id/reset-password?tenant_id=%3Cstring%3E' \ --header 'Content-Type: application/json' \ --data ' { "new_password": "new_password" } '
shell
Example Request Body
{ "new_password": "new_password" }
json
Example Responses
{ "status": "password_reset" }
json
application/json

Suspend a tenant user

POST
https://api-chat.bara.my.id
/api/super-admin/users/{id}/suspend

Suspend a tenant user › path Parameters

id
​string · uuid · required

Suspend a tenant user › query Parameters

tenant_id
​string · uuid · required

Suspend a tenant user › Responses

200

User suspended

status
​string
POST/api/super-admin/users/{id}/suspend
curl --request POST \ --url 'https://api-chat.bara.my.id/api/super-admin/users/:id/suspend?tenant_id=%3Cstring%3E'
shell
Example Responses
{ "status": "suspended" }
json
application/json

Activate a tenant user

POST
https://api-chat.bara.my.id
/api/super-admin/users/{id}/activate

Activate a tenant user › path Parameters

id
​string · uuid · required

Activate a tenant user › query Parameters

tenant_id
​string · uuid · required

Activate a tenant user › Responses

200

User activated

status
​string
POST/api/super-admin/users/{id}/activate
curl --request POST \ --url 'https://api-chat.bara.my.id/api/super-admin/users/:id/activate?tenant_id=%3Cstring%3E'
shell
Example Responses
{ "status": "activated" }
json
application/json

Impersonate a tenant user

POST
https://api-chat.bara.my.id
/api/super-admin/users/{id}/impersonate

Generate a 15-minute JWT for a specific tenant user.

Impersonate a tenant user › path Parameters

id
​string · uuid · required

Impersonate a tenant user › query Parameters

tenant_id
​string · uuid · required

Impersonate a tenant user › Responses

Impersonation token

token
​string
agent_id
​string · uuid
email
​string
role
​string
expires_in_seconds
​integer
POST/api/super-admin/users/{id}/impersonate
curl --request POST \ --url 'https://api-chat.bara.my.id/api/super-admin/users/:id/impersonate?tenant_id=%3Cstring%3E'
shell
Example Responses
{ "token": "token", "agent_id": "00000000-0000-0000-0000-000000000000", "email": "email", "role": "role", "expires_in_seconds": 900 }
json
application/json

Working HoursBilling Admin