Skip to content

List automation runs

GET
https://api.getsitecontrol.com/v1/sites/{site_id}/automations/{automation_id}/runs
curl --request GET \
--url 'https://api.getsitecontrol.com/v1/sites/1/automations/1/runs?limit=50&order=oldest' \
--header 'Authorization: Bearer <token>'

Runs of the automation by id, oldest first; order=newest gives the latest first. A run is one pass of a contact through the automation, with its status, its error and the steps it went through. Call it to find out what happened to a contact in the automation (contact_id) or why runs failed (status=failed). Counts by status are in get_automation_stats.

Events waiting to be picked up are not runs yet and are not listed, so queued here can be lower than in the statistics. Runs of contacts deleted since are not listed, and a step removed from the automation since is left out of steps. run_start:<id> in list_contact_activity is the run id, and its source_id is the automation.

FieldDescription
site_id
required
Site Id
integer
automation_id
required
Automation Id

Automation id from list_automations

integer

Automation id from list_automations

FieldDescription
contact_id
Contact Id

Only runs of this contact, id from list_contacts

integer
>= 1

Only runs of this contact, id from list_contacts

status

Only runs in this status

string
Allowed values: queued ongoing done ineligible failed

Only runs in this status

started_since
Started Since

Only runs started at or after this moment; without an offset, taken as UTC; a plain date means its start

string format: date-time

Only runs started at or after this moment; without an offset, taken as UTC; a plain date means its start

cursor
Cursor

next_cursor of the previous page, sent with the same order; omit for the first

string

next_cursor of the previous page, sent with the same order; omit for the first

limit
Limit

Items per page

integer
default: 50 >= 1 <= 100

Items per page

fields
Fields

Comma-separated fields to keep in each item, for example id,name; each item then carries only those fields and id. Omit for every field

string

Comma-separated fields to keep in each item, for example id,name; each item then carries only those fields and id. Omit for every field

order

Order of the items: oldest first (default) or newest first; asc and desc mean the same

string
Allowed values: oldest newest

Order of the items: oldest first (default) or newest first; asc and desc mean the same

Successful Response

Media typeapplication/json
AutomationRunPage

One page of a list; next_cursor is null on the last page.

object
FieldDescription
items
required
Items
Array<object>
AutomationRun
object
FieldDescription
id
required
Id

The run; run_start:<id> in list_contact_activity is this id

integer
status
required
AutomationRunStatus

Queued: waits to start. ongoing: running, waiting in a delay step or on hold. done: finished. ineligible: finished by being skipped. failed: finished with an error.

string
Allowed values: queued ongoing done ineligible failed
contact_id
Contact Id

The contact the run is for; read it with get_contact

integer
nullable
trigger_type

What started the run; null when not recorded

string
Allowed values: widget_submit manual email_click webhook segment_join shopify_order_paid shopify_order_fulfilled shopify_checkout_abandoned shopify_customer_winback shopify_customer_subscribed other
started_at
Started At
string format: date-time
nullable
completed_at
Completed At

Null until the run finishes

string format: date-time
nullable
error
Error

Why the run failed, as the admin says it, e.g. Email not delivered (unsubscribed); null unless status is failed

string
nullable
steps
required
Steps

Steps the run went through, in order

Array<object>
AutomationRunStep
object
FieldDescription
type
required
AutomationStepType

A step; send_email, add_tags, remove_tags and delay do what they are named for. New values may be added.

start_automation: starts another automation for the contact. condition: the entry condition, in runs only. other: a step the dashboard does not offer.

string
Allowed values: send_email add_tags remove_tags delay start_automation condition other
status
required
AutomationRunStatus

Queued: waits to start. ongoing: running, waiting in a delay step or on hold. done: finished. ineligible: finished by being skipped. failed: finished with an error.

string
Allowed values: queued ongoing done ineligible failed
started_at
required
Started At
string format: date-time
completed_at
Completed At

Null while the step goes on

string format: date-time
nullable
error
Error

Why the step failed, as the admin says it; null otherwise

string
nullable
next_cursor
Next Cursor
string
nullable

Example

{
"items": [
{
"status": "queued",
"trigger_type": "widget_submit",
"steps": [
{
"type": "send_email",
"status": "queued"
}
]
}
]
}
FieldDescription
GSC-Version
string

API version the response was produced for

X-Request-Id
string

Request id, echoed from the request when valid

X-RateLimit-Limit
integer

Limit of the tightest bucket

X-RateLimit-Remaining
integer

Requests left in its window

X-RateLimit-Reset
integer

End of its window, epoch seconds

Unsupported GSC-Version

Media typeapplication/problem+json
Problem

The documented shape of every error body on the versioned surface.

object
FieldDescription
type
required
Type
string
title
required
Title
string
status
required
Status
integer
detail
Detail
string
nullable
instance
required
Instance
string
reason
Reason
string
nullable
next
Next
string
nullable
request_id
required
Request Id
string
errors
Errors
Array<object>
nullable
ValidationIssue
object
FieldDescription
loc
required
Loc
Array
msg
required
Msg
string
type
required
Type
string
metadata
Metadata
object

Example · Generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"reason": "example",
"next": "example",
"request_id": "example",
"errors": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
],
"metadata": {}
}
FieldDescription
GSC-Version
string

API version the response was produced for

X-Request-Id
string

Request id, echoed from the request when valid

X-RateLimit-Limit
integer

Limit of the tightest bucket

X-RateLimit-Remaining
integer

Requests left in its window

X-RateLimit-Reset
integer

End of its window, epoch seconds

Missing or invalid API key or access token

Media typeapplication/problem+json
Problem

The documented shape of every error body on the versioned surface.

object
FieldDescription
type
required
Type
string
title
required
Title
string
status
required
Status
integer
detail
Detail
string
nullable
instance
required
Instance
string
reason
Reason
string
nullable
next
Next
string
nullable
request_id
required
Request Id
string
errors
Errors
Array<object>
nullable
ValidationIssue
object
FieldDescription
loc
required
Loc
Array
msg
required
Msg
string
type
required
Type
string
metadata
Metadata
object

Example · Generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"reason": "example",
"next": "example",
"request_id": "example",
"errors": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
],
"metadata": {}
}
FieldDescription
GSC-Version
string

API version the response was produced for

X-Request-Id
string

Request id, echoed from the request when valid

X-RateLimit-Limit
integer

Limit of the tightest bucket

X-RateLimit-Remaining
integer

Requests left in its window

X-RateLimit-Reset
integer

End of its window, epoch seconds

WWW-Authenticate
string

Authentication scheme: Bearer

Access denied

Media typeapplication/problem+json
Problem

The documented shape of every error body on the versioned surface.

object
FieldDescription
type
required
Type
string
title
required
Title
string
status
required
Status
integer
detail
Detail
string
nullable
instance
required
Instance
string
reason
Reason
string
nullable
next
Next
string
nullable
request_id
required
Request Id
string
errors
Errors
Array<object>
nullable
ValidationIssue
object
FieldDescription
loc
required
Loc
Array
msg
required
Msg
string
type
required
Type
string
metadata
Metadata
object

Example · Generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"reason": "example",
"next": "example",
"request_id": "example",
"errors": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
],
"metadata": {}
}
FieldDescription
GSC-Version
string

API version the response was produced for

X-Request-Id
string

Request id, echoed from the request when valid

X-RateLimit-Limit
integer

Limit of the tightest bucket

X-RateLimit-Remaining
integer

Requests left in its window

X-RateLimit-Reset
integer

End of its window, epoch seconds

site_not_found, automation_not_found

Media typeapplication/problem+json
Problem

The documented shape of every error body on the versioned surface.

object
FieldDescription
type
required
Type
string
title
required
Title
string
status
required
Status
integer
detail
Detail
string
nullable
instance
required
Instance
string
reason
Reason
string
nullable
next
Next
string
nullable
request_id
required
Request Id
string
errors
Errors
Array<object>
nullable
ValidationIssue
object
FieldDescription
loc
required
Loc
Array
msg
required
Msg
string
type
required
Type
string
metadata
Metadata
object

Example · Generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"reason": "example",
"next": "example",
"request_id": "example",
"errors": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
],
"metadata": {}
}
FieldDescription
GSC-Version
string

API version the response was produced for

X-Request-Id
string

Request id, echoed from the request when valid

X-RateLimit-Limit
integer

Limit of the tightest bucket

X-RateLimit-Remaining
integer

Requests left in its window

X-RateLimit-Reset
integer

End of its window, epoch seconds

Validation failed

Media typeapplication/problem+json
Problem

The documented shape of every error body on the versioned surface.

object
FieldDescription
type
required
Type
string
title
required
Title
string
status
required
Status
integer
detail
Detail
string
nullable
instance
required
Instance
string
reason
Reason
string
nullable
next
Next
string
nullable
request_id
required
Request Id
string
errors
Errors
Array<object>
nullable
ValidationIssue
object
FieldDescription
loc
required
Loc
Array
msg
required
Msg
string
type
required
Type
string
metadata
Metadata
object

Example · Generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"reason": "example",
"next": "example",
"request_id": "example",
"errors": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
],
"metadata": {}
}
FieldDescription
GSC-Version
string

API version the response was produced for

X-Request-Id
string

Request id, echoed from the request when valid

X-RateLimit-Limit
integer

Limit of the tightest bucket

X-RateLimit-Remaining
integer

Requests left in its window

X-RateLimit-Reset
integer

End of its window, epoch seconds

Rate limited

Media typeapplication/problem+json
Problem

The documented shape of every error body on the versioned surface.

object
FieldDescription
type
required
Type
string
title
required
Title
string
status
required
Status
integer
detail
Detail
string
nullable
instance
required
Instance
string
reason
Reason
string
nullable
next
Next
string
nullable
request_id
required
Request Id
string
errors
Errors
Array<object>
nullable
ValidationIssue
object
FieldDescription
loc
required
Loc
Array
msg
required
Msg
string
type
required
Type
string
metadata
Metadata
object

Example · Generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"reason": "example",
"next": "example",
"request_id": "example",
"errors": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
],
"metadata": {}
}
FieldDescription
GSC-Version
string

API version the response was produced for

X-Request-Id
string

Request id, echoed from the request when valid

X-RateLimit-Limit
integer

Limit of the tightest bucket

X-RateLimit-Remaining
integer

Requests left in its window

X-RateLimit-Reset
integer

End of its window, epoch seconds

Retry-After
integer

Seconds until the bucket refills

Media typeapplication/problem+json

temporarily_unavailable: the list took longer than 25 seconds or rate limits cannot be enforced; add filters or retry later

Problem

The documented shape of every error body on the versioned surface.

object
FieldDescription
type
required
Type
string
title
required
Title
string
status
required
Status
integer
detail
Detail
string
nullable
instance
required
Instance
string
reason
Reason
string
nullable
next
Next
string
nullable
request_id
required
Request Id
string
errors
Errors
Array<object>
nullable
ValidationIssue
object
FieldDescription
loc
required
Loc
Array
msg
required
Msg
string
type
required
Type
string
metadata
Metadata
object

Example · Generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"reason": "example",
"next": "example",
"request_id": "example",
"errors": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
],
"metadata": {}
}
FieldDescription
GSC-Version
string

API version the response was produced for

X-Request-Id
string

Request id, echoed from the request when valid

X-RateLimit-Limit
integer

Limit of the tightest bucket

X-RateLimit-Remaining
integer

Requests left in its window

X-RateLimit-Reset
integer

End of its window, epoch seconds