POST
/
v1
/
public
/
flowStates
curl --request POST \
  --url https://api.frigade.com/v1/public/flowStates \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "userId": "d34daa11-3745-4ac0-880e-d4b4d51fe13f",
  "groupId": "x34daa11-3745-4ac0-880e-d4b4d51fe13f",
  "flowSlug": "flow_abc",
  "stepId": "<string>",
  "data": {
    "action": "click"
  },
  "actionType": "COMPLETED_STEP"
}'
{
  "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",
              "flowResponses": [
                {
                  "flowSlug": "flow_abc",
                  "actionType": "STARTED_STEP",
                  "stepId": "step-1",
                  "data": "{\"key\": \"value\"}",
                  "createdAt": "2024-01-01T00:00:00Z"
                }
              ]
            }
          }
        ]
      },
      "$state": {
        "currentStepId": "step_abc",
        "currentStepIndex": 1,
        "completed": true,
        "started": true,
        "skipped": true,
        "visible": true,
        "lastActionAt": "2024-09-01T00:00:00.000Z",
        "flowResponses": [
          {
            "flowSlug": "flow_abc",
            "actionType": "STARTED_STEP",
            "stepId": "step-1",
            "data": "{\"key\": \"value\"}",
            "createdAt": "2024-01-01T00:00:00Z"
          }
        ]
      },
      "version": 1
    }
  ],
  "ineligibleFlows": [
    "<string>"
  ]
}

Authorizations

Authorization
string
header
required

Authentication header of the form Bearer: <token>, where <token> is either your public or private API key. See when to use which

Body

application/json
userId
string
required

The ID of the user

Example:

"d34daa11-3745-4ac0-880e-d4b4d51fe13f"

flowSlug
string
required

The Flow Slug

Example:

"flow_abc"

actionType
enum<string>
required

The type of action the user took

Available options:
STARTED_STEP,
COMPLETED_STEP,
SKIPPED_STEP,
NOT_STARTED_STEP,
STARTED_FLOW,
COMPLETED_FLOW,
SKIPPED_FLOW,
NOT_STARTED_FLOW
Example:

"COMPLETED_STEP"

groupId
string

Optional ID of the group

Example:

"x34daa11-3745-4ac0-880e-d4b4d51fe13f"

stepId
string

The Step ID if updating a specific Step

data
string

Any optional data including the user action

Example:
{ "action": "click" }

Response

201 - application/json
The user's state in the Flow was updated
eligibleFlows
object[]

List of Flows that the user is eligible for as well as the user's state in each Flow

ineligibleFlows
string[]

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