---
title: "POST /v1/public/flowStates"
method: POST
path: "/v1/public/flowStates"
tags: ["userFlowStates"]
---

# POST /v1/public/flowStates

`POST /v1/public/flowStates`

## Request

- The document declares no server URL.
- Auth: HTTP bearer

Updates the user's state in a single Flow

## Request body

- UserFlowStateDTO
  - `userId` string, required: The ID of the user
  - `groupId` string: Optional ID of the group
  - `flowSlug` string, required: The Flow Slug
  - `stepId` string: The Step ID if updating a specific Step
  - `data` string: 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

## Response `201`

The user's state in the Flow was updated

- PublicUserFlowStateV2
  - `eligibleFlows` StatefulFlow[]: List of Flows that the user is eligible for as well as the user's state in each Flow
    - `flowSlug` string: The Flow Slug
    - `flowName` string: The Flow Name
    - `flowType` string: The Flow Type
    - `data` StatefulFlowData
      - `steps` StatefulStep[]: List of Steps in the Flow
        - `id` string: The Step ID
        - `$state` StatefulStepState
          - `completed` boolean: Whether the Step is completed
          - `skipped` boolean: Whether the Step has been skipped
          - `started` boolean: Whether the Step has been started
          - `visible` boolean: Whether the Step is visible (based on `visibilityCriteria`)
          - `blocked` boolean: Whether the Step is blocked (based on `startCriteria`)
          - `lastActionAt` string, date-time: The last time the user took an action on the Step
    - `$state` StatefulFlowState
      - `currentStepId` string: The current step (if any) the user is on
      - `currentStepIndex` number: The index of the current step in the Flow. Will be -1 if the user has not started the Flow
      - `completed` boolean: Whether the Flow is completed
      - `started` boolean: Whether the Flow has been started
      - `skipped` boolean: Whether the Flow has been skipped/dismissed
      - `visible` boolean: Whether the Flow is visible (based on the Flow's Targeting)
      - `lastActionAt` string, date-time: The last time the user took an action on the Flow
  - `ineligibleFlows` string[]: List of Flow IDs that the user is ineligible for (for instance if a Flow is turned off)

---

[API](https://skmtc.dev/frigadehq/apis/frigade-api.md) - [All operations](https://skmtc.dev/frigadehq/apis/frigade-api/llms.txt) - [OpenAPI document](https://skmtc.dev/frigadehq/apis/frigade-api/revisions/92c033821b45?raw)
