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

Campaigns

Endpoint

Broadcast campaign management


List campaigns

GET
https://api-chat.bara.my.id
/api/campaigns

Mengembalikan daftar campaign dengan informasi template, dipaginasi.

List campaigns › query Parameters

page
​integer · min: 1
Default: 1
per_page
​integer · min: 1 · max: 100
Default: 20
status
​string · enum

Filter berdasarkan status: draft, scheduled, sending, completed, failed, cancelled

Enum values:
draft
scheduled
sending
completed
failed
cancelled

List campaigns › Responses

Daftar campaign dengan metadata paginasi

​object[] · required
total
​integer · int64 · required
page
​integer · int64 · required
per_page
​integer · int64 · required
total_pages
​integer · int64 · required
GET/api/campaigns
curl --request GET \ --url https://api-chat.bara.my.id/api/campaigns
shell
Example Responses
{ "data": [ { "id": "00000000-0000-0000-0000-000000000000", "name": "name", "template_id": "00000000-0000-0000-0000-000000000000", "status": "draft", "scheduled_at": "2024-08-25T15:00:00Z", "integration_account_id": "00000000-0000-0000-0000-000000000000", "total_recipients": 0, "sent_count": 0, "delivered_count": 0, "read_count": 0, "failed_count": 0, "created_by": "00000000-0000-0000-0000-000000000000", "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z", "template_name": "template_name", "template_language": "template_language" } ], "total": 0, "page": 0, "per_page": 0, "total_pages": 0 }
json
application/json

Create a new campaign (draft)

POST
https://api-chat.bara.my.id
/api/campaigns

Membuat campaign baru berstatus draft. Template harus berstatus APPROVED.

Create a new campaign (draft) › Request Body

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

Template harus berstatus APPROVED

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

Create a new campaign (draft) › Responses

Campaign berhasil dibuat

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
POST/api/campaigns
curl --request POST \ --url https://api-chat.bara.my.id/api/campaigns \ --header 'Content-Type: application/json' \ --data ' { "name": "name", "template_id": "00000000-0000-0000-0000-000000000000", "scheduled_at": "2024-08-25T15:00:00Z", "integration_account_id": "00000000-0000-0000-0000-000000000000" } '
shell
Example Request Body
{ "name": "name", "template_id": "00000000-0000-0000-0000-000000000000", "scheduled_at": "2024-08-25T15:00:00Z", "integration_account_id": "00000000-0000-0000-0000-000000000000" }
json
Example Responses
{ "id": "00000000-0000-0000-0000-000000000000", "name": "name", "template_id": "00000000-0000-0000-0000-000000000000", "status": "draft", "scheduled_at": "2024-08-25T15:00:00Z", "integration_account_id": "00000000-0000-0000-0000-000000000000", "total_recipients": 0, "sent_count": 0, "delivered_count": 0, "read_count": 0, "failed_count": 0, "created_by": "00000000-0000-0000-0000-000000000000", "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" }
json
application/json

Get a campaign

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

Mengembalikan detail campaign beserta informasi template.

Get a campaign › path Parameters

id
​string · uuid · required

Get a campaign › Responses

Detail 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
template_name
​string
template_language
​string
GET/api/campaigns/{id}
curl --request GET \ --url https://api-chat.bara.my.id/api/campaigns/:id
shell
Example Responses
{ "id": "00000000-0000-0000-0000-000000000000", "name": "name", "template_id": "00000000-0000-0000-0000-000000000000", "status": "draft", "scheduled_at": "2024-08-25T15:00:00Z", "integration_account_id": "00000000-0000-0000-0000-000000000000", "total_recipients": 0, "sent_count": 0, "delivered_count": 0, "read_count": 0, "failed_count": 0, "created_by": "00000000-0000-0000-0000-000000000000", "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z", "template_name": "template_name", "template_language": "template_language" }
json
application/json

Delete a draft campaign

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

Hanya campaign berstatus draft yang dapat dihapus. Penerima dihapus secara cascade.

Delete a draft campaign › path Parameters

id
​string · uuid · required

Delete a draft campaign › Responses

Campaign berhasil dihapus

message
​string
DELETE/api/campaigns/{id}
curl --request DELETE \ --url https://api-chat.bara.my.id/api/campaigns/:id
shell
Example Responses
{ "message": "message" }
json
application/json

Update a draft campaign

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

Hanya campaign berstatus draft yang dapat diubah. Template baru harus berstatus APPROVED.

Update a draft campaign › path Parameters

id
​string · uuid · required

Update a draft campaign › Request Body

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

Update a draft campaign › Responses

Campaign berhasil diperbarui

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
template_name
​string
template_language
​string
PATCH/api/campaigns/{id}
curl --request PATCH \ --url https://api-chat.bara.my.id/api/campaigns/:id \ --header 'Content-Type: application/json' \ --data ' { "name": "name", "template_id": "00000000-0000-0000-0000-000000000000", "scheduled_at": "2024-08-25T15:00:00Z", "integration_account_id": "00000000-0000-0000-0000-000000000000" } '
shell
Example Request Body
{ "name": "name", "template_id": "00000000-0000-0000-0000-000000000000", "scheduled_at": "2024-08-25T15:00:00Z", "integration_account_id": "00000000-0000-0000-0000-000000000000" }
json
Example Responses
{ "id": "00000000-0000-0000-0000-000000000000", "name": "name", "template_id": "00000000-0000-0000-0000-000000000000", "status": "draft", "scheduled_at": "2024-08-25T15:00:00Z", "integration_account_id": "00000000-0000-0000-0000-000000000000", "total_recipients": 0, "sent_count": 0, "delivered_count": 0, "read_count": 0, "failed_count": 0, "created_by": "00000000-0000-0000-0000-000000000000", "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z", "template_name": "template_name", "template_language": "template_language" }
json
application/json

List campaign recipients

GET
https://api-chat.bara.my.id
/api/campaigns/{id}/recipients

Mengembalikan daftar penerima campaign beserta nama kontak, dipaginasi.

List campaign recipients › path Parameters

id
​string · uuid · required

List campaign recipients › query Parameters

page
​integer · min: 1
Default: 1
per_page
​integer · min: 1 · max: 200
Default: 50
status
​string · enum

Filter berdasarkan status penerima

Enum values:
pending
sent
delivered
read
failed
cancelled

List campaign recipients › Responses

Daftar penerima dengan metadata paginasi

​object[] · required
total
​integer · int64 · required
page
​integer · int64 · required
per_page
​integer · int64 · required
total_pages
​integer · int64 · required
GET/api/campaigns/{id}/recipients
curl --request GET \ --url https://api-chat.bara.my.id/api/campaigns/:id/recipients
shell
Example Responses
{ "data": [ { "id": "00000000-0000-0000-0000-000000000000", "campaign_id": "00000000-0000-0000-0000-000000000000", "contact_id": "00000000-0000-0000-0000-000000000000", "phone_number": "phone_number", "variables": {}, "status": "pending", "external_id": "external_id", "error_message": "error_message", "sent_at": "2024-08-25T15:00:00Z", "delivered_at": "2024-08-25T15:00:00Z", "read_at": "2024-08-25T15:00:00Z", "created_at": "2024-08-25T15:00:00Z", "conversation_id": "00000000-0000-0000-0000-000000000000", "mongo_message_id": "mongo_message_id" } ], "total": 0, "page": 0, "per_page": 0, "total_pages": 0 }
json
application/json

Add recipients to a campaign

POST
https://api-chat.bara.my.id
/api/campaigns/{id}/recipients

Tambahkan penerima berdasarkan contact_ids, tags, dan/atau phone_numbers. Duplikat per nomor telepon diabaikan. Hanya campaign draft yang menerima penerima baru.

Add recipients to a campaign › path Parameters

id
​string · uuid · required

Add recipients to a campaign › Request Body

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"}}

Add recipients to a campaign › Responses

Penerima berhasil ditambahkan

message
​string
added
​integer
skipped
​integer
POST/api/campaigns/{id}/recipients
curl --request POST \ --url https://api-chat.bara.my.id/api/campaigns/:id/recipients \ --header 'Content-Type: application/json' \ --data ' { "contact_ids": [ "00000000-0000-0000-0000-000000000000" ], "tags": [ "string" ], "phone_numbers": [ "string" ], "variables": {} } '
shell
Example Request Body
{ "contact_ids": [ "00000000-0000-0000-0000-000000000000" ], "tags": [ "string" ], "phone_numbers": [ "string" ], "variables": {} }
json
Example Responses
{ "message": "message", "added": 0, "skipped": 0 }
json
application/json

Clear all recipients from a campaign

DELETE
https://api-chat.bara.my.id
/api/campaigns/{id}/recipients

Menghapus semua penerima dari campaign. Hanya campaign draft yang dapat dikosongkan.

Clear all recipients from a campaign › path Parameters

id
​string · uuid · required

Clear all recipients from a campaign › Responses

Semua penerima berhasil dihapus

message
​string
deleted
​integer
DELETE/api/campaigns/{id}/recipients
curl --request DELETE \ --url https://api-chat.bara.my.id/api/campaigns/:id/recipients
shell
Example Responses
{ "message": "message", "deleted": 0 }
json
application/json

Send or schedule a campaign

POST
https://api-chat.bara.my.id
/api/campaigns/{id}/send

Mengirim campaign secara langsung atau menjadwalkannya.

  • Jika scheduled_at ada dan di masa depan: status berubah ke scheduled.
  • Jika tidak: campaign dikirim langsung, status berubah ke completed atau failed.

Memerlukan flag can_broadcast = true pada profil agent.

Send or schedule a campaign › path Parameters

id
​string · uuid · required

Send or schedule a campaign › Responses

Campaign dikirim atau dijadwalkan

message
​string
total_recipients
​integer
sent
​integer
failed
​integer
scheduled_at
​string · date-time

Hanya ada jika campaign dijadwalkan

POST/api/campaigns/{id}/send
curl --request POST \ --url https://api-chat.bara.my.id/api/campaigns/:id/send
shell
Example Responses
{ "message": "message", "total_recipients": 0, "sent": 0, "failed": 0, "scheduled_at": "2024-08-25T15:00:00Z" }
json
application/json

Cancel a campaign

POST
https://api-chat.bara.my.id
/api/campaigns/{id}/cancel

Membatalkan campaign berstatus draft, sending, atau scheduled. Penerima pending ditandai cancelled.

Cancel a campaign › path Parameters

id
​string · uuid · required

Cancel a campaign › Responses

Campaign berhasil dibatalkan

message
​string
cancelled_recipients
​integer
POST/api/campaigns/{id}/cancel
curl --request POST \ --url https://api-chat.bara.my.id/api/campaigns/:id/cancel
shell
Example Responses
{ "message": "message", "cancelled_recipients": 0 }
json
application/json

Outgoing WebhooksIntegrations