Is AI recommending you? Ask Contentstack Canoe for free
Is AI recommending your brand? Find out with Contentstack Canoe for free
Contentstack.comAcademyLogin
CS-log-dark.svgCS-log-dark.svg
  • Changelog
  • APIs
  • SDKs

Platform

  • Solution Center
  • Marketplace
  • Changelog
  • Developers & IT
  • Business users
  • Digital leaders
  • Developer Fast Track
  • Plans & Pricing

Solutions

  • Retail
  • Travel and tourism
  • Financial services
  • Technology
  • Manufacturing
  • E-commerce
  • Localization
  • Personalization
  • Portals and knowledge bases

Resources

  • Academy
  • Docs
  • Contentstack for Developers
  • Agents Start Here
  • Product updates
  • Contentstack on Contentstack
  • Blog
  • Insights and analyst reports
  • The Forrester Wave™: Digital Experience Platforms, Q4 2025
  • Webinars
  • Podcasts
  • Glossary
  • Content generative library
  • Community
  • Headless CMS
  • Composable AXP
  • Personalization
  • CDP

Customers

  • Case Studies
  • Customer Care
  • Contentstack Experience Awards
  • Customer support

Partners

  • Overview
  • Find a partner
  • Login

Company

  • About us
  • News
  • Customer support portal
  • Contact

Social

  • Facebook
  • LinkedIn
  • Instagram
  • GitHub
  • YouTube
  • Discord
  • X
LegalTermsPrivacyTrust Center

Cookie settings

Copyright © 2026 Contentstack Inc. All rights reserved.
/
  1. Home
  2. APIs
  3. Lytics API
  4. Flows

Flows

markdownView as Markdown

Create and manage flows that orchestrate multi-step audience journeys.

Get flows

GEThttps://api.lytics.io/v2/flow

Get all flows for an account. Each version of each flow is returned unless latest=true.

Sample Response
Status|200 OK
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
{
  "_meta": {},
  "data": [
    {
      "aid": 0,
      "created": "2019-08-24T14:15:22Z",
      "description": "string",
      "entry_condition": "in_segment",
      "entry_segment_id": "string",
      "expires_at": "2019-08-24T14:15:22Z",
      "id": "string",
      "label": "string",
      "modified": "2019-08-24T14:15:22Z",
      "reentry_allowed": true,
      "reentry_condition": "in_segment",
      "reentry_delay": 0,
      "root_step_id": 0,
      "state": "draft",
      "state_modified_at": "2019-08-24T14:15:22Z",
      "steps": [
        {
          "affinity_config_id": "string",
          "delay": 0,
          "delay_condition": "string",
          "delay_until": {
            "day_of_week": 0,
            "kind": "day_of_week",
            "time_of_day": "09:30",
            "timezone": "America/New_York"
          },
          "delay_until_enters": [
            "string"
          ],
          "id": 0,
          "label": "string",
          "next": 0,
          "slug": "string",
          "split_affinities": [
            {
              "affinity": "string",
              "label": "string",
              "next": 0,
              "priority": 0
            }
          ],
          "split_conditions": [
            {
              "conditions": "string",
              "label": "string",
              "next": 0,
              "priority": 0
            }
          ],
          "split_probabilities": [
            {
              "next": 0,
              "prob": 0
            }
          ],
          "type_hint": "work_export",
          "work_config": {},
          "work_exit_step_ref": 0,
          "work_id": "string"
        }
      ],
      "version": 0
    }
  ],
  "request_id": "string",
  "status": 0
}

Create or update flow

POSThttps://api.lytics.io/v2/flow

Create a new flow or update an existing one. The flow id is taken from the request body.

Sample Request
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
{
  "aid": 0,
  "created": "2019-08-24T14:15:22Z",
  "description": "string",
  "entry_condition": "in_segment",
  "entry_segment_id": "string",
  "expires_at": "2019-08-24T14:15:22Z",
  "id": "string",
  "label": "string",
  "modified": "2019-08-24T14:15:22Z",
  "reentry_allowed": true,
  "reentry_condition": "in_segment",
  "reentry_delay": 0,
  "root_step_id": 0,
  "state": "draft",
  "state_modified_at": "2019-08-24T14:15:22Z",
  "steps": [
    {
      "affinity_config_id": "string",
      "delay": 0,
      "delay_condition": "string",
      "delay_until": {
        "day_of_week": 0,
        "kind": "day_of_week",
        "time_of_day": "09:30",
        "timezone": "America/New_York"
      },
      "delay_until_enters": [
        "string"
      ],
      "id": 0,
      "label": "string",
      "next": 0,
      "slug": "string",
      "split_affinities": [
        {
          "affinity": "string",
          "label": "string",
          "next": 0,
          "priority": 0
        }
      ],
      "split_conditions": [
        {
          "conditions": "string",
          "label": "string",
          "next": 0,
          "priority": 0
        }
      ],
      "split_probabilities": [
        {
          "next": 0,
          "prob": 0
        }
      ],
      "type_hint": "work_export",
      "work_config": {},
      "work_exit_step_ref": 0,
      "work_id": "string"
    }
  ],
  "version": 0
}
Sample Response
Status|200 OK
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
{
  "_meta": {},
  "data": {
    "aid": 0,
    "created": "2019-08-24T14:15:22Z",
    "description": "string",
    "entry_condition": "in_segment",
    "entry_segment_id": "string",
    "expires_at": "2019-08-24T14:15:22Z",
    "id": "string",
    "label": "string",
    "modified": "2019-08-24T14:15:22Z",
    "reentry_allowed": true,
    "reentry_condition": "in_segment",
    "reentry_delay": 0,
    "root_step_id": 0,
    "state": "draft",
    "state_modified_at": "2019-08-24T14:15:22Z",
    "steps": [
      {
        "affinity_config_id": "string",
        "delay": 0,
        "delay_condition": "string",
        "delay_until": {
          "day_of_week": 0,
          "kind": "day_of_week",
          "time_of_day": "09:30",
          "timezone": "America/New_York"
        },
        "delay_until_enters": [
          "string"
        ],
        "id": 0,
        "label": "string",
        "next": 0,
        "slug": "string",
        "split_affinities": [
          {
            "affinity": "string",
            "label": "string",
            "next": 0,
            "priority": 0
          }
        ],
        "split_conditions": [
          {
            "conditions": "string",
            "label": "string",
            "next": 0,
            "priority": 0
          }
        ],
        "split_probabilities": [
          {
            "next": 0,
            "prob": 0
          }
        ],
        "type_hint": "work_export",
        "work_config": {},
        "work_exit_step_ref": 0,
        "work_id": "string"
      }
    ],
    "version": 0
  },
  "request_id": "string",
  "status": 0
}

Get flow states

GEThttps://api.lytics.io/v2/flow/state

Get all possible flow state values (step slugs / personalization keys) for the account.

Sample Response
Status|200 OK
12345678
{
  "_meta": {},
  "data": [
    "string"
  ],
  "request_id": "string",
  "status": 0
}

Get flow

GEThttps://api.lytics.io/v2/flow/{name}

Get a flow by name. All versions are returned unless latest=true.

Sample Response
Status|200 OK
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
{
  "_meta": {},
  "data": {
    "aid": 0,
    "created": "2019-08-24T14:15:22Z",
    "description": "string",
    "entry_condition": "in_segment",
    "entry_segment_id": "string",
    "expires_at": "2019-08-24T14:15:22Z",
    "id": "string",
    "label": "string",
    "modified": "2019-08-24T14:15:22Z",
    "reentry_allowed": true,
    "reentry_condition": "in_segment",
    "reentry_delay": 0,
    "root_step_id": 0,
    "state": "draft",
    "state_modified_at": "2019-08-24T14:15:22Z",
    "steps": [
      {
        "affinity_config_id": "string",
        "delay": 0,
        "delay_condition": "string",
        "delay_until": {
          "day_of_week": 0,
          "kind": "day_of_week",
          "time_of_day": "09:30",
          "timezone": "America/New_York"
        },
        "delay_until_enters": [
          "string"
        ],
        "id": 0,
        "label": "string",
        "next": 0,
        "slug": "string",
        "split_affinities": [
          {
            "affinity": "string",
            "label": "string",
            "next": 0,
            "priority": 0
          }
        ],
        "split_conditions": [
          {
            "conditions": "string",
            "label": "string",
            "next": 0,
            "priority": 0
          }
        ],
        "split_probabilities": [
          {
            "next": 0,
            "prob": 0
          }
        ],
        "type_hint": "work_export",
        "work_config": {},
        "work_exit_step_ref": 0,
        "work_id": "string"
      }
    ],
    "version": 0
  },
  "request_id": "string",
  "status": 0
}

Create or update flow by name

POSThttps://api.lytics.io/v2/flow/{name}

Create a new flow or update an existing one. When the body has no id, the name path param is used as the flow id.

Sample Request
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
{
  "aid": 0,
  "created": "2019-08-24T14:15:22Z",
  "description": "string",
  "entry_condition": "in_segment",
  "entry_segment_id": "string",
  "expires_at": "2019-08-24T14:15:22Z",
  "id": "string",
  "label": "string",
  "modified": "2019-08-24T14:15:22Z",
  "reentry_allowed": true,
  "reentry_condition": "in_segment",
  "reentry_delay": 0,
  "root_step_id": 0,
  "state": "draft",
  "state_modified_at": "2019-08-24T14:15:22Z",
  "steps": [
    {
      "affinity_config_id": "string",
      "delay": 0,
      "delay_condition": "string",
      "delay_until": {
        "day_of_week": 0,
        "kind": "day_of_week",
        "time_of_day": "09:30",
        "timezone": "America/New_York"
      },
      "delay_until_enters": [
        "string"
      ],
      "id": 0,
      "label": "string",
      "next": 0,
      "slug": "string",
      "split_affinities": [
        {
          "affinity": "string",
          "label": "string",
          "next": 0,
          "priority": 0
        }
      ],
      "split_conditions": [
        {
          "conditions": "string",
          "label": "string",
          "next": 0,
          "priority": 0
        }
      ],
      "split_probabilities": [
        {
          "next": 0,
          "prob": 0
        }
      ],
      "type_hint": "work_export",
      "work_config": {},
      "work_exit_step_ref": 0,
      "work_id": "string"
    }
  ],
  "version": 0
}
Sample Response
Status|200 OK
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
{
  "_meta": {},
  "data": {
    "aid": 0,
    "created": "2019-08-24T14:15:22Z",
    "description": "string",
    "entry_condition": "in_segment",
    "entry_segment_id": "string",
    "expires_at": "2019-08-24T14:15:22Z",
    "id": "string",
    "label": "string",
    "modified": "2019-08-24T14:15:22Z",
    "reentry_allowed": true,
    "reentry_condition": "in_segment",
    "reentry_delay": 0,
    "root_step_id": 0,
    "state": "draft",
    "state_modified_at": "2019-08-24T14:15:22Z",
    "steps": [
      {
        "affinity_config_id": "string",
        "delay": 0,
        "delay_condition": "string",
        "delay_until": {
          "day_of_week": 0,
          "kind": "day_of_week",
          "time_of_day": "09:30",
          "timezone": "America/New_York"
        },
        "delay_until_enters": [
          "string"
        ],
        "id": 0,
        "label": "string",
        "next": 0,
        "slug": "string",
        "split_affinities": [
          {
            "affinity": "string",
            "label": "string",
            "next": 0,
            "priority": 0
          }
        ],
        "split_conditions": [
          {
            "conditions": "string",
            "label": "string",
            "next": 0,
            "priority": 0
          }
        ],
        "split_probabilities": [
          {
            "next": 0,
            "prob": 0
          }
        ],
        "type_hint": "work_export",
        "work_config": {},
        "work_exit_step_ref": 0,
        "work_id": "string"
      }
    ],
    "version": 0
  },
  "request_id": "string",
  "status": 0
}

Delete flow

DELETEhttps://api.lytics.io/v2/flow/{name}

Delete all versions of a flow by name.

Sample Response
Status|200 OK
123456
{
  "_meta": {},
  "data": {},
  "request_id": "string",
  "status": 0
}

Get flow version

GEThttps://api.lytics.io/v2/flow/{name}/{version}

Get a specific version of a flow by name and version.

Sample Response
Status|200 OK
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
{
  "_meta": {},
  "data": {
    "aid": 0,
    "created": "2019-08-24T14:15:22Z",
    "description": "string",
    "entry_condition": "in_segment",
    "entry_segment_id": "string",
    "expires_at": "2019-08-24T14:15:22Z",
    "id": "string",
    "label": "string",
    "modified": "2019-08-24T14:15:22Z",
    "reentry_allowed": true,
    "reentry_condition": "in_segment",
    "reentry_delay": 0,
    "root_step_id": 0,
    "state": "draft",
    "state_modified_at": "2019-08-24T14:15:22Z",
    "steps": [
      {
        "affinity_config_id": "string",
        "delay": 0,
        "delay_condition": "string",
        "delay_until": {
          "day_of_week": 0,
          "kind": "day_of_week",
          "time_of_day": "09:30",
          "timezone": "America/New_York"
        },
        "delay_until_enters": [
          "string"
        ],
        "id": 0,
        "label": "string",
        "next": 0,
        "slug": "string",
        "split_affinities": [
          {
            "affinity": "string",
            "label": "string",
            "next": 0,
            "priority": 0
          }
        ],
        "split_conditions": [
          {
            "conditions": "string",
            "label": "string",
            "next": 0,
            "priority": 0
          }
        ],
        "split_probabilities": [
          {
            "next": 0,
            "prob": 0
          }
        ],
        "type_hint": "work_export",
        "work_config": {},
        "work_exit_step_ref": 0,
        "work_id": "string"
      }
    ],
    "version": 0
  },
  "request_id": "string",
  "status": 0
}

Delete flow version

DELETEhttps://api.lytics.io/v2/flow/{name}/{version}

Delete a single version of a flow by name and version.

Sample Response
Status|200 OK
123456
{
  "_meta": {},
  "data": {},
  "request_id": "string",
  "status": 0
}

Create flow step work

POSThttps://api.lytics.io/v2/flow/{name}/{version}/{step}/work

Create the work for a given step of a flow version.

Sample Response
Status|200 OK
12345678910111213141516171819202122
{
  "_meta": {},
  "data": {
    "account_id": "string",
    "aid": 0,
    "auth_ids": [
      "string"
    ],
    "config": {},
    "created": "2019-08-24T14:15:22Z",
    "description": "string",
    "expires_at": "2019-08-24T14:15:22Z",
    "id": "string",
    "name": "string",
    "tag": "string",
    "updated": "2019-08-24T14:15:22Z",
    "workflow": "string",
    "workflow_id": "string"
  },
  "request_id": "string",
  "status": 0
}
Hide Parameters

Query Parameters

account_idoptionalstring

The account ID. Defaults to the user's default account.

latestoptionalstring

Return only the latest version of each flow

Headers

Authorizationoptionalstring

Hide Parameters

Query Parameters

account_idoptionalstring

The account ID. Defaults to the user's default account.

Headers

Authorizationoptionalstring

Body Parameters

aidoptionalinteger
createdoptionalstring (date-time)
descriptionoptionalstring
entry_conditionoptionalstring

One of: in_segment, on_segment_entry

entry_segment_idoptionalstring
expires_atoptionalstring (date-time)
idoptionalstring
labeloptionalstring
modifiedoptionalstring (date-time)
reentry_allowedoptionalboolean
reentry_conditionoptionalstring

One of: in_segment, on_segment_entry

reentry_delayoptionalinteger

Nanoseconds to wait before a profile may re-enter the flow.

root_step_idoptionalinteger
stateoptionalstring

One of: draft, running, draining, deleted

state_modified_atoptionalstring (date-time)
stepsoptionalobject[]
steps[].affinity_config_idoptionalstring
steps[].delayoptionalinteger

Nanoseconds to wait at this step. Mutually exclusive with delay_until.

steps[].delay_conditionoptionalstring
steps[].delay_untiloptionalobject
steps[].delay_until.day_of_weekoptionalinteger

One of: 0, 1, 2, 3, 4, 5, 6

steps[].delay_until.kindoptionalstring

One of: day_of_week, time_of_day

steps[].delay_until.time_of_dayoptionalstring
steps[].delay_until.timezoneoptionalstring
steps[].delay_until_entersoptionalstring[]
steps[].idoptionalinteger
steps[].labeloptionalstring
steps[].nextoptionalinteger
steps[].slugoptionalstring
steps[].split_affinitiesoptionalobject[]
steps[].split_affinities[].affinityoptionalstring
steps[].split_affinities[].labeloptionalstring
steps[].split_affinities[].nextoptionalinteger
steps[].split_affinities[].priorityoptionalinteger
steps[].split_conditionsoptionalobject[]
steps[].split_conditions[].conditionsoptionalstring
steps[].split_conditions[].labeloptionalstring
steps[].split_conditions[].nextoptionalinteger
steps[].split_conditions[].priorityoptionalinteger
steps[].split_probabilitiesoptionalobject[]
steps[].split_probabilities[].nextoptionalinteger
steps[].split_probabilities[].proboptionalnumber
steps[].type_hintoptionalstring

One of: work_export, delay, conditional, affinity, ab_testing, work_export_exit

steps[].work_configoptionalobject
steps[].work_exit_step_refoptionalinteger
steps[].work_idoptionalstring
versionoptionalinteger
Hide Parameters

Query Parameters

account_idoptionalstring

The account ID. Defaults to the user's default account.

Headers

Authorizationoptionalstring

Hide Parameters

URL Parameters

namerequiredstring

The flow name

Query Parameters

account_idoptionalstring

The account ID. Defaults to the user's default account.

latestoptionalstring

Return only the latest version of the flow

Headers

Authorizationoptionalstring

Hide Parameters

URL Parameters

namerequiredstring

The flow name (used as the flow id when the body has no id)

Query Parameters

account_idoptionalstring

The account ID. Defaults to the user's default account.

Headers

Authorizationoptionalstring

Body Parameters

aidoptionalinteger
createdoptionalstring (date-time)
descriptionoptionalstring
entry_conditionoptionalstring

One of: in_segment, on_segment_entry

entry_segment_idoptionalstring
expires_atoptionalstring (date-time)
idoptionalstring
labeloptionalstring
modifiedoptionalstring (date-time)
reentry_allowedoptionalboolean
reentry_conditionoptionalstring

One of: in_segment, on_segment_entry

reentry_delayoptionalinteger

Nanoseconds to wait before a profile may re-enter the flow.

root_step_idoptionalinteger
stateoptionalstring

One of: draft, running, draining, deleted

state_modified_atoptionalstring (date-time)
stepsoptionalobject[]
steps[].affinity_config_idoptionalstring
steps[].delayoptionalinteger

Nanoseconds to wait at this step. Mutually exclusive with delay_until.

steps[].delay_conditionoptionalstring
steps[].delay_untiloptionalobject
steps[].delay_until.day_of_weekoptionalinteger

One of: 0, 1, 2, 3, 4, 5, 6

steps[].delay_until.kindoptionalstring

One of: day_of_week, time_of_day

steps[].delay_until.time_of_dayoptionalstring
steps[].delay_until.timezoneoptionalstring
steps[].delay_until_entersoptionalstring[]
steps[].idoptionalinteger
steps[].labeloptionalstring
steps[].nextoptionalinteger
steps[].slugoptionalstring
steps[].split_affinitiesoptionalobject[]
steps[].split_affinities[].affinityoptionalstring
steps[].split_affinities[].labeloptionalstring
steps[].split_affinities[].nextoptionalinteger
steps[].split_affinities[].priorityoptionalinteger
steps[].split_conditionsoptionalobject[]
steps[].split_conditions[].conditionsoptionalstring
steps[].split_conditions[].labeloptionalstring
steps[].split_conditions[].nextoptionalinteger
steps[].split_conditions[].priorityoptionalinteger
steps[].split_probabilitiesoptionalobject[]
steps[].split_probabilities[].nextoptionalinteger
steps[].split_probabilities[].proboptionalnumber
steps[].type_hintoptionalstring

One of: work_export, delay, conditional, affinity, ab_testing, work_export_exit

steps[].work_configoptionalobject
steps[].work_exit_step_refoptionalinteger
steps[].work_idoptionalstring
versionoptionalinteger
Hide Parameters

URL Parameters

namerequiredstring

The flow name

Query Parameters

account_idoptionalstring

The account ID. Defaults to the user's default account.

Headers

Authorizationoptionalstring

Hide Parameters

URL Parameters

namerequiredstring

The flow name

versionrequiredstring

The flow version

Query Parameters

account_idoptionalstring

The account ID. Defaults to the user's default account.

Headers

Authorizationoptionalstring

Hide Parameters

URL Parameters

namerequiredstring

The flow name

versionrequiredstring

The flow version

Query Parameters

account_idoptionalstring

The account ID. Defaults to the user's default account.

Headers

Authorizationoptionalstring

Hide Parameters

URL Parameters

namerequiredstring

The flow name

versionrequiredstring

The flow version

steprequiredstring

The flow step id

Query Parameters

account_idoptionalstring

The account ID. Defaults to the user's default account.

Headers

Authorizationoptionalstring