Probably
Docs

Prepare a segment's openings

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

Prepare making a segment's openings once its body is delivered: one hook variant of the body per opening ad, named by its code, each opening with its own hook and lead while every body scene keeps its footage. The preview shows each one's credits and the total, and charged at quotes their quote, with quote.mostCredits, the most correction rounds can bring it to, to show first. Show the person the preview. If the connection may spend, call confirm_spend with the confirmationId once they agree; otherwise send them the confirmUrl to confirm it in the studio. It expires in 15 minutes. Pass a new requestKey; repeating one returns the same confirmation.

Authorization

apiKey
headerAuthorizationBearer <token>

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

Request Body

application/json
  1. body
batchId*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
segmentRecordId*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
requestKey*string
Match^[\w.:-]+$
Length8 <= length <= 64

Response Body

The tool's answer.

application/json
  1. response
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
confirmationId*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
expiresAt*string
preview*||||||
confirmUrl*|null
curl -X POST 'https://studio.probably.co/api/v1/tools/prepare_campaign_openings' \  -H "Authorization: Bearer $PROBABLY_API_KEY" \  -H 'Content-Type: application/json' \  -d '{  "batchId": "0d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6",  "segmentRecordId": "1e2f3a4b-5c6d-4e7f-9081-92a3b4c5d6e7",  "requestKey": "openings-trailguard-1"}'
{  "spaceId": "5b0e7c1a-3f52-4d8e-9a61-2c4f8e9d7b30",  "confirmationId": "e7a1b2c3-d4e5-4f60-8172-93a4b5c6d7e8",  "expiresAt": "2026-10-25T09:15:00.000Z",  "preview": {    "kind": "campaign-openings",    "count": 2,    "eachCredits": 214,    "totalCredits": 428,    "availableCredits": 1840,    "fits": true,    "quote": {      "priceCredits": 428,      "mostCredits": 1068,      "pricingVersion": "2026-10-26.1",      "lines": [        {          "line": "script",          "credits": 40        },        {          "line": "stills",          "credits": 64        },        {          "line": "voice",          "credits": 28        },        {          "line": "clips",          "credits": 296        }      ],      "corrections": {        "rounds": [          {            "line": "script",            "credits": 25          },          {            "line": "stills",            "credits": 30          },          {            "line": "voice",            "credits": 25          },          {            "line": "clips",            "credits": 270          }        ],        "maxRoundsPerStage": 3,        "maxRounds": 10,        "maxCredits": 640      }    },    "sandbox": false  },  "confirmUrl": null}