Skip to main content
Documentation

Automations

automations.activity

Show what the shop's automations actually did, and to whom
Read-onlyRead budget

REST

Shipping
POST /api/v1/automations/activity

MCP tool

Live
automations.activity

Exposed on: REST API · Shop MCP server · Claude connector · Dash (in-app copilot) · Zapier. Part of the Automations domain.

Operating contract

The run log: every time a rule fired, what it fired on, and whether it worked.

THIS IS THE ONLY PLACE A SHOP CAN SEE WHAT ITS AUTOMATIONS ARE DOING TO ITS CUSTOMERS. A rule's run_count is a number; this is the list of people it happened to.

status separates a run that did something from one that was evaluated and skipped — a cooldown still in force, a customer who opted out, a condition that did not match. A large skip count is not a fault; it is usually the cooldown doing its job.

subject_customer_id and subject_lead_id are who it happened to, and they are what customers.get and leads.get take. A customer appearing repeatedly in a short window is worth checking against the rule's cooldown.

APPEND-ONLY. A run is a record of something that happened and nothing in this registry edits or removes one.

TRUNCATION: total is the exact number of matching runs and omitted is how many are not here. When omitted is not 0, narrow the window — an automation audit built on a partial log is one that missed the sends somebody is asking about.

Who may call it

Permission
shop.manageThe caller must hold shop.manage at the ACT level. A read-only dashboard grant on the same section is refused.
Plan
Every planNo plan gate. Available on every Service VIN plan.
Retries
naturalNaturally idempotent — running it twice leaves the same world as running it once. A retrying integration needs no key.
Rate class
readCounted against the read budget — the widest of the four.

Partial answers

omitted is how many matching records are not in the response, and 0 is a real answer meaning you have all of them. There is no cursor here — narrow the filter instead.

Do not summarise from a truncated response

When `omitted` is not 0 there are more runs in this window. Narrow `days` or filter by `automation_id` rather than auditing from a partial log.

Input

FieldTypeDescription
automation_idstringuuid

One rule's id, as returned by automations.list.

statusstringmax 40 chars

One run status, exactly as it appears on another row.

daysinteger1–180

How many days back to read, 1-180. Defaults to 14.

Default: 14
limitinteger1–200

How many runs to return, 1-200. Defaults to 50.

Default: 50

Output

FieldTypeDescription
itemsobject[]

items[].idstring

items[].automation_idstring

items[].trigger_typestring

items[].statusstring

items[].customer_idstring | null

items[].lead_idstring | null

items[].created_atstring

totalnumber

omittednumber

Examples

Built from this capability's own schema — required fields and the ones carrying a default, and nothing invented. Paste one and it validates.

curl
export SERVICEVIN_API_KEY=svk_live_…

curl -X POST https://www.servicevin.com/api/v1/automations/activity \
  -H "Authorization: Bearer $SERVICEVIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"days":14,"limit":50}'

TypeScript (fetch)
const res = await fetch("https://www.servicevin.com/api/v1/automations/activity", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.SERVICEVIN_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "days": 14,
    "limit": 50
  }),
});

// Success and failure are both envelopes. Switch on error.code, never
// on error.message — the codes are stable, the messages are for people.
const payload = await res.json();
if (!res.ok) throw new Error(payload.error.code);
const data = payload.data;

Python (requests)
import os, requests

res = requests.post(
    "https://www.servicevin.com/api/v1/automations/activity",
    headers={"Authorization": f"Bearer {os.environ['SERVICEVIN_API_KEY']}"},
    json={
    "days": 14,
    "limit": 50
},
    timeout=30,
)
payload = res.json()
if not res.ok:
    raise RuntimeError(payload["error"]["code"])
data = payload["data"]

MCP tools/call — https://www.servicevin.com/api/mcp
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "automations.activity",
    "arguments": {
      "days": 14,
      "limit": 50
    }
  }
}

Refusals

The four gates run in this order on every surface, and the order is not arbitrary — see Authentication.

StatusCodeWhen
404not_foundThe id is unknown, or the feature is not enabled for this account. Deliberately the same answer for both.
403forbiddenThis login does not hold shop.manage.
422validation_errorAn argument was wrong. The message names the field.
429rate_limitedToo many read calls. Back off and retry.
500internal_errorSomething failed on our side. Nothing was changed.