Skip to main content
Documentation

Marketing

marketing.share_link_activity

Track which links a campaign or quote sent, and who opened them
Read-onlyRead budget

REST

Shipping
POST /api/v1/marketing/share_link_activity

MCP tool

Live
marketing.share_link_activity

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

Operating contract

Every private link the shop has sent a customer — a quote, an invoice, a document to sign — with how many times it was sent, whether it has been opened, and when.

view_count: 0 ON A SENT LINK IS THE FINDING. It means the customer never opened it, which is very different from a customer who read the quote and did not reply. One of those needs a resend on another channel; the other needs a conversation.

send_count above one means it has already been chased. Read it before suggesting another send.

last_send_error set is a delivery that failed — a wrong number, a bounced address, a carrier rejection. Nothing else in the product surfaces those, and they look identical to silence from the customer.

revoked_at set means somebody deliberately killed the link; expires_at in the past means it aged out on its own. Both make the link dead, and the customer clicking it now sees nothing.

READ ONLY. Minting or re-sending a link puts something in front of a customer, and that belongs to the capability that owns the thing being sent — quotes.send or invoices.send.

TRUNCATION: total is the exact number matching the filters and omitted is how many are not here. When omitted is not 0, call again with offset set to next_offset.

Who may call it

Permission
marketing.accessThe caller must hold Reviews & market 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. Continue with next_offset.

Do not summarise from a truncated response

When `omitted` is not 0 there are more links than came back. Call again with `offset` set to `next_offset`, or narrow the window.

Input

FieldTypeDescription
targetstring

Narrow to one kind of thing the link opens — quote, invoice, document, receipt, customer (their portal) or job.

One of: quote, invoice, document, receipt, customer, job
unopened_onlyboolean

True returns only links that were sent and never opened.

daysinteger1–365

How many days back to look, 1-365. Defaults to 30.

Default: 30
limitinteger1–200

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

Default: 50
offsetintegermin 0

How many to skip. Pass the previous response's next_offset to continue.

Default: 0

Output

FieldTypeDescription
itemsobject[]

items[].idstring

items[].target_typestring

items[].target_idstring

items[].recipient_namestring | null

items[].send_countnumber

items[].view_countnumber

items[].last_sent_atstring | null

items[].last_sent_channelstring | null

items[].last_send_errorstring | null

items[].last_viewed_atstring | null

items[].expires_atstring

items[].revoked_atstring | null

totalnumber

omittednumber

next_offsetnumber | null

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/marketing/share_link_activity \
  -H "Authorization: Bearer $SERVICEVIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"days":30,"limit":50,"offset":0}'

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

// 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/marketing/share_link_activity",
    headers={"Authorization": f"Bearer {os.environ['SERVICEVIN_API_KEY']}"},
    json={
    "days": 30,
    "limit": 50,
    "offset": 0
},
    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": "marketing.share_link_activity",
    "arguments": {
      "days": 30,
      "limit": 50,
      "offset": 0
    }
  }
}

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 marketing.access.
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.