curl -X PATCH "https://api.affonso.io/v1/onboarding-form" \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Onboarding",
"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
},
{
"question": "What is your website URL?",
"type": "text_input",
"is_required": false,
"order": 1
}
]
}'
{
"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
PATCH
/
v1
/
onboarding-form
curl -X PATCH "https://api.affonso.io/v1/onboarding-form" \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Onboarding",
"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
},
{
"question": "What is your website URL?",
"type": "text_input",
"is_required": false,
"order": 1
}
]
}'
{
"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
idare updated. - Items without
idare created as new questions. - Existing questions omitted from the array are soft-deleted (
statusset tofalse).
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.Body Parameters
string
Form display name. 1–200 characters.
string | null
Optional form description. Maximum 1000 characters. Pass
null to clear it.array
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.Response
Returns the updatedOnboardingForm object — same shape as GET /v1/onboarding-form.
curl -X PATCH "https://api.affonso.io/v1/onboarding-form" \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Onboarding",
"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
},
{
"question": "What is your website URL?",
"type": "text_input",
"is_required": false,
"order": 1
}
]
}'
{
"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"
}
}
Notes
- Required permission:
write:program. - Returns
404 NOT_FOUNDif no onboarding form exists yet — callPOST /v1/onboarding-formfirst. - Question IDs that do not belong to your team’s onboarding form return a
400 VALIDATION_ERROR.
Was this page helpful?
