Update User Flow State
Updates the user’s state in a single Flow
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
Authentication header of the form Bearer: <token>
, where <token>
is either your public or private API key. See when to use which
Body
The ID of the user
"d34daa11-3745-4ac0-880e-d4b4d51fe13f"
The Flow Slug
"flow_abc"
The type of action the user took
STARTED_STEP
, COMPLETED_STEP
, SKIPPED_STEP
, NOT_STARTED_STEP
, STARTED_FLOW
, COMPLETED_FLOW
, SKIPPED_FLOW
, NOT_STARTED_FLOW
"COMPLETED_STEP"
Optional ID of the group
"x34daa11-3745-4ac0-880e-d4b4d51fe13f"
The Step ID if updating a specific Step
Any optional data including the user action
{ "action": "click" }
Response
List of Flows that the user is eligible for as well as the user's state in each Flow
The Flow Slug
"flow_abc"
The Flow Name
"Onboarding Checklist"
The Flow Type
"ANNOUNCEMENT"
The Flow's metadata including the user's state in each step
List of Steps in the Flow
The Step ID
"step_abc"
The Step State
Whether the Step is completed
true
Whether the Step has been skipped
true
Whether the Step has been started
true
Whether the Step is visible (based on visibilityCriteria
)
true
Whether the Step is blocked (based on startCriteria
)
true
The last time the user took an action on the Step
"2024-09-01T00:00:00.000Z"
The flow responses associated with the user in the Step. This is only available when using a private API key.
[
{
"flowSlug": "flow_abc",
"actionType": "STARTED_STEP",
"stepId": "step-1",
"data": "{\"key\": \"value\"}",
"createdAt": "2024-01-01T00:00:00Z"
}
]
The user's state in the Flow
The current step (if any) the user is on
"step_abc"
The index of the current step in the Flow. Will be -1 if the user has not started the Flow
1
Whether the Flow is completed
true
Whether the Flow has been started
true
Whether the Flow has been skipped/dismissed
true
Whether the Flow is visible (based on the Flow's Targeting)
true
The last time the user took an action on the Flow
"2024-09-01T00:00:00.000Z"
The flow responses associated with the user in the Flow. This is only available when using a private API key.
The ID of the Flow
"flow_abc"
The ID of the Step
"step-1"
The JSON serialized data of the Flow response (for instance form data).
"{\"key\": \"value\"}"
The action type of the step. Possible values: STARTED_STEP
, COMPLETED_STEP
, SKIPPED_STEP
, NOT_STARTED_STEP
, STARTED_FLOW
, COMPLETED_FLOW
, SKIPPED_FLOW
, NOT_STARTED_FLOW
"STARTED_STEP"
The timestamp of the flow response
"2024-01-01T00:00:00Z"
[
{
"flowSlug": "flow_abc",
"actionType": "STARTED_STEP",
"stepId": "step-1",
"data": "{\"key\": \"value\"}",
"createdAt": "2024-01-01T00:00:00Z"
}
]
The version number of the Flow
1
List of Flow IDs that the user is ineligible for (for instance if a Flow is turned off)
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>"
]
}