curl -X POST "https://api.affonso.io/v1/affiliates/cmj8pptm10002p3010z8mk9ak/onboarding-responses" \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"responses": [
{
"question_id": "cmq1onb000onbq1",
"answer": ["Newsletter", "Blog"]
},
{
"question_id": "cmq1onb000onbq2",
"answer": "Mostly indie SaaS founders and bootstrapped teams."
}
],
"mark_complete": true
}'
{
"success": true,
"data": {
"form_id": "cmf8onb0001p3010onbform1",
"form_name": "Affiliate Onboarding",
"form_description": "Tell us a bit about how you plan to promote our product.",
"completed_at": "2024-04-22T17:32:11.000Z",
"questions": [
{
"id": "cmq1onb000onbq1",
"question": "Which channels will you use to promote us?",
"type": "multiple_choice",
"is_required": true,
"options": ["YouTube", "Newsletter", "Blog", "Social"],
"order": 0,
"answer": ["Newsletter", "Blog"]
},
{
"id": "cmq1onb000onbq2",
"question": "Tell us about your audience",
"type": "textarea",
"is_required": false,
"options": [],
"order": 1,
"answer": "Mostly indie SaaS founders and bootstrapped teams."
}
]
}
}
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Cannot mark onboarding as complete — required questions are unanswered",
"field": "mark_complete",
"missing_question_ids": ["cmq1onb000onbq1"]
}
}
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Answer for multiple_choice must be an array of strings",
"field": "responses[0].answer"
}
}
Affiliate Onboarding
Submit Onboarding Responses
Upsert one or more answers for an affiliate and optionally mark onboarding as complete
POST
/
v1
/
affiliates
/
{id}
/
onboarding-responses
curl -X POST "https://api.affonso.io/v1/affiliates/cmj8pptm10002p3010z8mk9ak/onboarding-responses" \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"responses": [
{
"question_id": "cmq1onb000onbq1",
"answer": ["Newsletter", "Blog"]
},
{
"question_id": "cmq1onb000onbq2",
"answer": "Mostly indie SaaS founders and bootstrapped teams."
}
],
"mark_complete": true
}'
{
"success": true,
"data": {
"form_id": "cmf8onb0001p3010onbform1",
"form_name": "Affiliate Onboarding",
"form_description": "Tell us a bit about how you plan to promote our product.",
"completed_at": "2024-04-22T17:32:11.000Z",
"questions": [
{
"id": "cmq1onb000onbq1",
"question": "Which channels will you use to promote us?",
"type": "multiple_choice",
"is_required": true,
"options": ["YouTube", "Newsletter", "Blog", "Social"],
"order": 0,
"answer": ["Newsletter", "Blog"]
},
{
"id": "cmq1onb000onbq2",
"question": "Tell us about your audience",
"type": "textarea",
"is_required": false,
"options": [],
"order": 1,
"answer": "Mostly indie SaaS founders and bootstrapped teams."
}
]
}
}
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Cannot mark onboarding as complete — required questions are unanswered",
"field": "mark_complete",
"missing_question_ids": ["cmq1onb000onbq1"]
}
}
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Answer for multiple_choice must be an array of strings",
"field": "responses[0].answer"
}
}
Upserts one answer per question (existing answers are overwritten in place). Optionally pass
mark_complete: true to record a completion — this fails with 400 VALIDATION_ERROR if any required question is still unanswered after this submission.
Path Parameters
string
required
The unique identifier of the affiliate
Body Parameters
array
required
Up to 100 answers. Each answer must reference an active question by ID. Duplicate
question_id values in the same payload are rejected.May be empty ([]) only when mark_complete: true — useful for finalizing onboarding after answers were saved incrementally over earlier calls. An empty array with mark_complete: false is rejected with a 400 VALIDATION_ERROR.Show Response Properties
Show Response Properties
string
required
ID of an active question on your team’s onboarding form.
string | array
required
stringforsingle_choice,text_input,textarea(max 5000 characters)array of stringsformultiple_choice(max 100 entries; each entry max 5000 characters)
type — submitting an array for a text_input (or vice versa) returns a 400 VALIDATION_ERROR.boolean
default:"false"
When
true, records an onboarding completion for this affiliate. The completion row is unique per affiliate + form, so subsequent calls with mark_complete: true are idempotent — completed_at is preserved from the first successful completion.If any required question is still unanswered after this submission, the request fails with 400 VALIDATION_ERROR and the missing_question_ids list.Response
Returns the same payload shape asGET /v1/affiliates/{id}/onboarding-responses — the full active form with all of the affiliate’s saved answers and the latest completed_at value.
curl -X POST "https://api.affonso.io/v1/affiliates/cmj8pptm10002p3010z8mk9ak/onboarding-responses" \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"responses": [
{
"question_id": "cmq1onb000onbq1",
"answer": ["Newsletter", "Blog"]
},
{
"question_id": "cmq1onb000onbq2",
"answer": "Mostly indie SaaS founders and bootstrapped teams."
}
],
"mark_complete": true
}'
{
"success": true,
"data": {
"form_id": "cmf8onb0001p3010onbform1",
"form_name": "Affiliate Onboarding",
"form_description": "Tell us a bit about how you plan to promote our product.",
"completed_at": "2024-04-22T17:32:11.000Z",
"questions": [
{
"id": "cmq1onb000onbq1",
"question": "Which channels will you use to promote us?",
"type": "multiple_choice",
"is_required": true,
"options": ["YouTube", "Newsletter", "Blog", "Social"],
"order": 0,
"answer": ["Newsletter", "Blog"]
},
{
"id": "cmq1onb000onbq2",
"question": "Tell us about your audience",
"type": "textarea",
"is_required": false,
"options": [],
"order": 1,
"answer": "Mostly indie SaaS founders and bootstrapped teams."
}
]
}
}
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Cannot mark onboarding as complete — required questions are unanswered",
"field": "mark_complete",
"missing_question_ids": ["cmq1onb000onbq1"]
}
}
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Answer for multiple_choice must be an array of strings",
"field": "responses[0].answer"
}
}
Notes
- Required permission:
write:affiliates. - Answers are validated against the question’s
type, but not against the configuredoptions. This matches the behavior of the hosted onboarding flow.
Was this page helpful?
