{"openapi":"3.1.0","info":{"title":"Hailbell Push API","version":"1.0.0","description":"Send push notifications to iOS (APNs), Android (FCM) and web browsers, read the satisfaction ratings of web chats, set chats to waiting or snoozed, set their priority and read their reply-time targets, merge duplicate chats, group chats into issues and message everyone linked when one is fixed, see the account's plan and trial, and make apps and their platforms. Every endpoint except the public occasion calendar (GET \/v1\/occasions) and a one-time screenshot upload (POST \/v1\/uploads\/{id}\/{secret}) takes an API key as `Authorization: Bearer hbk_...`, made on the Push page of the dashboard. Keys have scopes (read, send, manage), a daily limit on notifications they create, and belong to one app or to all apps. AI agents can use the same operations through the MCP server at \/mcp, with a key or by signing in with OAuth (see \/.well-known\/oauth-authorization-server). See \/llms.txt for a short guide. An app has up to three platforms (iOS, Android, web), each with its own App ID. Pass `productId` or `platforms` to send one campaign to several of them (id `ngr_...`); without them every call works on one platform, as before."},"servers":[{"url":"https:\/\/api.hailbell.com"}],"security":[{"apiKey":[]}],"paths":{"\/v1\/account":{"get":{"summary":"The account","operationId":"getAccount","description":"The account the key belongs to: its name, your role, the plan, and billing (`state` is trial, active, paused or owner; `daysLeft` in trial; times in ISO 8601). Paused means chat, replies, campaign pushes and AI replies are all off until a plan is picked. `summary` is one sentence for the person, `plans` the paid plans with prices in USD, and `planUrl` opens the dashboard's plan picker (Settings \u203a Plan). Only the owner picks a plan. `retention` says how long chats are kept.\n\nScope: `read`.","responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"account":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}}},"yourRole":{"type":["string","null"],"description":"owner, admin or agent: the role of the person who made the key"},"plan":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}}},"billing":{"type":"object","properties":{"state":{"type":"string","enum":["trial","active","paused","owner"]},"canSend":{"type":"boolean","description":"false once the trial or plan has ended: chat, replies, campaign pushes and AI replies are off"},"daysLeft":{"type":"integer"},"trialEndsAt":{"type":["string","null"],"format":"date-time"},"paidUntil":{"type":["string","null"],"format":"date-time"},"cycle":{"type":["string","null"],"description":"month or year"},"reason":{"type":"string","description":"Why it is paused: no-trial, refunded or disputed"}}},"summary":{"type":"string"},"plans":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"prices":{"type":"object","properties":{"month":{"type":"number"},"year":{"type":"number"},"currency":{"type":"string"}}},"users":{"type":"string"}}}},"planUrl":{"type":"string"},"dashboard":{"type":"string"},"retention":{"type":"object","description":"How long chats are kept after their last message. `chatDays` applies now (365 by default); `chosenDays` is what an admin picked (null for the default); `canChange` is true on Scale and Business.","properties":{"chatDays":{"type":"integer"},"chosenDays":{"type":["integer","null"]},"defaultDays":{"type":"integer"},"signalDays":{"type":"integer"},"choices":{"type":"array","items":{"type":"integer"}},"canChange":{"type":"boolean"}}}}}}}},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"}}},"patch":{"summary":"Change how long chats are kept","operationId":"updateRetention","description":"Sets how long the account keeps chats, like Settings \u203a Account \u203a Data retention. Every night Hailbell deletes the messages, images and events of chats whose last message is older than this; customers, push subscriptions and purchases stay. Only on the Scale and Business plans, with a key made for all apps by an admin or the owner. With a shorter period the nightly cleanup deletes older chats, which can't be undone.\n\nScope: `manage`.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["retentionDays"],"properties":{"retentionDays":{"type":["integer","null"],"enum":[30,90,180,365,730,1095,1825,null],"description":"Days to keep a chat after its last message; null for the default 365"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"retention":{"type":"object","description":"How long chats are kept after their last message. `chatDays` applies now (365 by default); `chosenDays` is what an admin picked (null for the default); `canChange` is true on Scale and Business.","properties":{"chatDays":{"type":"integer"},"chosenDays":{"type":["integer","null"]},"defaultDays":{"type":"integer"},"signalDays":{"type":"integer"},"choices":{"type":"array","items":{"type":"integer"}},"canChange":{"type":"boolean"}}}}}}}},"400":{"description":"retentionDays missing or not on offer"},"403":{"description":"Not on Scale or Business, not an admin, or the key doesn't cover every app"}}}},"\/v1\/apps":{"get":{"summary":"List apps","operationId":"listApps","responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"apps":{"type":"array","items":{"$ref":"#\/components\/schemas\/App"}}}}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"}},"description":"Scope: `read`."},"post":{"summary":"Make an app","operationId":"createApp","description":"Makes a new app with its first platform, like the dashboard's Settings \u203a New app. An app with the same name or iOS bundle ID in the account is refused with 409. Needs a key for every app in the account (all apps) with the `manage` scope, made by someone who is still an admin or the owner. The identity secret is not returned; the person makes one in the dashboard (Settings, the platform's Edit, New identity secret) if a backend will sign users in.\n\nScope: `manage`.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["name","platform"],"properties":{"name":{"type":"string","maxLength":80},"platform":{"type":"string","enum":["ios","android","web"]},"bundleId":{"type":"string","description":"iOS only: the bundle ID, like com.company.app. Needed for push."},"packageName":{"type":"string","description":"Android only: the Play Store package name, like com.company.app."},"appStoreId":{"type":"string","description":"iOS: the number in the App Store link (apps.apple.com\/app\/id1234567890), or the link itself. Used for review requests and the store icon."},"website":{"type":"string","description":"The app's website, like example.com. Its icon is used when the stores have none."}}}}}},"responses":{"201":{"description":"Made","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/NewPlatform"}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"409":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/products\/{productId}\/platforms":{"post":{"summary":"Add a platform to an app","operationId":"addPlatform","description":"Adds iOS, Android or web to an existing app, like the dashboard's Add iOS, Add Android or Add Web. The platform gets its own App ID and the app's shared settings (name, AI replies, chat design, Discord forum). An app has one platform of each kind; a second is refused with 409. Needs a key for every app in the account (all apps) with the `manage` scope, made by someone who is still an admin or the owner. The identity secret is not returned; the person makes one in the dashboard (Settings, the platform's Edit, New identity secret) if a backend will sign users in.\n\nScope: `manage`.","parameters":[{"name":"productId","in":"path","required":true,"schema":{"type":"string"},"description":"The app, from GET \/v1\/apps"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["platform"],"properties":{"platform":{"type":"string","enum":["ios","android","web"]},"bundleId":{"type":"string","description":"iOS only: the bundle ID, like com.company.app. Needed for push."},"packageName":{"type":"string","description":"Android only: the Play Store package name, like com.company.app."},"appStoreId":{"type":"string","description":"iOS: the number in the App Store link (apps.apple.com\/app\/id1234567890), or the link itself. Used for review requests and the store icon."},"website":{"type":"string","description":"The app's website, like example.com. Its icon is used when the stores have none."}}}}}},"responses":{"201":{"description":"Added","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/NewPlatform"}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"},"409":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/notifications":{"post":{"summary":"Send or schedule a notification","operationId":"createNotification","parameters":[{"name":"Idempotency-Key","in":"header","schema":{"type":"string","maxLength":100},"description":"Repeating a request with the same key returns the first notification (200) instead of sending again"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/NotificationRequest"}}}},"responses":{"200":{"description":"Already created with this idempotency key","content":{"application\/json":{"schema":{"oneOf":[{"$ref":"#\/components\/schemas\/Notification"},{"$ref":"#\/components\/schemas\/Campaign"}]}}}},"201":{"description":"Created","content":{"application\/json":{"schema":{"oneOf":[{"$ref":"#\/components\/schemas\/Notification"},{"$ref":"#\/components\/schemas\/Campaign"}]}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"},"429":{"$ref":"#\/components\/responses\/Error"}},"description":"Sends to one platform of an app, as before. With `productId` or `platforms` it is one campaign across those platforms of the app (id `ngr_...`): each signed-in person gets it once, on the matching device they used most recently, and it counts as one notification toward the key's daily limit.\n\nScope: `send`."},"get":{"summary":"List recent notifications","description":"With `appId` only: that platform's notifications, including its part of campaigns across platforms (with `groupId`). With `productId` or `platforms`: the app's campaigns, each campaign across platforms once with its numbers per platform.\n\nScope: `read`.","operationId":"listNotifications","parameters":[{"name":"appId","in":"query","schema":{"type":"string"},"description":"Needed only with an all-apps key"},{"name":"productId","in":"query","schema":{"type":"string"},"description":"The whole app (`productId` from GET \/v1\/apps). Covers all of its platforms unless `platforms` narrows it."},{"name":"platforms","in":"query","schema":{"type":"string"},"description":"Several platforms of one app: `all`, or a comma-separated list of `ios`, `android`, `web` or App IDs, such as `ios,web`. Leave out (with no `productId`) for the one platform of `appId`.","example":"ios,web"},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"notifications":{"type":"array","items":{"anyOf":[{"$ref":"#\/components\/schemas\/Notification"},{"$ref":"#\/components\/schemas\/CampaignListItem"}]}}}}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/notifications\/preview":{"post":{"summary":"Preview a notification without sending","operationId":"previewNotification","description":"Returns the cleaned content, the audience size per platform, warnings and the exact payload each platform receives. With `productId` or `platforms` it previews a campaign across those platforms, and its `confirmToken` is for exactly those platforms.\n\nScope: `read`.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/NotificationRequest"}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Preview"}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/notifications\/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"A notification (`ntf_...`) or a campaign across platforms (`ngr_...`)"}],"get":{"summary":"Get a notification and its numbers","operationId":"getNotification","responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"oneOf":[{"$ref":"#\/components\/schemas\/Notification"},{"$ref":"#\/components\/schemas\/Campaign"}]}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"}},"description":"A campaign across platforms (`ngr_...`) has the numbers for the whole campaign, the same per platform, and `deduped`.\n\nScope: `read`."},"delete":{"summary":"Cancel a notification","operationId":"cancelNotification","responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"status":{"const":"canceled"}}}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"},"409":{"$ref":"#\/components\/responses\/Error"}},"description":"Stops a scheduled notification, or one still sending. Devices already reached keep it. Cancelling a campaign across platforms, or any one of its platforms (`ntf_...` with a `groupId`), stops all of its platforms; the key must cover all of them.\n\nScope: `send`."}},"\/v1\/notifications\/{id}\/cancel":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"A notification (`ntf_...`) or a campaign across platforms (`ngr_...`)"}],"post":{"summary":"Cancel a notification","operationId":"cancelNotificationPost","responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"status":{"const":"canceled"}}}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"},"409":{"$ref":"#\/components\/responses\/Error"}},"description":"Stops a scheduled notification, or one still sending. Devices already reached keep it. Cancelling a campaign across platforms, or any one of its platforms (`ntf_...` with a `groupId`), stops all of its platforms; the key must cover all of them.\n\nScope: `send`."}},"\/v1\/audience\/estimate":{"post":{"summary":"Count the devices an audience reaches","operationId":"estimateAudience","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"appId":{"type":"string","description":"Needed only with an all-apps key"},"productId":{"type":"string","description":"The whole app (`productId` from GET \/v1\/apps), for all of its platforms. `platforms` defaults to \"all\" when you pass it."},"platforms":{"$ref":"#\/components\/schemas\/PlatformsSelector"},"audience":{"$ref":"#\/components\/schemas\/Audience"},"kind":{"$ref":"#\/components\/schemas\/Kind"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"estimate":{"$ref":"#\/components\/schemas\/Estimate"}}}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"}},"description":"Counts devices per platform and per App ID (`byApp`), and the people they belong to. With `productId` or `platforms` it counts across those platforms of the app.\n\nScope: `read`."}},"\/v1\/segments":{"get":{"summary":"List segments","operationId":"listSegments","parameters":[{"name":"appId","in":"query","schema":{"type":"string"},"description":"Needed only with an all-apps key"},{"name":"productId","in":"query","schema":{"type":"string"},"description":"The whole app (`productId` from GET \/v1\/apps). Covers all of its platforms unless `platforms` narrows it."},{"name":"platforms","in":"query","schema":{"type":"string"},"description":"Several platforms of one app: `all`, or a comma-separated list of `ios`, `android`, `web` or App IDs, such as `ios,web`. Leave out (with no `productId`) for the one platform of `appId`.","example":"ios,web"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"segments":{"type":"array","items":{"$ref":"#\/components\/schemas\/Segment"}}}}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"}},"description":"The app's segments, from every platform. `size` and `people` count the platforms asked for: the one of `appId`, or those named with `productId` or `platforms`.\n\nScope: `read`."},"post":{"summary":"Create a segment","operationId":"createSegment","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SegmentRequest"}}}},"responses":{"201":{"description":"Created","content":{"application\/json":{"schema":{"type":"object","properties":{"segment":{"$ref":"#\/components\/schemas\/Segment"}}}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"}},"description":"Scope: `manage`."}},"\/v1\/segments\/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Replace a segment","description":"Scope: `manage`.","operationId":"updateSegment","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SegmentRequest"}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"}}},"delete":{"summary":"Delete a segment","operationId":"deleteSegment","description":"Refused with 409 while a send that is scheduled or going out names the segment in `segments` or `excludeSegments`. The answer has `error` (a sentence naming the sends) and `sends`: `[{ id, name, sendAfter, use }]` with `use` `included` or `excluded`. Cancel those sends first; there is no force flag.\n\nScope: `manage`.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/context":{"get":{"summary":"What to know before writing a message","operationId":"getContext","description":"The local time where the audience is, their countries, the hours they usually use the app, upcoming occasions (festivals, holidays, shopping days and the app's own dates), the app's limits and the template variables. With `productId` or `platforms` it covers those platforms, and adds `limitsByPlatform`.\n\nScope: `read`.","parameters":[{"name":"appId","in":"query","schema":{"type":"string"},"description":"Needed only with an all-apps key"},{"name":"productId","in":"query","schema":{"type":"string"},"description":"The whole app (`productId` from GET \/v1\/apps). Covers all of its platforms unless `platforms` narrows it."},{"name":"platforms","in":"query","schema":{"type":"string"},"description":"Several platforms of one app: `all`, or a comma-separated list of `ios`, `android`, `web` or App IDs, such as `ios,web`. Leave out (with no `productId`) for the one platform of `appId`.","example":"ios,web"},{"name":"days","in":"query","schema":{"type":"integer","minimum":1,"maximum":60,"default":14}}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Context"}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/tag-keys":{"get":{"summary":"Tag keys in use","operationId":"listTagKeys","parameters":[{"name":"appId","in":"query","schema":{"type":"string"},"description":"Needed only with an all-apps key"},{"name":"productId","in":"query","schema":{"type":"string"},"description":"The whole app (`productId` from GET \/v1\/apps). Covers all of its platforms unless `platforms` narrows it."},{"name":"platforms","in":"query","schema":{"type":"string"},"description":"Several platforms of one app: `all`, or a comma-separated list of `ios`, `android`, `web` or App IDs, such as `ios,web`. Leave out (with no `productId`) for the one platform of `appId`.","example":"ios,web"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"keys":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"n":{"type":"integer"}}}}}}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"}},"description":"Tag keys and how many users have each. With `productId` or `platforms`, across those platforms. A tag filter matches a signed-in person when the tag is set on any platform of the app.\n\nScope: `read`."}},"\/v1\/users\/{externalId}":{"parameters":[{"name":"externalId","in":"path","required":true,"schema":{"type":"string"}},{"name":"appId","in":"query","schema":{"type":"string"},"description":"Needed only with an all-apps key"}],"get":{"summary":"Get a user by your own user id","operationId":"getUser","responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","description":"Tags, devices, recent events, topics, install, and `cancelQuestions`: the cancel feedback questions this person got or is due in the last 180 days, on any platform of the app (each { variant: cancel | trial_cancel | refund, status: waiting | sending | sent | skipped, reason, createdAt, dueAt, doneAt }, and on a sent one seen, replied and emailed: whether they opened the chat after it, wrote back, or got it by email because it went unread)"}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"}},"description":"Scope: `read`."}},"\/v1\/users\/{externalId}\/tags":{"parameters":[{"name":"externalId","in":"path","required":true,"schema":{"type":"string"}}],"post":{"summary":"Set tags on a user","operationId":"setUserTags","description":"An empty string removes a tag. Up to 100 tags per user.\n\nScope: `manage`.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["tags"],"properties":{"appId":{"type":"string","description":"Needed only with an all-apps key"},"tags":{"type":"object","additionalProperties":{"type":["string","number","boolean"]}}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/coming-up":{"get":{"summary":"What is coming: scheduled sends and occasions","operationId":"comingUp","description":"Notifications scheduled or still sending, and upcoming festivals, holidays and the app's own dates, in time order. `days` goes up to 365 for sends; occasions are listed at most 60 days ahead. Without appId (on an all-apps key) it covers every app.\n\nScope: `read`.","parameters":[{"name":"appId","in":"query","schema":{"type":"string"},"description":"One app, or omit for every app the key covers"},{"name":"days","in":"query","schema":{"type":"integer","minimum":1,"maximum":365,"default":30}}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/occasions":{"get":{"summary":"The occasion calendar, public","operationId":"listOccasions","security":[],"description":"Festivals, holidays and sales around the world, for planning paywalls, pushes and posts. Needs no API key, allows any origin and is cached for an hour. Each occasion has `kind` (religious, cultural, shopping, national, awareness) and `tier` (1 is worth a sale or paywall of its own in those countries, 2 a push or a post, 3 is minor). `countries: null` means everywhere, except the countries in `except`, which have their own date. `about` says in a sentence or two what the day is and how people mark it. Multi-day occasions carry `days`, and ones still under way on `from` are listed with their start date. Moon and religious dates are known through `datedThrough`.","parameters":[{"name":"from","in":"query","schema":{"type":"string","format":"date"},"description":"First day, YYYY-MM-DD. Default today (UTC)"},{"name":"days","in":"query","schema":{"type":"integer","minimum":1,"maximum":400,"default":60},"description":"How many days to list. More than 400 lists 400"},{"name":"country","in":"query","schema":{"type":"string"},"description":"Two-letter codes, comma separated, like IN or US,GB. Keeps those countries plus the occasions for everyone"},{"name":"tier","in":"query","schema":{"type":"integer","enum":[1,2,3],"default":3},"description":"Keep this tier and bigger: 1 only the biggest, 2 tiers 1 and 2"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"from":{"type":"string","format":"date"},"days":{"type":"integer"},"datedThrough":{"type":"string","format":"date"},"occasions":{"type":"array","items":{"type":"object","required":["name","date","countries","kind","tier","source"],"properties":{"name":{"type":"string"},"date":{"type":"string","format":"date"},"countries":{"type":["array","null"],"items":{"type":"string"}},"kind":{"type":"string","enum":["religious","cultural","shopping","national","awareness"]},"tier":{"type":"integer","enum":[1,2,3]},"about":{"type":"string","description":"A sentence or two on what the day is and how people mark it"},"days":{"type":"integer"},"except":{"type":"array","items":{"type":"string"}},"community":{"type":"array","description":"Countries where only one community keeps the day, such as Sikh days abroad. It is listed there, but {{occasion}} skips it.","items":{"type":"string"}},"source":{"type":"string","enum":["calendar"]}}}}}}}}},"400":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/settings":{"get":{"summary":"Push setup of an app","operationId":"getSettings","description":"Readiness per platform, subscriber counts and settings (limits, occasions, web prompt, Android settings, automatic messages in `settings.triggers`), `agentReplies` (`draft` when a support chat reply from an AI agent waits for a teammate to send it, `send` when it goes to the customer directly), `customerLanguage` (Customer's language: team replies in English go out AI-translated into the customer's language, and the help center shows articles in the visitor's language), and `triggerStats`: what each automatic message did in the last 30 days.\n\nScope: `read`.","parameters":[{"name":"appId","in":"query","schema":{"type":"string"},"description":"Needed only with an all-apps key"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"}}},"patch":{"summary":"Change push setup","operationId":"updateSettings","description":"Any of `limits`, `occasions`, `web` (`prompt`, `welcome`, `subject`), `firebaseProject`, `androidOffersChannel`, `triggers`, `agentReplies`, `customerLanguage`. Each part given replaces that part; inside `triggers`, each trigger given (`paywallDecline`, `billingIssue`, `cancellation`) replaces that trigger, except that `cancellation` keeps a `trialText` or `refundText` left out (an empty string clears one).\n\nScope: `manage`.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"appId":{"type":"string"},"limits":{"type":"object"},"occasions":{"type":"array","items":{"type":"object"}},"web":{"type":"object"},"firebaseProject":{"type":"string"},"androidOffersChannel":{"type":"string"},"triggers":{"type":"object","description":"Automatic messages. `paywallDecline`: { enabled, event (default paywall_decline), delayHours (1-168, default 24), fallback (HH:MM, default 19:00), cooldownDays (1-90, default 7), content (like a notification's content) }: a promotional push delayHours after the app records the signal, at the hour the person usually opens the app, to people who allow promotional pushes and aren't paying; a purchase first cancels it. `billingIssue`: { enabled, text }: when Superwall, RevenueCat, the App Store, Stripe, Paddle, Lemon Squeezy, Dodo Payments, Polar, Creem, Whop or Razorpay reports a failed renewal, the text goes into the customer's support chat as a team message, between 09:00 and 21:00 their time; skipped if the payment recovers first. `cancellation`: { enabled, text, trialText, refundText }: the cancel feedback question. When Superwall, RevenueCat, the App Store, Stripe, Paddle, Lemon Squeezy, Dodo Payments, Polar, Creem, Whop or Razorpay reports a cancel the person chose, `text` goes into their support chat as a team message about an hour later, between 09:00 and 21:00 their time; a cancelled free trial gets `trialText` (else `text`), a refund gets `refundText` (refunds are asked only when it is set). Skipped if they resubscribe or pay again first (except refunds), got a refund, or talked with the team in the last day; once per person every 180 days; never for billing-retry or developer cancels or Family Sharing members."},"agentReplies":{"type":"string","enum":["draft","send"],"description":"Support chat replies from AI agents (MCP `reply` and `start_conversation`), for every platform of the app. `draft` (the default): each reply waits in the dashboard until a teammate sends or discards it. `send`: replies go to the customer directly, with the push and email a teammate's reply gets. Needs a key made by an admin or the owner (403 otherwise). Admins can also switch it in the dashboard, in the app's Agent replies settings."},"customerLanguage":{"type":"boolean","description":"Customer's language, for every platform of the app: a teammate's reply written in English goes out AI-translated into the language the customer writes in, and the help center shows articles AI-translated into the visitor's language. Spends the account's AI budget. Needs a key made by an admin or the owner."}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/subscribers":{"get":{"summary":"Devices of an app","operationId":"listSubscribers","description":"Newest 100 devices, or those matching `q` (name, email, external id or subscription id). With `productId` or `platforms`, devices of those platforms.\n\nScope: `read`.","parameters":[{"name":"appId","in":"query","schema":{"type":"string"},"description":"Needed only with an all-apps key"},{"name":"productId","in":"query","schema":{"type":"string"},"description":"The whole app (`productId` from GET \/v1\/apps). Covers all of its platforms unless `platforms` narrows it."},{"name":"platforms","in":"query","schema":{"type":"string"},"description":"Several platforms of one app: `all`, or a comma-separated list of `ios`, `android`, `web` or App IDs, such as `ios,web`. Leave out (with no `productId`) for the one platform of `appId`.","example":"ios,web"},{"name":"q","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/subscribers\/{id}":{"patch":{"summary":"Mark a test device","operationId":"setTestDevice","description":"Scope: `manage`.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["test"],"properties":{"test":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/images":{"post":{"summary":"Store a notification image","operationId":"uploadImage","description":"PNG, JPEG, WebP or GIF up to 1 MB, from an https `url` or base64 `data`. Returns the URL for `content.image`.\n\nScope: `send`.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"appId":{"type":"string"},"url":{"type":"string"},"data":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object"}}}},"201":{"description":"Stored","content":{"application\/json":{"schema":{"type":"object","properties":{"url":{"type":"string"}}}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/image-uploads":{"post":{"summary":"A one-time URL for a support screenshot","operationId":"createImageUpload","description":"Returns `uploadUrl`, `expiresAt`, `command` and `note`. The command is `curl --data-binary @screenshot.png 'UPLOAD_URL'`. POST the file's raw bytes to `uploadUrl`. No API key. One use, about 15 minutes. PNG, JPEG, WebP or GIF, 1.5 MB. The answer is `{ id, url }`. Pass `id` in `images` on a reply or a draft. Needs `appId` with an all-apps key.\n\nScope: `send`.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"appId":{"type":"string"}}}}}},"responses":{"201":{"description":"The upload link","content":{"application\/json":{"schema":{"type":"object","properties":{"uploadUrl":{"type":"string"},"expiresAt":{"type":"string"},"command":{"type":"string"},"note":{"type":"string"}}}}}},"401":{"$ref":"#\/components\/responses\/Error"},"503":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/uploads\/{id}\/{secret}":{"post":{"summary":"Upload a screenshot to a one-time link","operationId":"uploadScreenshot","security":[],"description":"The raw image bytes, from the URL `create_image_upload` returned. No `Authorization` header. One use. PNG, JPEG, WebP or GIF, and the bytes must really be that type. 1.5 MB. Answers `{ id, url }`.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"secret","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application\/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"Stored","content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"}}}}}},"400":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"},"409":{"$ref":"#\/components\/responses\/Error"},"410":{"$ref":"#\/components\/responses\/Error"},"413":{"$ref":"#\/components\/responses\/Error"},"415":{"$ref":"#\/components\/responses\/Error"},"503":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/conversations\/start":{"post":{"summary":"Write first to one customer","operationId":"startConversation","description":"The same as MCP `start_conversation`. `identifier` is one whole user ID, email, Superwall or RevenueCat ID, or a Hailbell contact or conversation id. `text` is required. `images` adds up to 4 screenshots. `draft: true` saves a draft even when the app lets agents send. Several matches send nothing.\n\nScope: `send`.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["identifier","text"],"properties":{"identifier":{"type":"string"},"appId":{"type":"string"},"productId":{"type":"string"},"text":{"type":"string"},"images":{"type":"array","maxItems":4,"items":{}},"draft":{"type":"boolean"},"idempotencyKey":{"type":"string"}}}}}},"responses":{"200":{"description":"Drafted, sent, or several matches"},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/conversations\/{id}\/reply":{"post":{"summary":"Reply in a support chat","operationId":"replyToConversation","description":"The same as MCP `reply`. A draft by default. Sent now when the app has `agentReplies: \"send\"`, unless `draft` is true. `images` adds up to 4 screenshots (an id from the upload link, an https URL, a stored file URL, or base64).\n\nScope: `send`.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Conversation id"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["text"],"properties":{"text":{"type":"string"},"images":{"type":"array","maxItems":4,"items":{}},"draft":{"type":"boolean"},"idempotencyKey":{"type":"string"}}}}}},"responses":{"200":{"description":"The draft or the sent message"},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"503":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/conversations\/{id}\/drafts":{"post":{"summary":"Save a draft reply","operationId":"saveConversationDraft","description":"Always saves a draft, even when the app lets agents send. `text` is required. `images` adds up to 4 screenshots. One draft per chat. A newer one replaces the one waiting.\n\nScope: `send`.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["text"],"properties":{"text":{"type":"string"},"images":{"type":"array","maxItems":4,"items":{}},"idempotencyKey":{"type":"string"}}}}}},"responses":{"201":{"description":"The draft"},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"503":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/conversations\/{id}\/drafts\/{draftId}":{"post":{"summary":"Change a waiting draft","operationId":"editConversationDraftPost","description":"Same as PATCH on this path, and as MCP `edit_draft`.\n\nScope: `send`.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"draftId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"images":{"type":"array","maxItems":4,"items":{}},"addImages":{"type":"array","maxItems":4,"items":{}},"removeImages":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"The draft"},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"},"503":{"$ref":"#\/components\/responses\/Error"}}},"patch":{"summary":"Change a waiting draft","operationId":"editConversationDraft","description":"The same as MCP `edit_draft`. New `text`, or a new set of screenshots, without sending. `images` replaces the list (`[]` removes them). `addImages` and `removeImages` change it. Not both. A text-only edit keeps the images.\n\nScope: `send`.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"draftId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"images":{"type":"array","maxItems":4,"items":{}},"addImages":{"type":"array","maxItems":4,"items":{}},"removeImages":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"The draft"},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"},"503":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/conversations\/{id}\/drafts\/{draftId}\/send":{"post":{"summary":"Send a waiting draft","operationId":"sendConversationDraft","description":"The same as MCP `send_draft`. Sends the draft and its screenshots, only when the app has `agentReplies: \"send\"`. `text`, `images`, `addImages` and `removeImages` can change it on the way out. A drafts-only app answers 403 and the draft keeps waiting.\n\nScope: `send`.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"draftId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application\/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"images":{"type":"array","maxItems":4,"items":{}},"addImages":{"type":"array","maxItems":4,"items":{}},"removeImages":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"The sent message"},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"},"503":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/ai-replies":{"get":{"summary":"AI replies settings of an app","operationId":"getAiReplies","description":"The settings the AI answers customers in the support chat from, as in Settings \u203a AI replies: whether it is on, the wait, its name, the notes (`knowledge`), the how-to guide (`guide`), `appInfo`, `pricing` saved replies (`faq`) the reply time card (`replyTime`) the lookup URL (`lookup`) and the actions customers confirm (`actions`), plus whether the lookup has its signing secret (`lookupSecretSet`). Also the most characters each text field keeps (`limits`) and whether the server has an AI key (`aiConfigured`). The settings belong to the app, so every platform of it returns the same.\n\nScope: `read`.","parameters":[{"name":"appId","in":"query","schema":{"type":"string"},"description":"Needed only with an all-apps key"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/AiRepliesResponse"}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"}}},"patch":{"summary":"Change AI replies settings","operationId":"updateAiReplies","description":"Only the fields given change; the rest are kept. Text fields replace what was there. `pricing`, `replyTime`, `lookup` and `actions` are merged field by field; `faq` replaces the whole list. The change applies to every platform of the app. `enabled: true` makes the AI answer real customers. Text longer than its limit is cut, and the response lists those fields in `truncated`. Write the guide and notes from the app's source code and what the owner says; don't invent anything. POST works the same.\n\nScope: `manage`.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/AiRepliesUpdate"}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/AiRepliesResponse"}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/ai-replies\/lookup-test":{"post":{"summary":"Test the lookup URL","operationId":"testAiLookup","description":"Sends one signed sample request (type \"test\", a made-up customer `test_user_123` with sample purchases) to the app's lookup URL, or to `url` when given, like Test lookup in the dashboard. No AI call. Makes the signing secret if the app has none, and returns it once. Needs a key made by an admin or the owner.\n\nScope: `manage`.","requestBody":{"required":false,"content":{"application\/json":{"schema":{"type":"object","properties":{"appId":{"type":"string","description":"Needed only with an all-apps key"},"url":{"type":"string","maxLength":500,"description":"A URL to try instead of the saved one (not saved)"},"question":{"type":"string","maxLength":300,"description":"The question to send. Default: \"Where is my latest order?\""}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/AiLookupTest"}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/ai-replies\/actions-load":{"post":{"summary":"Load the actions the lookup URL declares","operationId":"loadAiActions","description":"Asks the app's lookup URL which actions it can do for customers and saves the list, like Load actions in Settings \u203a AI replies. Hailbell sends one signed request with `type: \"actions\"` (same signature as a lookup, no customer in it) and the endpoint answers `{ \"actions\": [{ \"id\", \"label\", \"description\", \"needsVerifiedUser\" }] }`, up to 20. A new action starts off, one already on stays on, and one no longer declared is dropped. Nothing is offered to customers until `actions.enabled` is true in PATCH \/v1\/ai-replies. When the call fails, `ok` is false and the saved list is unchanged. Needs a key made by an admin or the owner. Same as MCP `load_ai_actions`. Format: https:\/\/hailbell.com\/docs#ai-actions\n\nScope: `manage`.","requestBody":{"required":false,"content":{"application\/json":{"schema":{"type":"object","properties":{"appId":{"type":"string","description":"Needed only with an all-apps key"},"url":{"type":"string","maxLength":500,"description":"A URL to ask instead of the saved lookup URL (the URL is not saved)"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"actions":{"$ref":"#\/components\/schemas\/AiActions"},"status":{"type":"integer"},"ms":{"type":"integer"},"error":{"type":["string","null"],"description":"A lookup error, or no_actions when the answer had no actions list"},"message":{"type":"string","description":"The error in words"},"ignored":{"type":"integer","description":"Entries left out: no usable id or label, a repeated id, or past the 20th"},"lookupSecret":{"type":"string","description":"Only when this call made the signing secret"}}}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/ai-replies\/action-test":{"post":{"summary":"Dry-run one action","operationId":"testAiAction","description":"Sends one signed request with `type: \"action_test\"` and `dryRun: true` for one loaded action to the app's lookup URL, with a made-up customer `test_user_123` and an idempotency key. The endpoint must check it and answer `{ \"ok\": true, \"message\": \"\u2026\" }` without doing anything; a real run has `type: \"action\"`. No customer sees anything and no AI call is made. Needs a key made by an admin or the owner. Same as MCP `test_ai_action`.\n\nScope: `manage`.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["action"],"properties":{"appId":{"type":"string","description":"Needed only with an all-apps key"},"action":{"type":"string","description":"The action id, from settings.actions.list"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","description":"true only when the endpoint answered 2xx JSON with ok true"},"status":{"type":"integer"},"ms":{"type":"integer"},"error":{"type":["string","null"],"description":"timeout, network, redirect, status, too_large, not_json, declined (the endpoint said ok false) or bad_answer (no true or false ok)"},"message":{"type":["string","null"],"description":"What the customer would read"},"problem":{"type":"string","description":"The failure in words"},"sent":{"type":"object","description":"The exact body Hailbell signed"}}}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/hours":{"get":{"summary":"Business hours of an app","operationId":"getHours","description":"The app's business hours and away message, as in the app's settings \u203a Business hours, and `suggestion`: hours worked out from when the team actually replies, when `suggest` is on. With hours on, the reply time card says when the team is back. The hours belong to the app, so every platform of it returns the same.\n\nScope: `read`.","parameters":[{"name":"appId","in":"query","schema":{"type":"string"},"description":"Needed only with an all-apps key"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/HoursResponse"}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"}}},"patch":{"summary":"Change business hours","operationId":"updateHours","description":"Only the fields given change. `days` is merged day by day (`{\"sun\": null}` closes Sunday and keeps the other days), and `away` field by field. Customers see these times, converted to their own time zone, in the reply time card and the away message, so set them only to what the owner says. The change applies to every platform of the app. POST works the same.\n\nScope: `manage`.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/HoursUpdate"}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/HoursResponse"}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/help-center":{"get":{"summary":"The app's public help center","operationId":"getHelpCenter","description":"The help center's state and address, every article (hidden ones too) and limits. The AI answers customers from every article; published ones are public pages and chat suggestions while the help center is on. The AI replies notes and guide are never published.\n\nScope: `read`.","parameters":[{"name":"appId","in":"query","schema":{"type":"string"},"description":"Needed only with an all-apps key"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/HelpCenterResponse"}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"503":{"$ref":"#\/components\/responses\/Error"}}},"patch":{"summary":"Change the help center","operationId":"updateHelpCenter","description":"Only what is given changes. `enabled: true` publishes every article that isn't hidden, so turn it on only when the owner asks. `slug` changes the address. `order` lists article ids in order. `publishAll: true` un-hides every article. `importGuide: true` moves the how-to guide's top sections into hidden articles. `chat: true` turns on Chat on the help center: a Start a chat button on its pages and a hosted chat page at `chatUrl` (`\/help\/<slug>\/chat`) where anyone can write in without the app, through the app's web platform; one is made when the app has none, which needs an all-apps key made by an admin or the owner. Refused while that web platform requires sign-in. Articles can't be deleted over the API; hide them instead. POST works the same.\n\nScope: `manage`.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"appId":{"type":"string"},"enabled":{"type":"boolean"},"slug":{"type":"string"},"order":{"type":"array","items":{"type":"string"}},"publishAll":{"type":"boolean"},"importGuide":{"type":"boolean"},"chat":{"type":"boolean","description":"Chat on the help center: Start a chat buttons and the hosted chat page."}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/HelpCenterResponse"}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"409":{"$ref":"#\/components\/responses\/Error"},"503":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/help-center\/articles":{"post":{"summary":"Make a help article","operationId":"createHelpArticle","description":"A new article goes last and is published unless `hidden` is true; it is public only while the help center is on. Write it for customers; private notes belong in AI replies.\n\nScope: `manage`.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"appId":{"type":"string"},"title":{"type":"string","maxLength":120},"body":{"type":"string","maxLength":20000},"hidden":{"type":"boolean"},"slug":{"type":"string","maxLength":60}}}}}},"responses":{"201":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"article":{"$ref":"#\/components\/schemas\/HelpArticle"}}}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"409":{"$ref":"#\/components\/responses\/Error"},"503":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/help-center\/articles\/{id}":{"patch":{"summary":"Change a help article","operationId":"updateHelpArticle","description":"Only the fields given change. The slug stays when the title changes. POST works the same.\n\nScope: `manage`.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"appId":{"type":"string"},"title":{"type":"string","maxLength":120},"body":{"type":"string","maxLength":20000},"hidden":{"type":"boolean"},"slug":{"type":"string","maxLength":60}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"article":{"$ref":"#\/components\/schemas\/HelpArticle"}}}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"},"409":{"$ref":"#\/components\/responses\/Error"},"503":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/help\/suggest":{"get":{"summary":"Help articles for what a customer types","operationId":"suggestHelpArticles","security":[],"description":"Published articles of an app whose help center is on, best match first (up to 5), or the first 3 without `q`. Needs no key or session. Empty `articles` while the help center is off. With the app's Customer's language on, `lang` (the customer's language tag, like `es-MX`) returns articles already translated into it, with `?lang=` on their links; it never waits for a new translation.","parameters":[{"name":"appId","in":"query","required":true,"schema":{"type":"string"}},{"name":"q","in":"query","schema":{"type":"string"}},{"name":"lang","in":"query","schema":{"type":"string"},"description":"The customer's language, such as es or pt-BR"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"articles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"url":{"type":"string"},"snippet":{"type":"string"}}}}}}}}}}}},"\/v1\/reply-identity":{"get":{"summary":"Who customers see on replies in an app","operationId":"getReplyIdentity","description":"How the app signs replies in its support chat (`signing`: `team` for one team name and no personal photos, `person` for each teammate's name and photo), whether photos and names show, and each teammate who can see the app with their Profile identity, their own identity for this app (`custom`) and what customers see now (`shown`). A key made by an agent lists only that agent. The setting belongs to the app, so every platform returns the same.\n\nScope: `read`.","parameters":[{"name":"appId","in":"query","schema":{"type":"string"},"description":"Needed only with an all-apps key"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ReplyIdentity"}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"}}},"patch":{"summary":"Change who customers see on replies","operationId":"updateReplyIdentity","description":"Only the fields given change. `signing`, `photos` and `names` are the app's chat design and need a key made by an admin or the owner. `me` is the name and photo of the person who made the key, in this app only; no key changes another teammate's. Earlier replies keep their names and show the new photo. POST works the same.\n\nScope: `manage`.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ReplyIdentityUpdate"}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ReplyIdentity"}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"413":{"$ref":"#\/components\/responses\/Error"},"415":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/ratings":{"get":{"summary":"Satisfaction ratings of web chats","operationId":"listRatings","description":"When a web chat is closed, the widget asks the customer to rate it from 1 to 5 with an optional comment. iOS and Android apps never ask; they use the store review request instead. Returns the totals, the numbers per web platform and the ratings, newest first. Without appId (on an all-apps key) it covers every app.\n\nScope: `read`.","parameters":[{"name":"appId","in":"query","schema":{"type":"string"},"description":"One app, or omit for every app the key covers"},{"name":"days","in":"query","schema":{"type":"integer","minimum":1,"maximum":3650},"description":"Only the last N days. Default all time"},{"name":"rated","in":"query","schema":{"type":"boolean"},"description":"Only answered ratings"},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"before","in":"query","schema":{"type":"integer"},"description":"The `next` of the previous page"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"since":{"type":["string","null"],"format":"date-time"},"summary":{"$ref":"#\/components\/schemas\/RatingStats"},"apps":{"type":"array","items":{"allOf":[{"$ref":"#\/components\/schemas\/RatingStats"},{"type":"object","properties":{"appId":{"type":"string"},"name":{"type":"string"},"platform":{"type":"string"},"enabled":{"type":"boolean","description":"Whether this platform asks when a chat is closed"}}}]}},"ratings":{"type":"array","items":{"$ref":"#\/components\/schemas\/Rating"}},"next":{"type":["integer","null"],"description":"Pass as before for the next page"}}}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/payments":{"get":{"summary":"The app's web payment providers","operationId":"getPayments","description":"For Stripe, Paddle, Lemon Squeezy, Dodo Payments, Polar, Creem, Whop, Razorpay and the App Store's own notifications: connected, webhookUrl, the events it should send, secretHint, scope (Dodo brand and product ids that count), lastEventAt, purchasesStored, canAddWebhook and canImport. Their purchases show in conversations like app purchases.\n\nScope: `read`.","parameters":[{"name":"appId","in":"query","schema":{"type":"string"},"description":"Needed only with an all-apps key"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"503":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/payments\/{provider}":{"post":{"summary":"Connect, change or disconnect a web payment provider","operationId":"connectPayments","description":"`apiKey`: a live key that may manage webhooks; Hailbell adds its webhook in the provider account and keeps only the webhook's signing secret, encrypted (the key isn't stored). Razorpay and the App Store have no API for that (`canAddWebhook: false` in `GET \/v1\/payments`). Or `webhookSecret`: the signing secret of a webhook already added at `webhookUrl`; for `lemonsqueezy` and `razorpay` the secret the person typed into the webhook, and for `appstore` the app's bundle ID, since Apple signs its notifications itself. `scope` (Dodo only): brand and product ids that count, comma-separated; '' counts everything; alone, it changes only that. `disconnect: true` stops new events. Purchases match chats by the email the site passes to the chat or by the site's user id on the checkout (`hailbell_user_id` in the metadata for Stripe, Dodo, Creem and Whop, in Paddle's custom data and in Razorpay's notes, `external_customer_id` for Polar, `checkout[custom][user_id]` for Lemon Squeezy). App Store purchases match by the app account token or the original transaction id.\n\nScope: `manage`, and a key made by an admin or the owner.","parameters":[{"name":"appId","in":"query","schema":{"type":"string"},"description":"Needed only with an all-apps key"},{"name":"provider","in":"path","required":true,"schema":{"type":"string","enum":["stripe","dodo","polar","lemonsqueezy","paddle","creem","whop","razorpay","appstore"]}}],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"apiKey":{"type":"string"},"webhookSecret":{"type":"string"},"scope":{"type":"string"},"disconnect":{"type":"boolean"},"appId":{"type":"string"}}}}}},"responses":{"200":{"description":"connection, webhook (when Hailbell made one) and payments","content":{"application\/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"503":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/payments\/{provider}\/import":{"post":{"summary":"Import past purchases from a web payment provider","operationId":"importPayments","description":"Copies earlier subscriptions, payments and refunds a few pages per call with `apiKey` (a live key that can read them, not stored; for Razorpay the key id and key secret as `rzp_live_\u2026:secret`). The App Store has nothing to import. Call again with the returned `cursor` until it is null. Importing twice adds nothing twice; a Dodo connection's scope applies.\n\nScope: `manage`, and a key made by an admin or the owner.","parameters":[{"name":"appId","in":"query","schema":{"type":"string"},"description":"Needed only with an all-apps key"},{"name":"provider","in":"path","required":true,"schema":{"type":"string","enum":["stripe","dodo","polar","lemonsqueezy","paddle","creem","whop","razorpay","appstore"]}}],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","required":["apiKey"],"properties":{"apiKey":{"type":"string"},"cursor":{"type":"object"},"appId":{"type":"string"}}}}}},"responses":{"200":{"description":"seen, imported, stage, cursor","content":{"application\/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"503":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/issues":{"get":{"summary":"List issues","operationId":"listIssues","description":"Open issues first, the most people first; closed ones by when they closed. Same as MCP `list_issues`.\n\nScope: `read`.","parameters":[{"name":"appId","in":"query","schema":{"type":"string"},"description":"Issues of the app this platform belongs to"},{"name":"productId","in":"query","schema":{"type":"string"},"description":"Issues of one app"},{"name":"status","in":"query","schema":{"type":"string","enum":["open","fixed","wont_fix","all"]}},{"name":"q","in":"query","schema":{"type":"string"},"description":"Search the title and notes"},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"$ref":"#\/components\/schemas\/Issue"}}}}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"},"503":{"$ref":"#\/components\/responses\/Error"}}},"post":{"summary":"Make an issue","operationId":"createIssue","description":"Makes an issue in one app. With `conversationId` it is made from that chat (in that chat's app) and links it, with a team note. Same as MCP `create_issue`.\n\nScope: `send`.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["title"],"properties":{"title":{"type":"string","maxLength":120},"conversationId":{"type":"string"},"appId":{"type":"string"},"productId":{"type":"string"},"notes":{"type":"string","maxLength":4000},"customerNote":{"type":"string","maxLength":400}}}}}},"responses":{"201":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"issue":{"$ref":"#\/components\/schemas\/Issue"},"linked":{"type":["string","null"]}}}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"},"503":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/issues\/{id}":{"get":{"summary":"One issue with its stats and linked chats","operationId":"getIssue","description":"Stats over every linked chat (people, paying, spent in USD over the chats listed, versions, platforms) and the newest 300 linked chats. Same as MCP `get_issue`.\n\nScope: `read`.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The issue (iss_...)"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"issue":{"$ref":"#\/components\/schemas\/Issue"},"stats":{"type":"object","properties":{"people":{"type":"integer"},"paying":{"type":"integer"},"spent":{"type":"number"},"spentOver":{"type":"integer"},"spentPartial":{"type":"boolean"},"versions":{"type":"array","items":{"type":"object","properties":{"version":{"type":"string"},"count":{"type":"integer"}}}},"platforms":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string"},"count":{"type":"integer"}}}}}},"conversations":{"type":"array","items":{"type":"object","properties":{"conversationId":{"type":"string"},"appId":{"type":"string"},"platform":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":["string","null"]},"userId":{"type":["string","null"]},"appVersion":{"type":["string","null"]},"plan":{"type":["object","null"]},"reportedPlan":{"type":["string","null"]},"paying":{"type":"boolean"},"chatStatus":{"type":"string"},"linkedAt":{"type":["string","null"],"format":"date-time"},"linkedVia":{"type":"string","enum":["dashboard","ai","mcp"]},"linkedBy":{"type":["string","null"]},"notifiedAt":{"type":["string","null"],"format":"date-time"}}}},"capped":{"type":"boolean"},"maxLinks":{"type":"integer"}}}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"},"503":{"$ref":"#\/components\/responses\/Error"}}},"patch":{"summary":"Edit or reopen an issue","operationId":"updateIssue","description":"Changes the title, notes or customer note (empty text clears it), or reopens a closed issue with `status: \"open\"`. Close with POST \/v1\/issues\/{id}\/close. Same as MCP `update_issue`.\n\nScope: `send`.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The issue (iss_...)"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"title":{"type":"string","maxLength":120},"notes":{"type":"string","maxLength":4000},"customerNote":{"type":"string","maxLength":400},"status":{"type":"string","enum":["open"]}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"issue":{"$ref":"#\/components\/schemas\/Issue"}}}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"},"409":{"$ref":"#\/components\/responses\/Error"},"503":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/issues\/{id}\/conversations":{"post":{"summary":"Link a chat to an issue","operationId":"linkConversationToIssue","description":"Links a support chat to an issue of the same app, moving it off any other issue, with a team note in the chat. The customer gets nothing. Refused (409) at 5,000 linked chats. Same as MCP `link_conversation_to_issue`.\n\nScope: `send`.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The issue (iss_...)"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["conversationId"],"properties":{"conversationId":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"linked":{"type":"boolean"},"already":{"type":"boolean"},"moved":{"type":"boolean"},"issue":{"$ref":"#\/components\/schemas\/Issue"}}}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"},"409":{"$ref":"#\/components\/responses\/Error"},"503":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/issues\/{id}\/conversations\/{conversationId}":{"delete":{"summary":"Unlink a chat from an issue","operationId":"unlinkConversationFromIssue","description":"Takes the chat off this issue, with a team note. Same as MCP `unlink_conversation_from_issue`.\n\nScope: `send`.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The issue (iss_...)"},{"name":"conversationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"unlinked":{"type":"boolean"}}}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"},"503":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/issues\/{id}\/close":{"post":{"summary":"Close an issue and message everyone linked","operationId":"closeIssue","description":"Closes the issue as fixed or won't fix. `message` (optional, may be empty) goes once to every linked chat that has not had one from this issue, as a reply from the team: a push in apps, an email for web visitors who left one, copies in Discord, Slack and Telegram. Closed chats stay closed but get it; blocked customers are left out. Every linked chat also gets a team note. When it would message anyone, a call without `confirmToken` sends nothing and answers `status: \"preview\"` with the preview and a `confirmToken` (30 minutes) for exactly this status, message and version. Called again on an issue already closed with that status and no `message`, it sends the stored message to chats linked since. Same as MCP `close_issue`.\n\nScope: `send`.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The issue (iss_...)"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["fixed","wont_fix"]},"message":{"type":"string","maxLength":2000},"version":{"type":"string","maxLength":40},"confirmToken":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["preview","closed","sending"]},"preview":{"$ref":"#\/components\/schemas\/IssuePreview"},"issue":{"$ref":"#\/components\/schemas\/Issue"},"message":{"type":["string","null"]},"version":{"type":["string","null"]},"confirmToken":{"type":"string"},"confirmExpiresIn":{"type":"integer"},"note":{"type":"string"}}}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"},"409":{"$ref":"#\/components\/responses\/Error"},"503":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/reply-targets":{"get":{"summary":"Reply-time targets of an app","operationId":"getReplyTargets","description":"The app's first-reply and next-reply targets in minutes, when the about-to-miss alert goes (`warnAtPercent`), whether only business hours count, and the app's open chats that are overdue now and up to 20 due soonest. Only replies from people count; waiting and snoozed time never does. Same as MCP `get_reply_targets`.\n\nScope: `read`.","parameters":[{"name":"appId","in":"query","schema":{"type":"string"},"description":"Needed only with an all-apps key"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ReplyTargetsResponse"}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"}}},"patch":{"summary":"Change reply-time targets","operationId":"updateReplyTargets","description":"Only the fields given change; `null` turns a target off. `urgent` and `high` set shorter targets for chats of that priority. Shared by every platform of the app. Running clocks move to the new deadlines. POST works the same. Same as MCP `update_reply_targets`.\n\nScope: `manage`.","parameters":[{"name":"appId","in":"query","schema":{"type":"string"},"description":"Needed only with an all-apps key"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"firstReplyMinutes":{"type":["integer","null"],"minimum":1,"maximum":10080},"nextReplyMinutes":{"type":["integer","null"],"minimum":1,"maximum":10080},"warnAtPercent":{"type":["integer","null"],"enum":[0,50,75,80,90,null]},"urgent":{"type":["object","null"],"properties":{"firstReplyMinutes":{"type":["integer","null"],"minimum":1,"maximum":10080},"nextReplyMinutes":{"type":["integer","null"],"minimum":1,"maximum":10080}},"description":"Shorter targets for chats of this priority; a target left out or null uses the app's own. null drops them all."},"high":{"type":["object","null"],"properties":{"firstReplyMinutes":{"type":["integer","null"],"minimum":1,"maximum":10080},"nextReplyMinutes":{"type":["integer","null"],"minimum":1,"maximum":10080}},"description":"Shorter targets for chats of this priority; a target left out or null uses the app's own. null drops them all."}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ReplyTargetsResponse"}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/conversations\/{id}\/status":{"post":{"summary":"Set a chat's status","operationId":"setConversationStatus","description":"`open`, `waiting` (on the customer), `snoozed` (with `until` or `preset`) or `closed` (which may send a review or rating request, like Close). The customer's next message makes a waiting or snoozed chat open again; a snooze also ends by itself at its time. Waiting and snoozed chats leave the open list and unread counts, and their reply clock pauses. The customer gets nothing. Same as MCP `set_conversation_status`.\n\nScope: `send`.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The chat (cv_...)"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["open","waiting","snoozed","closed"]},"until":{"type":"string","format":"date-time","description":"For snoozed: at least a minute from now, at most a year"},"preset":{"type":"string","enum":["1h","tomorrow","next_week"],"description":"For snoozed, instead of until. tomorrow is the next business morning, next_week the first opening from Monday"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"conversationId":{"type":"string"},"customer":{"type":["string","null"]},"status":{"type":"string","enum":["open","waiting","snoozed","closed"]},"snoozedUntil":{"type":"string","format":"date-time"},"heldAt":{"type":"string","format":"date-time"},"heldBy":{"type":["string","null"]},"replyTarget":{"$ref":"#\/components\/schemas\/ReplyTarget"},"closed":{"type":"boolean"},"priority":{"type":"string","enum":["urgent","high","normal","low"]}}}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/conversations\/{id}\/priority":{"post":{"summary":"Set a chat's priority","operationId":"setConversationPriority","description":"`urgent`, `high`, `normal` (the default) or `low`. Urgent and high chats get a mark in the inbox and sort first when it is sorted by priority, and use the app's shorter urgent or high reply targets when it has them: a running reply clock moves to the new target at once. Use `urgent` only when the customer can't use what they paid for or their payment failed, or when the person asks. A line goes to the chat's Discord, Slack and Telegram threads; the customer gets nothing. Closing the chat sets it back to normal. Same as MCP `set_conversation_priority`.\n\nScope: `send`.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The chat (cv_...)"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["priority"],"properties":{"priority":{"type":"string","enum":["urgent","high","normal","low"]}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"conversationId":{"type":"string"},"priority":{"type":"string","enum":["urgent","high","normal","low"]},"changed":{"type":"boolean","description":"false when the chat already had this priority"},"replyTarget":{"$ref":"#\/components\/schemas\/ReplyTarget"}}}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/conversations\/bulk":{"post":{"summary":"Apply to all: close, assign or set the priority of several chats","operationId":"bulkUpdateConversations","description":"Changes up to 50 chats you name. Without `confirmToken` nothing changes: the answer is the preview (`applied` false) with `count`, `chats` (each chat that would change), `skipped` (with the reason), `summary` and a `confirmToken` that lasts 30 minutes. Call again with the same `conversationIds`, the same change and the token to make it (`applied` true). One call changes the first few chats (about 4, fewer when closing may send review requests) and answers with `done`, `skipped`, `failed` and `remaining`, the ids it hasn't reached. Call again with `conversationIds` set to `remaining` and the same token until `remaining` is empty; while chats are left the answer also has a `note` saying so. The token covers only the chats of its preview: one for another chat, another change or another key is refused with 428. Each chat goes through the same steps as closing it or setting its priority by itself, so closing can send a customer a rating question or a review request. Only chats of the apps the key may use; others are skipped. Same as MCP `bulk_update_conversations`.\n\nScope: `send`.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["conversationIds","action"],"properties":{"conversationIds":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"string"},"description":"The chats to change. On a follow-up call, the ids in `remaining`."},"action":{"type":"string","enum":["close","assign","priority"]},"priority":{"type":"string","enum":["urgent","high","normal","low"],"description":"For action priority"},"assignTo":{"type":["string","null"],"description":"For action assign: a member id, an email, \"me\" (the teammate who made the key), or null to unassign"},"confirmToken":{"type":"string","description":"From the preview. The same token serves every follow-up call."}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"applied":{"type":"boolean"},"action":{"type":"string"},"count":{"type":"integer","description":"Preview: how many chats would change"},"chats":{"type":"array","items":{"type":"object","properties":{"conversationId":{"type":"string"},"customer":{"type":["string","null"]},"app":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"platform":{"type":"string"}}},"status":{"type":"string"},"priority":{"type":"string"},"assignee":{"type":["object","null"]}}},"description":"Preview: the chats that would change"},"skipped":{"type":"array","items":{"type":"object","properties":{"conversationId":{"type":"string"},"reason":{"type":"string"}}}},"summary":{"type":"string","description":"Preview: the change in one sentence"},"confirmToken":{"type":"string","description":"Preview: pass it back to apply. Absent when nothing would change."},"confirmExpiresIn":{"type":"integer","description":"Seconds the token lasts"},"done":{"type":"array","items":{"type":"string"},"description":"Applied: the chats this call changed"},"failed":{"type":"array","items":{"type":"object","properties":{"conversationId":{"type":"string"},"error":{"type":"string"}}},"description":"Applied: chats that could not be changed"},"remaining":{"type":"array","items":{"type":"string"},"description":"Applied: the chats not reached yet. Send them as `conversationIds` with the same `confirmToken`. Empty when the change is finished."},"note":{"type":"string","description":"What to do next: confirm the preview, or call again for the remaining chats"}}}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"428":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/conversations\/{id}\/merge":{"post":{"summary":"Merge two chats of the same customer","operationId":"mergeConversations","description":"Moves every message of `secondaryId` into this chat with its own time, and adds a team note. The secondary leaves the inbox, and its id leads to this chat. This chat keeps its assignee (or takes the secondary's when it has none), the higher priority and its issue (or the secondary's). Replies afterwards go to the channel the customer wrote from last; each customer still sees only their own messages, and the two customer profiles stay separate. Only chats of the same app (any of its platforms) merge; 409 otherwise, or when the secondary is already merged. Undo within 7 days with \/unmerge. No AI cost. Same as MCP `merge_conversations`.\n\nScope: `send`.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The primary chat (cv_...), the one that stays"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["secondaryId"],"properties":{"secondaryId":{"type":"string","description":"The other chat (cv_...)"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"conversationId":{"type":"string","description":"The primary"},"merged":{"type":"string","description":"The secondary"},"moved":{"type":"integer","description":"Messages moved"},"undoUntil":{"type":"integer","description":"Unix time in milliseconds until which \/unmerge works"}}}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"},"409":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/conversations\/{id}\/unmerge":{"post":{"summary":"Undo a merge","operationId":"unmergeConversations","description":"Within 7 days of the merge, puts `secondaryId` back on its own: its messages, the ones its customer sent while merged and the replies that went to its channel move back, and it shows in the inbox again. What the merge changed on this chat (priority, assignee, issue) goes back unless someone changed it since. 409 after 7 days. Same as MCP `unmerge_conversations`.\n\nScope: `send`.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The primary chat (cv_...), the one that stays"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["secondaryId"],"properties":{"secondaryId":{"type":"string","description":"The other chat (cv_...)"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"conversationId":{"type":"string"},"unmerged":{"type":"string"},"moved":{"type":"integer"}}}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"},"409":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/routing-rules":{"get":{"summary":"Routing rules of the account","operationId":"listRoutingRules","description":"The account's routing rules in the order they run, and the team's member ids. When a customer starts a chat, or writes again after it was closed, the first enabled rule whose conditions all match assigns it (one teammate or round robin), sets its priority and can leave a team note. A chat a teammate assigned by hand keeps its assignee. Keyword matching only, no AI. Same as MCP `list_routing_rules`.\n\nScope: `read`.","responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/RoutingRulesResponse"}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"}}},"post":{"summary":"Create or change a routing rule","operationId":"saveRoutingRule","description":"Without `ruleId` it creates a rule (last, or at `order`); with it, only the fields given change, and a condition list given replaces the old one. A rule needs a name and at least one action. Same as MCP `save_routing_rule`.\n\nScope: `manage`, with a key made for all apps by an admin or the owner.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"ruleId":{"type":"string","description":"The rule to change (rr_...). Leave out to create one"},"name":{"type":"string","maxLength":60},"enabled":{"type":"boolean"},"order":{"type":"integer","minimum":1,"description":"Where it goes in the list, 1 first"},"conditions":{"type":"object","description":"Every list that is set must match; each matches when any of its values does. Leave all out to match every chat.","properties":{"keywords":{"type":"array","items":{"type":"string","maxLength":60},"description":"Words or phrases in the customer's message, whole words, any case"},"platforms":{"type":"array","items":{"type":"string","enum":["ios","android","web"]}},"planStatuses":{"type":"array","items":{"type":"string","enum":["active","trial","cancelled","billing_issue","expired","none"]},"description":"From the app's payments; customers with no known plan match none"},"tags":{"type":"array","items":{"type":"object","required":["key"],"properties":{"key":{"type":"string"},"value":{"type":["string","null"]}}},"description":"User tags; value null matches any value"},"countries":{"type":"array","items":{"type":"string"},"description":"ISO country codes, like US"},"languages":{"type":"array","items":{"type":"string"},"description":"Device language codes, like es"},"productIds":{"type":"array","items":{"type":"string"},"description":"Limit the rule to these apps (product ids, or any platform's app id)"}}},"actions":{"type":"object","properties":{"assignTo":{"type":["string","null"],"description":"One teammate: member id or email"},"roundRobin":{"type":["array","null"],"items":{"type":"string"},"description":"Several teammates in turn, instead of assignTo"},"assignToTeam":{"type":["string","null"],"description":"A team, by teamId or name from `GET \/v1\/teams`, instead of assignTo or roundRobin: the chat joins the team and goes round robin among its members, skipping anyone set to away or who can't see the app. A teamId in assignTo does the same"},"priority":{"type":["string","null"],"enum":["urgent","high","normal","low",null]},"note":{"type":["string","null"],"maxLength":500,"description":"A team note left in the chat"}}}}}}}},"responses":{"200":{"description":"Changed","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/RoutingRulesResponse"}}}},"201":{"description":"Created","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/RoutingRulesResponse"}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/routing-rules\/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The rule (rr_...)"}],"post":{"summary":"Change a routing rule","operationId":"updateRoutingRule","description":"The same as POST \/v1\/routing-rules with `ruleId`. PATCH works the same.\n\nScope: `manage`.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"ruleId":{"type":"string","description":"The rule to change (rr_...). Leave out to create one"},"name":{"type":"string","maxLength":60},"enabled":{"type":"boolean"},"order":{"type":"integer","minimum":1,"description":"Where it goes in the list, 1 first"},"conditions":{"type":"object","description":"Every list that is set must match; each matches when any of its values does. Leave all out to match every chat.","properties":{"keywords":{"type":"array","items":{"type":"string","maxLength":60},"description":"Words or phrases in the customer's message, whole words, any case"},"platforms":{"type":"array","items":{"type":"string","enum":["ios","android","web"]}},"planStatuses":{"type":"array","items":{"type":"string","enum":["active","trial","cancelled","billing_issue","expired","none"]},"description":"From the app's payments; customers with no known plan match none"},"tags":{"type":"array","items":{"type":"object","required":["key"],"properties":{"key":{"type":"string"},"value":{"type":["string","null"]}}},"description":"User tags; value null matches any value"},"countries":{"type":"array","items":{"type":"string"},"description":"ISO country codes, like US"},"languages":{"type":"array","items":{"type":"string"},"description":"Device language codes, like es"},"productIds":{"type":"array","items":{"type":"string"},"description":"Limit the rule to these apps (product ids, or any platform's app id)"}}},"actions":{"type":"object","properties":{"assignTo":{"type":["string","null"],"description":"One teammate: member id or email"},"roundRobin":{"type":["array","null"],"items":{"type":"string"},"description":"Several teammates in turn, instead of assignTo"},"assignToTeam":{"type":["string","null"],"description":"A team, by teamId or name from `GET \/v1\/teams`, instead of assignTo or roundRobin: the chat joins the team and goes round robin among its members, skipping anyone set to away or who can't see the app. A teamId in assignTo does the same"},"priority":{"type":["string","null"],"enum":["urgent","high","normal","low",null]},"note":{"type":["string","null"],"maxLength":500,"description":"A team note left in the chat"}}}}}}}},"responses":{"200":{"description":"Changed","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/RoutingRulesResponse"}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"}}},"delete":{"summary":"Delete a routing rule","operationId":"deleteRoutingRule","description":"Chats it already routed keep their assignee and priority. Same as MCP `delete_routing_rule`.\n\nScope: `manage`, with a key made for all apps by an admin or the owner.","responses":{"200":{"description":"Deleted","content":{"application\/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"},"ruleId":{"type":"string"}}}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/chat-tags":{"get":{"summary":"List chat tags","operationId":"listTags","description":"The account's chat tags, shared by every app, with how many open chats and chats in all have each, in the apps the key covers. Not the SDK's user tags (`\/v1\/tags`). Same as MCP `list_tags`.\n\nScope: `read`.","responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"ready":{"type":"boolean","description":"false until the database update that adds tags has run"},"tags":{"type":"array","items":{"type":"object","properties":{"tagId":{"type":"string"},"name":{"type":"string"},"color":{"type":"string","enum":["gray","red","orange","yellow","green","teal","blue","purple","pink"]},"openChats":{"type":"integer"},"chats":{"type":"integer"}}}},"colors":{"type":"array","items":{"type":"string"}}}}}}},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/conversations\/{id}\/tags":{"post":{"summary":"Tag a chat","operationId":"tagConversation","description":"Adds tags to a chat or removes them, by name (any case) or tagId. A name no tag has makes a new tag, so reuse names from `GET \/v1\/chat-tags`. A chat has at most 10 tags. The customer sees nothing. Same as MCP `tag_conversation`.\n\nScope: `send`.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The chat (cv_...)"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"add":{"type":"array","items":{"type":"string","maxLength":40},"maxItems":10,"description":"Tag names or tagIds to add, like [\"billing\"]"},"remove":{"type":"array","items":{"type":"string"},"maxItems":10,"description":"Tag names or tagIds to remove"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"conversationId":{"type":"string"},"tags":{"type":"array","items":{"type":"object","properties":{"tagId":{"type":"string"},"name":{"type":"string"},"color":{"type":"string","enum":["gray","red","orange","yellow","green","teal","blue","purple","pink"]}}}},"added":{"type":"array","items":{"type":"object","properties":{"tagId":{"type":"string"},"name":{"type":"string"},"color":{"type":"string","enum":["gray","red","orange","yellow","green","teal","blue","purple","pink"]}}}},"removed":{"type":"array","items":{"type":"object","properties":{"tagId":{"type":"string"},"name":{"type":"string"},"color":{"type":"string","enum":["gray","red","orange","yellow","green","teal","blue","purple","pink"]}}}}}}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"},"503":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/teams":{"get":{"summary":"List teams","operationId":"listTeams","description":"The account's teams: named groups of teammates, like \"Billing\", shared by every app. Each has its members and how many open chats it has in the apps the key covers. `teammates` lists everyone on the account. Same as MCP `list_teams`.\n\nScope: `read`.","responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"ready":{"type":"boolean","description":"false until the database update that adds teams has run"},"teams":{"type":"array","items":{"type":"object","properties":{"teamId":{"type":"string"},"name":{"type":"string"},"openChats":{"type":"integer","description":"Open chats in the team, in the apps the key covers"},"members":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"away":{"type":"boolean"}}}}}}},"teammates":{"type":"array","description":"Everyone on the account, to name in `members`","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":["string","null"]},"away":{"type":"boolean"}}}}}}}}},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"}}},"post":{"summary":"Create or change a team","operationId":"saveTeam","description":"Without `teamId` it creates a team; with it, only what you pass changes. `members` replaces the whole member list. An account has at most 50 teams. Same as MCP `save_team`. Needs a key made for all apps, by an admin or the owner.\n\nScope: `manage`.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"teamId":{"type":"string","description":"The team to change (team_...), or its name. Leave out to create one"},"name":{"type":"string","maxLength":40,"description":"Like \"Billing\". Unique in the account, in any case"},"members":{"type":"array","items":{"type":"string"},"maxItems":50,"description":"Everyone in the team, as member ids or emails. It replaces the whole list; [] empties it"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"saved":{"type":"boolean"},"created":{"type":"boolean"},"team":{"type":"object","properties":{"teamId":{"type":"string"},"name":{"type":"string"},"openChats":{"type":"integer","description":"Open chats in the team, in the apps the key covers"},"members":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"away":{"type":"boolean"}}}}}}}}}}},"201":{"description":"Created","content":{"application\/json":{"schema":{"type":"object","properties":{"saved":{"type":"boolean"},"created":{"type":"boolean"},"team":{"type":"object","properties":{"teamId":{"type":"string"},"name":{"type":"string"},"openChats":{"type":"integer","description":"Open chats in the team, in the apps the key covers"},"members":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"away":{"type":"boolean"}}}}}}}}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"409":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/teams\/{id}":{"post":{"summary":"Change a team","operationId":"updateTeam","description":"The same as POST \/v1\/teams with `teamId`. PATCH works the same. Needs a key made for all apps, by an admin or the owner.\n\nScope: `manage`.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The team (team_...)"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":40,"description":"Like \"Billing\". Unique in the account, in any case"},"members":{"type":"array","items":{"type":"string"},"maxItems":50,"description":"Everyone in the team, as member ids or emails. It replaces the whole list; [] empties it"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"saved":{"type":"boolean"},"created":{"type":"boolean"},"team":{"type":"object","properties":{"teamId":{"type":"string"},"name":{"type":"string"},"openChats":{"type":"integer","description":"Open chats in the team, in the apps the key covers"},"members":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"away":{"type":"boolean"}}}}}}}}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"},"409":{"$ref":"#\/components\/responses\/Error"}}},"delete":{"summary":"Delete a team","operationId":"deleteTeam","description":"Deletes a team. Its chats keep their assignee and lose only the team, and routing rules that assigned to it stop assigning (a rule left with nothing to do is turned off). Same as MCP `delete_team`. Needs a key made for all apps, by an admin or the owner.\n\nScope: `manage`.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The team (team_...)"}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"},"teamId":{"type":"string"},"chats":{"type":"integer","description":"Chats that lost the team"},"rules":{"type":"integer","description":"Routing rules that stopped assigning to it"}}}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/conversations\/{id}\/team":{"post":{"summary":"Move a chat to a team","operationId":"setConversationTeam","description":"Moves a chat to a team, or clears its team with `team: null`. Only the team changes: the chat keeps its assignee, and a routing rule won't move it to another team later. The customer sees nothing. Same as MCP `set_conversation_team`.\n\nScope: `send`.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The chat (cv_...)"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["team"],"properties":{"team":{"type":["string","null"],"description":"A team name (any case) or teamId from `GET \/v1\/teams`, or null for no team"}}}}}},"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"conversationId":{"type":"string"},"team":{"type":["object","null"],"properties":{"teamId":{"type":"string"},"name":{"type":"string"}}},"changed":{"type":"boolean"}}}}}},"400":{"$ref":"#\/components\/responses\/Error"},"401":{"$ref":"#\/components\/responses\/Error"},"403":{"$ref":"#\/components\/responses\/Error"},"404":{"$ref":"#\/components\/responses\/Error"}}}},"\/v1\/export":{"get":{"summary":"Export every chat","operationId":"exportChats","description":"Every chat of the account with its messages, in parts of whole chats up to about 400 messages; a longer chat comes alone in slices, one JSON line per slice with the same id and `slice: { from, total }`. `jsonl` gives one chat per line: id, app, status, priority, label, tags, assignee, times, customer, and messages with author (user, agent, bot, note, system), text, attachments (name, type) and edit or delete times. `csv` gives one message per row. Team notes are included and marked. Chats merged into another are skipped. Only on Scale and Business, with a key made for all apps by an admin or the owner. Each export is written to the audit log.\n\nWhen there are more chats, the `X-Export-Next` response header has a cursor: pass it as `after` (with the same `since` and `productId`) and append the answer (later CSV parts have no header row).\n\nScope: `read`.","parameters":[{"name":"format","in":"query","schema":{"type":"string","enum":["jsonl","csv"],"default":"jsonl"}},{"name":"since","in":"query","description":"Only chats with a message on or after this date (2026-01-31), ISO time or milliseconds","schema":{"type":"string"}},{"name":"productId","in":"query","description":"Only this app's chats","schema":{"type":"string"}},{"name":"after","in":"query","description":"The X-Export-Next cursor from the previous part","schema":{"type":"string"}}],"responses":{"200":{"description":"The file","content":{"application\/x-ndjson":{"schema":{"type":"string"}},"text\/csv":{"schema":{"type":"string"}}}},"400":{"description":"Unknown format or since"},"403":{"description":"Not on Scale or Business, not an admin, or the key doesn't cover every app"}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"hbk_..."},"oauth":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"\/oauth\/authorize","tokenUrl":"\/oauth\/token","refreshUrl":"\/oauth\/token","scopes":{"read":"Apps, stats, audiences, calendar","send":"Send, schedule, cancel, images","manage":"Segments, tags, test devices, setup"}}}}},"responses":{"Error":{"description":"Error, with a message that says what to change","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}},"schemas":{"Kind":{"type":"string","enum":["marketing","transactional"],"default":"marketing","description":"transactional also reaches users who opted out of marketing. Use it only for messages the user needs."},"App":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"productId":{"type":"string","description":"The app this platform belongs to. Its iOS, Android and web platforms share it."},"productName":{"type":"string"},"platform":{"type":"string"},"apnsTopic":{"type":["string","null"]},"subscribers":{"$ref":"#\/components\/schemas\/Estimate"},"ready":{"type":"object","properties":{"apns":{"type":"boolean"},"fcm":{"type":"boolean"},"web":{"type":"boolean"}}}}},"Estimate":{"type":"object","properties":{"total":{"type":"integer","description":"Devices"},"apns":{"type":"integer"},"fcm":{"type":"integer"},"web":{"type":"integer"},"people":{"type":"integer","description":"Distinct people. A signed-in person (the same external id on every platform) counts once; a device that never signed in counts as its own person."},"byApp":{"type":"object","additionalProperties":{"type":"integer"},"description":"Devices per App ID (platform)"}},"description":"Devices an audience reaches, and the people they belong to."},"Content":{"type":"object","required":["body"],"properties":{"title":{"type":"string","maxLength":200},"subtitle":{"type":"string","maxLength":200,"description":"iOS only"},"body":{"type":"string","maxLength":2000,"description":"Not needed when silent"},"image":{"type":"string","format":"uri","description":"https only"},"icon":{"type":"string","format":"uri"},"url":{"type":"string","description":"Opened on tap: https:\/\/\u2026 or a deep link"},"appUrl":{"type":"string"},"webUrl":{"type":"string"},"buttons":{"type":"array","maxItems":3,"items":{"type":"object","required":["text"],"properties":{"id":{"type":"string"},"text":{"type":"string","maxLength":40},"url":{"type":"string"}}}},"sound":{"type":"string","description":"\"none\" or a bundled sound name"},"badge":{"type":"object","properties":{"type":{"enum":["set","increase","none"]},"count":{"type":"integer"}}},"priority":{"enum":["high","normal"]},"ttl":{"type":"integer","maximum":2419200},"interruptionLevel":{"enum":["passive","active","time-sensitive","critical"]},"relevanceScore":{"type":"number","minimum":0,"maximum":1},"accentColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"group":{"type":"string"},"collapseId":{"type":"string","maxLength":32},"androidChannelId":{"type":"string"},"data":{"type":"object","description":"Up to 2 KB, passed to the app"},"silent":{"type":"boolean"},"requireInteraction":{"type":"boolean"},"versions":{"type":"array","minItems":2,"maxItems":5,"description":"Per-person learning: versions about different topics; each person gets the topic their own taps favour (Thompson sampling, starting from the app-wide rate).","items":{"type":"object","properties":{"id":{"type":"string"},"topic":{"type":"string","maxLength":32},"title":{"type":"string"},"subtitle":{"type":"string"},"body":{"type":"string"},"image":{"type":"string"},"url":{"type":"string"},"buttons":{"type":"array"}}}},"variants":{"type":"array","maxItems":5,"items":{"$ref":"#\/components\/schemas\/Variant"},"description":"Other versions for some people; the first whose when matches replaces the fields it lists"}},"description":"Text fields and links can use {{variables}} with an optional fallback, e.g. {{first_name|there}}. Variables: first_name, name, external_id, app_name, city, country, time_of_day, greeting, weekday, weather, temp, occasion, tag.<key>."},"Variant":{"type":"object","required":["when"],"properties":{"when":{"type":"object","properties":{"weather":{"type":"array","items":{"enum":["sunny","clear","cloudy","rainy","stormy","snowy","foggy"]}},"timeOfDay":{"type":"array","items":{"enum":["morning","afternoon","evening","night"]}},"country":{"type":"array","items":{"type":"string"}},"occasion":{"oneOf":[{"const":true},{"type":"array","items":{"type":"string"}}]},"tag":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}}}},"title":{"type":"string"},"subtitle":{"type":"string"},"body":{"type":"string"},"image":{"type":"string"},"url":{"type":"string"},"buttons":{"type":"array"}}},"Delivery":{"type":"object","description":"now: everyone at sendAfter (promotional pushes wait out quiet hours). local_time: at time in each person's time zone. best_hour: at the hour each person usually uses the app, else fallback. Waves run over up to 24 hours.","properties":{"mode":{"enum":["now","local_time","best_hour"],"default":"now"},"time":{"type":"string","pattern":"^\\d{1,2}:\\d{2}$"},"fallback":{"type":"string","default":"19:00"}}},"Context":{"type":"object","properties":{"now":{"type":"string"},"audienceTime":{"type":"array","items":{"type":"object","properties":{"utcOffsetMinutes":{"type":"integer"},"devices":{"type":"integer"},"localTime":{"type":"string"}}}},"countries":{"type":"array","items":{"type":"object","properties":{"country":{"type":"string"},"n":{"type":"integer"}}}},"usualHours":{"type":"array","items":{"type":"object","properties":{"localHour":{"type":"integer"},"devices":{"type":"integer"}}}},"upcomingOccasions":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"date":{"type":"string"},"countries":{"type":["array","null"],"items":{"type":"string"}},"source":{"enum":["calendar","app"]}}}},"limits":{"type":"object","properties":{"marketingPerDay":{"type":"integer"},"marketingPerWeek":{"type":"integer"},"restAfterIgnored":{"type":"integer"},"quietHours":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}}},"defaultTimezone":{"type":"string"}},"description":"The daily cap (`marketingPerDay`) and weekly cap (`marketingPerWeek`, Monday to Sunday in the person's time zone) count per person across every platform of the app. Each platform's own number applies to its own devices."},"templateVariables":{"type":"array","items":{"type":"string"}},"limitsByPlatform":{"type":"object","description":"Only with `productId` or `platforms`: the limits of each platform, keyed by ios, android or web","additionalProperties":{"type":"object"}}}},"Filter":{"type":"object","description":"A condition, or {\"operator\":\"OR\"} to start a new group. Conditions are ANDed within a group; groups are ORed. `app_version` takes `=` or `!=` (the exact text), or `>`, `>=`, `<`, `<=` comparing as versions: 1.10.0 is above 1.9.9, 1.3 equals 1.3.0, a build suffix like `1.4.2 (87)` is ignored, and a device with no version never matches. `plan_status` takes `=` or `!=` with `active`, `trial`, `cancelled` (auto-renew off, still has access), `billing_issue`, `expired` or `none` (never bought), from the app's Superwall, RevenueCat, the App Store, Stripe, Paddle, Lemon Squeezy, Dodo Payments, Polar, Creem, Whop or Razorpay purchases; people Hailbell can't match to purchases have none.","properties":{"operator":{"const":"OR"},"field":{"enum":["last_session","first_session","session_count","language","app_version","country","platform","tag","event","plan_status","external_id","test_users"]},"relation":{"enum":[">","<",">=","<=","=","!=","exists","not_exists","happened","not_happened"]},"key":{"type":"string"},"value":{},"name":{"type":"string"},"hours_ago":{"type":"number"}}},"Audience":{"type":"object","description":"Empty means everyone subscribed.","properties":{"segments":{"type":"array","items":{"type":"string"}},"excludeSegments":{"type":"array","items":{"type":"string"}},"filters":{"type":"array","items":{"$ref":"#\/components\/schemas\/Filter"}},"externalIds":{"type":"array","items":{"type":"string"}},"subscriptionIds":{"type":"array","items":{"type":"string"}},"testUsers":{"type":"boolean"},"platforms":{"type":"array","items":{"enum":["apns","fcm","web"]}}}},"NotificationRequest":{"type":"object","required":["content"],"properties":{"appId":{"type":"string","description":"Needed only with an all-apps key"},"productId":{"type":"string","description":"The whole app (`productId` from GET \/v1\/apps), for all of its platforms. `platforms` defaults to \"all\" when you pass it."},"platforms":{"$ref":"#\/components\/schemas\/PlatformsSelector"},"name":{"type":"string","maxLength":128},"kind":{"$ref":"#\/components\/schemas\/Kind"},"content":{"$ref":"#\/components\/schemas\/Content"},"audience":{"$ref":"#\/components\/schemas\/Audience"},"delivery":{"$ref":"#\/components\/schemas\/Delivery"},"sendAfter":{"type":"string","format":"date-time","description":"Up to 365 days ahead"},"idempotencyKey":{"type":"string","maxLength":100,"description":"Repeating a request with the same key returns the first notification instead of sending again. For a campaign across platforms the key is unique per app."}}},"Notification":{"type":"object","properties":{"id":{"type":"string"},"appId":{"type":"string"},"groupId":{"type":["string","null"],"description":"Set when this is one platform of a campaign across platforms (`ngr_...`). Cancelling it cancels the whole campaign."},"name":{"type":["string","null"]},"kind":{"$ref":"#\/components\/schemas\/Kind"},"status":{"enum":["scheduled","sending","sent","canceled","failed"]},"source":{"enum":["dashboard","api","mcp"]},"content":{"$ref":"#\/components\/schemas\/Content"},"audience":{"$ref":"#\/components\/schemas\/Audience"},"delivery":{"$ref":"#\/components\/schemas\/Delivery"},"sendAfter":{"type":"integer"},"startedAt":{"type":["integer","null"]},"finishedAt":{"type":["integer","null"]},"createdAt":{"type":"integer"},"stats":{"type":"object","properties":{"recipients":{"type":"integer"},"sent":{"type":"integer"},"failed":{"type":"integer"},"delivered":{"type":"integer"},"clicked":{"type":"integer"}}},"error":{"type":["string","null"]},"estimate":{"$ref":"#\/components\/schemas\/Estimate","description":"Only when it was just created"},"versions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"topic":{"type":"string"},"sent":{"type":"integer"},"clicked":{"type":"integer"},"clickRate":{"type":["number","null"]}}}},"audienceNames":{"$ref":"#\/components\/schemas\/AudienceNames"}}},"Preview":{"type":"object","properties":{"content":{"$ref":"#\/components\/schemas\/Content"},"audience":{"$ref":"#\/components\/schemas\/Audience"},"kind":{"$ref":"#\/components\/schemas\/Kind"},"delivery":{"$ref":"#\/components\/schemas\/Delivery"},"productId":{"type":"string","description":"Only for a campaign across platforms"},"platforms":{"type":"array","description":"Only for a campaign across platforms: the platforms it goes to","items":{"type":"object","properties":{"appId":{"type":"string"},"platform":{"enum":["ios","android","web"]}}}},"estimate":{"$ref":"#\/components\/schemas\/Estimate"},"warnings":{"type":"array","items":{"type":"string"}},"samples":{"type":"array","description":"How it reads for a few real recipients","items":{"type":"object"}},"waves":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string"},"devices":{"type":"integer"}}}},"cappedToday":{"type":"integer","description":"Devices left out because their person already reached the daily or weekly cap on promotional pushes"},"variables":{"type":"array","items":{"type":"string"}},"unknownVariables":{"type":"array","items":{"type":"string"}},"payloads":{"type":"object"},"confirmToken":{"type":"string","description":"Used by the MCP send tool. For a campaign across platforms it covers exactly the platforms previewed."},"confirmExpiresIn":{"type":"integer"}}},"Segment":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"filters":{"type":"array","items":{"$ref":"#\/components\/schemas\/Filter"}},"madeOn":{"enum":["ios","android","web",null],"description":"The platform it was made on. Changing or deleting it needs a key that covers that platform."},"size":{"type":"integer","description":"Devices on the platforms asked for"},"createdAt":{"type":"integer"},"people":{"type":"integer","description":"The people those devices belong to"}},"description":"A saved audience. It belongs to the whole app: one made on any platform works on all of them."},"SegmentRequest":{"type":"object","required":["name"],"properties":{"appId":{"type":"string","description":"Needed only with an all-apps key"},"productId":{"type":"string","description":"The whole app. The segment works on all of its platforms either way."},"name":{"type":"string","maxLength":80},"filters":{"type":"array","items":{"$ref":"#\/components\/schemas\/Filter"}}},"description":"A segment belongs to the whole app: one made on any platform works on all of them."},"AiReplies":{"type":"object","properties":{"enabled":{"type":"boolean","description":"true makes the AI answer real customers when nobody has replied within the wait"},"wait":{"type":"integer","enum":[0,1,5,15,30,60],"description":"Minutes to wait for a person before the AI answers"},"name":{"type":"string","maxLength":60,"description":"The AI's name in the chat. Empty for \"<app name> Assistant\""},"knowledge":{"type":"string","maxLength":20000,"description":"Notes: facts about the app, policies, known issues and workarounds"},"guide":{"type":"string","maxLength":40000,"description":"How-to guide: the steps customers follow in the app for each task (tab \u203a screen \u203a button), with iPhone and Android differences, written from the app's source code"},"appInfo":{"type":"string","maxLength":8000,"description":"The store listing or website text"},"pricing":{"type":"object","properties":{"plans":{"type":"string","maxLength":3000,"description":"Plans, prices and what each includes"},"free":{"type":"string","enum":["explain","offer","handoff"],"description":"What the AI does when a customer says it should be free or asks for a discount"},"freeNote":{"type":"string","maxLength":1000,"description":"Anything to add to that answer"},"refunds":{"type":"string","maxLength":2000,"description":"How refunds and cancelling work"}}},"faq":{"type":"array","maxItems":100,"items":{"type":"object","required":["q","a"],"properties":{"id":{"type":"string"},"q":{"type":"string","maxLength":200},"a":{"type":"string","maxLength":2000}}}},"replyTime":{"$ref":"#\/components\/schemas\/ReplyTime"},"lookup":{"$ref":"#\/components\/schemas\/AiLookup"},"actions":{"$ref":"#\/components\/schemas\/AiActions"}}},"AiRepliesUpdate":{"type":"object","properties":{"appId":{"type":"string","description":"Needed only with an all-apps key"},"enabled":{"type":"boolean","description":"true makes the AI answer real customers when nobody has replied within the wait"},"wait":{"type":"integer","enum":[0,1,5,15,30,60],"description":"Minutes to wait for a person before the AI answers"},"name":{"type":"string","maxLength":60,"description":"The AI's name in the chat. Empty for \"<app name> Assistant\""},"knowledge":{"type":"string","maxLength":20000,"description":"Notes: facts about the app, policies, known issues and workarounds"},"guide":{"type":"string","maxLength":40000,"description":"How-to guide: the steps customers follow in the app for each task (tab \u203a screen \u203a button), with iPhone and Android differences, written from the app's source code"},"appInfo":{"type":"string","maxLength":8000,"description":"The store listing or website text"},"pricing":{"type":"object","properties":{"plans":{"type":"string","maxLength":3000,"description":"Plans, prices and what each includes"},"free":{"type":"string","enum":["explain","offer","handoff"],"description":"What the AI does when a customer says it should be free or asks for a discount"},"freeNote":{"type":"string","maxLength":1000,"description":"Anything to add to that answer"},"refunds":{"type":"string","maxLength":2000,"description":"How refunds and cancelling work"}}},"faq":{"type":"array","maxItems":100,"items":{"type":"object","required":["q","a"],"properties":{"id":{"type":"string"},"q":{"type":"string","maxLength":200},"a":{"type":"string","maxLength":2000}}}},"replyTime":{"$ref":"#\/components\/schemas\/ReplyTime"},"lookup":{"type":"object","description":"Only the parts given change. Changing url, enabled or newSecret needs a key made by an admin or the owner.","properties":{"enabled":{"type":"boolean","description":"Let the AI call the lookup URL. Needs url."},"url":{"type":"string","maxLength":500,"description":"https on a public host name. No IP addresses or internal hosts; redirects aren't followed."},"description":{"type":"string","maxLength":500,"description":"What the endpoint can answer, for the AI"},"newSecret":{"type":"boolean","description":"Make a new signing secret now; the old one stops working. The response has it as lookupSecret."}}},"actions":{"type":"object","description":"The switches for actions the customer confirms. Only the parts you pass change. The actions themselves come from the lookup endpoint (POST \/v1\/ai-replies\/actions-load); this can't add or rename one. Needs a key made by an admin or the owner.","properties":{"enabled":{"type":"boolean","description":"Let the AI offer the actions that are on. Needs the lookup URL."},"list":{"type":"array","maxItems":20,"items":{"type":"object","required":["id","enabled"],"properties":{"id":{"type":"string"},"enabled":{"type":"boolean"}}},"description":"Switch single actions on or off. Ones you leave out keep their switch."}}}}},"AiRepliesResponse":{"type":"object","properties":{"settings":{"$ref":"#\/components\/schemas\/AiReplies"},"limits":{"type":"object","description":"The most characters each text field keeps, the allowed waits, free stances and reply time fallbacks, and for the lookup its timeout (timeoutMs), response cap (maxResponseBytes) and lookups per reply (perReply)"},"aiConfigured":{"type":"boolean","description":"Whether the server has an AI key. Without one the AI never answers."},"truncated":{"type":"array","items":{"type":"string"},"description":"Only on changes: fields that were cut to their limit, like guide or pricing.freeNote"},"lookupSecretSet":{"type":"boolean","description":"Whether the lookup has its signing secret. The secret itself is never returned by GET."},"lookupSecret":{"type":"string","description":"Only on the change that made the lookup's signing secret (turned on for the first time, or newSecret). Keep it on your server."}}},"RatingStats":{"type":"object","properties":{"asked":{"type":"integer","description":"Times a customer was asked"},"rated":{"type":"integer","description":"Answers"},"dismissed":{"type":"integer","description":"Closed without answering"},"average":{"type":["number","null"],"description":"Average score, 1 to 5"},"happy":{"type":"integer","description":"Answers of 4 or 5"},"csat":{"type":["integer","null"],"description":"Percent of answers that were 4 or 5"},"responseRate":{"type":["integer","null"],"description":"Percent of asks that were answered"},"scores":{"type":"object","description":"Answers per score","properties":{"1":{"type":"integer"},"2":{"type":"integer"},"3":{"type":"integer"},"4":{"type":"integer"},"5":{"type":"integer"}}}}},"Rating":{"type":"object","properties":{"id":{"type":"string"},"conversationId":{"type":"string"},"appId":{"type":"string"},"state":{"type":"string","enum":["asked","rated","dismissed"]},"score":{"type":["integer","null"],"minimum":1,"maximum":5,"description":"1 very bad, 2 bad, 3 OK, 4 good, 5 great"},"comment":{"type":["string","null"]},"askedAt":{"type":"integer","description":"When the chat was closed and the customer asked (ms)"},"ratedAt":{"type":["integer","null"]},"dismissedAt":{"type":["integer","null"]},"closedBy":{"type":["string","null"],"description":"Who closed the chat, as known then"},"closedVia":{"type":["string","null"],"enum":["dashboard","discord","telegram",null]},"memberId":{"type":["string","null"],"description":"The team member who closed the chat from the dashboard; null when closed from Discord or Telegram"},"customer":{"type":"object","properties":{"name":{"type":["string","null"]},"email":{"type":["string","null"]},"externalId":{"type":["string","null"]}}}}},"PlatformsSelector":{"description":"Several platforms of one app in one call: \"all\", or a list of \"ios\", \"android\", \"web\" or App IDs, all of the same app. Name the app with `productId` or with `appId` of any of its platforms. Leave out `platforms` and `productId` to work on the one platform of `appId`, as before. A key that does not cover a platform you name gets 403; it is not left out quietly.","anyOf":[{"type":"string","enum":["all"]},{"type":"array","minItems":1,"maxItems":3,"items":{"type":"string"}}]},"CampaignPlatform":{"type":"object","description":"One platform of a campaign","properties":{"appId":{"type":"string"},"platform":{"enum":["ios","android","web",null]},"notificationId":{"type":["string","null"],"description":"This platform's own notification (`ntf_...`), listed in its GET \/v1\/notifications?appId= with `groupId`"},"status":{"enum":["scheduled","sending","sent","canceled","failed"]},"stats":{"type":"object","properties":{"recipients":{"type":"integer"},"sent":{"type":"integer"},"failed":{"type":"integer"},"delivered":{"type":"integer"},"clicked":{"type":"integer"}}},"error":{"type":["string","null"]}}},"Campaign":{"type":"object","description":"A campaign across several platforms of one app (id `ngr_...`). Each platform sends with its own keys, Firebase project, web push keys, Android channel, limits and quiet hours, and has its own numbers in `platforms`. Each signed-in person gets it once.","properties":{"id":{"type":"string","example":"ngr_XXXXXXXX"},"type":{"const":"group"},"productId":{"type":"string"},"appId":{"type":"null"},"groupId":{"type":"string","description":"The same as id"},"name":{"type":["string","null"]},"kind":{"$ref":"#\/components\/schemas\/Kind"},"status":{"enum":["scheduled","sending","sent","canceled","failed"]},"source":{"enum":["dashboard","api","mcp"]},"content":{"$ref":"#\/components\/schemas\/Content"},"audience":{"$ref":"#\/components\/schemas\/Audience"},"delivery":{"$ref":"#\/components\/schemas\/Delivery"},"sendAfter":{"type":"integer"},"startedAt":{"type":["integer","null"]},"finishedAt":{"type":["integer","null"]},"createdAt":{"type":"integer"},"stats":{"type":"object","properties":{"recipients":{"type":"integer"},"sent":{"type":"integer"},"failed":{"type":"integer"},"delivered":{"type":"integer"},"clicked":{"type":"integer"}},"description":"The whole campaign: the sum of its platforms"},"deduped":{"type":"integer","description":"Devices left out because the same person got it on another device"},"platforms":{"type":"array","items":{"$ref":"#\/components\/schemas\/CampaignPlatform"}},"error":{"type":["string","null"]},"estimate":{"$ref":"#\/components\/schemas\/Estimate","description":"Only when it was just created"},"versions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"topic":{"type":"string"},"sent":{"type":"integer"},"clicked":{"type":"integer"},"clickRate":{"type":["number","null"]}}},"description":"Results per version, summed over the platforms, when it had versions"},"audienceNames":{"$ref":"#\/components\/schemas\/AudienceNames"}}},"CampaignListItem":{"description":"One entry of GET \/v1\/notifications with `productId` or `platforms`: a campaign across platforms (type \"group\") once, or a single-platform notification (type \"notification\") in the same shape, with its one platform in `platforms`.","anyOf":[{"$ref":"#\/components\/schemas\/Campaign"},{"allOf":[{"$ref":"#\/components\/schemas\/Notification"},{"type":"object","properties":{"type":{"const":"notification"},"platforms":{"type":"array","items":{"$ref":"#\/components\/schemas\/CampaignPlatform"}},"deduped":{"const":0}}}]}]},"NewPlatform":{"type":"object","properties":{"app":{"$ref":"#\/components\/schemas\/App","description":"The new platform, as GET \/v1\/apps lists it. Its App ID is `app.id`."},"productId":{"type":"string"},"newApp":{"type":"boolean","description":"true when a new app was made, false when a platform was added to an existing one"},"nextSteps":{"type":"array","items":{"type":"string"},"description":"What to tell the person: the App ID goes in code; push keys and the identity secret are set in the dashboard."}}},"ReplyIdentity":{"type":"object","properties":{"productId":{"type":"string"},"appName":{"type":"string"},"signing":{"type":"string","enum":["person","team"]},"teamName":{"type":"string","description":"The chat title, else \"<App> Support\": what replies carry when signing is team"},"photos":{"type":"boolean"},"names":{"type":"boolean"},"you":{"type":["string","null"],"description":"The teammate (member id) who made this key"},"teammates":{"type":"array","items":{"type":"object","properties":{"memberId":{"type":"string"},"role":{"type":"string","enum":["owner","admin","agent"]},"profile":{"type":"object","properties":{"name":{"type":["string","null"]},"avatarUrl":{"type":["string","null"],"description":"Relative to the API's base URL"}}},"custom":{"type":["object","null"],"description":"Their own identity for this app, or null for their Profile","properties":{"name":{"type":["string","null"]},"photo":{"type":"string","enum":["default","custom","none"]},"avatarUrl":{"type":["string","null"]}}},"shown":{"type":"object","description":"What customers see now","properties":{"name":{"type":"string"},"avatarUrl":{"type":["string","null"]},"source":{"type":"string","enum":["team","app","profile"]}}}}}}}},"ReplyIdentityUpdate":{"type":"object","properties":{"signing":{"type":"string","enum":["person","team"]},"photos":{"type":"boolean"},"names":{"type":"boolean"},"me":{"type":"object","properties":{"name":{"type":["string","null"],"maxLength":60,"description":"null or empty for your Profile name"},"photo":{"description":"'default' (your Profile photo), 'none', or { url } (https) \/ { data } (base64) up to 1 MB","oneOf":[{"type":"string","enum":["default","none"]},{"type":"object","properties":{"url":{"type":"string"},"data":{"type":"string"}}}]},"reset":{"type":"boolean","description":"true goes back to your Profile name and photo in this app"}}}}},"HelpCenterResponse":{"type":"object","properties":{"helpCenter":{"type":"object","properties":{"enabled":{"type":"boolean"},"slug":{"type":["string","null"]},"url":{"type":["string","null"],"description":"The public address, https:\/\/api.hailbell.com\/help\/<slug>"},"chat":{"type":"boolean","description":"Chat on the help center is on"},"chatUrl":{"type":["string","null"],"description":"The hosted chat page, https:\/\/api.hailbell.com\/help\/<slug>\/chat, while chat is on. It works while the help center is on, and as an App Store support URL."},"chatAppId":{"type":["string","null"],"description":"The app's web platform, whose App ID the chat page opens"},"chatReady":{"type":"boolean","description":"This server can save the chat setting yet"}}},"articles":{"type":"array","items":{"$ref":"#\/components\/schemas\/HelpArticle"}},"guideSections":{"type":"integer","description":"How many articles importGuide would make from the how-to guide"},"limits":{"type":"object"}}},"HelpArticle":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"body":{"type":"string","description":"Plain text with simple Markdown"},"hidden":{"type":"boolean"},"position":{"type":"integer"},"public":{"type":"boolean","description":"On the public pages and suggested in the chat right now: the help center is on and the article isn't hidden"},"url":{"type":["string","null"]},"updatedAt":{"type":"integer"}}},"AudienceNames":{"type":"object","description":"Who the notification was for, in names (only in GET \/v1\/notifications\/{id}): the names of its segments, and the people behind the first 50 devices or user ids it named. The stored audience keeps only ids.","properties":{"segments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}}}},"people":{"type":"array","items":{"type":"object","properties":{"subscriptionId":{"type":["string","null"]},"externalId":{"type":["string","null"]},"name":{"type":["string","null"]},"email":{"type":["string","null"]},"platform":{"type":["string","null"],"enum":["apns","fcm","web",null]},"device":{"type":["string","null"]},"country":{"type":["string","null"]},"found":{"type":"boolean","description":"False when the device or user is no longer in the app"}}}},"peopleTotal":{"type":"integer","description":"How many devices and user ids the audience named in all"}}},"ReplyTime":{"type":"object","description":"The reply time card: when the AI hands a chat to the team while nobody is around (outside business hours, everyone set to away, or nobody active for 30 minutes), the customer sees when to expect a reply, in their own time zone and language (\"Bello is offline right now. Usually back by 11:30 PM tonight, your time.\"), with a button to be notified. On updates, only the fields given change.","properties":{"enabled":{"type":"boolean","description":"Show the card. On by default; it never shows while someone is around. With it on, it replaces the away message."},"showLocalTime":{"type":"boolean","description":"Also show the team's own time and country (\"It's 2:30 AM for Bello in the United States\"), from the business hours' time zone. Off by default."},"notify":{"type":"boolean","description":"Offer to notify the customer when the team replies: push notification permission in apps, email on websites. On by default."},"fallback":{"type":"string","enum":["typical","none"],"description":"Without business hours: typical shows how long the team usually takes at that time of day (from its own replies over 30 days, at most 24 hours, or \"as soon as possible\" with too few); none shows no card."}}},"Hours":{"type":"object","properties":{"enabled":{"type":"boolean","description":"true turns business hours on"},"timezone":{"type":"string","description":"IANA time zone the hours are in, such as Asia\/Kolkata"},"days":{"type":"object","description":"One opening per weekday as [\"HH:MM\", \"HH:MM\"] (24-hour, start before end, \"24:00\" for midnight), or null for closed","properties":{"mon":{"type":["array","null"],"items":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"minItems":2,"maxItems":2},"tue":{"type":["array","null"],"items":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"minItems":2,"maxItems":2},"wed":{"type":["array","null"],"items":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"minItems":2,"maxItems":2},"thu":{"type":["array","null"],"items":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"minItems":2,"maxItems":2},"fri":{"type":["array","null"],"items":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"minItems":2,"maxItems":2},"sat":{"type":["array","null"],"items":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"minItems":2,"maxItems":2},"sun":{"type":["array","null"],"items":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"minItems":2,"maxItems":2}}},"away":{"type":"object","description":"The away message for customers who write while closed. Replaced by the reply time card when that card is on (AI replies `replyTime.enabled`).","properties":{"enabled":{"type":"boolean"},"text":{"type":"string","maxLength":500,"description":"{{when}} becomes the next opening in the customer's time zone, like \"tomorrow at 9:00 AM\""},"whenTeamAway":{"type":"boolean","description":"Also send it inside opening hours when everyone who can see the app is set to away"}}},"suggest":{"type":"boolean","description":"Work out suggested hours from when the team actually replies (`suggestion` in the response). A suggestion only: Hailbell never changes the hours by itself."}}},"HoursUpdate":{"type":"object","properties":{"appId":{"type":"string","description":"Needed only with an all-apps key"},"enabled":{"type":"boolean","description":"true turns business hours on"},"timezone":{"type":"string","description":"IANA time zone the hours are in, such as Asia\/Kolkata"},"days":{"type":"object","description":"One opening per weekday as [\"HH:MM\", \"HH:MM\"] (24-hour, start before end, \"24:00\" for midnight), or null for closed. Merged day by day: days you leave out are kept.","properties":{"mon":{"type":["array","null"],"items":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"minItems":2,"maxItems":2},"tue":{"type":["array","null"],"items":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"minItems":2,"maxItems":2},"wed":{"type":["array","null"],"items":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"minItems":2,"maxItems":2},"thu":{"type":["array","null"],"items":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"minItems":2,"maxItems":2},"fri":{"type":["array","null"],"items":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"minItems":2,"maxItems":2},"sat":{"type":["array","null"],"items":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"minItems":2,"maxItems":2},"sun":{"type":["array","null"],"items":{"type":"string","pattern":"^\\d{2}:\\d{2}$"},"minItems":2,"maxItems":2}}},"away":{"type":"object","description":"The away message for customers who write while closed. Replaced by the reply time card when that card is on (AI replies `replyTime.enabled`). Merged field by field.","properties":{"enabled":{"type":"boolean"},"text":{"type":"string","maxLength":500,"description":"{{when}} becomes the next opening in the customer's time zone, like \"tomorrow at 9:00 AM\""},"whenTeamAway":{"type":"boolean","description":"Also send it inside opening hours when everyone who can see the app is set to away"}}},"suggest":{"type":"boolean","description":"Work out suggested hours from when the team actually replies (`suggestion` in the response). A suggestion only: Hailbell never changes the hours by itself."}}},"HoursResponse":{"type":"object","properties":{"hours":{"$ref":"#\/components\/schemas\/Hours"},"suggestion":{"type":["object","null"],"description":"Hours worked out from when the team replied over the last 30 days: the shortest daily window holding 90% of its replies, the same every day. Null unless `suggest` is on and there were at least 20 replies.","properties":{"start":{"type":"string","description":"HH:MM"},"end":{"type":"string","description":"HH:MM, or 24:00"},"replies":{"type":"integer","description":"Replies it is based on"}}}}},"AiLookup":{"type":"object","description":"The lookup URL: an https endpoint on your own backend that the AI calls (at most twice per reply) when a customer asks about their own live data, such as an order's delivery or whether an upgrade went through. Each request is a signed POST: X-Hailbell-Timestamp (unix seconds) and X-Hailbell-Signature (hex HMAC-SHA256 of \"<timestamp>.<raw body>\" with the lookup secret). The body has type, appId, productId, platform, conversationId, question, customer (userId, userIdVerified, email, emailVerified, name, country, timezone, metadata), purchases and sentAt. Answer JSON within 5 seconds and 4 KB, optionally with a short `summary` for the team's note. See https:\/\/hailbell.com\/docs#ai-lookup. Off by default.","properties":{"enabled":{"type":"boolean","description":"Let the AI call the lookup URL. Needs url."},"url":{"type":"string","maxLength":500,"description":"https on a public host name. No IP addresses or internal hosts; redirects aren't followed."},"description":{"type":"string","maxLength":500,"description":"What the endpoint can answer, for the AI"}}},"AiLookupTest":{"type":"object","properties":{"ok":{"type":"boolean"},"status":{"type":"integer","description":"The HTTP status your endpoint answered, 0 when it couldn't be reached"},"ms":{"type":"integer","description":"How long it took"},"error":{"type":["string","null"],"enum":["timeout","network","redirect","status","too_large","not_json",null]},"message":{"type":"string","description":"The error in words"},"body":{"type":["string","null"],"description":"The first 4 KB of the answer, as text"},"sent":{"type":"object","description":"The exact body Hailbell signed and sent (type \"test\")"},"lookupSecret":{"type":"string","description":"Only when the app had no signing secret yet and this test made one"}}},"Issue":{"type":"object","description":"One problem many customers hit, with the chats linked to it.","properties":{"issueId":{"type":"string"},"productId":{"type":"string"},"productName":{"type":"string"},"title":{"type":"string","maxLength":120},"notes":{"type":"string","description":"Internal notes, for the team only"},"customerNote":{"type":"string","maxLength":400,"description":"What customers are told. While the issue is open, AI replies tell customers who ask about it and link their chat"},"status":{"type":"string","enum":["open","fixed","wont_fix"]},"fixMessage":{"type":["string","null"],"description":"The message the close sent to the linked chats"},"fixedVersion":{"type":["string","null"]},"createdVia":{"type":"string","enum":["dashboard","ai","mcp"]},"createdBy":{"type":["string","null"]},"closedBy":{"type":["string","null"]},"closedAt":{"type":["string","null"],"format":"date-time"},"people":{"type":"integer","description":"Linked chats"},"paying":{"type":"integer","description":"Linked customers whose purchases (or their app) say they pay"},"lastLinkedAt":{"type":["string","null"],"format":"date-time"},"notifiedCount":{"type":"integer","description":"How many people the fix message reached"},"notifiedAt":{"type":["string","null"],"format":"date-time"},"notify":{"type":["object","null"],"description":"The batched send of a close","properties":{"status":{"type":"string","enum":["sending","done","failed"]},"mode":{"type":"string","enum":["close","new"]},"total":{"type":"integer"},"error":{"type":["string","null"]},"startedAt":{"type":["string","null"],"format":"date-time"}}},"full":{"type":"boolean","description":"True at 5,000 linked chats, the most one issue holds"},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"}}},"IssuePreview":{"type":"object","description":"Who a close would message: every linked chat that has not had a message from this issue, by how it reaches them.","properties":{"people":{"type":"integer"},"push":{"type":"integer"},"email":{"type":"integer"},"chat":{"type":"integer","description":"Only in the chat: no push or email"},"already":{"type":"integer","description":"Already got a message from this issue"},"blocked":{"type":"integer"},"linked":{"type":"integer"},"messaged":{"type":"integer"},"summary":{"type":"string","example":"This messages 14 people: 9 by push, 3 by email, 2 only in the chat (no push or email)."}}},"ReplyTarget":{"type":["object","null"],"description":"The reply clock, when the app has a target for the reply that is owed","properties":{"kind":{"type":"string","enum":["first","next"]},"targetMinutes":{"type":"integer"},"paused":{"type":"boolean","description":"True while the chat waits on the customer or is snoozed"},"overdue":{"type":"boolean"},"dueAt":{"type":["string","null"],"format":"date-time"},"minutesLeft":{"type":"integer","description":"Open time left, inside business hours when the app has them"},"startedAt":{"type":["string","null"],"format":"date-time"},"businessHours":{"type":"boolean"}}},"ReplyTargetsResponse":{"type":"object","properties":{"ready":{"type":"boolean"},"targets":{"type":"object","properties":{"firstReplyMinutes":{"type":["integer","null"]},"nextReplyMinutes":{"type":["integer","null"]},"warnAtPercent":{"type":["integer","null"]},"urgent":{"type":["object","null"],"properties":{"firstReplyMinutes":{"type":["integer","null"]},"nextReplyMinutes":{"type":["integer","null"]}},"description":"Shorter targets for chats of this priority, or null when they use the app's own"},"high":{"type":["object","null"],"properties":{"firstReplyMinutes":{"type":["integer","null"]},"nextReplyMinutes":{"type":["integer","null"]}},"description":"Shorter targets for chats of this priority, or null when they use the app's own"}}},"businessHours":{"type":"boolean"},"overdue":{"type":"array","items":{"type":"object","properties":{"conversationId":{"type":"string"},"customer":{"type":["string","null"]},"status":{"type":"string","enum":["open","waiting","snoozed","closed"]},"snoozedUntil":{"type":"string","format":"date-time"},"heldAt":{"type":"string","format":"date-time"},"heldBy":{"type":["string","null"]},"replyTarget":{"$ref":"#\/components\/schemas\/ReplyTarget"},"priority":{"type":"string","enum":["urgent","high","normal","low"]}}}},"dueSoon":{"type":"array","items":{"type":"object","properties":{"conversationId":{"type":"string"},"customer":{"type":["string","null"]},"status":{"type":"string","enum":["open","waiting","snoozed","closed"]},"snoozedUntil":{"type":"string","format":"date-time"},"heldAt":{"type":"string","format":"date-time"},"heldBy":{"type":["string","null"]},"replyTarget":{"$ref":"#\/components\/schemas\/ReplyTarget"},"priority":{"type":"string","enum":["urgent","high","normal","low"]}}}}}},"RoutingRulesResponse":{"type":"object","properties":{"ready":{"type":"boolean","description":"false until the database update that adds rules has run"},"rules":{"type":"array","items":{"type":"object","properties":{"ruleId":{"type":"string"},"name":{"type":"string"},"order":{"type":"integer"},"enabled":{"type":"boolean"},"conditions":{"type":"object","description":"Every list that is set must match; each matches when any of its values does. Leave all out to match every chat.","properties":{"keywords":{"type":"array","items":{"type":"string","maxLength":60},"description":"Words or phrases in the customer's message, whole words, any case"},"platforms":{"type":"array","items":{"type":"string","enum":["ios","android","web"]}},"planStatuses":{"type":"array","items":{"type":"string","enum":["active","trial","cancelled","billing_issue","expired","none"]},"description":"From the app's payments; customers with no known plan match none"},"tags":{"type":"array","items":{"type":"object","required":["key"],"properties":{"key":{"type":"string"},"value":{"type":["string","null"]}}},"description":"User tags; value null matches any value"},"countries":{"type":"array","items":{"type":"string"},"description":"ISO country codes, like US"},"languages":{"type":"array","items":{"type":"string"},"description":"Device language codes, like es"},"productIds":{"type":"array","items":{"type":"string"},"description":"Limit the rule to these apps (product ids, or any platform's app id)"}}},"actions":{"type":"object","properties":{"assignTo":{"type":["string","null"],"description":"One teammate: member id or email"},"roundRobin":{"type":["array","null"],"items":{"type":"string"},"description":"Several teammates in turn, instead of assignTo"},"assignToTeam":{"type":["string","null"],"description":"The teamId the rule assigns to: the chat joins that team and goes round robin among its members"},"priority":{"type":["string","null"],"enum":["urgent","high","normal","low",null]},"note":{"type":["string","null"],"maxLength":500,"description":"A team note left in the chat"}}},"matchedChats":{"type":"integer"},"lastMatchedAt":{"type":["string","null"],"format":"date-time"}}}},"rule":{"type":"object","properties":{"ruleId":{"type":"string"},"name":{"type":"string"},"order":{"type":"integer"},"enabled":{"type":"boolean"},"conditions":{"type":"object","description":"Every list that is set must match; each matches when any of its values does. Leave all out to match every chat.","properties":{"keywords":{"type":"array","items":{"type":"string","maxLength":60},"description":"Words or phrases in the customer's message, whole words, any case"},"platforms":{"type":"array","items":{"type":"string","enum":["ios","android","web"]}},"planStatuses":{"type":"array","items":{"type":"string","enum":["active","trial","cancelled","billing_issue","expired","none"]},"description":"From the app's payments; customers with no known plan match none"},"tags":{"type":"array","items":{"type":"object","required":["key"],"properties":{"key":{"type":"string"},"value":{"type":["string","null"]}}},"description":"User tags; value null matches any value"},"countries":{"type":"array","items":{"type":"string"},"description":"ISO country codes, like US"},"languages":{"type":"array","items":{"type":"string"},"description":"Device language codes, like es"},"productIds":{"type":"array","items":{"type":"string"},"description":"Limit the rule to these apps (product ids, or any platform's app id)"}}},"actions":{"type":"object","properties":{"assignTo":{"type":["string","null"],"description":"One teammate: member id or email"},"roundRobin":{"type":["array","null"],"items":{"type":"string"},"description":"Several teammates in turn, instead of assignTo"},"assignToTeam":{"type":["string","null"],"description":"The teamId the rule assigns to: the chat joins that team and goes round robin among its members"},"priority":{"type":["string","null"],"enum":["urgent","high","normal","low",null]},"note":{"type":["string","null"],"maxLength":500,"description":"A team note left in the chat"}}},"matchedChats":{"type":"integer"},"lastMatchedAt":{"type":["string","null"],"format":"date-time"}},"description":"The rule just saved (POST only)"},"teammates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":["string","null"]},"away":{"type":"boolean"}}}},"teams":{"type":"array","description":"The account's teams, to name in assignToTeam","items":{"type":"object","properties":{"teamId":{"type":"string"},"name":{"type":"string"},"memberIds":{"type":"array","items":{"type":"string"}}}}}}},"AiActions":{"type":"object","description":"Actions the customer confirms: things the lookup endpoint can do for a customer, which the AI may offer in the web chat as a card with Confirm and No thanks. Nothing runs until the customer taps Confirm. Off by default.","properties":{"enabled":{"type":"boolean","description":"Whether the AI may offer the actions that are on"},"list":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Up to 40 lowercase letters, digits and underscores"},"label":{"type":"string","description":"What the customer reads on the card"},"description":{"type":"string","description":"The line under it: what will happen"},"needsVerifiedUser":{"type":"boolean","description":"true (the default): only for customers whose user id the app signed"},"enabled":{"type":"boolean","description":"This action's own switch. A newly loaded action is off."}}},"description":"What the endpoint declared, from the last load"},"loadedAt":{"type":["number","null"],"description":"When the list was last loaded (ms since 1970), or null"}}}}}}