Base URL: https://api.geoswap.co/v1. The machine-readable contract is https://api.geoswap.co/v1/openapi.json (OpenAPI 3.1). Step-by-step setups for Salesforce, HubSpot and Zapier are in the recipes. How conversions are credited, and the other ways to send them, are in Attribution.
Conversions you send are credited to channels, campaigns, links and places on your dashboard's Attribution page, within about three hours.
Create a key in Setup → API Keys (workspace owners and admins). A key belongs to one workspace and carries the scopes you tick: workspace:read, conversions:write, spend:write, attribution:read (the attribution reads below), attribution:lookup (finding a lead by email), and the MCP scopes links:read, links:write, reports:read and geo:write (pausing and resuming geo tool rules). An admin can change a key's scopes later. Send it as Authorization: Bearer gs_live_…. Keys are shown once; revoke one at any time. API access works on every plan.
Paths below are relative to https://api.geoswap.co/v1.
| Method | Path | Scope | What it does |
|---|---|---|---|
| GET | /workspace | workspace:read | The key's workspace, install snippet and sites. Use it to verify a key. |
| POST | /conversions | conversions:write | Send one conversion. |
| POST | /conversions/batch | conversions:write | Send up to 500 conversions; each succeeds or fails on its own. |
| POST | /spend | spend:write | Set ad spend per channel, campaign and day or month (up to 5,000 rows; all or nothing). |
| GET | /spend | spend:write | Read stored spend, one row per day, for a range of days (start_date, end_date). |
| GET | /attribution | attribution:read | Credited conversions for one event, grouped by channel, source, medium, campaign, landing page, referrer site, link, country or device, with daily buckets (up to 366 days). |
| GET | /conversions/{external_id} | attribution:read | Look up a conversion by your external_id: touchpoints, the credited touch, every model's credits, refunds. |
| GET | /conversions?external_id=… | attribution:read | The same lookup for any id, including one with a / or the literal "batch" or "search". |
| POST | /conversions/search | attribution:lookup | Look up conversions by the lead's email (in the JSON body, never the URL): every conversion sent with it, grouped by journey. |
| GET | /visitors/{visitor_id} | attribution:read | A visitor's first and last touch (the gs_vid value). |
One stage of a journey: a lead, a qualified lead, a signed deal, a purchase. A first send answers 201 with result: "created"; sending the same event and external_id again answers 200 with updated or unchanged. Fields you leave out keep their stored value. An empty string or null in an optional field is ignored.
curl -X POST https://api.geoswap.co/v1/conversions \
-H "Authorization: Bearer $GEOSWAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"event": "qualified",
"external_id": "006Hs00001AbCdE",
"parent_external_id": "00QHs00002XyZqR",
"occurred_at": "2026-10-12T14:03:00Z",
"visitor_id": "Xb3k9_Qm2LpA7vR1.20261003",
"email": "jane@example.com",
"value": 1200,
"currency": "USD",
"tags": {
"market": "co"
}
}'| Field | Type | Required | Notes |
|---|---|---|---|
event | string | Yes | Stage name: lead, qualified, signed, purchase… Letters, digits and _, up to 40. Stored lower-case. "refund" lowers an earlier conversion's revenue instead (see Refunds). |
external_id | string | integer | Yes | Your id for this conversion (lead id, order id), up to 128 chars. A JSON number is accepted too (some CRMs send ids that way) and stored as its decimal string. Sending the same event and external_id again updates it. |
occurred_at | string | integer | Yes | When it happened: ISO 8601 with a time zone (2026-10-12T14:03:00Z) or epoch milliseconds. Any age: backfills are welcome, but conversions older than 400 days can't be matched to visits. |
parent_external_id | string | integer | No | The external_id of an earlier stage, e.g. the lead behind this deal. A JSON number is accepted too. Links the stages into one journey, in any arrival order. Required for a refund: the external_id of the conversion refunded. |
parent_event | string | No | Refunds only: the event of the conversion refunded. Defaults to purchase. |
visitor_id | string | No | The gs_vid cookie value, or the hidden gs_vid form field that geoswap.js fills in. |
click_id | string | No | The GeoSwap click id from the hidden gs_c form field. |
contact_id | string | No | Your CRM contact id. Also matches gs_r on per-recipient links. |
email | string | No | Hashed on receipt (SHA-256 of the trimmed, lower-cased address). Also stored encrypted; never logged. |
phone | string | No | Normalized to E.164 (send a + prefix or country) and hashed. Also stored encrypted; never logged. |
email_sha256 | string | No | Instead of email: SHA-256 hex of the trimmed, lower-cased address. Not with email. |
phone_sha256 | string | No | Instead of phone: SHA-256 hex of the E.164 number with its + (e.g. of +14155550123). Not with phone. |
country | string | No | ISO 3166-1 alpha-2, e.g. US. Also the phone's default country. |
state | string | No | State or province code without the country, e.g. TX, ON, NSW (US-TX is accepted). Needs a country, sent with it or already stored. Used as the conversion's region instead of the visitor's IP location. |
postal | string | No | Postal or ZIP code, up to 16 characters. Stored as sent (address.zip is only hashed). |
city | string | No | City, up to 100 characters. |
address | object | No | { line1, zip, country? }. Normalized and hashed; never stored raw. |
value | number | string | No | Value in currency units, e.g. 49.99. For a refund: the amount refunded; leave it out for a full refund. |
currency | string | No | ISO 4217, e.g. USD. |
hdyhau | string | No | "How did you hear about us?" answer, up to 200 chars. |
tags | object | No | Up to 5 string labels, e.g. {"site": "diara", "market": "in"}. |
host | string | No | The site it happened on, e.g. shop.example.com (stored without www.). A host that isn't one of your sites is kept, with the warning host_not_a_site. |
test | boolean | No | true: checked like any conversion and answered with result "test", but never stored or reported. |
Email, phone and address are normalized and SHA-256 hashed the moment they arrive. GeoSwap also stores the normalized email and phone encrypted (never the address), and never logs any of them. An identifier that can't be read is dropped and named in warnings; the conversion is still saved. If you already hold hashes, send email_sha256 / phone_sha256 instead: they only match when you normalized exactly the same way (email trimmed and lower-cased; phone in E.164 with its +).
Add "test": true to check an integration: the conversion is validated exactly like a real one (errors and warnings included) and answered with result "test", but nothing is stored, so it never reaches a report.
external_id and parent_external_id also accept a JSON number (HubSpot's Record ID is one); it's stored as its decimal string, so the same id sent as 123 or "123" is the same conversion.
curl -X POST https://api.geoswap.co/v1/conversions \
-H "Authorization: Bearer $GEOSWAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"event": "refund",
"external_id": "refund-5001",
"parent_external_id": "order-1001",
"occurred_at": "2026-10-20T09:00:00Z",
"value": 20,
"currency": "USD"
}'POST /conversions/batch with { "conversions": [ … ] }. A valid batch always answers 200 with one result per item, in order, plus a summary; each item succeeds or fails on its own. An invalid envelope (wrong shape, over 500 items, over the size limit) or an auth/rate-limit failure answers before any item is written, with its own status (400/401/403/413/422/429/503) instead.
A batch is written in chunks of 100. If a later chunk fails, earlier chunks may already be committed and the request returns an error (503 temporarily_unavailable when the database is busy, else 500) — re-send the whole batch. That's safe: GeoSwap matches on event + external_id (a refund on its external_id), so already-written items are just updated again.
curl -X POST https://api.geoswap.co/v1/conversions/batch \
-H "Authorization: Bearer $GEOSWAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"conversions": [
{
"event": "qualified",
"external_id": "006Hs00001AbCdE",
"parent_external_id": "00QHs00002XyZqR",
"occurred_at": "2026-10-12T14:03:00Z",
"visitor_id": "Xb3k9_Qm2LpA7vR1.20261003",
"email": "jane@example.com",
"value": 1200,
"currency": "USD",
"tags": {
"market": "co"
}
},
{
"event": "purchase",
"external_id": "order-1001",
"occurred_at": "2026-10-12T15:20:00Z",
"visitor_id": "Pq7Lm2Xr9Ka0Zt3W",
"value": 49.99,
"currency": "USD",
"tags": {
"site": "diara",
"market": "in"
}
}
]
}'Add "dry_run": true to the request (beside the conversion's fields, or beside "conversions" in a batch) to see what a send would do without storing anything. Every check runs exactly as for a real send (the same errors and warnings), and each conversion is answered with result "dry_run" and would: created, updated, unchanged, or test (an item with "test": true, which a real send wouldn't store either). A dry run doesn't count against the conversions rate limit; the request itself still counts. It answers for that moment: a write in between can change what the real send does.
curl -X POST https://api.geoswap.co/v1/conversions \
-H "Authorization: Bearer $GEOSWAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"event": "qualified",
"external_id": "006Hs00001AbCdE",
"parent_external_id": "00QHs00002XyZqR",
"occurred_at": "2026-10-12T14:03:00Z",
"visitor_id": "Xb3k9_Qm2LpA7vR1.20261003",
"email": "jane@example.com",
"value": 1200,
"currency": "USD",
"tags": {
"market": "co"
},
"dry_run": true
}'{
"result": "dry_run",
"conversion": {
"id": null,
"event": "qualified",
"external_id": "006Hs00001AbCdE",
"chain_id": null,
"result": "dry_run",
"would": "created"
}
}POST /spend sets what you spent per channel (and optionally campaign) per day, so the Attribution report can show cost per conversion and ROAS. It follows the same rules as the dashboard's spend grid (Attribution → Spend) and CSV upload: spend is stored per UTC day; a day (YYYY-MM-DD) replaces that day and nothing else, so send any days you have (see Sync daily spend); a month (YYYY-MM) replaces every day of the month with an even share; amount 0 removes. A campaign with spend that no traffic has used in 120 days is written but comes back in warnings (campaign_not_seen), and so does a channel with both channel-level and campaign spend on the same days, which reports add together (channel_and_campaign_spend); a workspace's spend is in one currency (the report converts it to your reporting currency at each day's ECB rate). Up to 5,000 rows per request, all or nothing; sending the same body twice changes nothing, so a nightly warehouse sync can resend its whole window. dry_run: true checks it without writing. GET /spend?start_date=&end_date= reads it back, one row per day over exactly those days (up to 1,092 days). Both need the spend:write scope. A workspace runs at most 2 spend writes at once, a dry run included (a third gets 429 too_many_concurrent_requests, nothing written), and a busy database answers 503 temporarily_unavailable: on either, wait the Retry-After seconds (plus a little random jitter) and re-send the same request.
curl -X POST https://api.geoswap.co/v1/spend \
-H "Authorization: Bearer $GEOSWAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"currency": "USD",
"rows": [
{
"period": "2026-10-12",
"platform": "google_ads",
"campaign": "fall_promo",
"amount": 1200.5
},
{
"period": "2026-10",
"channel": "direct_mail",
"amount": "4,000.00"
}
]
}'| Field | Type | Required | Notes |
|---|---|---|---|
period | string | Yes | A day as YYYY-MM-DD (UTC), or a month as YYYY-MM. A day replaces that day's stored amount; days you don't send are left as they are, so send whichever days you have (yesterday only, or a re-sent correction). A month replaces every day of the month with an even share (extra cents on the first days); sending a day of it later replaces just that day. A request may cover a day of a series only once. |
channel | string | No | A channel KEY (paid_search_other, paid_social_other, programmatic, email, sms, organic_search, organic_social, referral, pr, ai_assistants, direct_mail, podcast, ctv, radio, direct, short_links, unassigned), exact, or the c_… key of a channel you added. Never a display name or an earlier channel name such as "Paid social". Required for Custom rows, and never an ad platform's key there. A built-in platform's channel is fixed (its key, e.g. meta), so leave it out (or send that key). |
platform | string | No | The ad platform: meta, google_ads, microsoft_ads, tiktok, linkedin, reddit, pinterest, snapchat, x, chatgpt_ads, custom. Defaults to custom. Built-in platform spend books to the platform's own channel (meta, google_ads, tiktok, …) and is refused (spend_rejected) for any day a sync of that platform already covers; send it as custom, with a name, to keep both. When you read rows back from GET /spend and post them again, echo platform and name too: leaving them out writes Custom rows. |
name | string | No | Only for platform custom: a label up to 60 characters, e.g. "Local radio". Rows with different names are separate; leave it out for none. Read back as "" when there is none. |
campaign | string | No | The utm_campaign the spend belongs to (matched case-insensitively). Leave it out for channel spend not tied to a campaign; a channel's spend is that plus its campaigns', so never send the same money both ways. |
amount | number | string | Yes | Currency units with up to 2 decimals, e.g. 1200.50 or "1,200.50". 0 removes that day (or every day of that month). |
Reads are people only (bots never count) over complete UTC days, up to 366 days. Attribution history follows your plan: 4 / 8 weeks on Free / Pro / Business, counted in complete Monday–Sunday (UTC) weeks before the current one (the current week to date is always readable). A start_date before that is moved to the first day of the history and the response says clamped_to_plan: true with plan_history_weeks; it is never an error. conversions is fractional credit under one attribution model (each model gives every conversion exactly 1 in total). value is a decimal string in your reporting currency, net of refunds once GeoSwap re-credits them (within about three hours; until then a refunded conversion shows status "pending"). Deleted conversions never appear. Responses are never cached.
channel is a stable channel key (meta, google_ads, microsoft_ads, tiktok, organic_search, email, …; a custom channel is c_ plus 10 characters), never a display name. Rows grouped by channel and every touch also carry channel_name, and channel_group / channel_group_name (the channel's group; null = no group). Names can be renamed in Setup → Marketing setup, so filter and page by the keys. Changed November 2026: channel used to be a name such as "Paid social"; ad platforms are now channels of their own (meta, google_ads, tiktok, …) inside the Paid social / Paid search groups. GET /spend rows carry the same channel key and channel_name; POST /spend takes the key only (an earlier name is refused as an unknown channel).
GET /attribution returns credited conversions for one event, one page of grouped rows at a time, with totals (received and pending too) and a daily series. Page with next_cursor. With host, a conversion counts by the host you sent on it, otherwise by the landing host of the touch credited.
curl "https://api.geoswap.co/v1/attribution?start_date=2026-10-01&end_date=2026-10-31&event=purchase&model=position&group_by=source,campaign" \
-H "Authorization: Bearer $GEOSWAP_API_KEY"| Parameter | Type | Required | Notes |
|---|---|---|---|
start_date | string | No | First UTC day, YYYY-MM-DD. Default: 7 days before end_date. Within your plan's attribution history: an earlier day is moved to its first day (clamped_to_plan: true). |
end_date | string | No | Last UTC day. Default: yesterday. Days are complete: today or later is moved to yesterday (end_clamped: true). |
event | string | No | One conversion event, e.g. purchase. Default: your workspace's primary event (Setup → Marketing setup → Conversions). Never summed across events. |
model | string | No | first, last, linear, position, time_decay or data_driven (for an event with about 300+ attributed conversions a month, once data-driven credit is on for your workspace; otherwise model_not_available with the reason). Default: your workspace's model. |
group_by | string | No | Comma-separated: channel_group, channel, source, medium, campaign, utm_content (the ad), utm_term (the keyword), landing_page, referrer_site, link, country, device (the credited visit's desktop / mobile / tablet; recorded since 2026-11-07). Default: channel,source,medium,campaign. channel groups by the channel key, channel_group by its group key. |
host | string | No | A site host (shop.example.com, or *.example.com for a site and its subdomains). Counts a conversion by its own host when you sent one, else by the landing host of the touch credited. |
buckets | string | No | day (default) adds a daily series to each row; none leaves it out. |
limit | integer | No | Rows per page, 1 to 500 (default 100). |
cursor | string | No | next_cursor from the previous page of the same query. |
GET /conversions/{external_id} (or GET /conversions?external_id=… for any id, including one with a / or the literal batch or search) returns every conversion with that id, one per event: the touches its credit was split over (with landing pages, short links, country, state and DMA), the credited touch under a model, every model's credits, the value as sent, what was refunded, and what was credited (net). Each conversion carries its region too (country, state, the postal code and city when you sent them, and the DMA for pixel and track() conversions). Identifiers show as present or not, never their values. A conversion in another workspace, or a deleted one, is 404 conversion_not_found.
curl "https://api.geoswap.co/v1/conversions/order-1001?model=last" \
-H "Authorization: Bearer $GEOSWAP_API_KEY"POST /conversions/search looks a lead up by email: every conversion sent with that email (any event, newest first, at most 50; truncated says more exist), each exactly as the lookup above returns it, plus group: conversions with the same group are stages of one journey. Send the email (or its SHA-256) in the JSON body, never in the URL: this endpoint refuses any query string, so an email can't land in an access log. GeoSwap trims, lower-cases and hashes it exactly as when you sent the conversion, and never stores or echoes it. It needs its own attribution:lookup scope (it confirms whether an email converted, so it's granted separately from attribution:read) and counts as one attribution read. No match is 404 conversion_not_found.
curl -X POST https://api.geoswap.co/v1/conversions/search \
-H "Authorization: Bearer $GEOSWAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "jane.doe@example.com"
}'| Field | Type | Required | Notes |
|---|---|---|---|
email | string | No | The lead's email as you have it. GeoSwap trims, lower-cases and hashes it (SHA-256) exactly as when you sent the conversion, and never stores or echoes it. Send this or email_sha256. |
email_sha256 | string | No | Or the SHA-256 (hex) of the trimmed, lower-cased email, if you only keep hashes. |
event | string | No | Only this event's conversions, e.g. lead. |
model | string | No | first, last, linear, position, time_decay or data_driven: the model for credited (data_driven also adds credits_by_model.data_driven; it needs data-driven credit on for your workspace, else model_not_available). Default: your workspace's model. |
GET /visitors/{visitor_id} takes the gs_vid value and returns that visitor's first and last touch, as attribution would credit a conversion from them now (the same lookback window). A visitor with no touches is a 200 with nulls.
curl "https://api.geoswap.co/v1/visitors/Xb3k9_Qm2LpA7vR1" \
-H "Authorization: Bearer $GEOSWAP_API_KEY"Every attribution read speaks channel keys: channel is the key, channel_name the name as it shows in reports, and channel_group / channel_group_name the channel's group (null when it has none). Keys never change; names can be renamed in Setup → Marketing setup, so filter and page by the keys. A channel a workspace adds has a key of c_ plus 10 characters, and a group it adds g_ plus 10. The built-in keys:
| Key | Name | Group (key) |
|---|---|---|
meta | Meta Ads | Paid social (paid_social) |
google_ads | Google Ads | Paid search (paid_search) |
microsoft_ads | Microsoft Ads | Paid search (paid_search) |
tiktok | TikTok Ads | Paid social (paid_social) |
linkedin | LinkedIn Ads | Paid social (paid_social) |
reddit | Reddit Ads | Paid social (paid_social) |
pinterest | Pinterest Ads | Paid social (paid_social) |
snapchat | Snapchat Ads | Paid social (paid_social) |
x | X Ads | Paid social (paid_social) |
chatgpt_ads | ChatGPT Ads | Paid search (paid_search) |
paid_search_other | Other paid search | Paid search (paid_search) |
paid_social_other | Other paid social | Paid social (paid_social) |
programmatic | Programmatic | Other paid (paid_other) |
email | Owned (owned) | |
sms | SMS | Owned (owned) |
organic_search | Organic search | Earned (earned) |
organic_social | Organic social | Earned (earned) |
referral | Referral | Earned (earned) |
pr | PR | Earned (earned) |
ai_assistants | AI assistants | Earned (earned) |
direct_mail | Direct mail | Offline (offline) |
podcast | Podcast | Offline (offline) |
ctv | CTV | Offline (offline) |
radio | Radio | Offline (offline) |
direct | Direct | Direct (direct) |
short_links | Short links | Direct (direct) |
unassigned | Unassigned | none |
Changed November 2026: channel used to be one of 18 names such as Paid social. Ad platforms are now channels of their own (meta, google_ads, tiktok, …) inside the Paid social and Paid search groups, and the old names are not accepted on input. How a visit gets its channel: Which channel a visit gets.
Add hidden inputs named gs_vid, gs_c and gs_r to your forms. geoswap.js fills them in (it never adds inputs), so the values land on the CRM record. Send them back as visitor_id, click_idand contact_id/gs_r. Forms inside cross-origin iframes (some HubSpot embeds) can't be filled; send the email instead.
There's no self-serve delete endpoint yet. Email support@geoswap.co with the visitor id, email, phone or contact id that identifies the person, and GeoSwap deletes their visit history (touches), erases the identifiers on their conversions, and removes them from attribution. Conversion counts stay; the person can't be identified from them. A deletion removes what is stored now: if your CRM sends the same conversion again later, it is stored as new data. Stop syncing a person who asked to be forgotten.
Every error is { "error": { "code", "message", "request_id" } }. code never changes meaning; request_id equals the X-Request-ID header. Quote it to support.
| Code | Status | Meaning |
|---|---|---|
invalid_json | 400 | The body isn't valid JSON. |
request_aborted | 400 | The connection closed before the whole body arrived. Retry the request; writes are idempotent. |
query_not_allowed | 400 | Write endpoints and POST /conversions/search take every field in the body. Query strings end up in access logs, so an email never goes in a URL. |
missing_api_key | 401 | No Authorization header with a gs_live_ key. |
invalid_api_key | 401 | Unknown or revoked key. |
workspace_suspended | 403 | The workspace is suspended. |
insufficient_scope | 403 | The key lacks the scope this endpoint needs. |
plan_required | 403 | Attribution isn't on the workspace's plan. |
workspace_not_found | 404 | The key's workspace no longer exists. |
conversion_not_found | 404 | No conversion (that isn't deleted) has this external_id, or was sent with this email, in your workspace. |
not_found | 404 | Unknown path: not a v1 endpoint. Includes any path on api.geoswap.co other than /v1/*, / and bare /v1. |
method_not_allowed | 405 | The attribution read endpoints only answer GET (and POST for /conversions/search). |
currency_mismatch | 409 | Spend in a different currency from the workspace's existing spend. Change it in the dashboard (Spend → Currency) first. |
payload_too_large | 413 | Body over 32 KiB (single), 1 MiB (batch, spend) or 4 KiB (/conversions/search). |
validation_failed | 422 | details lists each bad field or query parameter (never its value). Unknown query parameters are refused. |
range_too_long | 422 | An attribution report covers at most 366 days. |
invalid_cursor | 422 | The cursor is malformed, or came from a different query. Repeat the query without it. |
model_not_available | 422 | model=data_driven, but there's no data-driven credit for it: it isn't turned on for the workspace, the event has fewer than about 300 attributed conversions a month, or its first weekly fit hasn't run. The message says which. |
invalid_spend | 422 | Some spend rows can't be used, such as a Custom row without a channel (details: rows.<index> and why); nothing was written. |
spend_rejected | 422 | The spend would cover a day of a series twice in one request (a day inside a month you also send), exceed 250,000 stored rows (one per series per day), or book a built-in platform's day that a sync of that platform already covers; nothing was written. |
too_many_rows | 422 | GET /spend: more than 50,000 rows in the range. Ask for a shorter range. |
occurred_at_out_of_range | 422 | occurred_at is in the future (more than 5 minutes ahead) or before 2000. |
state_needs_country | 422 | state was sent without a country, and the conversion has no stored country. Send country with it. |
funnel_event | 422 | The event is a funnel event (cart, checkout, product view), not a conversion. Send it with geoswap.track() or the Shopify pixel. |
refund_parent_missing | 422 | A refund without parent_external_id: say which conversion it refunds. |
parent_event_not_refund | 422 | parent_event was sent on an event other than refund, or is "refund" itself. |
identifier_conflict | 422 | Both email and email_sha256 (or phone and phone_sha256) were sent. Send one. |
daily_limit | 429 | MCP only: the key used its daily allowance (2,000 report calls, or 200 Search Console reads by country). Retry-After counts down to the next UTC midnight. |
rate_limited | 429 | Too many requests, conversions or attribution reads this minute; wait Retry-After seconds. |
too_many_concurrent_requests | 429 | Your workspace already has 2 conversion writes (or 2 spend writes) in progress, or the server is at its limit. Send batches one after another (2 in parallel at most); wait Retry-After seconds and re-send. Nothing was written (for conversions it doesn't count against your conversions limit). |
internal_error | 500 | Our fault. Retry; quote request_id to support@geoswap.co if it persists. |
temporarily_unavailable | 503 | Conversion and spend writes: the database is temporarily unavailable. Wait Retry-After seconds (plus a little random jitter) and re-send the whole request; writes are idempotent. |
Warnings come back in a successful response's warnings array; the request was written anyway:
| Warning | Meaning |
|---|---|
campaign_not_seen | POST /spend: no traffic or credit used that utm_campaign (on a row with spend) in the last 120 days. The spend is written, but it only lines up with credits when the campaign value matches the links' utm_campaign (case-insensitive): check for a typo, or an ID where the links carry the name. |
channel_and_campaign_spend | POST /spend: a channel has both channel-level spend (no campaign) and campaign spend on some days this request covers (counting what was already stored). Reports add them together, so the same money usually counts twice. The spend is written: remove one of them (send amount 0) unless both are really separate spend. |
A 401 also carries a WWW-Authenticate header (RFC 6750); a 403 from insufficient_scope names the missing scope there too.
Per API key: 600 requests, 30,000 conversions and 60 attribution reads per minute, in fixed one-minute windows (a batch counts each conversion; each GET of /attribution, /conversions/… or /visitors/…, and each POST /conversions/search, is one attribution read). Over the limit you get 429 rate_limited with a Retry-After header. Per workspace, at most 2 conversion writes (POST /conversions or /conversions/batch, across all its keys) run at once, and separately at most 2 spend writes (POST /spend); a third gets 429 too_many_concurrent_requests. For a backfill, send batches one after another (or 2 in parallel at most); on 429 or 503 wait the Retry-After seconds (add a little random jitter) and re-send the same request. Wait the Retry-After seconds, then retry.
/v1 only changes additively: new endpoints, new optional fields, new response fields, new error codes. Ignore fields you don't know. Breaking changes ship as /v2, with at least six months' notice before v1 stops. One exception so far: in November 2026 channel changed from a name to a key (see Channels).