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.
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.
apiKeyAuthorizationBearer <token>An API key (prb_…) from Settings → Connections.
application/json- body
spaceId*string^([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)$uuidplatform*string"meta""tiktok"fileName?string1 <= length <= 200"export.csv"csv?stringAn Ads Manager report by day, as CSV: ad name, day, impressions and spend at least
1 <= length <= 60000uploadId?stringA report sent to begin_results_upload's link, in place of csv
^\d{13}-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$requestKey*string^[\w.:-]+$8 <= length <= 64The tool's answer.
application/json- response
rows*integer-9007199254740991 <= value <= 9007199254740991matchedRows*integer-9007199254740991 <= value <= 9007199254740991ads*integer-9007199254740991 <= value <= 9007199254740991campaigns*integer-9007199254740991 <= value <= 9007199254740991unreadable*integer-9007199254740991 <= value <= 9007199254740991unreadableLines*array<>undelivered*array<>[]unmatched*array<>unmatchedNames*integer-9007199254740991 <= value <= 9007199254740991curl -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}