Plan the next batch
plan_next_batch, 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.
Plan a campaign's next batch once its last one is made and has results: more ads for the segment, lead and hook kind its saved learnings say won, and about 30% of each segment's ads on combinations no batch tried yet (all of them, with no saved learning). A segment whose last body is still being made is left out. The campaign's pins come first and its choice of leads and hook kinds holds, but a pin whose lead or hook kind a saved learning says lost is dropped and listed in droppedPins, with why. Nothing is made or charged; change its ads, then prepare_campaign_batch. Pass a new requestKey; repeating one returns the same batch.
apiKeyAuthorizationBearer <token>An API key (prb_…) from Settings → Connections.
application/json- body
campaignId*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)$uuidads*integer1 <= value <= 10requestKey*string^[\w.:-]+$8 <= length <= 64The tool's answer.
application/json- response
batchId*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)$uuiddroppedPins*array<>[]curl -X POST 'https://studio.probably.co/api/v1/tools/plan_next_batch' \ -H "Authorization: Bearer $PROBABLY_API_KEY" \ -H 'Content-Type: application/json' \ -d '{ "campaignId": "13f8bf6d-dc27-4a04-bffe-6e5b13c19ddf", "ads": 1, "requestKey": "stringst"}'{ "batchId": "5579c111-9c50-47e2-af92-f16d52e63189", "droppedPins": []}