OptionalapiKey: stringReadonlyapiReadonlyaudiencesReadonlyautomationsDisable it and cancel the runs still in flight.
Steps can only change while the automation is disabled.
ReadonlybaseReadonlybatchReadonlybroadcastsReadonlychatMessages and events, oldest first when after_seq is given, else the latest page.
Reply as an agent (or add a private note). Pass an idempotencyKey to make retries safe.
Post a product card (up to 10 products, optional intro line) into the conversation.
Assign, tag, resolve, hide.
Everyone matching the filters, as CSV text.
Fold other customer records into this one (their conversations and orders move over). The API merges one customer per call; several ids are merged in order, stopping at the first error.
Who is on the website right now, and a proactive first message.
A VietQR payment for the order's total; the card lands in the conversation unless send_card is false.
Links agents open for the person in a conversation (your admin, an orders search…). set replaces the whole list.
One-time purchases: credit packs, unlocks, courses. App Store / Google Play ones arrive by themselves from the
SDK and store notifications; upsert records the ones your backend knows about, web sales included.
Subscriptions on the web, the App Store and Google Play. Store ones arrive by themselves once the app is
connected (App Store Server Notifications, Play RTDN); upsert records the ones your backend knows about.
The app account token to pass as Apple appAccountToken / Google obfuscatedExternalAccountId for one of your users.
Zalo ZNS notifications through a connected Official Account.
ReadonlycontactCustom contact fields, usable in emails as {{{contact.key}}}.
ReadonlycontactsReadonlydomainsReadonlyeinvoicesE-invoices (hóa đơn điện tử) through your own provider account.
Sign in and list the account's templates; nothing is saved.
Unlink: invoices already issued stay; the next provider becomes the default.
Run the step that failed again (creating the draft, sending it for approval, …).
ReadonlyemailEmail groups: team@your-domain forwarded to a list of members (needs receiving on the domain).
ReadonlyemailsCounts and rates per period (Resend's GET /emails/metrics).
Mail received on domains with receiving on (domains.update({ id, capabilities: { receiving: "enabled" } })).
ReadonlyeventsCustom events that trigger automations (and wake runs waiting for them).
Fire an event for a contact (by id, or by email, creating the contact).
ReadonlyknowledgeKnowledge the AI assistant answers from, on every channel: push your help center, CMS or product docs under your
own ids. Writes return at once and indexing runs in the background (status); sending a document unchanged does
nothing, so you can push everything on every deploy. sync makes a collection hold exactly what you send.
ReadonlylogsAPI request logs of the business (keys with a write scope).
ReadonlypaymentsBank-transfer payments. Choose the environment with the environment option (development: no bank integration, transfers are simulated).
A payment for one of your orders. order_id is the Idempotency-Key (calling again for the same
order returns the same payment, never a second one) and is kept in metadata.order_id.
IPN calls made to the payment's ipn_url.
A VietQR for any amount/description, for integrations that only listen to transaction.received.
Development only: pretend the payer's bank transfer arrived.
payment_id returns only the transactions that settled that payment.
Ask Hatang whether a payment is really paid, before you fulfil the order (after the payer comes back to your return_url, for example). Never trust the browser for this.
ReadonlysegmentsSegments: named groups of contacts to send broadcasts to (formerly audiences).
ReadonlytemplatesTemplates: edit a draft, publish it, then send with emails.send({ to, template: { id, variables } }).
ReadonlytopicsTopics: what contacts subscribe to one by one on the preferences page.
ReadonlyusageWhat the business used against its limits.
Readonlywebhooks
const hatang = new Hatang("ht_..."); const { data, error } = await hatang.emails.send({ from, to, subject, html });