PUT
/
v1
/
flows
/
{numericFlowId}
curl --request PUT \
  --url https://api.frigade.com/v1/flows/{numericFlowId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "New User Announcement",
  "data": "{\"steps\": [{\"id\": \"step_1\", \"title\": \"Welcome to my app!\", \"subtitle\": \"Let me show you around.\"}]}",
  "description": "This is a Flow that welcomes new users to the app",
  "targetingLogic": "user.property('\''isAdmin'\'') == true",
  "type": "CHECKLIST",
  "active": true
}'
{
  "id": 123,
  "name": "New User Announcement",
  "data": "{\"steps\": [{\"id\": \"step_1\", \"title\": \"Welcome to my app!\", \"subtitle\": \"Let me show you around.\"}]}",
  "targetingLogic": "user.property('isAdmin') == true",
  "type": "CHECKLIST",
  "slug": "flow_abc",
  "createdAt": "2024-01-01T00:00:00Z",
  "modifiedAt": "2024-01-01T00:00:00Z",
  "version": 1,
  "status": "ACTIVE",
  "codeSnippet": "<Frigade.Announcement flowId=\"my-flow-id\" />"
}

As this endpoint modifies data, you will need to use the private API key.

Only call this endpoint from your backend code.

Obtaining the numeric ID of a Flow

To obtain the numeric ID of a Flow, you should make a GET request to get the Flow you are looking to change. The numeric ID is a number and is different from the slug (e.g. flow_GzXC2fHz). The reason for this is that different versions of the Flow share the same slug but have different numeric IDs to differentiate them.

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
name
string

The name of the Flow

Example:

"New User Announcement"

data
string

JSON or YAML encoded raw data of thew Flow. If provided in JSON format it will be converted to YAML automatically

Example:

"{\"steps\": [{\"id\": \"step_1\", \"title\": \"Welcome to my app!\", \"subtitle\": \"Let me show you around.\"}]}"

description
string

The description of the Flow

Example:

"This is a Flow that welcomes new users to the app"

targetingLogic
string

The targeting logic for the Flow

Example:

"user.property('isAdmin') == true"

type
enum<string>

The type of Flow

Available options:
ANNOUNCEMENT,
BANNER,
CARD,
CHECKLIST,
CUSTOM,
FORM,
SURVEY,
TOUR
Example:

"CHECKLIST"

active
boolean

Whether the Flow is active or not. If set to false, the Flow will not be shown to users

Example:

true

Response

200 - application/json
The flow has been successfully updated.
id
number

The numeric ID of the Flow. This number will be different depending on the version used

name
string

The name of the Flow

Example:

"New User Announcement"

data
string

JSON encoded raw data of the Flow as defined in the Flow's YAML configuration

Example:

"{\"steps\": [{\"id\": \"step_1\", \"title\": \"Welcome to my app!\", \"subtitle\": \"Let me show you around.\"}]}"

targetingLogic
string

The targeting logic for the Flow

Example:

"user.property('isAdmin') == true"

type
enum<string>

The type of Flow

Available options:
ANNOUNCEMENT,
BANNER,
CARD,
CHECKLIST,
CUSTOM,
FORM,
SURVEY,
TOUR
Example:

"CHECKLIST"

slug
string

A unique identifier for the Flow such as flow_abc. Slugs stay the same between environment and versions.

Example:

"flow_abc"

createdAt
string

The data the Flow was created in ISO 8601 format

Example:

"2024-01-01T00:00:00Z"

modifiedAt
string

The data the Flow was last modified in ISO 8601 format

Example:

"2024-01-01T00:00:00Z"

version
number

The version of the Flow

Example:

1

status
enum<string>

The status of the Flow

Available options:
ACTIVE,
ARCHIVED,
DRAFT
Example:

"ACTIVE"

codeSnippet
string

The original code snippet for the Flow when it was created

Example:

"<Frigade.Announcement flowId=\"my-flow-id\" />"