ads

POST /v1/ads/connections/{connection_id}/history-imports

Import an older ad account's history and the revenue to seed the autopilot's starting values.

All ads endpoints

All developer docs →

Zinn®, our Viking, hammering at his anvil beside an API endpoint sending events to several listeners.

Authentication

Send an API key as a bearer token. The key must carry the ads.manage permission; a key without it is refused with 403, not 404.

Where your organisation id goes

This endpoint takes org_id as a field in the JSON body.

Your organisation id is on the API keys screen in your dashboard, beside the key itself. It is the same id in every call you make.

Try it

Replace anything in angle brackets with your own values, and the key placeholder with a key from your dashboard.

curl -X POST https://api.zinndigital.com/v1/ads/connections/{connection_id}/history-imports \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{  }'

Signed in? The API console in your dashboard fills in your real organisation id and your own key, and runs the request against the live API so you can see the actual response. Open this endpoint in the API console

Details

Gated on ads.manage; audit action ads.history_import_start. Reads the older account (source_connection_id, a Google Ads or Microsoft Advertising connection of the SAME organisation, read-only) month by month in a resumable workflow, with the revenue Zinn® Ads already holds (first_party), an uploaded CSV (csv: source,country,device,revenue,customers, at most 2 MB) or none. It seeds a target CPA and ROAS, the countries to start with and to exclude, and device bid modifiers, each with its evidence. Account seeds become pending changes in the approval queue; nothing is written to an ad account here. A source in another organisation answers 422 sourceNotYours (or 404 when the caller cannot see it). Other 422 codes: sameAccount, sourceUnsupported, badRevenueSource, nothingToImport, badThreshold, csvTooLarge, badCsvHeader, badCsvCountry, badCsvDevice, badCsvAmount, emptyCsv.

Parameters

NameTypeRequiredWhat it is
connection_id (path)stringYes—

Request body

NameTypeRequiredWhat it is
org_idstringNo—
source_connection_idstringNoThe older connection (uuid); empty = revenue only.
revenue_sourcestring<first_party, csv, none>No—
csvstringNo—
thresholdsAdsHistoryThresholdsInputNoAny of the thresholds (the rest keep their Recommended value), or {reset: true} for the defaults.

Response

NameTypeRequiredWhat it is
idstringYes—
connection_idstringYes—
source_connection_idobjectYes—
revenue_sourcestring<first_party, csv, none>Yes—
window_startstringYes—
window_endstringYes—
currencystringYes—
thresholdsAdsHistoryThresholdsYesHistory-import thresholds (za-159, docs/1006 §80); the Recommended defaults when returned as recommended.
months_readintegerYes—
months_totalintegerYes—
statusstring<queued, reading, done, failed>Yes—
errorstringYesWhy a failed import stopped, e.g. sourceNotYours, notInGoodStanding, sourceNeedsReconnect.
evidenceobjectYes—
seedsAdsHistorySeed[]Yes—
created_atstringYes—
finished_atobjectYes—

Errors this endpoint can return

401 · 403 · 404 · 422 · 429