Skip to main content
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
      }
    ]
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.affonso.io/llms.txt

Use this file to discover all available pages before exploring further.

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_choicetext_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

name
string
Form display name. 1–200 characters.
description
string | null
Optional form description. Maximum 1000 characters. Pass null to clear it.
questions
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 updated OnboardingForm 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
      }
    ]
  }
}

Notes

  • Required permission: write:program.
  • Returns 404 NOT_FOUND if no onboarding form exists yet — call POST /v1/onboarding-form first.
  • Question IDs that do not belong to your team’s onboarding form return a 400 VALIDATION_ERROR.