cURL
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",
"flowSlug": "flow_abc",
"actionType": "COMPLETED_STEP",
"groupId": "x34daa11-3745-4ac0-880e-d4b4d51fe13f",
"stepId": "<string>",
"data": {
"action": "click"
}
}
'import requests
url = "https://api.frigade.com/v1/public/flowStates"
payload = {
"userId": "d34daa11-3745-4ac0-880e-d4b4d51fe13f",
"flowSlug": "flow_abc",
"actionType": "COMPLETED_STEP",
"groupId": "x34daa11-3745-4ac0-880e-d4b4d51fe13f",
"stepId": "<string>",
"data": { "action": "click" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
userId: 'd34daa11-3745-4ac0-880e-d4b4d51fe13f',
flowSlug: 'flow_abc',
actionType: 'COMPLETED_STEP',
groupId: 'x34daa11-3745-4ac0-880e-d4b4d51fe13f',
stepId: '<string>',
data: {action: 'click'}
})
};
fetch('https://api.frigade.com/v1/public/flowStates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.frigade.com/v1/public/flowStates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'userId' => 'd34daa11-3745-4ac0-880e-d4b4d51fe13f',
'flowSlug' => 'flow_abc',
'actionType' => 'COMPLETED_STEP',
'groupId' => 'x34daa11-3745-4ac0-880e-d4b4d51fe13f',
'stepId' => '<string>',
'data' => [
'action' => 'click'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.frigade.com/v1/public/flowStates"
payload := strings.NewReader("{\n \"userId\": \"d34daa11-3745-4ac0-880e-d4b4d51fe13f\",\n \"flowSlug\": \"flow_abc\",\n \"actionType\": \"COMPLETED_STEP\",\n \"groupId\": \"x34daa11-3745-4ac0-880e-d4b4d51fe13f\",\n \"stepId\": \"<string>\",\n \"data\": {\n \"action\": \"click\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.frigade.com/v1/public/flowStates")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"userId\": \"d34daa11-3745-4ac0-880e-d4b4d51fe13f\",\n \"flowSlug\": \"flow_abc\",\n \"actionType\": \"COMPLETED_STEP\",\n \"groupId\": \"x34daa11-3745-4ac0-880e-d4b4d51fe13f\",\n \"stepId\": \"<string>\",\n \"data\": {\n \"action\": \"click\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.frigade.com/v1/public/flowStates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"userId\": \"d34daa11-3745-4ac0-880e-d4b4d51fe13f\",\n \"flowSlug\": \"flow_abc\",\n \"actionType\": \"COMPLETED_STEP\",\n \"groupId\": \"x34daa11-3745-4ac0-880e-d4b4d51fe13f\",\n \"stepId\": \"<string>\",\n \"data\": {\n \"action\": \"click\"\n }\n}"
response = http.request(request)
puts response.read_body{
"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>"
]
}Flows
Update User Flow State
Updates the user’s state in a single Flow
POST
/
v1
/
public
/
flowStates
cURL
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",
"flowSlug": "flow_abc",
"actionType": "COMPLETED_STEP",
"groupId": "x34daa11-3745-4ac0-880e-d4b4d51fe13f",
"stepId": "<string>",
"data": {
"action": "click"
}
}
'import requests
url = "https://api.frigade.com/v1/public/flowStates"
payload = {
"userId": "d34daa11-3745-4ac0-880e-d4b4d51fe13f",
"flowSlug": "flow_abc",
"actionType": "COMPLETED_STEP",
"groupId": "x34daa11-3745-4ac0-880e-d4b4d51fe13f",
"stepId": "<string>",
"data": { "action": "click" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
userId: 'd34daa11-3745-4ac0-880e-d4b4d51fe13f',
flowSlug: 'flow_abc',
actionType: 'COMPLETED_STEP',
groupId: 'x34daa11-3745-4ac0-880e-d4b4d51fe13f',
stepId: '<string>',
data: {action: 'click'}
})
};
fetch('https://api.frigade.com/v1/public/flowStates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.frigade.com/v1/public/flowStates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'userId' => 'd34daa11-3745-4ac0-880e-d4b4d51fe13f',
'flowSlug' => 'flow_abc',
'actionType' => 'COMPLETED_STEP',
'groupId' => 'x34daa11-3745-4ac0-880e-d4b4d51fe13f',
'stepId' => '<string>',
'data' => [
'action' => 'click'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.frigade.com/v1/public/flowStates"
payload := strings.NewReader("{\n \"userId\": \"d34daa11-3745-4ac0-880e-d4b4d51fe13f\",\n \"flowSlug\": \"flow_abc\",\n \"actionType\": \"COMPLETED_STEP\",\n \"groupId\": \"x34daa11-3745-4ac0-880e-d4b4d51fe13f\",\n \"stepId\": \"<string>\",\n \"data\": {\n \"action\": \"click\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.frigade.com/v1/public/flowStates")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"userId\": \"d34daa11-3745-4ac0-880e-d4b4d51fe13f\",\n \"flowSlug\": \"flow_abc\",\n \"actionType\": \"COMPLETED_STEP\",\n \"groupId\": \"x34daa11-3745-4ac0-880e-d4b4d51fe13f\",\n \"stepId\": \"<string>\",\n \"data\": {\n \"action\": \"click\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.frigade.com/v1/public/flowStates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"userId\": \"d34daa11-3745-4ac0-880e-d4b4d51fe13f\",\n \"flowSlug\": \"flow_abc\",\n \"actionType\": \"COMPLETED_STEP\",\n \"groupId\": \"x34daa11-3745-4ac0-880e-d4b4d51fe13f\",\n \"stepId\": \"<string>\",\n \"data\": {\n \"action\": \"click\"\n }\n}"
response = http.request(request)
puts response.read_body{
"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
application/json
The ID of the user
Example:
"d34daa11-3745-4ac0-880e-d4b4d51fe13f"
The Flow Slug
Example:
"flow_abc"
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"
Optional ID of the group
Example:
"x34daa11-3745-4ac0-880e-d4b4d51fe13f"
The Step ID if updating a specific Step
Any optional data including the user action
Example:
{ "action": "click" }
Response
201 - application/json
The user's state in the Flow was updated
⌘I