readyDocs Open the appOpen the app

Automation runs and stats

What your automations did: each run step by step, counts per step, who is waiting where, every fire, and how replies were sorted. Every route here needs the manage_campaigns permission unless it says otherwise. Test keys can read, but any change is refused with 403 test_key_not_allowed.

#Runs

#List an automation’s runs

Its runs, newest first. A run is one contact going through it once.

Parameters

idinteger, pathRequired
The automation id.
limitinteger, query
How many, up to 100. Default 50.
Returns
data.runsobject[]
Each run: run_key, started_at, status (succeeded, failed, waiting or stopped), duration_ms, step_count, contact (id, name, phone) and failed_step (node_id, type, error; null when nothing failed).
Errors
HTTPCodeWhen
404AUTOMATION_NOT_FOUNDNo automation with this id on your account.
500RUNS_LOAD_FAILEDRetry.

#Get one run

One run with every step in order.

Parameters

idinteger, pathRequired
The automation id.
runKeystring, pathRequired
The run’s run_key: 16 characters, 0 to 9 and a to f.
Returns
data.runobject
The run, as in the list.
data.stepsobject[]
Each step: id, seq, node_id, type, status (succeeded, failed, skipped, waiting or stopped), started_at, duration_ms, input, output, error (a plain sentence, or null), resumed and can_resume.
Errors
HTTPCodeWhen
404AUTOMATION_NOT_FOUNDNo automation with this id on your account.
404RUN_NOT_FOUNDNo such run in its history.
500RUN_LOAD_FAILEDRetry.

#Resume a run from a failed step

Runs the automation again for that contact from the failed step, using the steps as saved now. Only offered where nothing can happen twice: the step’s can_resume is true when it failed without doing anything (or is safe to repeat), every step before it succeeded, the automation is on, the contact isn’t waiting in it, and the step hasn’t changed since. Steps the run already passed are skipped. The rest run like any run: a text step goes through the usual opt-out and quiet hours checks and costs your per-segment rate. Each step can be resumed once. Returns { "resumed": true } in data.

Parameters

idinteger, pathRequired
The automation id.
runKeystring, pathRequired
The run’s run_key.
stepIdinteger, pathRequired
The failed step’s id from Get one run.
Errors
HTTPCodeWhen
402BILLING_PAST_DUEThe account is past due.
404AUTOMATION_NOT_FOUNDNo automation with this id on your account.
404RUN_NOT_FOUNDNo such run or step.
409RESUME_NOT_SAFEThis step can’t be resumed. Nothing ran. When the automation is off, the message says to turn it on first; when the contact is still waiting in it, to resume after their run ends.
409RESUME_TAKENIt was already resumed. Read the run to see what happened.
500RESUME_FAILEDIt didn’t finish. error says whether any step ran; read the run before you retry.

#Stats

The stats routes take from and to (ISO 8601) in the query. to defaults to now and is never later than now; from defaults to 90 days before to and goes back at most 400 days. Each answer repeats the from and to it used. partial: true means a read took too long and some counts are missing.

#Get stats per step

Counts for each step, keyed by its node id. A reply counts for the text it came after.

Returns
data.statsobject
Per node id: sent, replied and reply_rate (a whole percent) for text steps; ran and people for every step that ran; queued for texts held by quiet hours.
data.total_sentinteger
Texts sent.
data.total_raninteger
Step runs, plus queued texts.
data.has_databoolean
false when nothing happened in the window.
Errors
HTTPCodeWhen
404AUTOMATION_NOT_FOUNDNo automation with this id on your account.
500STEP_STATS_LOAD_FAILEDRetry.

#Get detailed stats

An overview of the whole automation, or one step’s detail with node.

Parameters

nodestring, query
A step’s node id.
Returns
dataobject
Overview: entered, sent, replied, interested, not_interested, other_replies, opted_out, a daily series, and capped with cap when there were too many texts to count them all. With node: also ran, people, delivered, failed, delivery_rate, reply_rate, segments, cost, top_replies and recent.
costnumber | null
What this step’s texts cost, in US dollars to 2 places. null when the texts don’t carry their cost (most sends are billed through your balance history instead); it never means free.
Errors
HTTPCodeWhen
404AUTOMATION_NOT_FOUNDNo automation with this id on your account.
500STATS_LOAD_FAILEDRetry in a moment.

#See who is waiting at each step

Contacts waiting in the automation right now, by the step they will run next. Takes no time window.

Returns
data.countsobject
Contacts waiting, per node id.
data.contactsobject
Per node id, up to the first 200 contacts, the soonest wait end first: contact_id, name, phone, email and next_at, when the wait ends. data.counts has the full number.
data.totalinteger
All contacts waiting. names_unavailable: true means the names couldn’t be read this time.
Errors
HTTPCodeWhen
404AUTOMATION_NOT_FOUNDNo automation with this id on your account.
500STEP_WAITS_LOAD_FAILEDRetry.

#List lead activity

Every time an automation fired, newest first, with the contact, the text that started it and the webhook addresses it posts to, so you can match it against your CRM.

Parameters

daysinteger, query
How far back, 1 to 90. Default 7.
limitinteger, query
Up to 500. Default 100.
offsetinteger, query
How many to skip.
rule_idinteger, query
Only this automation.
intentstring, query
Only fires with this reply intent.
campaignstring, query
Only fires from replies to one campaign, as blast:<id>, or one drip campaign, as drip:<id>.
Returns
data.filtersobject
The filters used.
data.countinteger
Fires in this page.
data.firesobject[]
Each with fire_id, fired_at, rule_id, rule_name, intent, intent_confidence, action_count, step_failures, webhook_urls, contact (id, first_name, last_name, phone, email, company_name, tags), message (id, body, from_number, to_number) and source_key.
Errors
HTTPCodeWhen
500FIRES_LOAD_FAILEDRetry.

#Reply sorting

Reply sorting labels each reply positive, negative or other, so automations with the Inbound intent trigger know which way a contact answered. To turn reply sorting on or off, describe your business or fix a label, see AI reply sorting.

#List how an automation’s replies were sorted

Replies from the last 30 days by contacts this automation fired for, newest first.

Parameters

limitinteger, query
Up to 100. Default 50.
Returns
data.repliesobject[]
Each with message_id, contact (id, first_name, last_name, phone), body (up to 300 characters), intent, sorted_as (positive, negative or other), corrected_label (your fix, or null) and created_at.
Errors
HTTPCodeWhen
404AUTOMATION_NOT_FOUNDNo automation with this id on your account.
500SORTED_REPLIES_LOAD_FAILEDRetry.