Bloss Docs

Schedule, start, pause, end, close or delete a campaign

Developers
POST
/brands/{brandId}/campaigns/{campaignId}/actions

Run one campaign action, as the buttons on the campaign's page do. Only one campaign can be Live or Paused at a time: starting one while another runs needs handover: true, which ends the running one at the same moment. Days are YYYY-MM-DD in the brand's time zone; Start now, End now, Pause and Resume happen at the moment of the call. Starting, ending and closing need a dry run first: call with ?dryRun=true, check from, to and changes with the user, then call again with the same body and the confirmToken it returned. Without the token those actions answer 400; with a token from before the campaign changed, 409. A refusal answers 400, 404 or 409 with the sentence as the message and a stable code in details.reason (for example needs_handover, overlaps_another, open_ended_running, payment_in_flight, sets_still_earning, has_payments, not_allowed). Deleting a campaign that has started needs its name as confirmName; one that had money paid can't be deleted (close it instead). Full admins only. Returns the campaign, the states before and after, and figuresStale when the figures will catch up at the next sync.

Authorization

bearerAuth campaigns:write
headerAuthorizationBearer <token>

Personal access token. Scopes: account:read, creator:read, creator:earnings, managed:read, coach:read, brand:read, creators:read, videos:read, analytics:read, onboarding:read, onboarding:signatures, engagement:read, support:read, integrations:read, payouts:read, funds:read, billing:read, groups:write, videos:write, onboarding:write, sync:write, payouts:write, campaigns:write.

Scope: campaigns:write

Path Parameters

brandId*string

A brand id from GET /me or GET /creator/brands.

Length1 <= length
campaignId*string

A campaign id from GET /brands/{brandId}/campaigns. A payout cycle id is the same id.

Length1 <= length

Query Parameters

dryRun?string

"true": run every check and return { dryRun: true, wouldChange } without changing anything.

Value in"true""false"

Request Body

application/json
  1. body
action*string

schedule (a draft gets its days), unschedule (back to a draft), start_now, change_dates (move a scheduled campaign, or extend, shorten or open-end a started one), pause, resume, remove_pause (its time becomes live time and its posts join), end_now, close (the figures become final), reopen, delete, restore.

Value in"schedule""unschedule""start_now""change_dates""pause""resume""remove_pause""end_now""close""reopen""delete""restore"
startDate?string

schedule (required) and change_dates: the first day, YYYY-MM-DD in the brand's time zone.

endDate?|

schedule, start_now and change_dates (required there): the last day, YYYY-MM-DD; null = open-ended. start_now without it keeps the end it has.

handover?boolean

start_now: end the campaign running now at the same moment and start this one.

trialOnStart?string

schedule and start_now: what creators on trial under an earlier campaign's rule do when this one starts. keep (the default) leaves them on their rule; move puts them on this campaign's trial rule, which can pass or fail them at once and, with no trial rule, passes them. Stored on the campaign; omitted keeps the stored choice. Creators waiting for a campaign start on this one's rule either way.

Value in"keep""move"
pauseId?string

remove_pause: a pause id from brand.campaigns.get.

Length1 <= length
confirmName?string

delete, on a campaign that has started: its name.

note?string

Kept in the campaign's history.

Lengthlength <= 500
confirmToken?string

The confirmToken a dry run of this same action returned. Required when the action starts, ends or closes the campaign.

Response Body

Success.

application/json
  1. response
campaign*
from*string

"draft" (saved, not started), "scheduled" (starts by itself on its start day), "live" (posts count), "paused" (new posts do not count; sets keep earning), "ended" (no new posts count; money can still be owed and paid), "closed" (the figures are final) or "deleted" (hidden, restorable for 30 days).

Value in"draft""scheduled""live""paused""ended""closed""deleted"
to*string

"draft" (saved, not started), "scheduled" (starts by itself on its start day), "live" (posts count), "paused" (new posts do not count; sets keep earning), "ended" (no new posts count; money can still be owed and paid), "closed" (the figures are final) or "deleted" (hidden, restorable for 30 days).

Value in"draft""scheduled""live""paused""ended""closed""deleted"
changed*boolean

False when it was already as asked.

figuresStale*boolean

The change landed, but the figures will only catch up at the next sync.

curl -X POST 'https://example.com/api/v1/brands/string/campaigns/string/actions' \  -H 'Content-Type: application/json' \  -d '{  "action": "schedule"}'
{  "campaign": {    "id": "string",    "name": "string",    "state": "draft",    "current": true,    "postsCount": true,    "startDate": "string",    "endDate": "string",    "startAt": "string",    "endAt": "string",    "openEnded": true,    "pausedSince": "string",    "pauseReason": "admin",    "closedAt": "string",    "deletedAt": "string",    "restorableUntil": "string",    "payEveryoneSame": true,    "notes": "string",    "actions": [      "edit"    ],    "money": {      "earned": 0,      "owed": 0    },    "setsStillEarning": -9007199254740991,    "earningUntil": "string",    "createdAt": "string"  },  "from": "draft",  "to": "draft",  "changed": true,  "figuresStale": true}

Was this page helpful?