Probably
Docs

Import ad results

import_ad_results, in Changes: A connection or key that may make changes. None spends credits; prepare_* and stage tools (research, brainstorm, write_script, review, generate_clip, voice, storyboard) prepare paid work for confirm_spend.

POST
/api/v1/tools/import_ad_results

Import a Meta or TikTok Ads Manager report, by day, as CSV text (about 60,000 characters at most), or one sent to begin_results_upload's link by its uploadId (up to 900,000 characters). Rows match the Space's delivered campaign ads by the ad code in each ad's name; rows of an ad not delivered yet are skipped and listed by its code; rows of one ad and day add up; a later import replaces a day's numbers rather than adding to them. Names with no known code are listed, and rows without a day, impressions or spend are named by their line. Pass a new requestKey; repeating one answers as before.

Authorization

apiKey
headerAuthorizationBearer <token>

An API key (prb_…) from Settings → Connections.

Request Body

application/json
  1. body
spaceId*string
Match^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Formatuuid
platform*string
Value in"meta""tiktok"
fileName?string
Length1 <= length <= 200
Default"export.csv"
csv?string

An Ads Manager report by day, as CSV: ad name, day, impressions and spend at least

Length1 <= length <= 60000
uploadId?string

A report sent to begin_results_upload's link, in place of csv

Match^\d{13}-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
requestKey*string
Match^[\w.:-]+$
Length8 <= length <= 64

Response Body

The tool's answer.

application/json
  1. response
rows*integer
Range-9007199254740991 <= value <= 9007199254740991
matchedRows*integer
Range-9007199254740991 <= value <= 9007199254740991
ads*integer
Range-9007199254740991 <= value <= 9007199254740991
campaigns*integer
Range-9007199254740991 <= value <= 9007199254740991
unreadable*integer
Range-9007199254740991 <= value <= 9007199254740991
unreadableLines*array<>
undelivered*array<>
Default[]
unmatched*array<>
unmatchedNames*integer
Range-9007199254740991 <= value <= 9007199254740991
curl -X POST 'https://studio.probably.co/api/v1/tools/import_ad_results' \  -H "Authorization: Bearer $PROBABLY_API_KEY" \  -H 'Content-Type: application/json' \  -d '{  "spaceId": "a330a273-e64a-4183-aedb-f3152797a9a5",  "platform": "meta",  "requestKey": "stringst"}'
{  "rows": -9007199254740991,  "matchedRows": -9007199254740991,  "ads": -9007199254740991,  "campaigns": -9007199254740991,  "unreadable": -9007199254740991,  "unreadableLines": [    -9007199254740991  ],  "undelivered": [],  "unmatched": [    {      "adName": "string",      "rows": -9007199254740991    }  ],  "unmatchedNames": -9007199254740991}