← UTM Builder
Your token

UTM Builder API

Building the tagged links, the GA4 channel check and every export run free in the browser and need no API. The API is for the one metered step: send a description of a campaign and the channels it uses, and get back, as JSON, a campaign name and one row per placement or variant with its content tag (and a term for search ads). The page checks every name against the description, keeps its own sources and mediums and builds the links.

Base URL: https://api.skillsafe.ai/v1/app-api. Every response is {"data": ...} or {"error": {"code", "message"}}; read error.code and error.message rather than the HTTP status alone.

The task field

This app has one task. Always send "task": "name".

taskWhat it doesReply
nameReads the campaign description and returns a campaign name (yyyy-mm-name) and one row per link: the channel id, a short placement label, a content tag, a term for Google or Microsoft search ads, a partner, affiliate or podcast name where the description gives one, and a verbatim quote for channels the description adds. It never writes URLs, sources for other channels or mediums.One JSON object

Input fields

FieldTypeMeaning
taskstring"name"
urlstringThe page being shared, without its query string.
briefstringThe campaign description. The page sends at most 4,000 characters: longer text keeps its first and last lines and loses the middle, with a marker line.
channelsstringJSON text: a list of {channel, label, source, medium} for the channels picked. Channel ids: newsletter, linkedin, facebook, instagram, x, reddit, tiktok, youtube, google_ads, bing_ads, meta_ads, linkedin_ads, sms, push, podcast, partner, affiliate, qr, and custom1 to custom5 for your own.
campaignstringThe campaign name the page has now.
monthstringThe current year and month, yyyy-mm.
separatorstring"-" or "_".
clipped_notestringEmpty, or a sentence saying the middle of the description was cut.

The reply

job.output.output is text holding one JSON object (sometimes inside a ```json fence): campaign (string), links (a list of {channel, placement, content, term, source, quote}, at most 30), notes (0 to 3 strings) and questions (0 to 2 strings). Build each link yourself: utm_source and utm_medium from the channel (or source on partner, affiliate and podcast rows), utm_campaign from campaign, utm_content and utm_term from the row. Before using a row for a channel you did not send, check its quote is in your description; the page drops any it cannot find. If the balance ran low, truncated is true and the object may stop early; the page keeps every row that arrived whole.

Worked example

Input (input.json):

{
  "task": "name",
  "url": "https://shop.example.com/collections/seed-starter-kits",
  "brief": "Spring seed sale, 20% off starter kits, runs March 3 to March 10 2027. In the March newsletter we have a banner at the top of the email and a P.S. link at the bottom. On Instagram we post two stories (day 1 and day 5) plus the link in bio. Facebook gets one post. We're also running Meta ads with one video ad and one carousel, and Google search ads on \"organic seed starter kit\" and \"heirloom tomato seeds\". Our friends at Garden Hour will do a host read on their podcast.",
  "channels": "[{\"channel\":\"newsletter\",\"label\":\"Email newsletter\",\"source\":\"newsletter\",\"medium\":\"email\"},{\"channel\":\"instagram\",\"label\":\"Instagram\",\"source\":\"instagram\",\"medium\":\"social\"},{\"channel\":\"facebook\",\"label\":\"Facebook post\",\"source\":\"facebook\",\"medium\":\"social\"},{\"channel\":\"google_ads\",\"label\":\"Google Ads\",\"source\":\"google\",\"medium\":\"cpc\"}]",
  "campaign": "2026-11-seed-starter-kits",
  "month": "2026-11",
  "separator": "-",
  "clipped_note": ""
}

Reply:

```json
{
  "campaign": "2027-03-seed-sale",
  "links": [
    {"channel": "newsletter", "placement": "Header banner", "content": "header-banner", "term": "", "source": "", "quote": "a banner at the top of the email"},
    {"channel": "newsletter", "placement": "P.S. link", "content": "ps-link", "term": "", "source": "", "quote": "a P.S. link at the bottom"},
    {"channel": "instagram", "placement": "Story day 1", "content": "story-day-1", "term": "", "source": "", "quote": "two stories (day 1 and day 5)"},
    {"channel": "instagram", "placement": "Story day 5", "content": "story-day-5", "term": "", "source": "", "quote": "two stories (day 1 and day 5)"},
    {"channel": "instagram", "placement": "Link in bio", "content": "link-in-bio", "term": "", "source": "", "quote": "plus the link in bio"},
    {"channel": "facebook", "placement": "", "content": "", "term": "", "source": "", "quote": ""},
    {"channel": "meta_ads", "placement": "Video ad", "content": "video", "term": "", "source": "", "quote": "one video ad and one carousel"},
    {"channel": "meta_ads", "placement": "Carousel ad", "content": "carousel", "term": "", "source": "", "quote": "one video ad and one carousel"},
    {"channel": "google_ads", "placement": "Organic keyword ad", "content": "", "term": "organic-seed-starter-kit", "source": "", "quote": "organic seed starter kit"},
    {"channel": "google_ads", "placement": "Heirloom keyword ad", "content": "", "term": "heirloom-tomato-seeds", "source": "", "quote": "heirloom tomato seeds"},
    {"channel": "podcast", "placement": "Host read", "content": "host-read", "term": "", "source": "garden-hour", "quote": "will do a host read on their podcast"}
  ],
  "notes": ["Newsletter, Instagram and Google search ads are split so each placement or keyword can be compared.", "Meta ads and the podcast are added because the description says the link goes there."],
  "questions": []
}
```

On the page, this reply turns four plain links into eleven: two newsletter placements, two Instagram stories and the bio link, a Facebook post, a Google Ads link per keyword, Meta video and carousel ads, and a podcast host read with the show's name as its source.

Errors

HTTPWhat to do
401The token is missing, expired or a guest token on a run. Get a personal token on the token page.
402The balance is below what the run reserves. Top up at skillsafe.ai/account/billing.
400The body is not a JSON object of the fields above.
429Wait and retry with the same Idempotency-Key.

Step 1 — a tiny client helper

One function that sends JSON and unwraps the {data, error} envelope.

BASE="https://api.skillsafe.ai/v1/app-api"
TOKEN="paste-your-token-here"   # from https://utm-builder.skillsafe.ai/tokens.html
api() { # api METHOD PATH [JSON-BODY]
  curl -s -X "$1" "$BASE$2" -H "Content-Type: application/json" \
    ${TOKEN:+-H "Authorization: Bearer $TOKEN"} ${3:+--data "$3"}
}

Step 2 — a token

A guest token is enough for /me and /estimate. A run is metered, so it needs your personal token: sign in on the token page and copy it.

# a guest token (enough for /me and /estimate); a run needs your personal token from /tokens.html
TOKEN=$(curl -s -X POST "$BASE/guest" -H "Content-Type: application/json" -d '{"slug":"utm-builder"}' | jq -r '.data.token')

Step 3 — who am I, and my balance

subject_type is guest or user; credits is the balance (1 credit = $0.0001).

api GET /me | jq '.data | {subject_type, credits}' 

Step 4 — price a run for free

/estimate charges nothing and starts no job. hold_credits is the amount reserved while a run is in flight, not the price; the run is charged what it uses.

# input.json: the run input object - {"task": "name", "url": "...", "brief": "...", "channels": "[...]", "campaign": "...", "month": "2026-11", "separator": "-", "clipped_note": ""}
api POST /estimate "$(cat input.json)" | jq '.data | {hold_credits, min_credits, model, model_alias, markup_bps, warnings}' 

Step 5 — run it and wait for the job

Send an Idempotency-Key derived from the input: a retry with the same key is never billed twice.

KEY="utm-builder:name:$(shasum -a 256 input.json | cut -c1-16):a1"
JOB=$(curl -s -X POST "$BASE/run" -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" \
  -H "Idempotency-Key: $KEY" --data @input.json | jq -r '.data.job_id')
while :; do
  J=$(api GET "/jobs/$JOB"); S=$(echo "$J" | jq -r '.data.status')
  case "$S" in succeeded|failed|cancelled) break;; esac; sleep 2
done
echo "$J" | jq -r '.data.output.output' > reply.json   # one JSON object: campaign, links, notes, questions
echo "$J" | jq '.data | {charged_credits, truncated}' 

Step 6 — or stream it

/run-stream sends Server-Sent Events while the job runs and the finished job at the end.

# Server-Sent Events: tick/delta events while the job runs, then a final event with the job
curl -N -s -X POST "$BASE/run-stream" -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" \
  -H "Idempotency-Key: utm-builder:name:$(shasum -a 256 input.json | cut -c1-16):a1" --data @input.json