Restore a form version into its draft
Copy a published version of a form back into its draft (a new draft revision). Creators see it when the flow is published. Returns the form.
bearerAuth onboarding:writeAuthorizationBearer <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.
Scope: onboarding:write
brandId*stringA brand id from GET /me or GET /creator/brands.
1 <= lengthformId*stringA form id from GET .../onboarding/flows/{flowId} (forms, or a form task's formId).
1 <= lengthversionId*stringA version id from the form's versions.
1 <= lengthSuccess.
application/json- response
id*stringflowId*|The flow that owns it.
name*stringrevision*numberSend as revision to PATCH .../onboarding/forms/{formId}.
archived*booleandefinition*The draft.
published*|The live version creators fill in. Null: never published.
versions*array<>Published versions, newest first. Restore one with POST .../versions/{versionId}/restore.
problems*array<string>What in the draft blocks publishing. Empty when it's ready.
curl -X POST 'https://example.com/api/v1/brands/string/onboarding/forms/string/versions/string/restore'{ "id": "string", "flowId": "string", "name": "string", "revision": 0, "archived": true, "definition": { "sections": [ { "id": "string", "title": "string", "description": "string", "pageBreak": true, "condition": { "fieldId": "string", "op": "equals", "value": "string" }, "fields": [ { "id": "string", "type": "short_text", "label": "string", "help": "string", "placeholder": "string", "required": false, "width": "full", "options": [ "string" ], "validation": { "minLength": 0, "maxLength": 1, "min": 0, "max": 0, "pattern": "string", "patternMessage": "string", "allowedDomains": [ "string" ] }, "platform": "instagram", "profileKey": "name", "rating": { "max": 5 }, "file": { "accept": [ "image" ], "maxMb": 1 }, "media": { "kind": "image", "url": "string", "fileId": "string" }, "condition": { "fieldId": "string", "op": "equals", "value": "string" } } ] } ] }, "published": { "versionId": "string", "version": 0, "definition": { "sections": [ { "id": "string", "title": "string", "description": "string", "pageBreak": true, "condition": { "fieldId": "string", "op": "equals", "value": "string" }, "fields": [ { "id": "string", "type": "short_text", "label": "string", "help": "string", "placeholder": "string", "required": false, "width": "full", "options": [ "string" ], "validation": { "minLength": 0, "maxLength": 1, "min": 0, "max": 0, "pattern": "string", "patternMessage": "string", "allowedDomains": [ "string" ] }, "platform": "instagram", "profileKey": "name", "rating": { "max": 5 }, "file": { "accept": [ "image" ], "maxMb": 1 }, "media": { "kind": "image", "url": "string", "fileId": "string" }, "condition": { "fieldId": "string", "op": "equals", "value": "string" } } ] } ] } }, "versions": [ { "id": "string", "version": 0, "publishedAt": "string" } ], "problems": [ "string" ]}Replace a form's draft PATCH
Save a form's draft definition, as the form builder does. It replaces the whole draft: send every section and question, keeping the ids of questions you keep (answers are stored under them). Creators see it when the flow is published. The draft's `revision` as you last read it. If anyone has saved the draft since, nothing is saved and the call answers 409 conflict with `details.currentRevision`: read it again, reapply your change, and retry. Returns the new revision and what still blocks publishing the form.
Set or clear the creator a sign-up link credits POST
Choose which of the brand's creators a flow link credits for referrals, or clear it with null, as the link dialog's referrer does. Moves money: when a creator who joined through the link passes their trial and the brand's referral bonus is on, the referrer named on the link at that moment earns it. So the change also reaches creators who already joined through the link and are still in their trial; creators who already earned a referral payout keep its referrer. The creator must be one of the brand's (400 `bad_creator` otherwise). Full admins only; a brand key can do it. Read the current referrer with brand.invite-codes.list (`referrer`) or a dryRun. With ?dryRun=true nothing is written: the answer shows the referrer before and after, the brand's referral bonus, and how many creators joined through the link, already earned a referral payout, or are still in their trial.