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

Billing Admin

Endpoint

Billing plan, coupon, add-on, and analytics management (super-admin only)


List all billing plans

GET
https://api-chat.bara.my.id
/api/billing/admin/plans

Returns all plans (active and inactive). Requires super-admin auth.

List all billing plans › Responses

200

Array of billing plans

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

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

features
​object · required

Feature flags (ai_agent, api_access, dedicated_support)

is_active
​boolean · required
sort_order
​integer · required
created_at
​string · date-time · required
updated_at
​string · date-time · required
GET/api/billing/admin/plans
curl --request GET \ --url https://api-chat.bara.my.id/api/billing/admin/plans
shell
Example Responses
[ { "id": "00000000-0000-0000-0000-000000000000", "name": "name", "slug": "slug", "currency": "IDR", "base_price_monthly": 0, "base_price_annual": 0, "per_agent_price": 0, "overage_message_price": 0, "limits": {}, "features": {}, "is_active": true, "sort_order": 0, "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" } ]
json
application/json

Create a billing plan

POST
https://api-chat.bara.my.id
/api/billing/admin/plans

Defaults: currency=IDR, annual_price=monthly*10, sort_order=0.

Create a billing plan › Request Body

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

Create a billing plan › Responses

200

Created billing plan

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

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

features
​object · required

Feature flags (ai_agent, api_access, dedicated_support)

is_active
​boolean · required
sort_order
​integer · required
created_at
​string · date-time · required
updated_at
​string · date-time · required
POST/api/billing/admin/plans
curl --request POST \ --url https://api-chat.bara.my.id/api/billing/admin/plans \ --header 'Content-Type: application/json' \ --data ' { "name": "name", "slug": "slug", "currency": "IDR", "base_price_monthly": 0, "base_price_annual": 0, "per_agent_price": 0, "overage_message_price": 0, "limits": {}, "features": {}, "sort_order": 0 } '
shell
Example Request Body
{ "name": "name", "slug": "slug", "currency": "IDR", "base_price_monthly": 0, "base_price_annual": 0, "per_agent_price": 0, "overage_message_price": 0, "limits": {}, "features": {}, "sort_order": 0 }
json
Example Responses
{ "id": "00000000-0000-0000-0000-000000000000", "name": "name", "slug": "slug", "currency": "IDR", "base_price_monthly": 0, "base_price_annual": 0, "per_agent_price": 0, "overage_message_price": 0, "limits": {}, "features": {}, "is_active": true, "sort_order": 0, "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" }
json
application/json

Get a billing plan by ID

GET
https://api-chat.bara.my.id
/api/billing/admin/plans/{id}

Get a billing plan by ID › path Parameters

id
​string · uuid · required

Get a billing plan by ID › Responses

Billing plan details

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

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

features
​object · required

Feature flags (ai_agent, api_access, dedicated_support)

is_active
​boolean · required
sort_order
​integer · required
created_at
​string · date-time · required
updated_at
​string · date-time · required
GET/api/billing/admin/plans/{id}
curl --request GET \ --url https://api-chat.bara.my.id/api/billing/admin/plans/:id
shell
Example Responses
{ "id": "00000000-0000-0000-0000-000000000000", "name": "name", "slug": "slug", "currency": "IDR", "base_price_monthly": 0, "base_price_annual": 0, "per_agent_price": 0, "overage_message_price": 0, "limits": {}, "features": {}, "is_active": true, "sort_order": 0, "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" }
json
application/json

Delete a billing plan

DELETE
https://api-chat.bara.my.id
/api/billing/admin/plans/{id}

Delete a billing plan › path Parameters

id
​string · uuid · required

Delete a billing plan › Responses

Deletion confirmation

deleted
​boolean
DELETE/api/billing/admin/plans/{id}
curl --request DELETE \ --url https://api-chat.bara.my.id/api/billing/admin/plans/:id
shell
Example Responses
{ "deleted": true }
json
application/json

Update a billing plan

PATCH
https://api-chat.bara.my.id
/api/billing/admin/plans/{id}

Update a billing plan › path Parameters

id
​string · uuid · required

Update a billing plan › Request Body

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

Update a billing plan › Responses

Updated billing plan

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

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

features
​object · required

Feature flags (ai_agent, api_access, dedicated_support)

is_active
​boolean · required
sort_order
​integer · required
created_at
​string · date-time · required
updated_at
​string · date-time · required
PATCH/api/billing/admin/plans/{id}
curl --request PATCH \ --url https://api-chat.bara.my.id/api/billing/admin/plans/:id \ --header 'Content-Type: application/json' \ --data ' { "name": "name", "slug": "slug", "currency": "currency", "base_price_monthly": 0, "base_price_annual": 0, "per_agent_price": 0, "overage_message_price": 0, "limits": {}, "features": {}, "is_active": true, "sort_order": 0 } '
shell
Example Request Body
{ "name": "name", "slug": "slug", "currency": "currency", "base_price_monthly": 0, "base_price_annual": 0, "per_agent_price": 0, "overage_message_price": 0, "limits": {}, "features": {}, "is_active": true, "sort_order": 0 }
json
Example Responses
{ "id": "00000000-0000-0000-0000-000000000000", "name": "name", "slug": "slug", "currency": "IDR", "base_price_monthly": 0, "base_price_annual": 0, "per_agent_price": 0, "overage_message_price": 0, "limits": {}, "features": {}, "is_active": true, "sort_order": 0, "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" }
json
application/json

List all coupons

GET
https://api-chat.bara.my.id
/api/billing/admin/coupons

List all coupons › Responses

200

Array of coupons

​object[]
id
​string · uuid · required
code
​string · required
discount_type
​string · enum · required
Enum values:
percentage
fixed
discount_value
​integer · int64 · required
currency
​string · required
current_uses
​integer · required
valid_from
​string · date-time · required
is_active
​boolean · required
created_at
​string · date-time · required
max_uses
​integer
valid_until
​string · date-time
applicable_plans
​string[]
GET/api/billing/admin/coupons
curl --request GET \ --url https://api-chat.bara.my.id/api/billing/admin/coupons
shell
Example Responses
[ { "id": "00000000-0000-0000-0000-000000000000", "code": "code", "discount_type": "percentage", "discount_value": 0, "currency": "currency", "max_uses": 0, "current_uses": 0, "valid_from": "2024-08-25T15:00:00Z", "valid_until": "2024-08-25T15:00:00Z", "applicable_plans": [ "00000000-0000-0000-0000-000000000000" ], "is_active": true, "created_at": "2024-08-25T15:00:00Z" } ]
json
application/json

Create a coupon

POST
https://api-chat.bara.my.id
/api/billing/admin/coupons

discount_type must be 'percentage' (1-100) or 'fixed'.

Create a coupon › Request Body

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

Create a coupon › Responses

Created coupon

id
​string · uuid · required
code
​string · required
discount_type
​string · enum · required
Enum values:
percentage
fixed
discount_value
​integer · int64 · required
currency
​string · required
current_uses
​integer · required
valid_from
​string · date-time · required
is_active
​boolean · required
created_at
​string · date-time · required
max_uses
​integer
valid_until
​string · date-time
applicable_plans
​string[]
POST/api/billing/admin/coupons
curl --request POST \ --url https://api-chat.bara.my.id/api/billing/admin/coupons \ --header 'Content-Type: application/json' \ --data ' { "code": "code", "discount_type": "percentage", "discount_value": 0, "currency": "IDR", "max_uses": 0, "valid_from": "2024-08-25T15:00:00Z", "valid_until": "2024-08-25T15:00:00Z", "applicable_plans": [ "00000000-0000-0000-0000-000000000000" ] } '
shell
Example Request Body
{ "code": "code", "discount_type": "percentage", "discount_value": 0, "currency": "IDR", "max_uses": 0, "valid_from": "2024-08-25T15:00:00Z", "valid_until": "2024-08-25T15:00:00Z", "applicable_plans": [ "00000000-0000-0000-0000-000000000000" ] }
json
Example Responses
{ "id": "00000000-0000-0000-0000-000000000000", "code": "code", "discount_type": "percentage", "discount_value": 0, "currency": "currency", "max_uses": 0, "current_uses": 0, "valid_from": "2024-08-25T15:00:00Z", "valid_until": "2024-08-25T15:00:00Z", "applicable_plans": [ "00000000-0000-0000-0000-000000000000" ], "is_active": true, "created_at": "2024-08-25T15:00:00Z" }
json
application/json

Delete a coupon

DELETE
https://api-chat.bara.my.id
/api/billing/admin/coupons/{id}

Delete a coupon › path Parameters

id
​string · uuid · required

Delete a coupon › Responses

Deletion confirmation

No data returned
DELETE/api/billing/admin/coupons/{id}
curl --request DELETE \ --url https://api-chat.bara.my.id/api/billing/admin/coupons/:id
shell
Example Responses
No example specified for this content type

Update a coupon

PATCH
https://api-chat.bara.my.id
/api/billing/admin/coupons/{id}

Update a coupon › path Parameters

id
​string · uuid · required

Update a coupon › Request Body

is_active
​boolean
max_uses
​integer
valid_until
​string · date-time

Update a coupon › Responses

Updated coupon

id
​string · uuid · required
code
​string · required
discount_type
​string · enum · required
Enum values:
percentage
fixed
discount_value
​integer · int64 · required
currency
​string · required
current_uses
​integer · required
valid_from
​string · date-time · required
is_active
​boolean · required
created_at
​string · date-time · required
max_uses
​integer
valid_until
​string · date-time
applicable_plans
​string[]
PATCH/api/billing/admin/coupons/{id}
curl --request PATCH \ --url https://api-chat.bara.my.id/api/billing/admin/coupons/:id \ --header 'Content-Type: application/json' \ --data ' { "is_active": true, "max_uses": 0, "valid_until": "2024-08-25T15:00:00Z" } '
shell
Example Request Body
{ "is_active": true, "max_uses": 0, "valid_until": "2024-08-25T15:00:00Z" }
json
Example Responses
{ "id": "00000000-0000-0000-0000-000000000000", "code": "code", "discount_type": "percentage", "discount_value": 0, "currency": "currency", "max_uses": 0, "current_uses": 0, "valid_from": "2024-08-25T15:00:00Z", "valid_until": "2024-08-25T15:00:00Z", "applicable_plans": [ "00000000-0000-0000-0000-000000000000" ], "is_active": true, "created_at": "2024-08-25T15:00:00Z" }
json
application/json

List all add-ons

GET
https://api-chat.bara.my.id
/api/billing/admin/addons

List all add-ons › Responses

200

Array of add-ons

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

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

is_active
​boolean · required
sort_order
​integer · required
created_at
​string · date-time · required
updated_at
​string · date-time · required
description
​string
GET/api/billing/admin/addons
curl --request GET \ --url https://api-chat.bara.my.id/api/billing/admin/addons
shell
Example Responses
[ { "id": "00000000-0000-0000-0000-000000000000", "name": "name", "slug": "slug", "description": "description", "price_monthly": 0, "price_annual": 0, "unit": "unit", "is_active": true, "sort_order": 0, "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" } ]
json
application/json

Create an add-on

POST
https://api-chat.bara.my.id
/api/billing/admin/addons

Create an add-on › Request Body

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

Create an add-on › Responses

Created add-on

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

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

is_active
​boolean · required
sort_order
​integer · required
created_at
​string · date-time · required
updated_at
​string · date-time · required
description
​string
POST/api/billing/admin/addons
curl --request POST \ --url https://api-chat.bara.my.id/api/billing/admin/addons \ --header 'Content-Type: application/json' \ --data ' { "name": "name", "slug": "slug", "description": "description", "price_monthly": 0, "price_annual": 0, "unit": "flat", "sort_order": 0 } '
shell
Example Request Body
{ "name": "name", "slug": "slug", "description": "description", "price_monthly": 0, "price_annual": 0, "unit": "flat", "sort_order": 0 }
json
Example Responses
{ "id": "00000000-0000-0000-0000-000000000000", "name": "name", "slug": "slug", "description": "description", "price_monthly": 0, "price_annual": 0, "unit": "unit", "is_active": true, "sort_order": 0, "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" }
json
application/json

Delete an add-on

DELETE
https://api-chat.bara.my.id
/api/billing/admin/addons/{id}

Delete an add-on › path Parameters

id
​string · uuid · required

Delete an add-on › Responses

Deletion confirmation

No data returned
DELETE/api/billing/admin/addons/{id}
curl --request DELETE \ --url https://api-chat.bara.my.id/api/billing/admin/addons/:id
shell
Example Responses
No example specified for this content type

Update an add-on

PATCH
https://api-chat.bara.my.id
/api/billing/admin/addons/{id}

Update an add-on › path Parameters

id
​string · uuid · required

Update an add-on › Request Body

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

Update an add-on › Responses

Updated add-on

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

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

is_active
​boolean · required
sort_order
​integer · required
created_at
​string · date-time · required
updated_at
​string · date-time · required
description
​string
PATCH/api/billing/admin/addons/{id}
curl --request PATCH \ --url https://api-chat.bara.my.id/api/billing/admin/addons/:id \ --header 'Content-Type: application/json' \ --data ' { "name": "name", "description": "description", "price_monthly": 0, "price_annual": 0, "is_active": true, "sort_order": 0 } '
shell
Example Request Body
{ "name": "name", "description": "description", "price_monthly": 0, "price_annual": 0, "is_active": true, "sort_order": 0 }
json
Example Responses
{ "id": "00000000-0000-0000-0000-000000000000", "name": "name", "slug": "slug", "description": "description", "price_monthly": 0, "price_annual": 0, "unit": "unit", "is_active": true, "sort_order": 0, "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" }
json
application/json

Combined analytics dashboard

GET
https://api-chat.bara.my.id
/api/billing/admin/analytics/dashboard

Returns MRR, revenue by plan, monthly revenue, and churn metrics in one call.

Combined analytics dashboard › Responses

200

Analytics dashboard

​object · required
​object[] · required
​object[] · required
​object · required
GET/api/billing/admin/analytics/dashboard
curl --request GET \ --url https://api-chat.bara.my.id/api/billing/admin/analytics/dashboard
shell
Example Responses
{ "mrr": { "total_mrr": 0, "active_subscriptions": 0, "trial_subscriptions": 0, "past_due_subscriptions": 0, "currency": "currency" }, "revenue_by_plan": [ { "plan_id": "00000000-0000-0000-0000-000000000000", "plan_name": "plan_name", "subscriber_count": 0, "monthly_revenue": 0, "currency": "currency" } ], "monthly_revenue": [ { "month": "2024-08-25", "total_revenue": 0, "invoice_count": 0, "paid_count": 0 } ], "churn": { "cancelled_this_month": 0, "suspended_this_month": 0, "new_subscriptions_this_month": 0, "active_at_start_of_month": 0 } }
json
application/json

Monthly recurring revenue summary

GET
https://api-chat.bara.my.id
/api/billing/admin/analytics/mrr

Monthly recurring revenue summary › Responses

200

MRR summary

total_mrr
​integer · int64 · required

Total monthly recurring revenue

active_subscriptions
​integer · int64 · required
trial_subscriptions
​integer · int64 · required
past_due_subscriptions
​integer · int64 · required
currency
​string · required
GET/api/billing/admin/analytics/mrr
curl --request GET \ --url https://api-chat.bara.my.id/api/billing/admin/analytics/mrr
shell
Example Responses
{ "total_mrr": 0, "active_subscriptions": 0, "trial_subscriptions": 0, "past_due_subscriptions": 0, "currency": "currency" }
json
application/json

Revenue breakdown by plan

GET
https://api-chat.bara.my.id
/api/billing/admin/analytics/revenue-by-plan

Revenue breakdown by plan › Responses

200

Revenue per plan

​object[]
plan_id
​string · uuid · required
plan_name
​string · required
subscriber_count
​integer · int64 · required
monthly_revenue
​integer · int64 · required
currency
​string · required
GET/api/billing/admin/analytics/revenue-by-plan
curl --request GET \ --url https://api-chat.bara.my.id/api/billing/admin/analytics/revenue-by-plan
shell
Example Responses
[ { "plan_id": "00000000-0000-0000-0000-000000000000", "plan_name": "plan_name", "subscriber_count": 0, "monthly_revenue": 0, "currency": "currency" } ]
json
application/json

Monthly revenue over time (last 12 months)

GET
https://api-chat.bara.my.id
/api/billing/admin/analytics/monthly-revenue

Monthly revenue over time (last 12 months) › Responses

200

Monthly revenue array

​object[]
month
​string · date · required
total_revenue
​integer · int64 · required
invoice_count
​integer · int64 · required
paid_count
​integer · int64 · required
GET/api/billing/admin/analytics/monthly-revenue
curl --request GET \ --url https://api-chat.bara.my.id/api/billing/admin/analytics/monthly-revenue
shell
Example Responses
[ { "month": "2024-08-25", "total_revenue": 0, "invoice_count": 0, "paid_count": 0 } ]
json
application/json

Churn metrics for current month

GET
https://api-chat.bara.my.id
/api/billing/admin/analytics/churn

Churn metrics for current month › Responses

200

Churn metrics

cancelled_this_month
​integer · int64 · required
suspended_this_month
​integer · int64 · required
new_subscriptions_this_month
​integer · int64 · required
active_at_start_of_month
​integer · int64 · required
GET/api/billing/admin/analytics/churn
curl --request GET \ --url https://api-chat.bara.my.id/api/billing/admin/analytics/churn
shell
Example Responses
{ "cancelled_this_month": 0, "suspended_this_month": 0, "new_subscriptions_this_month": 0, "active_at_start_of_month": 0 }
json
application/json

Refund an invoice

POST
https://api-chat.bara.my.id
/api/billing/admin/invoices/{id}/refund

Issue a full or partial refund. Defaults to full refund if amount is omitted.

Refund an invoice › path Parameters

id
​string · uuid · required

Refund an invoice › Request Body

reason
​string
amount
​integer · int64

Partial refund amount. Omit for full refund.

Refund an invoice › Responses

Refund issued

status
​string
refund_amount
​integer · int64
invoice_status
​string
POST/api/billing/admin/invoices/{id}/refund
curl --request POST \ --url https://api-chat.bara.my.id/api/billing/admin/invoices/:id/refund \ --header 'Content-Type: application/json' \ --data ' { "reason": "reason", "amount": 0 } '
shell
Example Request Body
{ "reason": "reason", "amount": 0 }
json
Example Responses
{ "status": "status", "refund_amount": 0, "invoice_status": "invoice_status" }
json
application/json

Super AdminBilling