Skip to content

Placements, numbers and conversions

Look up the REST routes for placements, credentials, the conversion mapping and log, ad accounts and reported numbers, with their fields and who may call them.

Updated

The REST routes for placements, numbers and conversions, generated with npm run openapi from the schemas Handline validates every request with. Routes are under https://app.handline.io/api/v1 and take Authorization: Bearer <key or token>; the ids in braces are path parameters. The OpenAPI document is at https://app.handline.io/api/v1/openapi.json.

A GET or DELETE takes its fields as query parameters: numbers and true or false are read as such, and a repeated key is a list. Other methods take a JSON body with content-type: application/json.

POST /products/{productId}/placements#

Record a placement: where a concept is live, with the outside tool’s ids, countries and budget. Call this after writing the ad or sequence into the outside tool. The concept must be approved, its copy and page the concept’s own (a page not retired), the countries allowed, the budget inside the cell’s allocation, and the outside ids new to this product. On a channel with strict country rules (outbound, email), name every country the placement targets: none is allowed until the ground rules allow it. On outbound, say in trigger why these recipients are being contacted now.

Operation: placements.record, MCP tool placements_record. Who: owners, admins and editors (placements.record); agent keys with report.

BodyTypeRequiredRules
conceptIdstringYes
copyIdstringNo
pageIdstringNo
creativeIdsstring[]NoAt most 20 items.
channelIdstringYes
audienceIdstringNo
outsideIdsobjectYesAny keys; each value string.
countriesstring[]NoAt most 250 items. Each matches ^[A-Z]{2}$. Default [].
budgetobjectNo
budget.dailynumber or nullNoAt least 0.
budget.monthlynumber or nullNoAt least 0.
statusstringNoOne of planned, live. Default planned.
platformTestobjectNo
platformTest.testIdstringYes
platformTest.armIdstringYes
aiLabelstringNoAt most 200 characters.
triggerstringNo3 to 500 characters.

PATCH /products/{productId}/placements/{placementId}#

Update a placement: its status, budget, countries, trigger or outside ids. Send only what changes. A new copy or page is checked as placements.record checks it, and an ended placement stays ended.

Operation: placements.update, MCP tool placements_update. Who: owners, admins and editors (placements.record); agent keys with report.

BodyTypeRequiredRules
statusstringNoOne of planned, live, paused, ended.
budgetobjectNo
budget.dailynumber or nullNoAt least 0.
budget.monthlynumber or nullNoAt least 0.
countriesstring[]NoAt most 250 items. Each matches ^[A-Z]{2}$.
outsideIdsobjectNoAny keys; each value string.
copyIdstring or nullNo
pageIdstring or nullNo
creativeIdsstring[]NoAt most 20 items.
aiLabelstring or nullNoAt most 200 characters.
triggerstring or nullNo3 to 500 characters.

GET /products/{productId}/placements#

List placements, filtered by status, concept or channel. Status "live" lists what is live now.

Operation: placements.list, MCP tool placements_list. Who: owners, admins, editors and viewers (record.read); agent keys with read.

QueryTypeRequiredRules
statusstringNoOne of planned, live, paused, ended.
conceptIdstringNo
channelIdstringNo

GET /products/{productId}/credentials#

List the product’s platform credentials: that each exists, when it was set and when it last worked. Never the secret.

Operation: credentials.list, MCP tool credentials_list. Who: owners, admins, editors and viewers (record.read); agent keys with read. Outside text: credentials.[].lastError.

No query parameters.

GET /products/{productId}/conversion-mapping#

Read which outcome stage becomes which conversion on each channel.

Operation: conversions.mapping, MCP tool conversions_mapping. Who: owners, admins, editors and viewers (record.read); agent keys with read.

No query parameters.

PUT /products/{productId}/conversion-mapping/{channelId}#

Map outcome stages to a channel’s conversion actions: one primary, and whether to send a value. Start with the earliest stage that has steady volume, so the platform has enough to learn from. Move the primary to a later stage as weekly volume grows.

Operation: conversions.setMapping, MCP tool conversions_setMapping. Who: owners and admins (products.settings); not agent keys.

BodyTypeRequiredRules
destinationobjectYesAny keys; each value string.
stagesobject[]YesAt most 12 items.
stages[].stagestringYes
stages[].actionstringYes1 to 200 characters.
stages[].primarybooleanNoDefault false.
stages[].sendValuebooleanNoDefault false.
hashedIdentifiersbooleanNo

GET /products/{productId}/conversions#

The delivery log: every conversion with its status, the platform’s answers and each attempt.

Operation: conversions.log, MCP tool conversions_log. Who: owners, admins, editors and viewers (record.read); agent keys with read. Outside text: conversions.[].reason, conversions.[].attempts.[].response.

QueryTypeRequiredRules
channelIdstringNo
statusstringNoOne of queued, accepted, rejected, not_sent.
limitintegerNoFrom 1 to 500. Default 100.

GET /products/{productId}/conversions/counts#

Per channel and day: outcomes, eligible conversions, and how many were sent, accepted, rejected, not sent or still queued.

Operation: conversions.counts, MCP tool conversions_counts. Who: owners, admins, editors and viewers (record.read); agent keys with read.

QueryTypeRequiredRules
fromstringYesA date, YYYY-MM-DD.
tostringYesA date, YYYY-MM-DD.

GET /products/{productId}/ad-accounts#

List the connected ad accounts, with when each was last read and whether the read worked.

Operation: adAccounts.list, MCP tool adAccounts_list. Who: owners, admins, editors and viewers (record.read); agent keys with read. Outside text: adAccounts.[].name, adAccounts.[].lastSync.message.

No query parameters.

POST /products/{productId}/numbers#

Report a tool’s raw number rows for a channel, keyed by the tool’s own ids and a day. Pass the outside tool’s rows through untouched: raw counts and spend only, never a rate, a ratio or a cost per result. Send rows or a csv in the tool’s export format. Reporting the same id and day again replaces the earlier row and keeps it in history. Rows that match no placement are kept as unmatched.

Operation: numbers.report, MCP tool numbers_report. Who: owners, admins and editors (numbers.report); agent keys with report. Outside text: unmatched.[].name, flagged.[].name.

BodyTypeRequiredRules
channelIdstringYes
sourcestringYes1 to 100 characters.
rowsobject[]NoAt most 5000 items.
rows[].outsideIdstringYes1 to 200 characters.
rows[].daystringYesMatches ^\d{4}-\d{2}-\d{2}$.
rows[].columnsobjectYesAny keys; each value number.
rows[].namestringNoAt most 300 characters.
csvstringNoAt most 5000000 characters.
timezonestringNo
currencystringNoMatches ^[A-Z]{3}$.

GET /products/{productId}/numbers#

List number rows, read or reported, with where each came from. Filter by day, channel, placement or unmatched.

Operation: numbers.list, MCP tool numbers_list. Who: owners, admins, editors and viewers (record.read); agent keys with read. Outside text: rows.[].names.ad, rows.[].names.campaign, rows.[].reportedBy.sourceName.

QueryTypeRequiredRules
fromstringYesMatches ^\d{4}-\d{2}-\d{2}$.
tostringYesMatches ^\d{4}-\d{2}-\d{2}$.
sourcestringNoOne of read, reported.
channelIdstringNo
placementIdstringNo
unmatchedbooleanNo
limitintegerNoFrom 1 to 2000. Default 500.

GET /products/{productId}/numbers/{rowId}/history#

The earlier versions of a number row, replaced by a re-read or a later report.

Operation: numbers.history, MCP tool numbers_history. Who: owners, admins, editors and viewers (record.read); agent keys with read. Outside text: history.[].names.ad, history.[].names.campaign, history.[].reportedBy.sourceName, current.names.ad, current.names.campaign, current.reportedBy.sourceName.

No query parameters.

GET /products/{productId}/numbers/sources#

Where each channel’s numbers come from, read or reported, when they last arrived, and whether they are stale.

Operation: numbers.sources, MCP tool numbers_sources. Who: owners, admins, editors and viewers (record.read); agent keys with read.

No query parameters.

POST /products/{productId}/ad-accounts/{adAccountId}/sync#

Read a connected ad account now, instead of waiting for the daily read.

Operation: numbers.sync, MCP tool numbers_sync. Who: owners, admins and editors (numbers.report); agent keys with report.

No body.

Was this page helpful?