API
Integrations
API
This documentation covers the RESTful API endpoints for customers, forms, workflows, campaign content, campaigns and social analytics. All endpoints are protected by ApiClientMiddleware and require proper authentication.
Using an AI assistant such as Claude, ChatGPT, Gemini or Cursor? You don't need an API key: connect it over MCP and sign in with your TrueBeep account instead.
Create a secret key
To get started, create a secret key to authenticate your API requests.
Use https://api.truebeep.com/v1 as the base URL for all TrueBeep API requests.
Create Customer
Creates a new customer record.
{
"success": true,
"data": {
"id": "e8c43l37t1zayx8t66t5xbg9",
"firstName": "John",
"lastName": "Doe",
"phone": "+177566302",
"points": 15
}
}
| Field | Type | Description |
|---|---|---|
firstName(Required) | string | This field is required |
lastName(Required) | string | This field is required |
phone(Conditional) | string | Min 10 digits |
email(Conditional) | string | Valid email |
username(Optional) | string | Optional |
Conditional fields indicate that at least one of the marked fields is required. For this endpoint, you must provide either phone or email (or both) along with the required fields.
Bulk Create Customers
Create multiple customer records in a single request.
[
{
"id": "uuid",
"firstName": "John",
"lastName": "Doe",
"phone": "1234567890",
"email": "john.doe@example.com"
},
{
"id": "uuid2",
"firstName": "Sam",
"lastName": "Smith",
"phone": "9876543210",
"email": "sam.smith@example.com"
}
]
| Field | Type | Description |
|---|---|---|
firstName(Required) | string | This field is required |
lastName(Required) | string | This field is required |
phone(Conditional) | string | Min 10 digits |
email(Conditional) | string | Valid email |
username(Optional) | string | Optional |
Conditional fields indicate that at least one of the marked fields is required. For this endpoint, you must provide either phone or email (or both) along with the required fields.
Update Customer
Update customer information.
{
"id": "uuid",
"firstName": "Walter",
"lastName": "White",
"phone": "+1234567890"
}
Get Customer
Retrieve customer information by ID.
{
"id": "uuid",
"firstName": "John",
"lastName": "Doe",
"phone": "1234567890",
"email": "john.doe@example.com",
"points": "100"
}
Update Customer QR Points
Update customer points using a QR code scan.
{
"success": true,
"data": {
"id": "jv3cstlguhr2e91oihi0bfsx",
"firstName": "John",
"lastName": "Doe",
"points": 2
}
}
| Field | Type | Description |
|---|---|---|
code(Required) | string | This field is required |
couponId(Required) | string | This field is required |
Update Customer Loyalty Points
Update a customer's loyalty points.
{
"id": "l7817f8lbdqn18pok75x2mnm",
"firstName": "John",
"lastName": "Doe",
"email": "john@gmail.com",
"points": 10
}
| Field | Type | Description |
|---|---|---|
points(Required) | number | This field is required |
type(Required) | increment or decrement | This field is required |
Forms API
The Forms API lets your own website, app, or backend submit responses into a TrueBeep form. You keep your existing front-end — the markup, styling, and validation stay yours — and TrueBeep becomes the place the submissions are stored, searched, exported, and turned into customer records.
Use it to:
- Replace a mailto or a bespoke form handler with a real inbox you can filter and export
- Consolidate many website forms into one TrueBeep form, tagging each submission with the page it came from
- Capture leads as customers automatically — a submission with an email or phone is matched to an existing customer or creates a new one
All Forms endpoints are protected by ApiClientMiddleware and use the same secret key as the rest of the API. Base URL https://api.truebeep.com/v1, with your key as a bearer token:
Authorization: Bearer <token>
Requests are scoped to the team that owns the key — you can only read and write your own team's forms.
Server-to-server only. Your secret key grants full write access to your team's data, so it must never be embedded in browser JavaScript or a mobile app binary. Post the form to your own backend first, then have your backend call this API.
How it works
Create the form
Build it in the Form Builder, or create it over the API with POST /forms. Either way the form defines the schema that submissions are validated against.
Read the field keys
Call the schema endpoint to get each field's key. Keys are what you submit against.
Submit responses
POST an array of key / value pairs. The response appears in your dashboard under Forms → View Responses immediately.
See the Forms guide for building and publishing a form.
About field keys
Every field has a key — a lowercase, underscore-separated identifier derived from its label. First Name becomes first_name, Email Address becomes email_address.
Keys are regenerated from the label every time the form is saved in the builder. Renaming a field label will change its key and silently break an integration that hard-codes the old one. Two further quirks to be aware of when naming fields:
- A question mark becomes a trailing
q—How did you find us?yieldshow_did_you_find_usq - Digits are replaced with letters derived from the field's internal id, so
Line 2yields an unpredictable key
Prefer labels without digits or question marks, and always read keys from the schema endpoint rather than guessing them.
Create a Form
Creates a form and all its fields in one request. Returns the generated formId and each field's server-generated key.
{
"success": true,
"data": {
"id": "q06e8ni8x0oksl2l23xxknjz",
"name": "Contact Us",
"status": "published",
"fields": [
{ "key": "first_name", "label": "First Name", "type": "varchar", "fieldType": "TextInput", "isRequired": true, "options": [] },
{ "key": "email_address", "label": "Email Address", "type": "varchar", "fieldType": "EmailInput", "isRequired": true, "options": [] },
{ "key": "region", "label": "Region", "type": "varchar", "fieldType": "Select", "isRequired": false, "options": ["Guam", "CNMI"] }
]
}
}
| Field | Type | Description |
|---|---|---|
name(Required) | string | Must be unique within your team |
fields(Required) | array | At least one field — see the field object below |
description(Optional) | string | Shown under the form title |
formPurpose(Optional) | string | Context used by AI form filling |
status(Optional) | string | draft or published. Default draft |
isPublic(Optional) | boolean | Default true |
createCustomerOnSubmit(Optional) | boolean | Default true |
webhookUrl(Optional) | string | POSTed the full response after each submission |
webhookSecret(Optional) | string | Sent as Authorization: Bearer on the webhook |
| Field | Type | Description |
|---|---|---|
fieldType(Required) | string | TextInput, Textarea, EmailInput, PhoneInput, NumberInput, DatePicker, Select, Radio, Checkbox |
label(Required) | string | Also the source of the generated key |
isRequired(Optional) | boolean | Default false |
options(Optional) | string[] | Required for Select, Radio, and checkbox groups |
isGroup(Optional) | boolean | Checkbox only — renders a multi-select group |
placeholder(Optional) | string | |
helperText(Optional) | string | Hint shown under the field |
defaultValue(Optional) | string | |
aiInstruction(Optional) | string | Guidance for AI-assisted form filling |
You cannot choose the field keys. They are generated from each label using the same rules the Form Builder uses, so that opening the form in the builder and saving it does not rename them. Read the keys from the create response, or from GET /forms/:formId/schema, before you write any code that submits to the form.
Field ordering follows the order of the fields array. type (the storage type) is derived from fieldType — you do not send it.
Update a Form
Updates a form's settings and, optionally, its fields. Every property is optional — send only what you want to change.
{
"success": true,
"data": {
"id": "q06e8ni8x0oksl2l23xxknjz",
"name": "Contact Us",
"status": "published",
"fields": [
{ "key": "first_name", "label": "First Name", "type": "varchar", "fieldType": "TextInput", "isRequired": true, "options": [] }
],
"removedFields": []
}
}
Accepts every body parameter from Create (except that name is optional), plus:
| Field | Type | Description |
|---|---|---|
fields(Optional) | array | Omit to leave fields untouched. If sent, this is the complete list the form ends up with |
removeMissingFields(Optional) | boolean | Confirms deletion of fields absent from fields. Default false |
How fields are matched
Fields are matched to the existing ones by label. A field whose label is unchanged keeps its id and key, so every answer already collected against it is preserved while its type, options, or required flag change freely. A field with a new label is created; renaming a label therefore creates a new field rather than renaming the old one.
Removing a field permanently deletes every answer already collected for it, across all past responses — it cannot be undone.
Because fields is a complete replacement list, simply forgetting to include an existing field would silently destroy data. The API therefore refuses the update, listing the fields at risk.
Re-send the missing fields to keep them, or set removeMissingFields: true to confirm you intend to delete them and their data.
{
"success": false,
"code": "FIELDS_WOULD_BE_REMOVED",
"message": "These fields are missing from the update and removing them deletes every answer already collected for them. Re-send them, or set removeMissingFields to true to confirm.",
"fields": ["how_did_you_find_us"]
}
Header, footer, and styling configured in the Form Builder are preserved on update — only the field list is rewritten.
List Forms
Returns every form belonging to your team, so you can find the formId you need without opening the dashboard.
{
"success": true,
"data": [
{
"id": "qo0zhyldtdiv7vxgtg6emq5r",
"name": "Contact Us",
"status": "published",
"provider": "internal",
"isPublic": true,
"responseCount": 128,
"createdAt": "2026-08-20T01:37:41.438Z",
"updatedAt": "2026-08-20T01:37:41.438Z"
}
]
}
Get Form Schema
Returns the form's fields, in the order they appear in the builder. Call this once when building your integration — and again whenever someone edits the form — to pick up the current keys and select options.
{
"success": true,
"data": {
"id": "qo0zhyldtdiv7vxgtg6emq5r",
"name": "Contact Us",
"status": "published",
"fields": [
{
"key": "first_name",
"label": "First Name",
"type": "varchar",
"fieldType": "TextInput",
"isRequired": true,
"options": [],
"maxLength": 255
},
{
"key": "who_is_this_directed_to",
"label": "Who is this directed to",
"type": "varchar",
"fieldType": "Select",
"isRequired": false,
"options": ["Customer Service / Tech Support", "Business Sales", "Ad Sales"],
"maxLength": 255
},
{
"key": "comment",
"label": "Comment",
"type": "text",
"fieldType": "Textarea",
"isRequired": false,
"options": [],
"maxLength": null
}
]
}
}
| Field | Type | Description |
|---|---|---|
key | string | The identifier you submit against |
label | string | Human-readable label as shown on the form |
type | string | Storage type — varchar, text, number, boolean, or date |
fieldType | string | Builder component — TextInput, Select, Checkbox, Textarea, ... |
isRequired | boolean | Submissions missing this field are rejected |
options | string[] | Allowed values for Select, Radio, and checkbox groups. Empty otherwise |
maxLength | number | 255 for varchar fields, null when unlimited |
Submit a Form Response
Creates a form response. Returns the new response id and, when a customer could be matched or created, the customer id.
{
"success": true,
"data": {
"formResponseId": "e8c43l37t1zayx8t66t5xbg9",
"subscriberId": "jv3cstlguhr2e91oihi0bfsx"
}
}
| Field | Type | Description |
|---|---|---|
responses(Required) | array | At least one { key, value } pair |
responses[].key(Required) | string | A key from the schema endpoint |
responses[].value(Required) | mixed | String, number, boolean, or array of strings — see the table below |
customer(Optional) | object | Overrides the customer details derived from the submission |
customer.firstName(Optional) | string | Optional |
customer.lastName(Optional) | string | Optional |
customer.email(Optional) | string | Valid email |
customer.phone(Optional) | string | Optional |
Value formats by field type
The type returned by the schema endpoint determines what a value may be:
type | Accepted value | Notes |
|---|---|---|
varchar | string, number, or string[] | Max 255 characters. For Select / Radio the value must be one of options. Checkbox groups take an array and are stored pipe-joined |
text | string | No length limit — use this for long free-text and URLs |
number | number or a numeric string | Must be finite |
boolean | true / false, or "true" / "false" | |
date | ISO 8601 string | e.g. 2026-08-20T00:00:00.000Z |
varchar fields are capped at 255 characters and a longer value is rejected with INVALID_FIELD_VALUES. If you need to send something long — a page URL with tracking parameters, a plan summary, a free-text comment — make that field a Textarea in the builder so it is stored as text instead.
Validation rules
- Required fields are enforced. Any field with
isRequired: truethat is missing,null, or blank rejects the whole submission with400 MISSING_REQUIRED_FIELDS. - Unknown keys are ignored, not rejected. A key that does not exist on the form is dropped and echoed back in
data.ignoredKeysso typos surface without failing live traffic. Always check this array while building your integration. - Blank optional fields are skipped. They are not stored as empty values.
- Select and Radio values are checked against
options, so a value that does not match is rejected rather than silently stored.
{
"success": true,
"data": {
"formResponseId": "e8c43l37t1zayx8t66t5xbg9",
"subscriberId": null,
"ignoredKeys": ["emial_address"]
}
}
List Form Responses
Returns a form's responses, newest first, with pagination and filtering.
{
"success": true,
"data": [
{
"id": "kt36fnwwr0ni3dk6biksw8nf",
"createdAt": "2026-08-20T02:40:06.967Z",
"source": "public",
"isRead": false,
"formId": "qo0zhyldtdiv7vxgtg6emq5r",
"formName": "Contact Us",
"subscriberId": "v863ihow50ztrh8kserqhvjx",
"subscriberFirstName": "John",
"subscriberLastName": "Doe",
"fields": [
{ "key": "first_name", "label": "First Name", "type": "varchar", "fieldType": "TextInput", "value": "John" },
{ "key": "inquiry_source", "label": "Inquiry Source", "type": "varchar", "fieldType": "Select", "value": "fiber" },
{ "key": "comment", "label": "Comment", "type": "text", "fieldType": "Textarea", "value": "Please call me." }
]
}
],
"pagination": { "page": 1, "limit": 20, "total": 137, "totalPages": 7 }
}
| Field | Type | Description |
|---|---|---|
page(Optional) | number | Default 1 |
limit(Optional) | number | Default 20, max 100 |
order(Optional) | string | asc or desc by submission time. Default desc |
source(Optional) | string | public (form or API) or ai (collected by AI auto-reply) |
isRead(Optional) | string | true or false |
startDate(Optional) | string | ISO date; filters createdAt >= |
endDate(Optional) | string | ISO date; filters createdAt <= |
search(Optional) | string | Case-insensitive match across every answer on the response |
fieldKey(Optional) | string | Filter on one field, e.g. inquiry_source. Requires fieldValue |
fieldValue(Optional) | string | Exact value the field must equal. Requires fieldKey |
fieldKey + fieldValue is what makes one shared form workable across many pages. If every page sets its own inquiry_source, then ?fieldKey=inquiry_source&fieldValue=fiber gives you just that page's submissions — no separate form needed per page.
fields always lists every field currently on the form, in builder order. A field the responder left blank — or one added to the form after the response was collected — comes back with value: null, so the shape is stable across rows and easy to turn into table columns or CSV.
Get a Form Response
Returns a single response in the same shape as a list entry. Responds 404 RESPONSE_NOT_FOUND if the response does not exist, is not on that form, or belongs to another team.
Customer matching
When a submission contains an email or phone number, TrueBeep looks for an existing customer on your team with that channel and links the response to them, creating a new customer if there is no match. The returned subscriberId is that customer.
Values are taken from the submission automatically:
- Email — the first field with
fieldType: "EmailInput" - Phone — the first field with
fieldType: "PhoneInput" - Name — the
first_nameandlast_namefields, or a singlenamefield split on the first space
Send a customer object to override any of these. If a submission has neither an email nor a phone, subscriberId is null and the response is still stored.
Customer matching never fails a submission. If the customer record cannot be created, the form response is still saved and subscriberId comes back null.
Turning customer creation off
Customer creation is controlled by the form, not by the request. Open the form in the Form Builder → Settings → Customer and switch Create Customer On Submit off to collect responses without adding anyone to your customer list.
It is on by default, and the setting applies to every route into the form — this API and the public form page alike — so all your pages behave consistently and no integration can opt itself out.
The current value is returned by the schema endpoint:
{
"success": true,
"data": {
"id": "qo0zhyldtdiv7vxgtg6emq5r",
"name": "Contact Us",
"createCustomerOnSubmit": true,
"fields": []
}
}
With it off, submissions still succeed and every answer is still stored — including name, email and phone, which remain visible in the responses table and in exports. You simply get subscriberId: null and nobody is added to your customer list.
Switching it off is not retroactive, and there is no way to back-fill customers from responses collected while it was off. If you are unsure, leave it on — you can always turn it off later, but you cannot recover the gap.
Consolidating several website forms into one
If the same enquiry form appears on many pages, you do not need a TrueBeep form for each one. Build a single form with the union of the fields, mark the page-specific ones optional, and add a field that records where the submission came from — a Select of page slugs, plus a Textarea for the full URL.
Every page then posts to the same formId, differing only in that source value, and you get one inbox and one export you can still segment by page.
{
"responses": [
{ "key": "first_name", "value": "John" },
{ "key": "email_address", "value": "john.doe@example.com" },
{ "key": "inquiry_source", "value": "fiber" },
{ "key": "source_url", "value": "https://www.example.com/shop/internet/fiber?utm_source=newsletter" }
]
}
Make the source field a Select so its values stay consistent and filterable, and keep the full-URL field a Textarea — URLs with tracking parameters routinely exceed the 255-character varchar limit.
Webhooks
If the form has a webhook URL configured in its settings, TrueBeep POSTs the complete response — including every field's key, label, type, and value — to that URL after a successful submission. When a webhook secret is set it is sent as Authorization: Bearer <secret>.
The webhook target always comes from the form's own settings and can never be supplied in the request body. Delivery is fire-and-forget with a 10-second timeout: a failing webhook is logged but does not fail the submission.
Errors
code | Status | Meaning |
|---|---|---|
FORM_NOT_FOUND | 404 | No form with that id on your team |
RESPONSE_NOT_FOUND | 404 | No such response on that form |
FORM_NAME_TAKEN | 409 | Another form on your team already uses that name |
FIELDS_WOULD_BE_REMOVED | 409 | An update omitted existing fields; confirm with removeMissingFields |
NO_FORM_OWNER | 422 | The team has no existing form to inherit an owner from — create one in the dashboard first |
FORM_HAS_NO_FIELDS | 422 | The form exists but has no fields yet — finish it in the builder |
MISSING_REQUIRED_FIELDS | 400 | One or more required fields were absent. The offending keys are in fields |
INVALID_FIELD_VALUES | 400 | A value did not match its field's type, options, or length. Per-field messages are in fields |
AUTH_HEADER_MISSING | 401 | No Authorization header |
INVALID_CLIENT | 401 | The key does not resolve to a team |
API_KEY_EXPIRED | 401 | Generate a new key in team settings |
{
"success": false,
"code": "MISSING_REQUIRED_FIELDS",
"message": "Missing required field(s): first_name, email_address",
"fields": ["first_name", "email_address"]
}
Workflows API
The Workflows API lets you build and run workflows from your own code: create one from a graph or a plain-language description, rename it, change its steps, publish it, pause and resume it, and read its runs. It applies the same rules as the workflow editor, so a workflow you create over the API opens in the editor exactly as you sent it, and one that wouldn't publish in the editor won't publish here either.
Same base URL and secret key as the rest of the API:
Authorization: Bearer <token>
Requests are scoped to the team that owns the key. Another team's workflow behaves exactly like one that doesn't exist (404).
How it works
Look up your ids
GET /workflows/resources returns the email and message templates, forms, tags, segments, custom fields and sending domains a workflow can use.
Create a draft
POST /workflows with a graph of triggers and steps, or POST /workflows/generate with a description and let AI build it. Either way the result is a draft: nothing runs yet.
Publish
POST /workflows/:workflowId/publish. If a step is incomplete you get every problem back at once, so you can fix them in one pass.
Watch the runs
GET /workflows/:workflowId/executions lists each run and whether it completed or failed.
Workflow lifecycle
| Status | Meaning | Get here with |
|---|---|---|
draft | Saved, not running | POST /workflows, POST /:id/unpublish |
active | Published: its trigger starts runs | POST /:id/publish, POST /:id/resume |
paused | Published, but no new runs start | POST /:id/pause |
archived | Gone from the list; no longer returned by the API | POST /:id/archive |
Every save creates a new version. Publishing makes the latest version live. Editing a live workflow saves a new draft version and the live one keeps running until you publish again. hasUnpublishedChanges tells you when that's the case. Pause and resume keep the version that's live; unpublish takes it down entirely. Runs already in progress always finish on the version they started with.
The graph
A workflow is a graph of nodes (one trigger, then steps) joined by edges.
{
"nodes": [
{ "id": "start", "kind": "trigger.event", "config": { "eventName": "subscriber.opted_in" } },
{ "id": "welcome", "kind": "action.email", "label": "Welcome email",
"config": { "to": "{{trigger.email}}", "contentId": "<emailTemplateId>" } },
{ "id": "wait", "kind": "flow.delay", "config": { "durationMs": 172800000 } },
{ "id": "tips", "kind": "action.sms", "config": { "contentId": "<messagingTemplateId>" } }
],
"edges": [
{ "source": "start", "target": "welcome" },
{ "source": "welcome", "target": "wait" },
{ "source": "wait", "target": "tips" }
]
}
id: any string unique in the graph. On create the ids are replaced with generated ones (read them back from the response). On update they're kept, so you can refer to the same step across edits.position({ x, y }) is optional. Steps without one are laid out automatically; on update, existing steps keep their place in the editor.edges:source→target. After aflow.conditionstep, setbranchto"true"or"false"; everywhere else leave it out.label(optional): the name shown on the step in the editor.
kind | config |
|---|---|
trigger.event | eventName: subscriber.created, subscriber.opted_in, form.submitted, interaction.created, campaign.completed, campaign.failed. Optional formId (with form.submitted) and interactionType (with interaction.created: message, booking, purchase, order, …) |
trigger.webhook | Leave config empty. An endpoint is created for you; its url and signing secret are in the response's webhooks |
trigger.cron | cronExpr (e.g. 0 9 * * 1), timezone (default UTC) |
trigger.date | field (joined_at or custom:<key> of a date custom field), offsetDays (−365 to 365), recurrence (yearly/once), time (HH:MM), timezone |
kind | config |
|---|---|
action.email | contentId (email template), to (e.g. {{trigger.email}}), fromEmail (an address on a verified sending domain; if you leave it out, noreply@ your first verified domain is used) |
action.sms | contentId (message template). to is optional: blank sends to the run's customer |
action.whatsapp | contentId. to is optional, as for SMS |
action.messenger | platform (facebook/instagram), contentId. psid is optional: blank uses the customer's own id |
action.tag | op (add/remove), tagIds |
action.update_field | field (custom field key), op (set/increment/today/clear), value |
action.webhook | url, method, headers, body (an API call to your own system) |
flow.delay | durationMs, up to 90 days |
flow.condition | expr: { "all": [ { "field": "trigger.email", "op": "exists" } ] }. Ops: eq, neq, in, nin, gt, gte, lt, lte, contains, not_contains, exists, in_segment, not_in_segment |
Values such as to and message bodies can use personal values like {{trigger.email}}. The webhook and schedule triggers have no customer, so SMS, WhatsApp and Messenger steps after them need an explicit to/psid.
Ids must belong to your team. A contentId, formId, tagIds or segment that belongs to another team is rejected on update (INVALID_REFERENCE). On create it's removed instead, and removedReferences counts how many were removed, so check it. Get valid ids from GET /workflows/resources.
Get Workflow Resources
Everything a graph can reference: emailTemplates, messagingTemplates, forms, tags, segments, customFields, dateFields and sendingDomains.
Create a Workflow
Creates a draft. Send a graph to add its steps now, or leave it out and add them later with PATCH.
{
"success": true,
"data": {
"id": "d2kq8v0yq3n1x7f5m4t6p9wa",
"name": "Welcome series",
"description": "Welcome email, then a tips SMS two days later",
"status": "draft",
"publishedVersionId": null,
"latestVersion": { "id": "k1y7z0c3v8b2n5m4x6q9w1er", "number": 1 },
"hasUnpublishedChanges": false,
"graph": { "version": 1, "nodes": ["…"], "edges": ["…"] },
"webhooks": [],
"removedReferences": 0,
"createdAt": "2026-10-19T08:00:00.000Z",
"updatedAt": "2026-10-19T08:00:00.000Z"
}
}
| Field | Type | Description |
|---|---|---|
name(Required) | string | 1–255 characters |
description(Optional) | string | Up to 2000 characters |
graph(Optional) | object | { nodes, edges }; see The graph |
Generate a Workflow with AI
Describe the automation in plain language and get back a draft, built with your team's templates, forms and tags. Review it (or open it in the editor) before you publish. Generation can take up to a minute.
| Field | Type | Description |
|---|---|---|
prompt(Required) | string | 5–2000 characters |
List Workflows
Query: status (draft, active, paused), search (matches the name), page (default 1), size (default 20, max 100). Each item has id, name, description, status, publishedVersionId, executionCount, createdAt and updatedAt, plus pagination: { page, size, total }.
Get a Workflow
Returns the workflow with its latest graph and its webhooks. Each webhook has its url and secret. A POST to the URL starts a run with the JSON body as trigger data, and must carry the header x-workflow-signature: sha256=<hex>, where <hex> is the HMAC-SHA256 of the raw request body keyed with the secret. Unsigned or wrongly signed calls get 401.
Update a Workflow
Renames it, changes the description, and/or saves a new version of its steps. Send only what you want to change.
| Field | Type | Description |
|---|---|---|
name(Optional) | string | 1–255 characters |
description(Optional) | string | |
graph(Optional) | object | The complete graph. Saved as a new draft version; publish to make it live |
graph replaces the whole graph: any step you leave out is removed in the new version. GET the workflow first, change what you need, and send the full graph back. Keep the webhook trigger's webhookId if it has one, otherwise you get a new endpoint URL.
Publish a Workflow
Makes the latest version live. Its trigger starts runs immediately.
If a step is incomplete, nothing is published and you get every problem at once:
{
"success": false,
"code": "NOT_READY_TO_PUBLISH",
"message": "Fix these before publishing",
"problems": [
"Node #2 (Welcome email) · content id: Pick an email template.",
"Node #2 (Welcome email) · from email: Pick a verified sending domain."
]
}
Pause, Resume and Unpublish
POST /workflows/:workflowId/pause: stops new runs. Only a published (active) workflow can be paused.POST /workflows/:workflowId/resume: turns apausedworkflow back on, with the version that was live. Saved edits that were never published stay unpublished; use publish for those.POST /workflows/:workflowId/unpublish: back todraft. Its steps are kept, and you can publish again any time.
All three return the updated workflow, or 409 when the workflow isn't in a state the action applies to.
Archive a Workflow
Stops its trigger and removes it from your workflow list. Runs already in progress finish, and its run history is kept. There's no API call to restore an archived workflow.
List Workflow Runs
The most recent runs first, with status (pending, running, completed, failed, cancelled; a run waiting on a delay step is running), startedAt, finishedAt, error and the versionId the run used. Query: page, size.
Workflow errors
| Status | code | When |
|---|---|---|
404 | WORKFLOW_NOT_FOUND | No such workflow on your team, or it's archived |
409 | NOT_LIVE, NOT_PAUSED, ALREADY_DRAFT | Pause, resume or unpublish doesn't apply to the current status |
422 | INVALID_NAME, NOTHING_TO_UPDATE, INVALID_PROMPT | A body field is missing or out of range |
422 | INVALID_GRAPH | The graph doesn't match the format; issues lists each problem with its path |
422 | INVALID_REFERENCE | The graph uses an id your team doesn't own |
422 | NOT_READY_TO_PUBLISH, NO_STEPS | Publishing needs every step complete; problems lists them |
422 | GENERATION_FAILED | AI couldn't build a valid workflow; try rephrasing |
Content API
The Content API creates the content a campaign sends: social posts, messages (SMS, WhatsApp, Messenger, Instagram direct messages) and emails. Every item is saved as a draft in your Content, Messaging or Email library, built by the same content builder as the dashboard, so it opens in the editor exactly as you sent it.
Same base URL and secret key as the rest of the API. Requests are scoped to the team that owns the key; another team's content behaves exactly like content that doesn't exist (404).
How it works
Write the content
POST /contents with the text, optional per-channel text, and optional images or a video. Emails take a plain-text/Markdown body or a full HTML template.
Check the response
warnings lists channel problems (text too long, a platform not connected, a file a platform rejects). needsMedia lists channels that still need an image or video. editUrl opens the item in TrueBeep.
Use it in a campaign
Pass the content id to POST /campaigns. See the Campaigns API below.
Content types and channels
type | Channels | Notes |
|---|---|---|
content (social) | facebook, facebookStories, facebookReels, instagram, instagramStories, instagramReels, twitter, linkedin, tikTok, youtubeShorts | One shared text, optional per-channel text. Stories, Reels, TikTok and Shorts need media |
messaging | sms, whatsapp, messenger, instagramMessage | SMS is text only. One image can be sent as the WhatsApp header |
email | — | email.body (plain text or Markdown) or email.html (a full HTML template) |
A channel is created turned off when it can't be used as sent: its platform isn't connected, it needs media you didn't send, or a file breaks that platform's rules. The reason is in warnings, and the item still saves.
Media
Send images or one video in media. Every file is downloaded into your team's Media Cloud, checked, and attached the same way a dashboard upload is.
| Images | Video | |
|---|---|---|
| Formats | JPG, PNG, WebP | MP4 |
By URL ({ "url": "https://…" }) | Up to 8 MB | Up to 1 GB |
As base64 ({ "base64": "…" }) | Up to 5 MB | Not accepted |
| Per item | Up to 10 images | One video, not mixed with images |
- The file type is read from the file itself, not its name or extension.
- URLs must be public
httpsaddresses. Links to private or internal addresses are refused. - Files count toward your Media Cloud storage. If an upload would go over your plan's limit, nothing is uploaded and you get
422 STORAGE_LIMIT_REACHED. - Each platform's own rules (for example video length for Reels or TikTok) are checked. A file that breaks one platform's rules is still saved and used on the channels it fits; the channel it doesn't fit is turned off with the reason in
warnings. - On
PATCH,mediareplaces the item's media. Leave it out to keep the current media.
HTML email templates
Send a complete HTML email in email.html (up to 500 KB) instead of email.body. It's saved like Emails → Upload HTML in the dashboard and opens in the HTML code editor.
For safety the HTML is cleaned before it's saved: scripts, embedded frames, event handlers (such as onclick) and javascript: links are removed. Inline styles, <style> blocks, tables and images linked by https URL are kept.
Create Content
{
"success": true,
"data": {
"id": "ba6wmleti05wjybgh3e7clav",
"name": "Weekend sale",
"type": "content",
"status": "draft",
"editUrl": "https://app.truebeep.com/content-builder/ba6wmleti05wjybgh3e7clav",
"text": "Weekend sale: 20% off everything, Saturday and Sunday only.",
"channels": [
{ "id": "facebook", "title": "Facebook", "enabled": true, "text": "Weekend sale: 20% off…", "errors": [] },
{ "id": "twitter", "title": "X (Twitter)", "enabled": true, "text": "Weekend sale: 20% off, Sat–Sun only.", "errors": [] }
],
"media": [
{ "fileId": "q1w2e3r4t5y6u7i8o9p0a1s2", "url": "https://…", "type": "image", "mimeType": "image/jpeg", "sizeBytes": 182044, "width": 1080, "height": 1350 }
],
"needsMedia": ["facebookReels", "instagramReels", "youtubeShorts"],
"warnings": [],
"mediaHint": "Add or change media with `media`, or in TrueBeep at https://app.truebeep.com/content-builder/ba6wmleti05wjybgh3e7clav."
}
}
| Field | Type | Description |
|---|---|---|
type(Required) | string | content, messaging or email |
name(Required) | string | Library name, 1–255 characters |
text(Optional) | string | Shared text for every channel (social and messaging) |
channels(Optional) | object | Per channel: { "<channelId>": { "text": "…", "enabled": true } } |
media(Optional) | array | [{ "url": "…" }] or [{ "base64": "…", "fileName": "…" }]; see Media |
email(Optional) | object | body or html, plus optional suggestedSubject, suggestedPreviewText. Required for email |
A text message:
An email from text or Markdown (paragraphs, **bold**, *italic*, links and lists):
An email from your own HTML template:
suggestedSubject and suggestedPreviewText become the default subject and preview text of an email campaign that uses this content.
List Content
Query: type (content, messaging, email), search (matches the name), page (default 1), size (default 20, max 100). Each item has id, name, type, status, updatedAt, the enabled channels and editUrl, plus pagination: { page, size, total }.
Get Content
Returns the same shape as create. For emails, email.mode is html (an HTML template) or builder (designed in the email editor), with the html (first 100,000 characters), htmlLength and htmlTruncated.
Update Content
Changes the name, the shared text, one channel's text or on/off, the media, or the email. Send only what you want to change.
- Changing text keeps media someone already added in TrueBeep.
- An email designed in the email editor can't be replaced with
email.bodyoremail.htmlhere (409); change it in the editor.
Duplicate Content
Delete Content
Refused with 409 CONTENT_IN_USE while a scheduled or running campaign uses it.
Content errors
| Status | code | When |
|---|---|---|
400 | INVALID_MEDIA | A file isn't a supported type, is corrupt, is a base64 video, mixes images and video, or the URL isn't public https. item and reason say which one and why |
400 | UNSUPPORTED_TYPE | ads content isn't available through the API |
404 | CONTENT_NOT_FOUND | No such content on your team |
409 | EMAIL_MODE_MISMATCH, EDITED_IN_EDITOR | The email was designed in the email editor; change it there |
409 | CONTENT_IN_USE | A scheduled or running campaign uses this content |
413 | MEDIA_TOO_LARGE, HTML_TOO_LARGE | A file or the HTML is over its size limit |
422 | INVALID_CONTENT, NOTHING_TO_UPDATE, UNKNOWN_CHANNEL | A body field is missing, unknown or out of range |
422 | MEDIA_FETCH_FAILED | A media URL couldn't be downloaded (not found, timed out) |
422 | STORAGE_LIMIT_REACHED | The upload would go over your Media Cloud storage limit; usedBytes, limitBytes, incomingBytes |
502 | MEDIA_UPLOAD_FAILED | The file couldn't be saved; try again |
Campaigns API
The Campaigns API creates draft campaigns from your content, previews them, and schedules them. It checks everything the dashboard's Start button checks (audience, sender, balance), so a campaign that wouldn't start in the dashboard won't schedule here either. There's no "send now": a scheduled campaign goes to review and is sent by TrueBeep.
Same base URL and secret key as the rest of the API. Another team's campaign behaves exactly like one that doesn't exist (404).
How it works
Create the content
POST /contents (see the Content API above) and keep its id.
Create a draft campaign
POST /campaigns with the content id and an audience: a segment from GET /campaigns/segments, or tags.
Preview
POST /campaigns/:campaignId/preview shows the audience size, channels, send time, estimated cost and anything still missing.
Schedule
POST /campaigns/:campaignId/schedule with confirm: true. Without confirm you get the preview back and nothing changes.
Campaign types
type | Content | Channels |
|---|---|---|
content (social) | A content item, in contentId | Posts to the channels enabled in the content |
messaging | A messaging item, in contentId | channels: sms, whatsapp, messenger, instagram-messenger |
email | An email item, in emailContentId | Email. Needs emailConfig with senderName, a senderEmail on one of your verified sending domains, and a subject |
List Segments
Returns { "segments": [{ "id", "name" }] }: the segments a campaign can target.
Create a Campaign
Creates a draft. Nothing is sent.
{
"success": true,
"data": {
"id": "fk0dnmrj6oue8b3vdfpjglbg",
"name": "VIP early access",
"type": "messaging",
"status": "draft",
"isReady": false,
"sendAt": "2026-11-07T04:00:00.000Z",
"contentId": "o604qskfmpk7m2pc3t3a2o97",
"emailContentId": null,
"segmentId": "s3gm3nt1d0000000000000001",
"channels": ["sms"],
"audience": { "total": 412, "channels": { "sms": 398 } },
"ready": true,
"missing": [],
"overviewUrl": "https://app.truebeep.com/dashboard/campaigns/fk0dnmrj6oue8b3vdfpjglbg"
}
}
| Field | Type | Description |
|---|---|---|
name(Required) | string | 3–40 characters |
type(Required) | string | content, messaging or email |
contentId(Optional) | string | Social or messaging content (required for those types) |
emailContentId(Optional) | string | Email content (required for email) |
segmentId(Optional) | string | From GET /campaigns/segments |
tags(Optional) | string[] | Target customers with these tags |
channels(Optional) | string[] | Messaging campaigns only |
sendAt(Optional) | string | Planned send time, ISO 8601 with a UTC offset (e.g. 2026-11-07T10:00:00+06:00) |
emailConfig(Optional) | object | senderName, senderEmail, subject, previewText (email campaigns) |
List Campaigns
Query: status (draft, under-review, processing, stopped, completed, cancelled, archived), type, search, page, size (max 100).
Get a Campaign
The campaign with its audience (total and per channel), ready, and missing: everything still needed before it can be scheduled.
Update a Campaign
Changes a draft: name, content, audience, channels, send time or email settings. Send only what you want to change. Campaigns that are scheduled or running can't be changed (409 NOT_DRAFT).
Preview a Campaign
What scheduling would do, without changing anything: audienceSize, channels, sendAt, estimatedCost (with costBreakdown; social campaigns have no cost), ready and missing.
Schedule a Campaign
With confirm: true the campaign is scheduled for sendAt (or the time already set on it) and moves to review. Without it you get { "scheduled": false, "preview": { … } } and nothing changes, which is useful for showing someone what will happen first.
Scheduling is refused when:
- the campaign isn't a draft (
409 NOT_DRAFT) - something is missing, such as an empty audience, a send time in the past, or an email sender or subject (
422 CAMPAIGN_NOT_READY, withmissing) - the estimated cost isn't covered by your balance (
402 INSUFFICIENT_BALANCE)
Cancel a Campaign
Takes a scheduled campaign back to draft, or stops one that is sending. A social campaign can only be cancelled while it's in review.
Get Campaign Results
Delivery counts by channel and status (analytics), and post insights for social campaigns (insights), as the campaign's Analytics tab shows them.
Campaign errors
| Status | code | When |
|---|---|---|
400 | UNSUPPORTED_TYPE | Ads and push campaigns aren't available through the API |
402 | INSUFFICIENT_BALANCE | The estimated cost isn't covered by your balance |
404 | CAMPAIGN_NOT_FOUND | No such campaign on your team |
409 | NOT_DRAFT | Only a draft can be changed or scheduled |
409 | NOT_SCHEDULED, CANNOT_CANCEL | The campaign isn't in a state that can be cancelled |
422 | INVALID_CAMPAIGN, NOTHING_TO_UPDATE, UNKNOWN_CHANNEL | A body field is missing, unknown or out of range; issues lists them |
422 | CONTENT_NOT_FOUND, CONTENT_TYPE_MISMATCH, SEGMENT_NOT_FOUND, TAG_NOT_FOUND | A referenced id isn't on your team, or the content type doesn't match the campaign |
422 | SENDER_NOT_VERIFIED | senderEmail isn't on one of your verified sending domains |
422 | CAMPAIGN_NOT_READY | Scheduling needs everything in missing fixed first |
503 | COST_UNAVAILABLE, DOMAINS_UNAVAILABLE | A check couldn't run; try again |
Analytics API
The Analytics API exposes the social analytics behind your TrueBeep dashboard — post-level metrics and page/profile-level insights — for every connected platform: Facebook, Instagram, X (Twitter), LinkedIn, TikTok, and YouTube.
All endpoints are protected by ApiClientMiddleware and require the same secret key as the rest of the API. Use https://api.truebeep.com/v1 as the base URL, and pass your key as a bearer token:
Authorization: Bearer <token>
Requests are automatically scoped to the team that owns the API key — you only ever see your own team's analytics.
Response shape: normalized + raw
Every metrics payload carries two views so you never have to relearn each platform's vocabulary, yet never lose detail:
metrics/kpis— a normalized common set (impressions,reach,engagement,likes,comments,shares,clicks,videoViews,engagementRate). A metric that a platform does not report isnull(distinct from a measured0).rawMetrics/rawKpis— the platform's original keys, untouched (e.g. Facebook'spost_video_views_15s, LinkedIn'suniqueImpressionsCount).
null means "this platform does not provide this metric" or "not yet ingested" — it is not the same as 0. Data is only as fresh as the last analytics refresh; page/profile responses include lastRefreshedAt so you can surface staleness.
List Post Analytics
Returns paginated post-level analytics for a single platform. Post sub-types (feed post, reel, story) are mixed together by default and can be narrowed with postType.
{
"success": true,
"data": [
{
"id": "e8c43l37t1zayx8t66t5xbg9",
"postId": "1224...901",
"platform": "facebook",
"postType": "post",
"campaignId": null,
"content": "Summer sale is live!",
"permalinkUrl": "https://facebook.com/...",
"publishedAt": "2026-06-10T12:00:00.000Z",
"metrics": {
"impressions": 1200,
"reach": 900,
"engagement": 84,
"likes": 40,
"comments": 8,
"shares": 6,
"clicks": 30,
"videoViews": 210,
"engagementRate": 0.07
},
"rawMetrics": {
"post_impressions": 1200,
"post_impressions_unique": 900,
"post_video_views_15s": 150
}
}
],
"pagination": { "page": 1, "limit": 20, "total": 137 }
}
| Field | Type | Description |
|---|---|---|
platform(Required) | string | facebook, instagram, twitter, linkedin, tiktok, or youtube |
| Field | Type | Description |
|---|---|---|
postType(Optional) | string | post, reel, or story. Omit for all. A no-op on platforms without sub-types (e.g. Twitter) |
startDate(Optional) | string | ISO date; filters publishedAt >= |
endDate(Optional) | string | ISO date; filters publishedAt <= |
campaignId(Optional) | string | Filter to a single campaign |
search(Optional) | string | Case-insensitive match on post content |
page(Optional) | number | Default 1 |
limit(Optional) | number | Default 20, max 100 |
order(Optional) | string | asc or desc by publishedAt. Default desc |
startDate / endDate accept full ISO timestamps (2026-06-30T23:59:59Z) or plain dates (2026-06-30).
Get a Single Post
Returns the analytics for one post. Responds 404 if the post is not in your team or does not belong to {platform}. The data object has the same shape as a list element above.
{
"success": true,
"data": {
"id": "e8c43l37t1zayx8t66t5xbg9",
"postId": "1224...901",
"platform": "facebook",
"postType": "post",
"metrics": { "impressions": 1200, "engagement": 84, "engagementRate": 0.07 },
"rawMetrics": { "post_impressions": 1200 }
}
}
Profile / Page Analytics
Returns page/profile-level insights for a platform — headline KPIs, a time-series for the selected window, and period-over-period percentage change.
{
"success": true,
"data": {
"platform": "instagram",
"status": "ready",
"connected": true,
"lastRefreshedAt": "2026-07-13T04:00:00.000Z",
"window": "30d",
"kpis": {
"followers": 5400,
"impressions": 88000,
"reach": 61000,
"engagement": 4300
},
"rawKpis": { "Followers": 5400, "Reach": 61000 },
"timeSeries": { "impressions": [], "reach": [] },
"percentageChange": { "impressions": 0.12, "reach": -0.03 }
}
}
| Field | Type | Description |
|---|---|---|
window(Optional) | string | 7d, 30d, 90d, or 12m. Default 30d |
Profile metrics are stored as pre-aggregated windows (7d / 30d / 90d / 12m), so — unlike posts — they do not accept arbitrary date ranges. Pick the closest window.
Cross-Platform Summary
Returns one entry per platform (including ones you have not connected), ideal for a dashboard landing view in a single call.
{
"success": true,
"data": {
"window": "30d",
"platforms": [
{
"platform": "facebook",
"status": "ready",
"connected": true,
"lastRefreshedAt": "2026-07-13T04:00:00.000Z",
"kpis": { "followers": 12000, "impressions": 240000, "reach": 180000, "engagement": 9100 },
"postCount": 42
},
{
"platform": "tiktok",
"status": "not_connected",
"connected": false,
"lastRefreshedAt": null,
"kpis": null,
"postCount": 0
}
]
}
}
| Field | Type | Description |
|---|---|---|
window(Optional) | string | 7d, 30d, 90d, or 12m. Default 30d |
platforms(Optional) | string | Comma-separated filter, e.g. facebook,instagram. Omit for all |
Connection status
Because "not connected" is a normal state, profile and summary responses carry an explicit status instead of erroring:
status | connected | Meaning |
|---|---|---|
not_connected | false | The platform is supported but your team hasn't connected it |
pending | true | Connected, but analytics haven't been ingested yet |
unavailable | true | Connected, but analytics aren't available (e.g. a LinkedIn personal profile) |
ready | true | Connected and data is present |
An unsupported platform in the path (e.g. /analytics/social/myspace/posts) returns 404 PLATFORM_NOT_SUPPORTED. A supported-but-not-connected platform returns 200 with status: "not_connected".
Metric availability by platform
Not every platform reports every metric — unavailable ones are null in metrics. Notable differences:
| Platform | Notes |
|---|---|
Full post + page metrics; reach is unique impressions | |
reach, total_interactions (→ engagement), saves in raw | |
| Twitter/X | Uses public_metrics; reach/clicks not reported |
Metrics nested per post; engagementRate is a stored ratio; personal profiles have none | |
| TikTok | view_count drives impressions/reach/videoViews; no clicks |
| YouTube | Views drive impressions; channel KPIs come from account metadata |