Probably
Docs

Plan a campaign

plan_campaign, 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/plan_campaign

Plan a campaign testing one of a Space's products on its saved segments (list_segments): the first batch's ads are chosen by coverage, each segment its share, over its awareness level's lead and the next one down and different hook kinds, each tagged and given an ad code. To test a delivered video on them, name it as sourceVideoId. To test a hypothesis, narrow the leads and hookKinds to try, or pins the combinations a round must hold; a pin that can't be placed is refused, saying why. Nothing is made or charged; change the ads with change_campaign_ad, then make the batch with prepare_campaign_batch. Pass a new requestKey; repeating one returns the same campaign.

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
name*string
Length1 <= length <= 80
productRecordId*string

The Space's product to test (list_products)

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
segmentRecordIds*array<>

Saved segments of that product (list_segments), in the order to plan them

Items1 <= items <= 6
ads*integer

At least one per segment

Range1 <= value <= 10
lengthSeconds?number

How long its videos run: 30 seconds if not said. Not with sourceVideoId

Value in15304560
sourceVideoId?string

A delivered video of the Space featuring the product, in no campaign yet, to test on these segments: it becomes the body of the segment it was aimed at, at no charge, and every other body is made from its brief, in its built-in format, at its length

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
leads?array<>

The leads to try, for every round: each segment tries its own two where they're named, then the next named. All of them if not said

Items1 <= items
hookKinds?array<>

The hook kinds to try, for every round: all of them if not said

Items1 <= items
pins?array<>

Combinations every round must hold, each once, with coverage filling the rest: a chosen segment, and a lead and hook kind among those to try. In a segment's ads, in this order, so its first is its body, unless a source video is its body. Its share of ads grows to hold them: ads must hold every pin and a body for every other segment. plan_next_batch drops one a saved learning says lost

Itemsitems <= 10
requestKey*string
Match^[\w.:-]+$
Length8 <= length <= 64

Response Body

The tool's answer.

application/json
  1. response
campaignId*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
curl -X POST 'https://studio.probably.co/api/v1/tools/plan_campaign' \  -H "Authorization: Bearer $PROBABLY_API_KEY" \  -H 'Content-Type: application/json' \  -d '{  "spaceId": "a330a273-e64a-4183-aedb-f3152797a9a5",  "name": "string",  "productRecordId": "325e8cde-b631-46f8-ab4d-a44e138f037a",  "segmentRecordIds": [    "31e7be13-7414-4d91-a8c2-181a0c392d9e"  ],  "ads": 1,  "requestKey": "stringst"}'
{  "campaignId": "13f8bf6d-dc27-4a04-bffe-6e5b13c19ddf"}