userFlowStates

POST /v1/public/flowStates

Updates the user's state in a single Flow

Request

  • The document declares no server URL.
  • Auth
    HTTP bearer

Request body

userIdstring required

The ID of the user

groupIdstring

Optional ID of the group

flowSlugstring required

The Flow Slug

stepIdstring

The Step ID if updating a specific Step

datastring

Any optional data including the user action

actionType'STARTED_STEP' | 'COMPLETED_STEP' | 'SKIPPED_STEP' | 'NOT_STARTED_STEP' | 'STARTED_FLOW' | 'COMPLETED_FLOW' | 'SKIPPED_FLOW' | 'NOT_STARTED_FLOW' required

The type of action the user took

Example request

{
  "userId": "d34daa11-3745-4ac0-880e-d4b4d51fe13f",
  "groupId": "x34daa11-3745-4ac0-880e-d4b4d51fe13f",
  "flowSlug": "flow_abc",
  "actionType": "COMPLETED_STEP"
}

Response

The user's state in the Flow was updated

ineligibleFlowsstring[]

List of Flow IDs that the user is ineligible for (for instance if a Flow is turned off)

Example response

{
  "eligibleFlows": [
    {
      "flowSlug": "flow_abc",
      "flowName": "Onboarding Checklist",
      "flowType": "ANNOUNCEMENT",
      "data": {
        "steps": [
          {
            "id": "step_abc",
            "$state": {
              "completed": true,
              "skipped": true,
              "started": true,
              "visible": true,
              "blocked": true,
              "lastActionAt": "2024-09-01T00:00:00.000Z"
            }
          }
        ]
      },
      "$state": {
        "currentStepId": "step_abc",
        "currentStepIndex": 1,
        "completed": true,
        "started": true,
        "skipped": true,
        "visible": true,
        "lastActionAt": "2024-09-01T00:00:00.000Z"
      }
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.