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

Integrations

Endpoint

Channel integration settings


List all channel integrations

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

Admin or supervisor only.

List all channel integrations › Responses

List of integrations

​object[]
id
​string · uuid · required
channel
​string · required

whatsapp, instagram, email, or messenger

is_active
​boolean · required
config
​object · required

Channel configuration (sensitive fields masked)

created_at
​string · date-time · required
updated_at
​string · date-time · required
division_id
​string · uuid
GET/api/integrations
curl --request GET \ --url https://api-chat.bara.my.id/api/integrations
shell
Example Responses
[ { "id": "00000000-0000-0000-0000-000000000000", "channel": "channel", "is_active": true, "config": {}, "division_id": "00000000-0000-0000-0000-000000000000", "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" } ]
json
application/json

Get a single integration by channel

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

Returns empty config if not yet configured.

Get a single integration by channel › path Parameters

channel
​string · enum · required
Enum values:
whatsapp
instagram
email
messenger

Get a single integration by channel › Responses

Integration details (or default empty config)

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

whatsapp, instagram, email, or messenger

is_active
​boolean · required
config
​object · required

Channel configuration (sensitive fields masked)

created_at
​string · date-time · required
updated_at
​string · date-time · required
division_id
​string · uuid
GET/api/integrations/{channel}
curl --request GET \ --url https://api-chat.bara.my.id/api/integrations/:channel
shell
Example Responses
{ "id": "00000000-0000-0000-0000-000000000000", "channel": "channel", "is_active": true, "config": {}, "division_id": "00000000-0000-0000-0000-000000000000", "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" }
json
application/json

Create or update an integration (upsert)

PUT
https://api-chat.bara.my.id
/api/integrations/{channel}

Admin only. Merges config — masked values are not overwritten.

Create or update an integration (upsert) › path Parameters

channel
​string · enum · required
Enum values:
whatsapp
instagram
email
messenger

Create or update an integration (upsert) › Request Body

is_active
​boolean
config
​object
division_id
​string · uuid

Create or update an integration (upsert) › Responses

Integration updated

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

whatsapp, instagram, email, or messenger

is_active
​boolean · required
config
​object · required

Channel configuration (sensitive fields masked)

created_at
​string · date-time · required
updated_at
​string · date-time · required
division_id
​string · uuid
PUT/api/integrations/{channel}
curl --request PUT \ --url https://api-chat.bara.my.id/api/integrations/:channel \ --header 'Content-Type: application/json' \ --data ' { "is_active": true, "config": {}, "division_id": "00000000-0000-0000-0000-000000000000" } '
shell
Example Request Body
{ "is_active": true, "config": {}, "division_id": "00000000-0000-0000-0000-000000000000" }
json
Example Responses
{ "id": "00000000-0000-0000-0000-000000000000", "channel": "channel", "is_active": true, "config": {}, "division_id": "00000000-0000-0000-0000-000000000000", "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" }
json
application/json

Delete an integration

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

Admin only.

Delete an integration › path Parameters

channel
​string · enum · required
Enum values:
whatsapp
instagram
email
messenger

Delete an integration › Responses

Integration deleted

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

List integration accounts

GET
https://api-chat.bara.my.id
/api/integrations/accounts

Admin or supervisor only. Optionally filter by channel.

List integration accounts › query Parameters

channel
​string · enum
Enum values:
whatsapp
instagram
email
messenger

List integration accounts › Responses

List of integration accounts

​object[]
id
​string · uuid · required
channel
​string · required

whatsapp, instagram, email, or messenger

account_key
​string · required

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

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

Account configuration (sensitive fields masked)

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

Computed webhook URL for this account

GET/api/integrations/accounts
curl --request GET \ --url https://api-chat.bara.my.id/api/integrations/accounts
shell
Example Responses
[ { "id": "00000000-0000-0000-0000-000000000000", "channel": "channel", "account_key": "account_key", "display_name": "display_name", "is_active": true, "is_default": true, "division_id": "00000000-0000-0000-0000-000000000000", "config": {}, "verify_token": "verify_token", "webhook_url": "webhook_url", "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" } ]
json
application/json

Create an integration account

POST
https://api-chat.bara.my.id
/api/integrations/accounts

Admin only. For WhatsApp, auto-registers and subscribes the phone number.

Create an integration account › Request Body

channel
​string · required

whatsapp, instagram, email, or messenger

account_key
​string

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

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

Create an integration account › Responses

Account created

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

whatsapp, instagram, email, or messenger

account_key
​string · required

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

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

Account configuration (sensitive fields masked)

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

Computed webhook URL for this account

POST/api/integrations/accounts
curl --request POST \ --url https://api-chat.bara.my.id/api/integrations/accounts \ --header 'Content-Type: application/json' \ --data ' { "channel": "channel", "account_key": "account_key", "display_name": "display_name", "is_active": false, "is_default": false, "division_id": "00000000-0000-0000-0000-000000000000", "config": {} } '
shell
Example Request Body
{ "channel": "channel", "account_key": "account_key", "display_name": "display_name", "is_active": false, "is_default": false, "division_id": "00000000-0000-0000-0000-000000000000", "config": {} }
json
Example Responses
{ "id": "00000000-0000-0000-0000-000000000000", "channel": "channel", "account_key": "account_key", "display_name": "display_name", "is_active": true, "is_default": true, "division_id": "00000000-0000-0000-0000-000000000000", "config": {}, "verify_token": "verify_token", "webhook_url": "webhook_url", "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" }
json
application/json

Get an integration account by ID

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

Get an integration account by ID › path Parameters

id
​string · uuid · required

Get an integration account by ID › Responses

Integration account details

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

whatsapp, instagram, email, or messenger

account_key
​string · required

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

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

Account configuration (sensitive fields masked)

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

Computed webhook URL for this account

GET/api/integrations/accounts/{id}
curl --request GET \ --url https://api-chat.bara.my.id/api/integrations/accounts/:id
shell
Example Responses
{ "id": "00000000-0000-0000-0000-000000000000", "channel": "channel", "account_key": "account_key", "display_name": "display_name", "is_active": true, "is_default": true, "division_id": "00000000-0000-0000-0000-000000000000", "config": {}, "verify_token": "verify_token", "webhook_url": "webhook_url", "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" }
json
application/json

Delete an integration account

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

Admin only. If deleted account was default, another account is promoted.

Delete an integration account › path Parameters

id
​string · uuid · required

Delete an integration account › Responses

Account deleted

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

Update an integration account

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

Admin only. Merges config — masked values are not overwritten.

Update an integration account › path Parameters

id
​string · uuid · required

Update an integration account › Request Body

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

Update an integration account › Responses

Account updated

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

whatsapp, instagram, email, or messenger

account_key
​string · required

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

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

Account configuration (sensitive fields masked)

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

Computed webhook URL for this account

PATCH/api/integrations/accounts/{id}
curl --request PATCH \ --url https://api-chat.bara.my.id/api/integrations/accounts/:id \ --header 'Content-Type: application/json' \ --data ' { "account_key": "account_key", "display_name": "display_name", "is_active": true, "is_default": true, "division_id": "00000000-0000-0000-0000-000000000000", "config": {} } '
shell
Example Request Body
{ "account_key": "account_key", "display_name": "display_name", "is_active": true, "is_default": true, "division_id": "00000000-0000-0000-0000-000000000000", "config": {} }
json
Example Responses
{ "id": "00000000-0000-0000-0000-000000000000", "channel": "channel", "account_key": "account_key", "display_name": "display_name", "is_active": true, "is_default": true, "division_id": "00000000-0000-0000-0000-000000000000", "config": {}, "verify_token": "verify_token", "webhook_url": "webhook_url", "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" }
json
application/json

Set an integration account as the default for its channel

POST
https://api-chat.bara.my.id
/api/integrations/accounts/{id}/set-default

Admin only. Clears the default flag from all other accounts in that channel.

Set an integration account as the default for its channel › path Parameters

id
​string · uuid · required

Set an integration account as the default for its channel › Responses

Account set as default

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

whatsapp, instagram, email, or messenger

account_key
​string · required

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

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

Account configuration (sensitive fields masked)

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

Computed webhook URL for this account

POST/api/integrations/accounts/{id}/set-default
curl --request POST \ --url https://api-chat.bara.my.id/api/integrations/accounts/:id/set-default
shell
Example Responses
{ "id": "00000000-0000-0000-0000-000000000000", "channel": "channel", "account_key": "account_key", "display_name": "display_name", "is_active": true, "is_default": true, "division_id": "00000000-0000-0000-0000-000000000000", "config": {}, "verify_token": "verify_token", "webhook_url": "webhook_url", "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" }
json
application/json

Fetch WhatsApp account health from Meta Graph API

GET
https://api-chat.bara.my.id
/api/integrations/accounts/{id}/whatsapp-status

Admin only. Returns phone number status, WABA info, and subscribed apps status in parallel.

Fetch WhatsApp account health from Meta Graph API › path Parameters

id
​string · uuid · required

Fetch WhatsApp account health from Meta Graph API › Responses

WhatsApp account status

account_id
​string · uuid
display_name
​string
phone_number_id
​string
waba_id
​string
healthy
​boolean
phone_number
​object
waba
​object
subscribed_apps
​object
subscribed_ok
​boolean
GET/api/integrations/accounts/{id}/whatsapp-status
curl --request GET \ --url https://api-chat.bara.my.id/api/integrations/accounts/:id/whatsapp-status
shell
Example Responses
{ "account_id": "00000000-0000-0000-0000-000000000000", "display_name": "display_name", "phone_number_id": "phone_number_id", "waba_id": "waba_id", "healthy": true, "phone_number": {}, "waba": {}, "subscribed_apps": {}, "subscribed_ok": true }
json
application/json

Get WhatsApp Embedded Signup config

GET
https://api-chat.bara.my.id
/api/integrations/whatsapp/embedded-signup-config

Admin only. Returns Meta App ID and config ID for the Facebook JS SDK.

Get WhatsApp Embedded Signup config › Responses

Embedded signup config

app_id
​string
config_id
​string
GET/api/integrations/whatsapp/embedded-signup-config
curl --request GET \ --url https://api-chat.bara.my.id/api/integrations/whatsapp/embedded-signup-config
shell
Example Responses
{ "app_id": "app_id", "config_id": "config_id" }
json
application/json

Complete WhatsApp Embedded Signup

POST
https://api-chat.bara.my.id
/api/integrations/whatsapp/embedded-signup

Admin only. Exchanges the authorization code from the WhatsApp Embedded Signup JS SDK flow for an access token, upserts the integration account, and subscribes the phone number to WABA webhooks.

Complete WhatsApp Embedded Signup › Request Body

code
​string · required

Authorization code from the Embedded Signup JS SDK

waba_id
​string · required
phone_number_id
​string · required

Complete WhatsApp Embedded Signup › Responses

Account connected

success
​boolean
account_key
​string
display_name
​string
waba_id
​string
phone_number_id
​string
POST/api/integrations/whatsapp/embedded-signup
curl --request POST \ --url https://api-chat.bara.my.id/api/integrations/whatsapp/embedded-signup \ --header 'Content-Type: application/json' \ --data ' { "code": "code", "waba_id": "waba_id", "phone_number_id": "phone_number_id" } '
shell
Example Request Body
{ "code": "code", "waba_id": "waba_id", "phone_number_id": "phone_number_id" }
json
Example Responses
{ "success": true, "account_key": "account_key", "display_name": "display_name", "waba_id": "waba_id", "phone_number_id": "phone_number_id" }
json
application/json

Get Instagram OAuth app config

GET
https://api-chat.bara.my.id
/api/integrations/instagram/auth-config

Admin only. Returns the Instagram App ID for the OAuth flow.

Get Instagram OAuth app config › Responses

Instagram app config

app_id
​string
GET/api/integrations/instagram/auth-config
curl --request GET \ --url https://api-chat.bara.my.id/api/integrations/instagram/auth-config
shell
Example Responses
{ "app_id": "app_id" }
json
application/json

Connect Instagram account via OAuth

POST
https://api-chat.bara.my.id
/api/integrations/instagram/connect

Admin only. Exchanges an authorization code for a long-lived token, fetches the user profile, and saves the Instagram integration account.

Connect Instagram account via OAuth › Request Body

code
​string · required

Authorization code from Instagram Login OAuth popup

redirect_uri
​string · required

Must exactly match the redirect_uri used in the OAuth dialog

Connect Instagram account via OAuth › Responses

Account connected

success
​boolean
​object[]
POST/api/integrations/instagram/connect
curl --request POST \ --url https://api-chat.bara.my.id/api/integrations/instagram/connect \ --header 'Content-Type: application/json' \ --data ' { "code": "code", "redirect_uri": "redirect_uri" } '
shell
Example Request Body
{ "code": "code", "redirect_uri": "redirect_uri" }
json
Example Responses
{ "success": true, "connected": [ { "account_key": "account_key", "username": "username" } ] }
json
application/json

Get Messenger OAuth app config

GET
https://api-chat.bara.my.id
/api/integrations/messenger/auth-config

Admin only. Returns the Meta App ID for the Facebook Login flow.

Get Messenger OAuth app config › Responses

Messenger app config

app_id
​string
config_id
​string
GET/api/integrations/messenger/auth-config
curl --request GET \ --url https://api-chat.bara.my.id/api/integrations/messenger/auth-config
shell
Example Responses
{ "app_id": "app_id", "config_id": "config_id" }
json
application/json

Connect Messenger via Facebook Login OAuth

POST
https://api-chat.bara.my.id
/api/integrations/messenger/connect

Admin only. Exchanges the authorization code for a long-lived user token, fetches the user's Facebook Pages, and returns them for selection. Pass the returned user_token and selected pages to POST /api/integrations/messenger/pages.

Connect Messenger via Facebook Login OAuth › Request Body

code
​string · required

Authorization code from Facebook Login OAuth popup

redirect_uri
​string · required

Must exactly match the redirect_uri used in the OAuth dialog

Connect Messenger via Facebook Login OAuth › Responses

Pages available for selection

​object[]
user_token
​string

Long-lived user token — pass back to /messenger/pages

POST/api/integrations/messenger/connect
curl --request POST \ --url https://api-chat.bara.my.id/api/integrations/messenger/connect \ --header 'Content-Type: application/json' \ --data ' { "code": "code", "redirect_uri": "redirect_uri" } '
shell
Example Request Body
{ "code": "code", "redirect_uri": "redirect_uri" }
json
Example Responses
{ "pages": [ { "page_id": "page_id", "page_name": "page_name" } ], "user_token": "user_token" }
json
application/json

Subscribe selected Facebook Pages to Messenger webhooks

POST
https://api-chat.bara.my.id
/api/integrations/messenger/pages

Admin only. For each selected page: fetches the Page Access Token, subscribes the page to messaging webhooks, and creates an IntegrationAccount.

Subscribe selected Facebook Pages to Messenger webhooks › Request Body

​object[] · required
user_token
​string · required

Long-lived user token from POST /messenger/connect

Subscribe selected Facebook Pages to Messenger webhooks › Responses

Pages connected

success
​boolean
​object[]
POST/api/integrations/messenger/pages
curl --request POST \ --url https://api-chat.bara.my.id/api/integrations/messenger/pages \ --header 'Content-Type: application/json' \ --data ' { "pages": [ { "page_id": "page_id", "page_name": "page_name" } ], "user_token": "user_token" } '
shell
Example Request Body
{ "pages": [ { "page_id": "page_id", "page_name": "page_name" } ], "user_token": "user_token" }
json
Example Responses
{ "success": true, "connected": [ { "account_key": "account_key", "page_name": "page_name", "page_id": "page_id" } ] }
json
application/json

Disconnect a Messenger page

POST
https://api-chat.bara.my.id
/api/integrations/messenger/disconnect/{account_id}

Admin only. Unsubscribes the page from webhooks and deactivates the account.

Disconnect a Messenger page › path Parameters

account_id
​string · uuid · required

Disconnect a Messenger page › Responses

Page disconnected

success
​boolean
id
​string
POST/api/integrations/messenger/disconnect/{account_id}
curl --request POST \ --url https://api-chat.bara.my.id/api/integrations/messenger/disconnect/:account_id
shell
Example Responses
{ "success": true, "id": "id" }
json
application/json

Get Messenger persistent menu

GET
https://api-chat.bara.my.id
/api/integrations/messenger/{account_id}/persistent-menu

Admin only. Fetches the current persistent menu from Meta Graph API.

Get Messenger persistent menu › path Parameters

account_id
​string · uuid · required

Get Messenger persistent menu › Responses

Persistent menu from Meta

GET/api/integrations/messenger/{account_id}/persistent-menu
curl --request GET \ --url https://api-chat.bara.my.id/api/integrations/messenger/:account_id/persistent-menu
shell
Example Responses
{}
json
application/json

Set or delete Messenger persistent menu

POST
https://api-chat.bara.my.id
/api/integrations/messenger/{account_id}/persistent-menu

Admin only. Pass delete: true to remove the menu instead.

Set or delete Messenger persistent menu › path Parameters

account_id
​string · uuid · required

Set or delete Messenger persistent menu › Request Body

persistent_menu
​

Meta persistent_menu array. Required unless delete is true.

delete
​boolean

If true, deletes the persistent menu instead of setting it.

Set or delete Messenger persistent menu › Responses

Menu set or deleted

success
​boolean
deleted
​boolean
POST/api/integrations/messenger/{account_id}/persistent-menu
curl --request POST \ --url https://api-chat.bara.my.id/api/integrations/messenger/:account_id/persistent-menu \ --header 'Content-Type: application/json' \ --data ' { "persistent_menu": {}, "delete": true } '
shell
Example Request Body
{ "persistent_menu": {}, "delete": true }
json
Example Responses
{ "success": true, "deleted": true }
json
application/json

CampaignsActivity Logs