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

Automation

Endpoint

Automation rules engine with scheduling, snoozing, and alerting


List automation rules

GET
https://api-chat.bara.my.id
/api/automation-rules

Supervisor or admin only.

List automation rules › query Parameters

is_active
​boolean
trigger_type
​string · enum
Enum values:
conversation_created
message_received_inbound
status_changed
sla_breached

List automation rules › Responses

Automation rules

​object[]
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
​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
GET/api/automation-rules
curl --request GET \
  --url https://api-chat.bara.my.id/api/automation-rules
Example Responses
[ { "id": "00000000-0000-0000-0000-000000000000", "name": "name", "description": "description", "is_active": true, "trigger_type": "conversation_created", "conditions": { "channel_in": [ "string" ], "status_in": [ "string" ], "assigned_is_null": true, "has_any_tags": [ "string" ], "division_id_in": [ "00000000-0000-0000-0000-000000000000" ], "business_hours_only": true }, "actions": [ {} ], "alert_settings": { "enabled": true, "min_matched_runs": 0, "medium_threshold_pct": 0, "high_threshold_pct": 0 }, "schedule_settings": { "enabled": true, "active_weekdays": [ 0 ], "start_hour_utc": 0, "end_hour_utc": 0, "timezone_offset_minutes": 0, "invert": true }, "priority": 0, "rollout_percentage": 1, "stop_on_match": true, "cooldown_secs": 0, "snoozed_until": "2024-08-25T15:00:00Z", "created_by": "00000000-0000-0000-0000-000000000000", "updated_by": "00000000-0000-0000-0000-000000000000", "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" } ]
application/json

Create an automation rule

POST
https://api-chat.bara.my.id
/api/automation-rules

Supervisor or admin only.

Create an automation rule › Request Body

name
​string · minLength: 1 · required
trigger_type
​string · enum · required
Enum values:
conversation_created
message_received_inbound
status_changed
sla_breached
​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

Create an automation rule › Responses

Automation rule created

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
​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
POST/api/automation-rules
curl --request POST \ --url https://api-chat.bara.my.id/api/automation-rules \ --header 'Content-Type: application/json' \ --data ' { "name": "name", "description": "description", "is_active": true, "trigger_type": "conversation_created", "conditions": {}, "actions": [ {} ], "alert_settings": {}, "schedule_settings": {}, "priority": 0, "rollout_percentage": 100, "stop_on_match": false, "cooldown_secs": 0 } '
Example Request Body
{ "name": "name", "description": "description", "is_active": true, "trigger_type": "conversation_created", "conditions": {}, "actions": [ {} ], "alert_settings": {}, "schedule_settings": {}, "priority": 0, "rollout_percentage": 100, "stop_on_match": false, "cooldown_secs": 0 }
Example Responses
{ "id": "00000000-0000-0000-0000-000000000000", "name": "name", "description": "description", "is_active": true, "trigger_type": "conversation_created", "conditions": { "channel_in": [ "string" ], "status_in": [ "string" ], "assigned_is_null": true, "has_any_tags": [ "string" ], "division_id_in": [ "00000000-0000-0000-0000-000000000000" ], "business_hours_only": true }, "actions": [ {} ], "alert_settings": { "enabled": true, "min_matched_runs": 0, "medium_threshold_pct": 0, "high_threshold_pct": 0 }, "schedule_settings": { "enabled": true, "active_weekdays": [ 0 ], "start_hour_utc": 0, "end_hour_utc": 0, "timezone_offset_minutes": 0, "invert": true }, "priority": 0, "rollout_percentage": 1, "stop_on_match": true, "cooldown_secs": 0, "snoozed_until": "2024-08-25T15:00:00Z", "created_by": "00000000-0000-0000-0000-000000000000", "updated_by": "00000000-0000-0000-0000-000000000000", "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" }
application/json

List snoozed automation rules

GET
https://api-chat.bara.my.id
/api/automation-rules/snoozed

Returns rules currently snoozed (snoozed_until in the future). Supervisor or admin only.

List snoozed automation rules › query Parameters

trigger_type
​string · enum
Enum values:
conversation_created
message_received_inbound
status_changed
sla_breached
is_active
​boolean
page
​integer
Default: 1
per_page
​integer
Default: 20

List snoozed automation rules › Responses

200

Snoozed automation rules

​object[]
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
​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
GET/api/automation-rules/snoozed
curl --request GET \
  --url https://api-chat.bara.my.id/api/automation-rules/snoozed
Example Responses
[ { "id": "00000000-0000-0000-0000-000000000000", "name": "name", "description": "description", "is_active": true, "trigger_type": "conversation_created", "conditions": { "channel_in": [ "string" ], "status_in": [ "string" ], "assigned_is_null": true, "has_any_tags": [ "string" ], "division_id_in": [ "00000000-0000-0000-0000-000000000000" ], "business_hours_only": true }, "actions": [ {} ], "alert_settings": { "enabled": true, "min_matched_runs": 0, "medium_threshold_pct": 0, "high_threshold_pct": 0 }, "schedule_settings": { "enabled": true, "active_weekdays": [ 0 ], "start_hour_utc": 0, "end_hour_utc": 0, "timezone_offset_minutes": 0, "invert": true }, "priority": 0, "rollout_percentage": 1, "stop_on_match": true, "cooldown_secs": 0, "snoozed_until": "2024-08-25T15:00:00Z", "created_by": "00000000-0000-0000-0000-000000000000", "updated_by": "00000000-0000-0000-0000-000000000000", "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" } ]
application/json

Snooze multiple automation rules

POST
https://api-chat.bara.my.id
/api/automation-rules/snooze-bulk

Supervisor or admin only.

Snooze multiple automation rules › Request Body

rule_ids
​string[] · required
snoozed_until
​string · date-time · required

Snooze multiple automation rules › Responses

200

Rules snoozed

message
​string
snoozed_count
​integer
POST/api/automation-rules/snooze-bulk
curl --request POST \
  --url https://api-chat.bara.my.id/api/automation-rules/snooze-bulk \
  --header 'Content-Type: application/json' \
  --data '
{
  "rule_ids": [
    "00000000-0000-0000-0000-000000000000"
  ],
  "snoozed_until": "2024-08-25T15:00:00Z"
}
'
Example Request Body
{
  "rule_ids": [
    "00000000-0000-0000-0000-000000000000"
  ],
  "snoozed_until": "2024-08-25T15:00:00Z"
}
Example Responses
{
  "message": "message",
  "snoozed_count": 0
}
application/json

Automation stats overview

GET
https://api-chat.bara.my.id
/api/automation-rules/stats/overview

Aggregate stats across all rules. Supervisor or admin only.

Automation stats overview › query Parameters

window_days
​integer · min: 1 · max: 365
Default: 7

Automation stats overview › Responses

200

Automation stats overview

total_rules
​integer
active_rules
​integer
snoozed_rules
​integer
total_events
​integer
total_runs
​integer
matched_runs
​integer
executed_runs
​integer
failed_events
​integer
GET/api/automation-rules/stats/overview
curl --request GET \
  --url https://api-chat.bara.my.id/api/automation-rules/stats/overview
Example Responses
{
  "total_rules": 0,
  "active_rules": 0,
  "snoozed_rules": 0,
  "total_events": 0,
  "total_runs": 0,
  "matched_runs": 0,
  "executed_runs": 0,
  "failed_events": 0
}
application/json

Automation stats time series

GET
https://api-chat.bara.my.id
/api/automation-rules/stats/timeseries

Bucketed time series of rule runs. Supervisor or admin only.

Automation stats time series › query Parameters

window_days
​integer · min: 1 · max: 365
Default: 7
bucket_days
​integer · min: 1 · max: 30
Default: 1

Automation stats time series › Responses

200

Time series data

​object[]
bucket
​string · date
total_runs
​integer
matched_runs
​integer
executed_runs
​integer
GET/api/automation-rules/stats/timeseries
curl --request GET \
  --url https://api-chat.bara.my.id/api/automation-rules/stats/timeseries
Example Responses
[
  {
    "bucket": "2024-08-25",
    "total_runs": 0,
    "matched_runs": 0,
    "executed_runs": 0
  }
]
application/json

Automation alert stats

GET
https://api-chat.bara.my.id
/api/automation-rules/stats/alerts

Rules with high failure rates or anomalous patterns. Supervisor or admin only.

Automation alert stats › query Parameters

window_days
​integer
Default: 7
min_matched_runs
​integer
failure_rate_threshold_pct
​number · double

Automation alert stats › Responses

200

Alert stats per rule

​object[]
rule_id
​string · uuid
rule_name
​string
matched_runs
​integer
executed_runs
​integer
failure_rate_pct
​number
alert_level
​string · enum
Enum values:
ok
medium
high
GET/api/automation-rules/stats/alerts
curl --request GET \
  --url https://api-chat.bara.my.id/api/automation-rules/stats/alerts
Example Responses
[
  {
    "rule_id": "00000000-0000-0000-0000-000000000000",
    "rule_name": "rule_name",
    "matched_runs": 0,
    "executed_runs": 0,
    "failure_rate_pct": 0,
    "alert_level": "ok"
  }
]
application/json

Dry-run an automation rule against a test payload

POST
https://api-chat.bara.my.id
/api/automation-rules/test

Evaluates conditions and simulates actions without executing them. Supervisor or admin only.

Dry-run an automation rule against a test payload › Request Body

event_payload
​object · required
rule_id
​string · uuid
trigger_type
​string · enum
Enum values:
conversation_created
message_received_inbound
status_changed
sla_breached
conditions
​object
​object[]

Dry-run an automation rule against a test payload › Responses

Dry-run result

matched
​boolean
would_execute
​boolean
​object[]
POST/api/automation-rules/test
curl --request POST \ --url https://api-chat.bara.my.id/api/automation-rules/test \ --header 'Content-Type: application/json' \ --data ' { "rule_id": "00000000-0000-0000-0000-000000000000", "trigger_type": "conversation_created", "conditions": {}, "actions": [ {} ], "event_payload": {} } '
Example Request Body
{
  "rule_id": "00000000-0000-0000-0000-000000000000",
  "trigger_type": "conversation_created",
  "conditions": {},
  "actions": [
    {}
  ],
  "event_payload": {}
}
Example Responses
{
  "matched": true,
  "would_execute": true,
  "actions_preview": [
    {}
  ]
}
application/json

Get an automation rule by ID

GET
https://api-chat.bara.my.id
/api/automation-rules/{id}

Supervisor or admin only.

Get an automation rule by ID › path Parameters

id
​string · uuid · required

Get an automation rule by ID › Responses

Automation rule

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
​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
GET/api/automation-rules/{id}
curl --request GET \
  --url https://api-chat.bara.my.id/api/automation-rules/:id
Example Responses
{ "id": "00000000-0000-0000-0000-000000000000", "name": "name", "description": "description", "is_active": true, "trigger_type": "conversation_created", "conditions": { "channel_in": [ "string" ], "status_in": [ "string" ], "assigned_is_null": true, "has_any_tags": [ "string" ], "division_id_in": [ "00000000-0000-0000-0000-000000000000" ], "business_hours_only": true }, "actions": [ {} ], "alert_settings": { "enabled": true, "min_matched_runs": 0, "medium_threshold_pct": 0, "high_threshold_pct": 0 }, "schedule_settings": { "enabled": true, "active_weekdays": [ 0 ], "start_hour_utc": 0, "end_hour_utc": 0, "timezone_offset_minutes": 0, "invert": true }, "priority": 0, "rollout_percentage": 1, "stop_on_match": true, "cooldown_secs": 0, "snoozed_until": "2024-08-25T15:00:00Z", "created_by": "00000000-0000-0000-0000-000000000000", "updated_by": "00000000-0000-0000-0000-000000000000", "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" }
application/json

Delete an automation rule

DELETE
https://api-chat.bara.my.id
/api/automation-rules/{id}

Supervisor or admin only.

Delete an automation rule › path Parameters

id
​string · uuid · required

Delete an automation rule › Responses

Rule deleted

message
​string
id
​string · uuid
DELETE/api/automation-rules/{id}
curl --request DELETE \
  --url https://api-chat.bara.my.id/api/automation-rules/:id
Example Responses
{
  "message": "message",
  "id": "00000000-0000-0000-0000-000000000000"
}
application/json

Update an automation rule

PATCH
https://api-chat.bara.my.id
/api/automation-rules/{id}

Supervisor or admin only.

Update an automation rule › path Parameters

id
​string · uuid · required

Update an automation rule › Request Body

name
​string
description
​string
is_active
​boolean
trigger_type
​string · enum
Enum values:
conversation_created
message_received_inbound
status_changed
sla_breached
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

Update an automation rule › Responses

Updated automation rule

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
​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
PATCH/api/automation-rules/{id}
curl --request PATCH \ --url https://api-chat.bara.my.id/api/automation-rules/:id \ --header 'Content-Type: application/json' \ --data ' { "name": "name", "description": "description", "is_active": true, "trigger_type": "conversation_created", "conditions": {}, "actions": [ {} ], "alert_settings": {}, "schedule_settings": {}, "priority": 0, "rollout_percentage": 1, "stop_on_match": true, "cooldown_secs": 0 } '
Example Request Body
{ "name": "name", "description": "description", "is_active": true, "trigger_type": "conversation_created", "conditions": {}, "actions": [ {} ], "alert_settings": {}, "schedule_settings": {}, "priority": 0, "rollout_percentage": 1, "stop_on_match": true, "cooldown_secs": 0 }
Example Responses
{ "id": "00000000-0000-0000-0000-000000000000", "name": "name", "description": "description", "is_active": true, "trigger_type": "conversation_created", "conditions": { "channel_in": [ "string" ], "status_in": [ "string" ], "assigned_is_null": true, "has_any_tags": [ "string" ], "division_id_in": [ "00000000-0000-0000-0000-000000000000" ], "business_hours_only": true }, "actions": [ {} ], "alert_settings": { "enabled": true, "min_matched_runs": 0, "medium_threshold_pct": 0, "high_threshold_pct": 0 }, "schedule_settings": { "enabled": true, "active_weekdays": [ 0 ], "start_hour_utc": 0, "end_hour_utc": 0, "timezone_offset_minutes": 0, "invert": true }, "priority": 0, "rollout_percentage": 1, "stop_on_match": true, "cooldown_secs": 0, "snoozed_until": "2024-08-25T15:00:00Z", "created_by": "00000000-0000-0000-0000-000000000000", "updated_by": "00000000-0000-0000-0000-000000000000", "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" }
application/json

Toggle automation rule active state

POST
https://api-chat.bara.my.id
/api/automation-rules/{id}/toggle

Supervisor or admin only.

Toggle automation rule active state › path Parameters

id
​string · uuid · required

Toggle automation rule active state › Request Body

is_active
​boolean · required

Toggle automation rule active state › Responses

Toggle result

message
​string
id
​string · uuid
is_active
​boolean
POST/api/automation-rules/{id}/toggle
curl --request POST \
  --url https://api-chat.bara.my.id/api/automation-rules/:id/toggle \
  --header 'Content-Type: application/json' \
  --data '
{
  "is_active": true
}
'
Example Request Body
{
  "is_active": true
}
Example Responses
{
  "message": "message",
  "id": "00000000-0000-0000-0000-000000000000",
  "is_active": true
}
application/json

Snooze an automation rule until a given time

POST
https://api-chat.bara.my.id
/api/automation-rules/{id}/snooze

Supervisor or admin only.

Snooze an automation rule until a given time › path Parameters

id
​string · uuid · required

Snooze an automation rule until a given time › Request Body

snoozed_until
​string · date-time · required

Snooze an automation rule until a given time › Responses

Rule snoozed

message
​string
id
​string · uuid
snoozed_until
​string · date-time
POST/api/automation-rules/{id}/snooze
curl --request POST \
  --url https://api-chat.bara.my.id/api/automation-rules/:id/snooze \
  --header 'Content-Type: application/json' \
  --data '
{
  "snoozed_until": "2024-08-25T15:00:00Z"
}
'
Example Request Body
{
  "snoozed_until": "2024-08-25T15:00:00Z"
}
Example Responses
{
  "message": "message",
  "id": "00000000-0000-0000-0000-000000000000",
  "snoozed_until": "2024-08-25T15:00:00Z"
}
application/json

Unsnooze an automation rule

POST
https://api-chat.bara.my.id
/api/automation-rules/{id}/unsnooze

Clears the snoozed_until timestamp. Supervisor or admin only.

Unsnooze an automation rule › path Parameters

id
​string · uuid · required

Unsnooze an automation rule › Responses

Rule unsnoozed

message
​string
id
​string · uuid
POST/api/automation-rules/{id}/unsnooze
curl --request POST \
  --url https://api-chat.bara.my.id/api/automation-rules/:id/unsnooze
Example Responses
{
  "message": "message",
  "id": "00000000-0000-0000-0000-000000000000"
}
application/json

Get stats for a specific automation rule

GET
https://api-chat.bara.my.id
/api/automation-rules/{id}/stats

Supervisor or admin only.

Get stats for a specific automation rule › path Parameters

id
​string · uuid · required

Get stats for a specific automation rule › query Parameters

window_days
​integer · min: 1 · max: 365
Default: 7

Get stats for a specific automation rule › Responses

Rule stats

rule_id
​string · uuid
total_runs
​integer
matched_runs
​integer
executed_runs
​integer
failure_rate_pct
​number
GET/api/automation-rules/{id}/stats
curl --request GET \
  --url https://api-chat.bara.my.id/api/automation-rules/:id/stats
Example Responses
{
  "rule_id": "00000000-0000-0000-0000-000000000000",
  "total_runs": 0,
  "matched_runs": 0,
  "executed_runs": 0,
  "failure_rate_pct": 0
}
application/json

Get time series stats for a specific automation rule

GET
https://api-chat.bara.my.id
/api/automation-rules/{id}/stats/timeseries

Supervisor or admin only.

Get time series stats for a specific automation rule › path Parameters

id
​string · uuid · required

Get time series stats for a specific automation rule › query Parameters

window_days
​integer · min: 1 · max: 365
Default: 7
bucket_days
​integer · min: 1 · max: 30
Default: 1

Get time series stats for a specific automation rule › Responses

Time series for this rule

​object[]
bucket
​string · date
total_runs
​integer
matched_runs
​integer
executed_runs
​integer
GET/api/automation-rules/{id}/stats/timeseries
curl --request GET \
  --url https://api-chat.bara.my.id/api/automation-rules/:id/stats/timeseries
Example Responses
[
  {
    "bucket": "2024-08-25",
    "total_runs": 0,
    "matched_runs": 0,
    "executed_runs": 0
  }
]
application/json

Get the effective state of an automation rule

GET
https://api-chat.bara.my.id
/api/automation-rules/{id}/effective-state

Returns whether the rule is currently active considering snooze, global pause, and schedule. Supervisor or admin only.

Get the effective state of an automation rule › path Parameters

id
​string · uuid · required

Get the effective state of an automation rule › Responses

Effective state

rule_id
​string · uuid
is_active
​boolean
is_snoozed
​boolean
snoozed_until
​string · date-time
global_paused
​boolean
schedule_active
​boolean
effective_active
​boolean
GET/api/automation-rules/{id}/effective-state
curl --request GET \
  --url https://api-chat.bara.my.id/api/automation-rules/:id/effective-state
Example Responses
{
  "rule_id": "00000000-0000-0000-0000-000000000000",
  "is_active": true,
  "is_snoozed": true,
  "snoozed_until": "2024-08-25T15:00:00Z",
  "global_paused": true,
  "schedule_active": true,
  "effective_active": true
}
application/json

Update alert settings for an automation rule

PATCH
https://api-chat.bara.my.id
/api/automation-rules/{id}/alert-settings

Accepts either a preset name or explicit alert_settings. Supervisor or admin only.

Update alert settings for an automation rule › path Parameters

id
​string · uuid · required

Update alert settings for an automation rule › Request Body

preset
​string · enum
Enum values:
conservative
balanced
aggressive
​object

Update alert settings for an automation rule › Responses

Updated automation rule

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
​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
PATCH/api/automation-rules/{id}/alert-settings
curl --request PATCH \ --url https://api-chat.bara.my.id/api/automation-rules/:id/alert-settings \ --header 'Content-Type: application/json' \ --data ' { "preset": "conservative", "alert_settings": { "enabled": true, "min_matched_runs": 1, "medium_threshold_pct": 0, "high_threshold_pct": 0 } } '
Example Request Body
{
  "preset": "conservative",
  "alert_settings": {
    "enabled": true,
    "min_matched_runs": 1,
    "medium_threshold_pct": 0,
    "high_threshold_pct": 0
  }
}
Example Responses
{ "id": "00000000-0000-0000-0000-000000000000", "name": "name", "description": "description", "is_active": true, "trigger_type": "conversation_created", "conditions": { "channel_in": [ "string" ], "status_in": [ "string" ], "assigned_is_null": true, "has_any_tags": [ "string" ], "division_id_in": [ "00000000-0000-0000-0000-000000000000" ], "business_hours_only": true }, "actions": [ {} ], "alert_settings": { "enabled": true, "min_matched_runs": 0, "medium_threshold_pct": 0, "high_threshold_pct": 0 }, "schedule_settings": { "enabled": true, "active_weekdays": [ 0 ], "start_hour_utc": 0, "end_hour_utc": 0, "timezone_offset_minutes": 0, "invert": true }, "priority": 0, "rollout_percentage": 1, "stop_on_match": true, "cooldown_secs": 0, "snoozed_until": "2024-08-25T15:00:00Z", "created_by": "00000000-0000-0000-0000-000000000000", "updated_by": "00000000-0000-0000-0000-000000000000", "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" }
application/json

Update schedule settings for an automation rule

PATCH
https://api-chat.bara.my.id
/api/automation-rules/{id}/schedule-settings

Supervisor or admin only.

Update schedule settings for an automation rule › path Parameters

id
​string · uuid · required

Update schedule settings for an automation rule › Request Body

​object · required

Update schedule settings for an automation rule › Responses

Updated automation rule

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
​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
PATCH/api/automation-rules/{id}/schedule-settings
curl --request PATCH \ --url https://api-chat.bara.my.id/api/automation-rules/:id/schedule-settings \ --header 'Content-Type: application/json' \ --data ' { "schedule_settings": { "enabled": true, "active_weekdays": [ 0 ], "start_hour_utc": 0, "end_hour_utc": 1, "timezone_offset_minutes": 0, "invert": true } } '
Example Request Body
{
  "schedule_settings": {
    "enabled": true,
    "active_weekdays": [
      0
    ],
    "start_hour_utc": 0,
    "end_hour_utc": 1,
    "timezone_offset_minutes": 0,
    "invert": true
  }
}
Example Responses
{ "id": "00000000-0000-0000-0000-000000000000", "name": "name", "description": "description", "is_active": true, "trigger_type": "conversation_created", "conditions": { "channel_in": [ "string" ], "status_in": [ "string" ], "assigned_is_null": true, "has_any_tags": [ "string" ], "division_id_in": [ "00000000-0000-0000-0000-000000000000" ], "business_hours_only": true }, "actions": [ {} ], "alert_settings": { "enabled": true, "min_matched_runs": 0, "medium_threshold_pct": 0, "high_threshold_pct": 0 }, "schedule_settings": { "enabled": true, "active_weekdays": [ 0 ], "start_hour_utc": 0, "end_hour_utc": 0, "timezone_offset_minutes": 0, "invert": true }, "priority": 0, "rollout_percentage": 1, "stop_on_match": true, "cooldown_secs": 0, "snoozed_until": "2024-08-25T15:00:00Z", "created_by": "00000000-0000-0000-0000-000000000000", "updated_by": "00000000-0000-0000-0000-000000000000", "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" }
application/json

Update rollout percentage for an automation rule

PATCH
https://api-chat.bara.my.id
/api/automation-rules/{id}/rollout

Supervisor or admin only.

Update rollout percentage for an automation rule › path Parameters

id
​string · uuid · required

Update rollout percentage for an automation rule › Request Body

rollout_percentage
​integer · min: 1 · max: 100 · required

Update rollout percentage for an automation rule › Responses

Updated automation rule

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
​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
PATCH/api/automation-rules/{id}/rollout
curl --request PATCH \
  --url https://api-chat.bara.my.id/api/automation-rules/:id/rollout \
  --header 'Content-Type: application/json' \
  --data '
{
  "rollout_percentage": 1
}
'
Example Request Body
{
  "rollout_percentage": 1
}
Example Responses
{ "id": "00000000-0000-0000-0000-000000000000", "name": "name", "description": "description", "is_active": true, "trigger_type": "conversation_created", "conditions": { "channel_in": [ "string" ], "status_in": [ "string" ], "assigned_is_null": true, "has_any_tags": [ "string" ], "division_id_in": [ "00000000-0000-0000-0000-000000000000" ], "business_hours_only": true }, "actions": [ {} ], "alert_settings": { "enabled": true, "min_matched_runs": 0, "medium_threshold_pct": 0, "high_threshold_pct": 0 }, "schedule_settings": { "enabled": true, "active_weekdays": [ 0 ], "start_hour_utc": 0, "end_hour_utc": 0, "timezone_offset_minutes": 0, "invert": true }, "priority": 0, "rollout_percentage": 1, "stop_on_match": true, "cooldown_secs": 0, "snoozed_until": "2024-08-25T15:00:00Z", "created_by": "00000000-0000-0000-0000-000000000000", "updated_by": "00000000-0000-0000-0000-000000000000", "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" }
application/json

Preview upcoming schedule windows for an automation rule

GET
https://api-chat.bara.my.id
/api/automation-rules/{id}/schedule-preview

Returns future time slots when the rule will be active based on its schedule settings. Supervisor or admin only.

Preview upcoming schedule windows for an automation rule › path Parameters

id
​string · uuid · required

Preview upcoming schedule windows for an automation rule › query Parameters

hours
​integer
Default: 48
start_at
​string · date-time

Preview upcoming schedule windows for an automation rule › Responses

Schedule preview windows

rule_id
​string · uuid
​object[]
GET/api/automation-rules/{id}/schedule-preview
curl --request GET \
  --url https://api-chat.bara.my.id/api/automation-rules/:id/schedule-preview
Example Responses
{
  "rule_id": "00000000-0000-0000-0000-000000000000",
  "windows": [
    {
      "start": "2024-08-25T15:00:00Z",
      "end": "2024-08-25T15:00:00Z"
    }
  ]
}
application/json

Get global automation control state

GET
https://api-chat.bara.my.id
/api/automation-control

Returns the singleton automation control record. Supervisor or admin only.

Get global automation control state › Responses

200

Automation control state

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
GET/api/automation-control
curl --request GET \
  --url https://api-chat.bara.my.id/api/automation-control
Example Responses
{
  "singleton": true,
  "is_paused": true,
  "pause_reason": "pause_reason",
  "paused_until": "2024-08-25T15:00:00Z",
  "updated_by": "00000000-0000-0000-0000-000000000000",
  "updated_at": "2024-08-25T15:00:00Z"
}
application/json

Update global automation control state

PATCH
https://api-chat.bara.my.id
/api/automation-control

Pause or resume all automation processing globally. Supervisor or admin only.

Update global automation control state › Request Body

is_paused
​boolean · required
pause_reason
​string
paused_until
​string · date-time

Update global automation control state › Responses

200

Updated automation control

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
PATCH/api/automation-control
curl --request PATCH \
  --url https://api-chat.bara.my.id/api/automation-control \
  --header 'Content-Type: application/json' \
  --data '
{
  "is_paused": true,
  "pause_reason": "pause_reason",
  "paused_until": "2024-08-25T15:00:00Z"
}
'
Example Request Body
{
  "is_paused": true,
  "pause_reason": "pause_reason",
  "paused_until": "2024-08-25T15:00:00Z"
}
Example Responses
{
  "singleton": true,
  "is_paused": true,
  "pause_reason": "pause_reason",
  "paused_until": "2024-08-25T15:00:00Z",
  "updated_by": "00000000-0000-0000-0000-000000000000",
  "updated_at": "2024-08-25T15:00:00Z"
}
application/json

List automation rule runs

GET
https://api-chat.bara.my.id
/api/automation-runs

Paginated (cursor or offset). Supervisor or admin only.

List automation rule runs › query Parameters

rule_id
​string · uuid
event_id
​string · uuid
cursor
​string

Keyset cursor (format ISO8601|uuid)

page
​integer
Default: 1
per_page
​integer
Default: 20
sort_by
​string · enum
Enum values:
created_at
matched
executed
rule_id
event_id
sort_order
​string · enum
Enum values:
asc
desc

List automation rule runs › Responses

200

Automation rule runs

​object[]
next_cursor
​string
total
​integer
GET/api/automation-runs
curl --request GET \
  --url https://api-chat.bara.my.id/api/automation-runs
Example Responses
{ "runs": [ { "id": "00000000-0000-0000-0000-000000000000", "event_id": "00000000-0000-0000-0000-000000000000", "rule_id": "00000000-0000-0000-0000-000000000000", "rule_name": "rule_name", "conversation_id": "00000000-0000-0000-0000-000000000000", "matched": true, "executed": true, "result": {}, "created_at": "2024-08-25T15:00:00Z" } ], "next_cursor": "next_cursor", "total": 0 }
application/json

Export automation runs as CSV

GET
https://api-chat.bara.my.id
/api/automation-runs/export

Supervisor or admin only.

Export automation runs as CSV › query Parameters

limit
​integer
rule_id
​string · uuid
event_id
​string · uuid
matched
​boolean
executed
​boolean
sort_by
​string
sort_order
​string · enum
Enum values:
asc
desc
created_from
​string · date-time
created_to
​string · date-time

Export automation runs as CSV › Responses

200

CSV file of automation runs

string
GET/api/automation-runs/export
curl --request GET \
  --url https://api-chat.bara.my.id/api/automation-runs/export
Example Responses
string
text/csv

List automation runs for a specific rule

GET
https://api-chat.bara.my.id
/api/automation-runs/by-rule/{rule_id}

Supervisor or admin only.

List automation runs for a specific rule › path Parameters

rule_id
​string · uuid · required

List automation runs for a specific rule › query Parameters

event_id
​string · uuid
cursor
​string
page
​integer
Default: 1
per_page
​integer
Default: 20
sort_by
​string · enum
Enum values:
created_at
matched
executed
event_id
sort_order
​string · enum
Enum values:
asc
desc

List automation runs for a specific rule › Responses

200

Runs for the given rule

​object[]
next_cursor
​string
total
​integer
GET/api/automation-runs/by-rule/{rule_id}
curl --request GET \
  --url https://api-chat.bara.my.id/api/automation-runs/by-rule/:rule_id
Example Responses
{ "runs": [ { "id": "00000000-0000-0000-0000-000000000000", "event_id": "00000000-0000-0000-0000-000000000000", "rule_id": "00000000-0000-0000-0000-000000000000", "rule_name": "rule_name", "conversation_id": "00000000-0000-0000-0000-000000000000", "matched": true, "executed": true, "result": {}, "created_at": "2024-08-25T15:00:00Z" } ], "next_cursor": "next_cursor", "total": 0 }
application/json

List automation runs for a specific event

GET
https://api-chat.bara.my.id
/api/automation-runs/by-event/{event_id}

Supervisor or admin only.

List automation runs for a specific event › path Parameters

event_id
​string · uuid · required

List automation runs for a specific event › query Parameters

rule_id
​string · uuid
cursor
​string
page
​integer
Default: 1
per_page
​integer
Default: 20
sort_by
​string · enum
Enum values:
created_at
matched
executed
rule_id
sort_order
​string · enum
Enum values:
asc
desc

List automation runs for a specific event › Responses

200

Runs for the given event

​object[]
next_cursor
​string
total
​integer
GET/api/automation-runs/by-event/{event_id}
curl --request GET \
  --url https://api-chat.bara.my.id/api/automation-runs/by-event/:event_id
Example Responses
{ "runs": [ { "id": "00000000-0000-0000-0000-000000000000", "event_id": "00000000-0000-0000-0000-000000000000", "rule_id": "00000000-0000-0000-0000-000000000000", "rule_name": "rule_name", "conversation_id": "00000000-0000-0000-0000-000000000000", "matched": true, "executed": true, "result": {}, "created_at": "2024-08-25T15:00:00Z" } ], "next_cursor": "next_cursor", "total": 0 }
application/json

Get a single automation run by ID

GET
https://api-chat.bara.my.id
/api/automation-runs/{id}

Supervisor or admin only.

Get a single automation run by ID › path Parameters

id
​string · uuid · required

Get a single automation run by ID › Responses

Automation run detail

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
event_type
​string
event_source
​string
event_status
​string
contact_id
​string · uuid
channel_source
​string
GET/api/automation-runs/{id}
curl --request GET \
  --url https://api-chat.bara.my.id/api/automation-runs/:id
Example Responses
{ "id": "00000000-0000-0000-0000-000000000000", "event_id": "00000000-0000-0000-0000-000000000000", "rule_id": "00000000-0000-0000-0000-000000000000", "rule_name": "rule_name", "conversation_id": "00000000-0000-0000-0000-000000000000", "matched": true, "executed": true, "result": {}, "created_at": "2024-08-25T15:00:00Z", "event_type": "event_type", "event_source": "event_source", "event_status": "event_status", "contact_id": "00000000-0000-0000-0000-000000000000", "channel_source": "channel_source" }
application/json

Get replay context for an automation run

GET
https://api-chat.bara.my.id
/api/automation-runs/{id}/replay-context

Returns the run, original event payload, and rule conditions/actions at time of execution. Supervisor or admin only.

Get replay context for an automation run › path Parameters

id
​string · uuid · required

Get replay context for an automation run › Responses

Replay context

run
​object
event_payload
​object
rule_conditions
​object
rule_actions
​object
GET/api/automation-runs/{id}/replay-context
curl --request GET \
  --url https://api-chat.bara.my.id/api/automation-runs/:id/replay-context
Example Responses
{
  "run": {},
  "event_payload": {},
  "rule_conditions": {},
  "rule_actions": {}
}
application/json

List automation event queue items

GET
https://api-chat.bara.my.id
/api/automation-events

Supervisor or admin only.

List automation event queue items › query Parameters

status
​string · enum
Enum values:
pending
processing
done
failed
event_type
​string · enum
Enum values:
conversation_created
message_received_inbound
status_changed
sla_breached
source
​string
payload_hash
​string
cursor
​string
page
​integer
Default: 1
per_page
​integer
Default: 20
sort_by
​string · enum
Enum values:
created_at
available_at
processed_at
attempts
status
event_type
sort_order
​string · enum
Enum values:
asc
desc

List automation event queue items › Responses

200

Automation event queue items

​object[]
next_cursor
​string
total
​integer
GET/api/automation-events
curl --request GET \
  --url https://api-chat.bara.my.id/api/automation-events
Example Responses
{ "events": [ { "id": "00000000-0000-0000-0000-000000000000", "event_type": "event_type", "conversation_id": "00000000-0000-0000-0000-000000000000", "contact_id": "00000000-0000-0000-0000-000000000000", "payload": {}, "payload_hash": "payload_hash", "source": "source", "status": "pending", "attempts": 0, "available_at": "2024-08-25T15:00:00Z", "processed_at": "2024-08-25T15:00:00Z", "error": "error", "created_at": "2024-08-25T15:00:00Z" } ], "next_cursor": "next_cursor", "total": 0 }
application/json

Automation event queue stats

GET
https://api-chat.bara.my.id
/api/automation-events/stats

Supervisor or admin only.

Automation event queue stats › query Parameters

window_days
​integer · min: 1 · max: 365
Default: 7

Automation event queue stats › Responses

200

Event queue stats

total_events
​integer
pending_events
​integer
processing_events
​integer
done_events
​integer
failed_events
​integer
GET/api/automation-events/stats
curl --request GET \
  --url https://api-chat.bara.my.id/api/automation-events/stats
Example Responses
{
  "total_events": 0,
  "pending_events": 0,
  "processing_events": 0,
  "done_events": 0,
  "failed_events": 0
}
application/json

Export automation events as CSV

GET
https://api-chat.bara.my.id
/api/automation-events/export

Supervisor or admin only.

Export automation events as CSV › query Parameters

limit
​integer
status
​string
event_type
​string
source
​string
payload_hash
​string
sort_by
​string
sort_order
​string · enum
Enum values:
asc
desc
created_from
​string · date-time
created_to
​string · date-time

Export automation events as CSV › Responses

200

CSV file of automation events

string
GET/api/automation-events/export
curl --request GET \
  --url https://api-chat.bara.my.id/api/automation-events/export
Example Responses
string
text/csv

Retry all failed automation events

POST
https://api-chat.bara.my.id
/api/automation-events/retry-failed

Resets failed events to pending for reprocessing. Supervisor or admin only.

Retry all failed automation events › Request Body

limit
​integer

Retry all failed automation events › Responses

200

Events queued for retry

message
​string
retried_count
​integer
POST/api/automation-events/retry-failed
curl --request POST \
  --url https://api-chat.bara.my.id/api/automation-events/retry-failed \
  --header 'Content-Type: application/json' \
  --data '{
  "limit": 0
}'
Example Request Body
{
  "limit": 0
}
Example Responses
{
  "message": "message",
  "retried_count": 0
}
application/json

Clean up old failed automation events

POST
https://api-chat.bara.my.id
/api/automation-events/cleanup

Deletes failed events older than the specified number of days. Supervisor or admin only.

Clean up old failed automation events › Request Body

older_than_days
​integer
Default: 30
limit
​integer

Clean up old failed automation events › Responses

200

Cleanup result

message
​string
deleted_count
​integer
POST/api/automation-events/cleanup
curl --request POST \
  --url https://api-chat.bara.my.id/api/automation-events/cleanup \
  --header 'Content-Type: application/json' \
  --data '
{
  "older_than_days": 30,
  "limit": 0
}
'
Example Request Body
{
  "older_than_days": 30,
  "limit": 0
}
Example Responses
{
  "message": "message",
  "deleted_count": 0
}
application/json

List automation events for a conversation

GET
https://api-chat.bara.my.id
/api/automation-events/by-conversation/{conversation_id}

Supervisor or admin only.

List automation events for a conversation › path Parameters

conversation_id
​string · uuid · required

List automation events for a conversation › query Parameters

status
​string · enum
Enum values:
pending
processing
done
failed
event_type
​string
source
​string
cursor
​string
page
​integer
Default: 1
per_page
​integer
Default: 20
sort_by
​string · enum
Enum values:
created_at
available_at
processed_at
attempts
status
event_type
sort_order
​string · enum
Enum values:
asc
desc

List automation events for a conversation › Responses

200

Events for the conversation

​object[]
next_cursor
​string
total
​integer
GET/api/automation-events/by-conversation/{conversation_id}
curl --request GET \
  --url https://api-chat.bara.my.id/api/automation-events/by-conversation/:conversation_id
Example Responses
{ "events": [ { "id": "00000000-0000-0000-0000-000000000000", "event_type": "event_type", "conversation_id": "00000000-0000-0000-0000-000000000000", "contact_id": "00000000-0000-0000-0000-000000000000", "payload": {}, "payload_hash": "payload_hash", "source": "source", "status": "pending", "attempts": 0, "available_at": "2024-08-25T15:00:00Z", "processed_at": "2024-08-25T15:00:00Z", "error": "error", "created_at": "2024-08-25T15:00:00Z" } ], "next_cursor": "next_cursor", "total": 0 }
application/json

List automation events for a rule

GET
https://api-chat.bara.my.id
/api/automation-events/by-rule/{rule_id}

Supervisor or admin only.

List automation events for a rule › path Parameters

rule_id
​string · uuid · required

List automation events for a rule › query Parameters

status
​string · enum
Enum values:
pending
processing
done
failed
event_type
​string
source
​string
payload_hash
​string
cursor
​string
page
​integer
Default: 1
per_page
​integer
Default: 20
sort_by
​string · enum
Enum values:
created_at
available_at
processed_at
attempts
status
event_type
sort_order
​string · enum
Enum values:
asc
desc

List automation events for a rule › Responses

200

Events for the rule

​object[]
next_cursor
​string
total
​integer
GET/api/automation-events/by-rule/{rule_id}
curl --request GET \
  --url https://api-chat.bara.my.id/api/automation-events/by-rule/:rule_id
Example Responses
{ "events": [ { "id": "00000000-0000-0000-0000-000000000000", "event_type": "event_type", "conversation_id": "00000000-0000-0000-0000-000000000000", "contact_id": "00000000-0000-0000-0000-000000000000", "payload": {}, "payload_hash": "payload_hash", "source": "source", "status": "pending", "attempts": 0, "available_at": "2024-08-25T15:00:00Z", "processed_at": "2024-08-25T15:00:00Z", "error": "error", "created_at": "2024-08-25T15:00:00Z" } ], "next_cursor": "next_cursor", "total": 0 }
application/json

List automation events by payload fingerprint

GET
https://api-chat.bara.my.id
/api/automation-events/by-fingerprint/{payload_hash}

Finds all events with the given SHA-256 payload hash. Supervisor or admin only.

List automation events by payload fingerprint › path Parameters

payload_hash
​string · required

64-char hex SHA-256 digest

List automation events by payload fingerprint › Responses

Events with matching payload hash

​object[]
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
GET/api/automation-events/by-fingerprint/{payload_hash}
curl --request GET \
  --url https://api-chat.bara.my.id/api/automation-events/by-fingerprint/:payload_hash
Example Responses
[ { "id": "00000000-0000-0000-0000-000000000000", "event_type": "event_type", "conversation_id": "00000000-0000-0000-0000-000000000000", "contact_id": "00000000-0000-0000-0000-000000000000", "payload": {}, "payload_hash": "payload_hash", "source": "source", "status": "pending", "attempts": 0, "available_at": "2024-08-25T15:00:00Z", "processed_at": "2024-08-25T15:00:00Z", "error": "error", "created_at": "2024-08-25T15:00:00Z" } ]
application/json

Get a single automation event by ID

GET
https://api-chat.bara.my.id
/api/automation-events/{id}

Supervisor or admin only.

Get a single automation event by ID › path Parameters

id
​string · uuid · required

Get a single automation event by ID › Responses

Automation event

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
GET/api/automation-events/{id}
curl --request GET \
  --url https://api-chat.bara.my.id/api/automation-events/:id
Example Responses
{ "id": "00000000-0000-0000-0000-000000000000", "event_type": "event_type", "conversation_id": "00000000-0000-0000-0000-000000000000", "contact_id": "00000000-0000-0000-0000-000000000000", "payload": {}, "payload_hash": "payload_hash", "source": "source", "status": "pending", "attempts": 0, "available_at": "2024-08-25T15:00:00Z", "processed_at": "2024-08-25T15:00:00Z", "error": "error", "created_at": "2024-08-25T15:00:00Z" }
application/json

Retry a single automation event

POST
https://api-chat.bara.my.id
/api/automation-events/{id}/retry

Resets the event to pending for reprocessing. Supervisor or admin only.

Retry a single automation event › path Parameters

id
​string · uuid · required

Retry a single automation event › Responses

Event queued for retry

message
​string
id
​string · uuid
POST/api/automation-events/{id}/retry
curl --request POST \
  --url https://api-chat.bara.my.id/api/automation-events/:id/retry
Example Responses
{
  "message": "message",
  "id": "00000000-0000-0000-0000-000000000000"
}
application/json

Reprocess an automation event with the current rule set

POST
https://api-chat.bara.my.id
/api/automation-events/{id}/reprocess

Re-evaluates all matching rules against the stored event payload. Supervisor or admin only.

Reprocess an automation event with the current rule set › path Parameters

id
​string · uuid · required

Reprocess an automation event with the current rule set › Responses

Reprocess result

message
​string
id
​string · uuid
​object[]
POST/api/automation-events/{id}/reprocess
curl --request POST \
  --url https://api-chat.bara.my.id/api/automation-events/:id/reprocess
Example Responses
{ "message": "message", "id": "00000000-0000-0000-0000-000000000000", "runs": [ { "id": "00000000-0000-0000-0000-000000000000", "event_id": "00000000-0000-0000-0000-000000000000", "rule_id": "00000000-0000-0000-0000-000000000000", "rule_name": "rule_name", "conversation_id": "00000000-0000-0000-0000-000000000000", "matched": true, "executed": true, "result": {}, "created_at": "2024-08-25T15:00:00Z" } ] }
application/json

Get automation worker metrics

GET
https://api-chat.bara.my.id
/api/automation-worker/metrics

Per-event-type worker metrics (claimed, retried, failed). Supervisor or admin only.

Get automation worker metrics › Responses

200

Worker metrics per event type

​object[]
event_type
​string
claimed_events
​integer
retried_events
​integer
failed_events
​integer
GET/api/automation-worker/metrics
curl --request GET \
  --url https://api-chat.bara.my.id/api/automation-worker/metrics
Example Responses
[
  {
    "event_type": "event_type",
    "claimed_events": 0,
    "retried_events": 0,
    "failed_events": 0
  }
]
application/json

HealthChat Expiration