Workflows
A workflow automates a sequence of steps for every contact enrolled in it. With the API, you can find workflows, build one from a definition (its triggers, its steps, and the connections between them), publish or unpublish it, read its run logs, delete it, and enroll contacts in it or remove them.
Base URL: https://services.smbcrm.com · Version header: v3 ·
Scopes: workflows.readonly (list, search, step types, definitions), workflows.write
(create, validate, update), workflows.publish (publish or unpublish), workflows.logs
(run logs), workflows.delete (delete), and contacts.write (enroll or remove a contact).
See Scopes.
{ "statusCode": 403, "error": "Forbidden", "code": "WORKFLOW_API_NOT_ENABLED_FOR_LOCATION", "message": "The workflow API is not enabled for location <location_id>."}A 403 without that code means the token can’t access the locationId you sent.
Rate limits. Search, step types, definitions, validate, create, update, status, and
delete also count against a per-account budget for each 10-second window, shared by every
token used for the account. Reads (search, step types, get definition) and writes (validate,
create, update, status, delete) are counted separately. The rate-limit headers don’t report
this budget, so a 429 while X-RateLimit-Remaining and X-RateLimit-Daily-Remaining are
both above 0 means it’s spent. Wait 10 seconds and retry. See
Errors.
Find workflows
Section titled “Find workflows”List workflows
Section titled “List workflows”locationId is required as a query parameter and scopes the results to your account.
| Query param | Type | Required | Description |
|---|---|---|---|
locationId |
string | Yes | The account (location) whose workflows to list. |
curl "https://services.smbcrm.com/workflows/?locationId=<location_id>" \ -H "Authorization: Bearer <token>" \ -H "Version: v3"{ "workflows": [ { "id": "<workflow_id>", "name": "New Lead Nurture", "status": "published", "version": 2, "createdAt": "2026-05-26T11:33:49.000Z", "updatedAt": "2026-05-26T11:33:49.000Z", "locationId": "<location_id>" }, { "id": "<workflow_id>", "name": "Missed Call Follow-Up", "status": "draft", "version": 1, "createdAt": "2026-06-02T16:20:10.000Z", "updatedAt": "2026-06-02T16:20:10.000Z", "locationId": "<location_id>" } ]}Each workflow in workflows has these fields:
| Field | Type | Description |
|---|---|---|
id |
string | The workflow ID. Use it to read, edit, publish, or delete the workflow, to read its logs, and to enroll or remove contacts. |
name |
string | The workflow’s name. |
status |
string | The workflow’s status, for example draft or published. |
version |
number | The workflow’s version number. |
createdAt |
string | When the workflow was created (ISO 8601). |
updatedAt |
string | When the workflow was last updated (ISO 8601). |
locationId |
string | The account (location) the workflow belongs to. |
Save the id of the workflow you want. You’ll need it for every endpoint below that acts on
one workflow.
Search workflows
Section titled “Search workflows”Search returns summaries only. To get a whole workflow, pass its id to
Read a definition. Filters combine with AND.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
locationId |
query | string | Yes | The account (location) to search. |
filters |
body | array | No | Up to 20 filters, combined with AND. Leave it out to match every workflow in the account. |
sort |
body | array | No | Sort order. Defaults to most recently updated first. |
limit |
body | number | No | Page size. Defaults to 20. |
offset |
body | number | No | Result offset. Can’t be combined with searchAfter. Deep paging with offset is slow, so use searchAfter after the first few pages. |
searchAfter |
body | array of strings | No | The cursor from a previous response, for paging through a large result set. Send it back unchanged and don’t build one yourself. |
Each filter has three required fields:
| Field | Type | Description |
|---|---|---|
field |
string | The field to filter on: workflowId, name, status, type, customObjectType, folderId, updatedBy, createdAt, or updatedAt. |
operator |
string | eq, not_eq, in, contains, not_contains, gt, gte, lt, or lte. |
value |
string or array of strings | The value to compare against. in requires an array, and every other operator rejects one. Dates are ISO 8601. |
eq, not_eq, in, contains, and not_contains work on text fields. gt, gte, lt,
and lte work on date fields (createdAt and updatedAt). A mismatch returns 422. To
match a single moment on a date field, send gte and lte with the same value. To fetch a
known set of workflows, filter workflowId with in.
Each sort entry has a field (any of the filter fields) and a direction (asc or
desc).
curl -X POST "https://services.smbcrm.com/workflows/search?locationId=<location_id>" \ -H "Authorization: Bearer <token>" \ -H "Version: v3" \ -H "Content-Type: application/json" \ -d '{ "filters": [ { "field": "name", "operator": "contains", "value": "welcome" }, { "field": "status", "operator": "eq", "value": "published" } ], "sort": [{ "field": "updatedAt", "direction": "desc" }], "limit": 2 }'{ "total": 42, "count": 2, "offset": 0, "workflows": [ { "id": "<workflow_id>", "name": "Welcome new contacts", "description": null, "status": "published", "folderId": "<folder_id>", "updatedBy": "<user_id>", "createdAt": "2026-01-14T09:12:44.000Z", "updatedAt": "2026-02-02T17:41:09.000Z" }, { "id": "<workflow_id>", "name": "Welcome back, lapsed clients", "description": null, "status": "published", "folderId": null, "updatedBy": "<user_id>", "createdAt": "2026-01-09T13:02:10.000Z", "updatedAt": "2026-01-20T08:15:31.000Z" } ], "searchAfter": ["1735689600000"]}| Field | Type | Description |
|---|---|---|
total |
number | Total matches, ignoring paging. |
count |
number | How many workflows this response holds. |
offset |
number | The offset this page started at. Missing when you page with searchAfter. |
workflows |
array | The matching workflows. |
searchAfter |
array of strings | The cursor for the next page. Missing on the last page. |
Each workflow in workflows has these fields:
| Field | Type | Description |
|---|---|---|
id |
string | The workflow ID. |
name |
string | The workflow’s name. |
description |
string or null | Always null. |
status |
string | The workflow’s status, for example draft or published. |
folderId |
string or null | The folder the workflow is in, or null at the root. |
workflowType |
string | Set only on some workflows built in the SMBcrm UI. Workflows created through the API don’t have one. |
updatedBy |
string | The user who last updated the workflow. |
createdAt |
string | When the workflow was created (ISO 8601). |
updatedAt |
string | When the workflow was last updated (ISO 8601). |
createdBy isn’t returned. You can’t filter or sort on description, createdBy, or
workflowType.
To get the next page, send the same body with the searchAfter value from the response.
Don’t send offset with it, because a request with both is rejected.
{ "filters": [ { "field": "name", "operator": "contains", "value": "welcome" }, { "field": "status", "operator": "eq", "value": "published" } ], "sort": [{ "field": "updatedAt", "direction": "desc" }], "limit": 2, "searchAfter": ["1735689600000"]}Build and edit a workflow
Section titled “Build and edit a workflow”A workflow is built from a definition: a JSON object holding its triggers, its steps (called
actions), and the edges that connect them. Create, validate, and update all take the same
definition shape, and reading a workflow gives it back in that shape. To build a new
workflow:
- Get step types to find the
typekeys and field names for the triggers and steps you want. - Write the definition.
- Validate it. Validation runs the same checks as a real save and
saves nothing. Fix whatever
errorsreports untilvalidistrue. - Create the workflow. It starts as a draft, and a definition that fails validation creates nothing.
- Publish it.
To change a workflow that already exists, see Update a definition.
The workflow definition
Section titled “The workflow definition”These are the top-level fields of a definition.
| Field | Type | Required | Description |
|---|---|---|---|
name |
string | Yes | The workflow’s name, up to 500 characters. |
source |
object | Yes | Where the definition came from. system (string, required) identifies your app. workflowId (string, optional) is your own ID for the workflow, which the API echoes back. |
triggers |
array | Yes | What enrolls contacts. It can be empty, because a workflow with no trigger can still be entered by another workflow or by the API, but the key must be present. |
actions |
array | Yes | The steps. It can be empty, but the key must be present. |
edges |
array | Yes | The connections between steps. It can be empty, but the key must be present. |
triggerRelation |
string | No | and or or. Returned when you read a definition. It’s ignored on write, and the workflow is always stored as or. |
settings |
object | No | Workflow-level settings. See Settings. |
folderName |
string | No | A single folder to put the workflow in. Can’t be combined with folderPath. |
folderPath |
array of strings | No | A folder path, outermost first, up to 10 levels. Can’t be combined with folderName. |
createFolderIfMissing |
boolean | No | Create the folder if it doesn’t exist. Requires folderName or folderPath. |
version |
number | See description | The workflow’s version counter. Leave it out when you create. Send back the value you read when you update, because an update without it is rejected with 422. It’s optional when you validate. |
version belongs to the system. It isn’t a format version and it doesn’t always go up by
one, so it can be a decimal. Echo it back and don’t calculate from it.
Triggers
Section titled “Triggers”| Field | Type | Required | Description |
|---|---|---|---|
type |
string | Yes | The trigger type key, for example contact_created. Get step types lists them. |
name |
string | No | The display name shown on the canvas. |
conditions |
array of objects | No | Filters for the trigger. The shape depends on type, so check it with validate. Get step types lists each trigger’s filters in triggerFilters. |
scheduleConfig |
object | No | For scheduler triggers only. stopAt (number) is when the schedule stops, in epoch milliseconds (UTC), and you leave it out for no end date. skipWeekends (boolean) skips runs that fall on a Saturday or Sunday. |
id |
string | No | The trigger ID, up to 200 characters. It’s assigned when you leave it out. Send back the ID you read to keep the trigger stable across updates. |
Triggers can also carry position, testResponse, metadata, workflowsTriggerType,
integrationAccountId, masterType, and targetActionId. The builder stores these. If you
read a definition and send it back, leave them as they came.
Actions
Section titled “Actions”| Field | Type | Required | Description |
|---|---|---|---|
id |
string | Yes | The step ID, up to 200 characters. Any non-empty string that is unique within the definition. Edges refer to a step by this ID. |
type |
string | Yes | The step type key, for example sms or add_contact_tag. |
name |
string | No | The display name shown on the canvas. |
attributes |
object | No | The step’s configuration. The shape depends on type. Get it from Get step types and check it with validate. |
container |
string | No | The ID of the container step this step is nested in, where the builder uses one. |
Steps can also carry position, metadata, workflowsActionType, and
isMarketplaceAction. These are set by the builder or by marketplace steps, so leave them as
they came.
A readable ID such as welcome-sms works. Any ID that isn’t a UUID is converted to one when
the workflow is saved, so a definition you read back carries the converted IDs, not the ones
you sent. Keep IDs the same across updates. A step keeps contacts that are already moving through
the workflow on their current step only while it keeps its ID.
| Field | Type | Required | Description |
|---|---|---|---|
from |
string | Yes | The ID of the step this edge leaves. |
to |
string | Yes | The ID of the step this edge arrives at. |
branch |
string | No | The branch label, for steps that fan out. On an if/else step it’s the id of one of the step’s declared branches, or no for the else lane. |
goto |
boolean | No | true marks the edge as a loop back to an earlier step. |
Settings
Section titled “Settings”| Field | Type | Description |
|---|---|---|
allowReEntry |
boolean | Let a contact enter the workflow more than once. |
allowMultipleOpportunities |
boolean | Allow multiple opportunities per contact. |
stopOnResponse |
boolean | Stop the workflow when the contact replies. |
isConversationsMarkAsRead |
boolean | Mark conversations as read automatically. |
timezone |
string | Whose timezone drives scheduling: account or contact. |
window |
object | The sending window. condition (string, required) says how the window is applied, for example wait or when. start (string, required) and end (string) are 24-hour HH:mm times. days is an array of the days of the week the window applies to, where 0 is Sunday. |
senderAddress |
object | The default sender details. The keys are from_name, from_email, and from_number, in snake case exactly as shown. |
Example definition
Section titled “Example definition”The examples below send this definition from a file named definition.json. It has one
trigger and two steps, and the edge runs from the first step to the second.
{ "name": "Welcome new contacts", "source": { "system": "my-app" }, "triggers": [ { "type": "contact_created", "name": "New contact" } ], "actions": [ { "id": "send-welcome-sms", "type": "sms", "name": "Send welcome SMS", "attributes": { "body": "Hi {{contact.first_name}}, thanks for getting in touch!" } }, { "id": "tag-as-welcomed", "type": "add_contact_tag", "name": "Tag as welcomed", "attributes": { "tags": ["welcomed"] } } ], "edges": [ { "from": "send-welcome-sms", "to": "tag-as-welcomed" } ], "settings": { "allowReEntry": false, "stopOnResponse": true, "timezone": "account" }, "folderName": "Sales", "createFolderIfMissing": true}Get step types
Section titled “Get step types”Use this to build a definition against real type keys and field names before you save it.
Every entry carries its full field schema, including the assetReferences that show which
fields must hold the IDs of assets that already exist.
| Query param | Type | Required | Description |
|---|---|---|---|
locationId |
string | Yes | The account (location) whose step types to return. |
types |
string | No | Comma-separated step type filters, up to 50 terms. Each term matches any step type whose key contains it, so email returns send_email as well as email. Only the key is matched, not the name or description. A term that matches nothing is listed in notFound. |
kind |
string | No | action or trigger. |
query |
string | No | A free-text match over the type, name, and description. It’s broader than types, and it’s ignored when you send types. |
limit |
number | No | Page size. Defaults to 20, because every entry carries its full field schema. |
skip |
number | No | How many results to skip before the page starts. Defaults to 0. |
curl "https://services.smbcrm.com/workflows/step-types?locationId=<location_id>&types=add_contact_tag" \ -H "Authorization: Bearer <token>" \ -H "Version: v3"{ "locationId": "<location_id>", "total": 1, "count": 1, "skip": 0, "stepTypes": [ { "kind": "action", "type": "add_contact_tag", "name": "Add Contact Tag", "description": "Adds one or more tags to the contact", "category": "Contact", "provider": "native", "fields": [ { "field": "tags", "fieldType": "array", "required": true, "itemsType": "string", "title": "Tags" } ] } ], "notFound": [], "warnings": []}| Field | Type | Description |
|---|---|---|
locationId |
string | The account the catalog was scoped to. |
total |
number | Total matching step types before paging. |
count |
number | How many step types this response holds. |
skip |
number | The skip this page started at. |
stepTypes |
array | The step types. |
notFound |
array | One entry for each types term that matched no step type key, with the unmatched term in its type field. |
warnings |
array | Non-blocking findings, each with a path, a message, and the step type. |
Each step type in stepTypes has these fields:
| Field | Type | Description |
|---|---|---|
kind |
string | action or trigger. |
type |
string | The type key to use in a definition. |
name |
string | The display name. |
description |
string | What the step does. |
category |
string | The grouping shown in the builder. |
provider |
string | Whether the step is native or comes from a marketplace app. |
fields |
array | The step’s configurable fields. See the table below. |
assetReferences |
array | The assets the step refers to. Each entry has a path, which is where the ID goes in the definition, and an assetType, which is the kind of asset the ID must refer to. |
triggerFilters |
object | Triggers only. definitions lists the configurable filters, each with its field, label, fieldType, required, allowed operators, and valueSource. When filtersComplete is false, or a marketplace trigger has feedNormalization set to incomplete, the list is partial. incompleteFields names filters that can’t be authored. |
Each entry in fields has these fields:
| Field | Type | Description |
|---|---|---|
field |
string | The attribute name to use inside attributes. |
fieldType |
string | The value type. |
required |
boolean | Whether the step won’t save without it. |
requiredEnforcement |
string | Present only as builder-only. See below. |
itemsType |
string | The element type when fieldType is array. |
title |
string | The label shown in the builder. |
helpText |
string | Guidance shown next to the field in the builder. |
options |
array | The allowed values, when they are constrained. |
assetType |
string | Set when the field must hold the ID of an existing asset of this type. |
hasDynamicOptions |
boolean | true when valid values must be looked up and can’t be hard-coded. |
A field marked requiredEnforcement: "builder-only" is required by the builder, but
validation and saving don’t reject a definition that leaves it out. A successful validate or
save doesn’t prove the field was there. The builder generates these values, and they may
belong in __customInputFields__ instead of under the field name.
Validate a definition
Section titled “Validate a definition”Validation runs the full save pipeline against a definition and reports what a real save would do. Nothing is saved. Run it before create and update, and again whenever the definition changes.
The request body is a definition, with one extra optional field:
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
locationId |
query | string | Yes | The account (location) the workflow belongs to. |
workflowId |
body | string | No | Validate the definition as an update of this workflow instead of as a create. Returns 404 if the workflow doesn’t exist. |
The name, source, triggers, actions, and edges fields are required, as for create.
version is optional here, because a definition that hasn’t been created yet has no counter.
curl -X POST "https://services.smbcrm.com/workflows/definition/validate?locationId=<location_id>" \ -H "Authorization: Bearer <token>" \ -H "Version: v3" \ -H "Content-Type: application/json" \ -d @definition.jsonA definition that would save returns valid: true:
{ "valid": true, "errors": [], "warnings": []}A definition that would be rejected still returns 200, with valid: false. This one is
missing the body of the SMS step:
{ "valid": false, "errors": [ { "code": "MISSING_REQUIRED_FIELDS", "message": "Body is required", "path": "definition.actions[0].attributes.body", "stage": "schema", "context": { "stepId": "<step_id>", "stepName": "Send welcome SMS", "stepType": "sms" } } ], "warnings": []}Anything in errors blocks the save, and anything in warnings doesn’t. A 4xx status means
the request itself was malformed.
| Field | Type | Description |
|---|---|---|
valid |
boolean | Whether this exact body would save right now. |
errors |
array | Blocking findings. |
warnings |
array | Non-blocking findings. |
Each entry in errors has these fields:
| Field | Type | Description |
|---|---|---|
code |
string | A stable error code you can branch on. |
message |
string | A readable explanation. |
path |
string | Where in the definition the problem is. |
stage |
string | Which validation phase found it. |
context |
object | The step or asset the finding relates to. |
Each entry in warnings has a path, a message, and the step type it relates to. For
example, Step has no incoming edges and may be unreachable. is reported at actions[4].
Create a workflow
Section titled “Create a workflow”Send a definition as the request body. The definition is checked
in full before anything is saved, so a rejected request creates nothing. A new workflow is
always created as a draft. Publish it when it’s ready.
Leave version out. The system assigns the starting value.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
locationId |
query | string | Yes | The account (location) to create the workflow in. |
curl -X POST "https://services.smbcrm.com/workflows/?locationId=<location_id>" \ -H "Authorization: Bearer <token>" \ -H "Version: v3" \ -H "Content-Type: application/json" \ -d @definition.json{ "workflowId": "<workflow_id>", "status": "draft", "definition": { "version": 3, "name": "Welcome new contacts", "source": { "system": "my-app" }, "triggers": [ { "id": "<trigger_id>", "type": "contact_created", "name": "New contact" } ], "actions": [ { "id": "<sms_step_id>", "type": "sms", "name": "Send welcome SMS", "attributes": { "body": "Hi {{contact.first_name}}, thanks for getting in touch!" } }, { "id": "<tag_step_id>", "type": "add_contact_tag", "name": "Tag as welcomed", "attributes": { "tags": ["welcomed"] } } ], "edges": [ { "from": "<sms_step_id>", "to": "<tag_step_id>" } ] }, "warnings": []}| Field | Type | Description |
|---|---|---|
workflowId |
string | The ID of the new workflow. |
status |
string | Always draft. Missing only if the workflow was created but couldn’t be read back. |
definition |
object | The created workflow, in the shape that Read a definition returns and Update a definition accepts, so an update doesn’t need a separate read. Missing only if the workflow couldn’t be read back. |
warnings |
array | Non-blocking findings, each with a path, a message, and the step type. |
The version in the response isn’t 1, because creating a workflow saves it several times.
The step IDs in definition are the converted UUIDs, not the readable IDs you sent.
If the definition is rejected, the 422 response has an errors array in the same shape as
Validate a definition. Use path and context to find the step to
fix.
Read a definition
Section titled “Read a definition”The definition object comes back in the shape Update a definition
accepts, so you can read it, change it, and send it back.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
workflowId |
path | string | Yes | The workflow to read. |
locationId |
query | string | Yes | The account (location) the workflow belongs to. |
curl "https://services.smbcrm.com/workflows/<workflow_id>/definition?locationId=<location_id>" \ -H "Authorization: Bearer <token>" \ -H "Version: v3"To edit the definition, save it to a file. This command uses jq to keep only the
definition object:
curl "https://services.smbcrm.com/workflows/<workflow_id>/definition?locationId=<location_id>" \ -H "Authorization: Bearer <token>" \ -H "Version: v3" | jq .definition > definition.json| Field | Type | Description |
|---|---|---|
workflowId |
string | The workflow ID. |
status |
string | draft or published. This is read-only here. Change it with Publish or unpublish a workflow. It sits outside definition because the definition is sent back as it is. |
definition |
object | The definition, with the same fields as the create example. Fields that the builder stores, such as a trigger’s or step’s canvas position (an object with x and y), come back too. |
warnings |
array | Non-blocking findings, each with a path, a message, and the step type. |
definition.version is the workflow’s own counter. Leave it as it comes back. Sending it
unchanged on update is what stops an update from silently overwriting a change someone made
in the builder in the meantime. A workflow ID that doesn’t exist in the account returns 404.
Update a definition
Section titled “Update a definition”This replaces the whole definition. Any step missing from the request is deleted, so read the current definition first and send it back with your changes.
Two rules apply:
- The workflow must be a draft. A published workflow returns
409, because the overwrite would replace steps under contacts that are moving through it. versionmust be current. It’s required on update. A staleversionis rejected with422and nothing is written.
Changing the status advances version, so read the definition after you set the workflow to
draft, not before:
- Set the workflow to
draft, if it’s published. This step and step 6 need theworkflows.publishscope. - Read the definition.
- Change what you need, and keep
versionand the step IDs as they came. - Validate it. Send the workflow’s
workflowIdto check the definition as an update. - Send the whole definition to this endpoint.
- Publish again.
The request body is a definition. name, source, triggers, actions, edges, and
version are required.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
workflowId |
path | string | Yes | The workflow to update. |
locationId |
query | string | Yes | The account (location) the workflow belongs to. |
curl -X PUT "https://services.smbcrm.com/workflows/<workflow_id>/definition?locationId=<location_id>" \ -H "Authorization: Bearer <token>" \ -H "Version: v3" \ -H "Content-Type: application/json" \ -d @definition.jsonA successful update returns 200 OK with the same fields as the
create response: workflowId, status, the updated definition, and
warnings. definition.version has advanced, so send that value on your next edit and skip
the extra read.
| Status | Meaning |
|---|---|
404 |
No workflow with that ID in the account. |
409 |
The workflow is published, so set it to draft first. It also returns 409 if the workflow was deleted while the update was in flight. |
422 |
The definition was rejected, or version is stale. Read the definition again and retry. |
Publish or unpublish a workflow
Section titled “Publish or unpublish a workflow”Publishing checks the whole definition and activates the triggers. A definition that fails
that check returns 422, and the workflow stays as it was. Sending a workflow back to draft
is how you make it editable again.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
workflowId |
path | string | Yes | The workflow to change. |
locationId |
query | string | Yes | The account (location) the workflow belongs to. |
status |
body | string | Yes | The status to move to: published or draft. |
curl -X PUT "https://services.smbcrm.com/workflows/<workflow_id>/status?locationId=<location_id>" \ -H "Authorization: Bearer <token>" \ -H "Version: v3" \ -H "Content-Type: application/json" \ -d '{ "status": "published" }'{ "workflowId": "<workflow_id>", "status": "published"}status in the response is the status the workflow has now.
| Status | Meaning |
|---|---|
404 |
No workflow with that ID in the account. |
409 |
The workflow is locked or scheduled-paused. Neither can change status. |
422 |
Publishing failed validation, and the workflow is unchanged. |
Contacts already in a workflow when you send it back to draft show
paused_due_to_draft_mode in the run logs.
Enroll a contact in a workflow
Section titled “Enroll a contact in a workflow”Once you have a workflow’s id, add a contact to it with this endpoint (it’s also listed on
the Contacts page):
Send a JSON body with the request. The body can be an empty object.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
contactId |
path | string | Yes | The contact to enroll. |
workflowId |
path | string | Yes | The workflow to enroll the contact in. |
eventStartTime |
body | string | No | Start time of the workflow event, in ISO 8601 format. |
curl -X POST https://services.smbcrm.com/contacts/<contact_id>/workflow/<workflow_id> \ -H "Authorization: Bearer <token>" \ -H "Version: v3" \ -H "Content-Type: application/json" \ -d '{}'To pass an event time, include eventStartTime in the body:
curl -X POST https://services.smbcrm.com/contacts/<contact_id>/workflow/<workflow_id> \ -H "Authorization: Bearer <token>" \ -H "Version: v3" \ -H "Content-Type: application/json" \ -d '{ "eventStartTime": "2026-10-09T09:30:00-05:00" }'{ "succeeded": true }The response can also include succeded, a legacy misspelling of succeeded. It’s
deprecated, so read succeeded. Failed requests return 400, 401, or 422; see
Errors.
Remove a contact from a workflow
Section titled “Remove a contact from a workflow”This endpoint takes the same path parameters, request body, and response as enrolling a contact. Send a JSON body with the request; it can be an empty object.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
contactId |
path | string | Yes | The contact to remove. |
workflowId |
path | string | Yes | The workflow to remove the contact from. |
eventStartTime |
body | string | No | Start time of the workflow event, in ISO 8601 format. |
curl -X DELETE https://services.smbcrm.com/contacts/<contact_id>/workflow/<workflow_id> \ -H "Authorization: Bearer <token>" \ -H "Version: v3" \ -H "Content-Type: application/json" \ -d '{}'{ "succeeded": true }Read run logs
Section titled “Read run logs”Run logs record what a workflow did, one record for each step of each run. Two endpoints cover them. List log records answers who and what: who entered, what happened to a contact, and which steps failed for whom. Count log records answers how many: enrollments, completions, failures per step, why contacts left, and trends over time.
Logs are available for the last 60 days. Both endpoints take the workflowId from
Search workflows, never a workflow name.
List log records
Section titled “List log records”Each record is one step of one run, for one contact or record, with its outcome and timing.
To see what each step is, read the definition. Its actions[].id
matches stepId in the logs.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
workflowId |
path | string | Yes | The workflow whose logs to read. |
locationId |
query | string | Yes | The account (location). It must be the account the token belongs to, or the request returns 403. |
limit |
query | number | No | Records per page, from 1 to 100. Defaults to 15. |
action |
query | string | No | first (the default) returns the newest page, which can start with steps that are still running. next returns the next, older page and requires referenceId and referenceCreatedAt. |
referenceId |
query | string | With next |
nextCursor.referenceId from the previous response. |
referenceCreatedAt |
query | string | With next |
nextCursor.referenceCreatedAt from the previous response, sent unchanged. |
types |
query | array of strings | No | Only steps of this type: a step type key from Get step types or from actions[].type in the definition, for example email. Send one type per call. drip also matches drip_queued and drip_resume, and if_else also matches condition. |
statuses |
query | array of strings | No | Only steps with these outcomes. Repeat the parameter or send a comma-separated list. See Log statuses. |
startDate |
query | string | No | The start of the range, in ISO 8601. A plain date is the start of that day in UTC. Send it with endDate. Defaults to 30 days ago, and can’t be earlier than 60 days ago. |
endDate |
query | string | No | The end of the range, in ISO 8601. A plain date includes the whole day. It can be at most 30 days after startDate. Defaults to now. |
contactId |
query | string | No | Only logs for this contact. |
executionId |
query | string | No | Only the steps of one run of the workflow for one contact or record. Use the workflowStatusId of any record from that run. |
recordId |
query | string | No | Only logs for one record, in workflows that run on records (opportunities, custom objects, and so on) instead of contacts. Send it with recordType. |
recordType |
query | string | No | The object type of recordId: contact, opportunity, task, business, inbound_webhook, or custom_objects.<object key> for a custom object, for example custom_objects.cars. |
Common requests:
| To find | Send |
|---|---|
| Who entered the workflow | statuses=added_to_workflow |
| Which steps failed, and for whom | statuses=error,failed,failed_retry_limit_reached |
| What happened to one contact | contactId=<contact_id> |
| Every step of one run | executionId=<execution_id>, using the workflowStatusId of any record from that run |
curl "https://services.smbcrm.com/workflows/<workflow_id>/logs?locationId=<location_id>&statuses=error,failed,failed_retry_limit_reached" \ -H "Authorization: Bearer <token>" \ -H "Version: v3"{ "count": 1, "nextCursor": null, "logs": [ { "id": "<log_id>", "locationId": "<location_id>", "workflowId": "<workflow_id>", "contactId": "<contact_id>", "workflowStatusId": "<execution_id>", "stepId": "<step_id>", "stepName": "Send email", "type": "email", "status": "error", "contactName": "Alex Doe", "contactEmail": "alex@example.com", "meta": { "msg": "Unable to send e-mail, contact's e-mail is invalid" }, "createdAt": "2026-09-25T10:00:00.000Z" } ]}An empty logs list means nothing matched in that window. A workflowId that doesn’t exist
in the account, or that is a folder, returns 404.
Paging and dates
Section titled “Paging and dates”A page holds at most 100 records, and 15 by default. When nextCursor isn’t null, get the
next, older page by sending action=next with the referenceId and referenceCreatedAt
from nextCursor, unchanged, and the same filters and dates:
curl "https://services.smbcrm.com/workflows/<workflow_id>/logs?locationId=<location_id>&statuses=error,failed,failed_retry_limit_reached&action=next&referenceId=<reference_id>&referenceCreatedAt=<reference_created_at>" \ -H "Authorization: Bearer <token>" \ -H "Version: v3"nextCursor is null when there are no more records. A cursor that doesn’t match the
request returns 422. Send startDate and endDate together. Without them, you get the last
30 days. A long range can run past the query time limit and return 504. Resending the same
request usually times out again, so try a shorter range, such as 7 days.
Response fields
Section titled “Response fields”| Field | Type | Description |
|---|---|---|
count |
number | How many records this response holds. |
nextCursor |
object or null | Where the next page starts, as referenceId and referenceCreatedAt. null when there are no more records. |
logs |
array | The records, newest first. |
Each record in logs has these fields:
| Field | Type | Description |
|---|---|---|
id |
string | The ID of this log record. |
locationId |
string | The account (location) that owns the workflow. |
workflowId |
string | The workflow that produced the record. |
contactId |
string | The contact the step ran for. An empty string when the step didn’t run for a contact. |
workflowStatusId |
string | The execution ID. Every step of one run shares it. Send it as executionId to read that run only. |
stepId |
string or null | The step ID. It matches actions[].id in the definition. |
stepName |
string | The step’s name as shown in the builder when the step ran. |
type |
string | The step type key. It matches the key that Get step types and the definition use, with exceptions. If/else steps are logged as condition, wait steps as wait_time, wait_reply, and similar, and drip steps as drip, drip_queued, or drip_resume. Some records aren’t steps, such as added_to_workflow when a contact enters and remove_from_workflow when a contact leaves. |
status |
string | The step’s outcome. See Log statuses. |
recordId |
string or null | The record the step ran for, in workflows that run on records. null otherwise. |
recordType |
string or null | The object type of recordId. |
recordPrimaryProperty |
string or null | The display name of the record. |
contactName |
string or null | The contact’s name when the step ran. |
contactEmail |
string or null | The contact’s email when the step ran. |
meta |
object | Step details. See below. |
createdAt |
string | When the step was logged. |
On if/else steps where attributes.version is 2, stepId is the ID of the branch that was
taken, not the ID of the if/else step, and stepName is that branch’s name. To find the
branch in the definition, match stepName to the step’s attributes.branches[].name, or to
attributes.noneBranchName when no branch matched.
meta says how the contact entered, why a step was skipped or failed, what a step did,
whether a wait timed out, and why the contact left. A key is left out when it doesn’t apply.
meta key |
Type | Description |
|---|---|---|
addedSource |
object | How the contact entered the workflow. source is how, for example trigger, bulk_action, or workflow. sourceName is the name of what added the contact, such as the trigger name. id is the ID of what added the contact: the trigger ID for trigger (triggers[].id in the definition), the bulk action ID for bulk_action, or the ID of the workflow that added the contact for workflow. |
skippedFor |
object | On skipped steps. msg says why the step was skipped. |
msg |
string | Information about the step. On most failed steps, it’s the error text. |
data |
object | The step’s result. msg says what the step did, and on some failed steps, such as webhooks, it’s the error text. |
waitMeta |
object | On wait steps. isTimedOut is true when the wait ended because it timed out. |
removedFrom |
object | When the contact left the workflow. type is why. It uses the same values as Removal reasons and can be empty. |
New fields, new meta keys, and new values of status, type, and recordType can appear
at any time. Ignore fields you don’t know, and give an unknown value a catch-all case.
Log statuses
Section titled “Log statuses”| Status | Meaning |
|---|---|
added_to_workflow |
The contact entered the workflow. |
success |
The step ran. |
error, failed |
The step didn’t complete. |
failed_retry_limit_reached |
The step gave up after its retries. |
retry |
The step will run again. |
skipped |
The step didn’t run, for example because of DND, a time window, or missing data. |
waiting |
The contact is waiting at the step. |
wait_finished |
A wait ended. |
finished |
The contact left the workflow. See meta.removedFrom. |
paused_due_to_draft_mode |
The workflow was unpublished while the contact was in it. |
contact_merged |
The contact was merged into another contact. |
drip_queued |
The contact is waiting in a drip step for its batch. |
drip_resume |
The batch was released and the contact moved on. |
processing |
The step has started and hasn’t finished yet. |
winner_declared |
An A/B test step picked its winning path. The record has no contact. |
To catch every kind of failure, send error, failed, and failed_retry_limit_reached.
Count log records
Section titled “Count log records”Each row of the result holds one value for every dimension in groupBy, plus a count. To
see who the records are about, use List log records.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
workflowId |
path | string | Yes | The workflow to count logs for. |
locationId |
query | string | Yes | The account (location). It must be the account the token belongs to, or the request returns 403. |
startDate |
query | string | No | The start of the range, in ISO 8601. A plain date is the start of that day in UTC. Send it with endDate. Defaults to 30 days ago, and can’t be earlier than 60 days ago. |
endDate |
query | string | No | The end of the range, in ISO 8601. A plain date includes the whole day. It can be at most 30 days after startDate. Defaults to now. |
groupBy |
query | array of strings | No | The dimensions to group by: status (the step outcome), type (the step type), stepId, removedReason (why the contact left), and at most one of week, day, or hour (a time bucket). Repeat the parameter or send a comma-separated list. Defaults to status. |
statuses |
query | array of strings | No | Count only these step outcomes. The values are the Log statuses. |
types |
query | array of strings | No | Count only these step types. Unlike List log records, if_else and drip match only those exact keys here. |
removedReasons |
query | array of strings | No | Count only records removed for these reasons. See Removal reasons. |
timezone |
query | string | No | The IANA timezone for the week, day, and hour buckets, for example America/New_York. startDate and endDate stay in UTC. Defaults to UTC. |
limit |
query | number | No | The maximum number of grouped rows. A grouping that produces more is refused with 422 instead of being cut short, because a cut-short count reports wrong totals. Defaults to 1000, and the maximum is 5000. |
To find the values a workflow has, group by that dimension first, and then filter on what you
see. For example, groupBy=removedReason lists the reasons present, and those values work
in removedReasons.
Common requests:
| To count | Send |
|---|---|
| Enrollments | statuses=added_to_workflow |
| Completions | removedReasons=end_of_workflow. Divide by enrollments for a completion rate. |
| Failures per step | statuses=error,failed,failed_retry_limit_reached&groupBy=stepId |
| Why contacts left | types=remove_from_workflow&groupBy=removedReason |
| Contacts who replied and stopped the workflow | removedReasons=contact_reply_stop_response |
| Goals reached | types=workflow_goal&statuses=success |
| Enrollment trend | statuses=added_to_workflow&groupBy=week, or day |
To compare two periods, make the call twice with back-to-back windows of equal length.
Failures per step:
curl "https://services.smbcrm.com/workflows/<workflow_id>/logs/aggregate?locationId=<location_id>&statuses=error,failed,failed_retry_limit_reached&groupBy=stepId" \ -H "Authorization: Bearer <token>" \ -H "Version: v3"{ "count": 2, "statistics": [ { "stepId": "<email_step_id>", "stepName": "Send email", "count": 14 }, { "stepId": "<value_step_id>", "stepName": "Update Custom Value", "count": 3 } ]}Enrollments per week, with weeks bucketed in a timezone:
curl "https://services.smbcrm.com/workflows/<workflow_id>/logs/aggregate?locationId=<location_id>&statuses=added_to_workflow&groupBy=week&timezone=America/New_York" \ -H "Authorization: Bearer <token>" \ -H "Version: v3"{ "count": 2, "statistics": [ { "bucket": "2026-09-28", "count": 41 }, { "bucket": "2026-10-05", "count": 37 } ]}Rows are sorted by their grouped values in ascending order (status, then type, stepId,
removedReason, and bucket), not by count.
| Field | Type | Description |
|---|---|---|
count |
number | How many rows this response holds. |
statistics |
array | The grouped counts. |
Each row in statistics has count, the number of log records in the group, plus one field
for each dimension in groupBy:
| Field | Type | Present when grouping by | Description |
|---|---|---|---|
status |
string | status |
The step outcome. |
type |
string | type |
The step type. |
stepId |
string | stepId |
The step ID. It matches actions[].id in the definition. Enrollment rows use added_to_workflow or add_to_workflow, and removals with no current step, for example after the contact was deleted, have an empty string. For an if/else step with "version": 2, it’s the branch that was taken, as in the logs. |
stepName |
string | stepId |
The step’s name on its most recent log record in the date range. |
removedReason |
string or null | removedReason |
Why the contact left the workflow. null when no reason is recorded, which includes every record that isn’t a removal. |
bucket |
string | week, day, or hour |
The start of the time bucket in the requested timezone. It’s YYYY-MM-DD for a week, and weeks start on Monday. It’s YYYY-MM-DD HH:mm:ss for a day or an hour. |
A step’s count includes the remove_from_workflow record written when a contact leaves the
workflow at that step. To count how often the step itself ran, group by stepId and type
together.
Completions in a window can include contacts who enrolled before it, so a completion rate can
go over 100%. With fewer than about 30 enrollments, rates swing widely. A count of zero means
nothing matched. A workflowId that doesn’t exist in the account returns 404. A long range
or a grouping with many dimensions can run past the query time limit and return 504. Narrow
the range or group by fewer dimensions. removedReason is the slowest dimension.
Removal reasons
Section titled “Removal reasons”| Reason | Meaning |
|---|---|
end_of_workflow |
The contact reached the end. |
contact_deleted |
The contact was deleted. |
deleted_workflow |
The workflow was deleted. |
record_deleted |
The record was deleted. |
goal_action |
A goal step removed the contact. |
contact_reply_stop_response |
The contact replied and the workflow stops on reply. |
contact_merge |
The contact was merged. |
appointment-change, invoice-change, service-booking-change |
The appointment, invoice, or booking changed, and the workflow restarted for the contact. |
attendee-change |
The Events attendee or their event changed, and the run for that attendee ended. |
rental-booking-change |
The rental booking that started the workflow was deleted or cancelled. |
wait_step_window_in_past |
A wait step’s time window pointed to a time in the past, so the contact left. |
missing-data |
The step the contact was on was deleted from the workflow. |
Values are exact, including the ones with hyphens. New values can appear at any time, so give an unknown value a catch-all case.
Delete a workflow
Section titled “Delete a workflow”Deleting a workflow also ends every enrollment in progress. Contacts that are moving through the workflow stop where they are. Treat it as permanent.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
workflowId |
path | string | Yes | The workflow to delete. |
locationId |
query | string | Yes | The account (location) the workflow belongs to. |
curl -X DELETE "https://services.smbcrm.com/workflows/<workflow_id>?locationId=<location_id>" \ -H "Authorization: Bearer <token>" \ -H "Version: v3"{ "succeeded": true, "workflowId": "<workflow_id>"}| Field | Type | Description |
|---|---|---|
succeeded |
boolean | Whether the workflow was deleted. |
workflowId |
string | The ID of the deleted workflow. |
A workflow ID that doesn’t exist in the account returns 404.
