{ "success": true, "data": { "id": "cmf8onb0001p3010onbform1", "name": "Updated Onboarding", "description": "Tell us about how you plan to promote our product.", "created_at": "2024-04-10T08:00:00.000Z", "updated_at": "2024-04-20T10:15:00.000Z", "questions": [ { "id": "cmq1onb000onbq1", "question": "Which channels will you use to promote us?", "type": "multiple_choice", "is_required": true, "options": ["YouTube", "Newsletter", "Blog", "Social", "Podcast"], "order": 0 }, { "id": "cmq1onb000onbq3", "question": "What is your website URL?", "type": "text_input", "is_required": false, "options": [], "order": 1 } ] }}
{ "success": false, "error": { "code": "VALIDATION_ERROR", "message": "Question cmq1onb000onbqXX does not belong to this onboarding form", "field": "questions" }}
Affiliate Onboarding
Update Onboarding Form
Update form metadata and/or replace the question set atomically
{ "success": true, "data": { "id": "cmf8onb0001p3010onbform1", "name": "Updated Onboarding", "description": "Tell us about how you plan to promote our product.", "created_at": "2024-04-10T08:00:00.000Z", "updated_at": "2024-04-20T10:15:00.000Z", "questions": [ { "id": "cmq1onb000onbq1", "question": "Which channels will you use to promote us?", "type": "multiple_choice", "is_required": true, "options": ["YouTube", "Newsletter", "Blog", "Social", "Podcast"], "order": 0 }, { "id": "cmq1onb000onbq3", "question": "What is your website URL?", "type": "text_input", "is_required": false, "options": [], "order": 1 } ] }}
{ "success": false, "error": { "code": "VALIDATION_ERROR", "message": "Question cmq1onb000onbqXX does not belong to this onboarding form", "field": "questions" }}
Provide at least one of name, description, or questions. The whole update runs in a single transaction.When questions is provided, the array fully replaces the existing question set:
Items with an existing id are updated.
Items without id are created as new questions.
Existing questions omitted from the array are soft-deleted (status set to false).
Existing affiliate answers are preserved during soft-delete and remain queryable internally — orphan questions are cleaned up by a separate periodic job.
Type changes are not migrated. Changing a question’s type (e.g. single_choice → text_input) does not transform existing answers. Re-shape your answer storage on the consumer side, or wipe responses for that question, before changing types.
1–50 questions. When provided, this array fully replaces the active question set. See Create Onboarding Form for the question schema.Include id for an existing question to update it; omit id to create a new one. Duplicate id values in the same payload are rejected with a validation error.
{ "success": true, "data": { "id": "cmf8onb0001p3010onbform1", "name": "Updated Onboarding", "description": "Tell us about how you plan to promote our product.", "created_at": "2024-04-10T08:00:00.000Z", "updated_at": "2024-04-20T10:15:00.000Z", "questions": [ { "id": "cmq1onb000onbq1", "question": "Which channels will you use to promote us?", "type": "multiple_choice", "is_required": true, "options": ["YouTube", "Newsletter", "Blog", "Social", "Podcast"], "order": 0 }, { "id": "cmq1onb000onbq3", "question": "What is your website URL?", "type": "text_input", "is_required": false, "options": [], "order": 1 } ] }}
{ "success": false, "error": { "code": "VALIDATION_ERROR", "message": "Question cmq1onb000onbqXX does not belong to this onboarding form", "field": "questions" }}