Updates a customer journey state entity

Updates a customer journey state entity

The format of the params field is checked, except for the params.forward field which is not validated.
Partial edits to the params field are not allowed.
Unexpected fields are removed in params object.

In case of error, a 400 error is returned with the details.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
number
required

customer journey's id

number
required

customer journey state's id

Body Params

Customer Journey State data payload

string
enum
params
object | null
  • Params example for state types: IN_LIST and IN_ALL

    {
      "forward": 2
    }
  • Params example for state type: IN_SEGMENT

    Options:

    • cond: Indicates the field and operation to be verified. Currently, only the segmentId should be selected.
    • forward: indicates the id of the next journey state if condition is applied
    {
      "cond": {
        "segmentIds" : [1],
      },
      "forward": 2
    }
  • Params example for state type: IN_FILTER

    Options:

    • cond: indicates the field and the operation to check, dateTrunc and datePart both cannot be sent
    • forward: indicates the id of the next journey state if condition is applied
    • filterOperator: optional, defines the logical operator between fields or operations inside fields ('AND' or 'OR'). Default: 'AND'

    If field is date type, to check with today, follow birthday example.

    Operators:

    • lt -> lower than
    • gt -> greater than
    • eq -> equal to
    • gte -> greater or equal to
    • lte -> less or equal to
    • neq -> not equal to
    • isnull -> is null (the field has no value)
    • isnotnull -> is not null (the field has any value)
    {
      "cond": {
        "age" : {
          "gt": 30,
          "lt": 90,
          "filterOperator": "AND"
        },
        "last_login": {
          "isnotnull": true
        },
        "unsubscribe_date": {
          "isnull": true
        },
        "birthday": {
          "useActualDate": {
            "active": true,
            "offset": "PT0S",
            "operator": "eq",
            "timezone": "Europe/Madrid"
          },
          "datePart": [
            "day",
            "month"
          ]}
        },
      },
      "filterOperator": "AND",
      "forward": 2
    }

    Notes:

    • isnull: checks for the absence of a field for a customer.
    • isnull: operator overrides any other operators (gt, eq, etc.) on the same field.
    • filterOperator: optional field that defines how to combine multiple field conditions:
      • "AND" (default): customer must match ALL field conditions
      • "OR": customer must match AT LEAST ONE field condition
      • If only one field is present, filterOperator has no effect

    Datetime field filters

    For datetime fields, use the datePart modifier (preferred) or dateTrunc (deprecated).
    They cannot be combined on the same field.

    datePart (recommended) – compares specific date parts using pre-computed indexed virtual columns.
    Accepts an array of part names. Only the following combinations are allowed (order does not matter):

    datePart arrayComparison type
    ["day"]exact day-of-month match
    ["month"]exact month match
    ["year"]exact year match
    ["month", "day"]exact month AND day match
    ["year", "day"]exact year AND day match
    ["year", "month"]range covering the entire month
    ["year", "month", "day"]range covering the entire day
    ["year", "month", "day", "hour"] … up to […, "milliseconds"]range covering the specified period

    Supported operators: eq, neq. Any other combination is rejected.

    {
      "cond": {
        "birthday": { "eq": "2021-10-25T09:33:50.468Z", "datePart": ["day", "month"] }
      },
      "forward": 2
    }

    dateTrunc ⚠️ Deprecated – use datePart with the equivalent combination instead.
    Still supported for backward compatibility. Truncates the field value to the given granularity
    and compares using BETWEEN. Allowed values: milliseconds, second, minute, hour, day, month, year.

    useActualDate – compare against the current system date instead of a fixed value.
    Can be combined with datePart or dateTrunc.
    Fields: active (boolean), operator (eq/neq/lt/gt/lte/gte), offset (optional ISO 8601 duration, e.g. "-P5D").

    {
      "cond": {
        "birthday": {
          "useActualDate": { "active": true, "offset": "-P5D", "operator": "eq" },
          "datePart": ["day", "month"]
        }
      },
      "forward": 2
    }

    Boolean field filters

    For boolean fields, use eq / neq with a boolean value (true / false), or isnull / isnotnull
    to check whether the field has a value. Filtering by eq: false matches only customers whose field is
    explicitly false; customers without a value (null / absent) are not returned. Use isnull to match
    customers that have no value for the field.

    {
      "cond": {
        "premium": { "eq": true }
      },
      "forward": 2
    }
  • Params example for state type: IN_CUSTOM_EVENT

    {
      "eventName": "test_event",
      "forward": 2
    }
  • Params example for state type ACTION_PUSH_SEND

    Options:

    • action: indicates the action to do, in the example send a push
    • forward: indicates the id of the next journey state
    {
      "action": {
        "campaignId" : 1
      },
      "forward": 3
    }
  • Params example for state type ACTION_EMAIL_SEND

    Options:

    • action: indicates the action to do, in the example send a email
    • forward: indicates the id of the next journey state
    {
      "action": {
        "campaignId" : 1
      },
      "forward": 3
    }
  • Params example for state type ACTION_SMS_SEND

    Options:

    • action: indicates the action to do, in the example send a sms
    • forward: indicates the id of the next journey state
    • The phone number can be provided in two ways:
      1. Using a single field phoneE164FieldId for the complete international number.
      2. Using two separate fields: prefixFieldId and phoneNumberFieldId.
    • sms-api priorize the use of phoneE164FieldId over prefixFieldId and phoneNumberFieldId if both are provided.
    {
      "action":{
          "campaignId":66,
          "phoneNumberFieldId": 151,
          "prefixFieldId": 152,
          "phoneE164FieldId": 153,
          "customValues": [
              {
                  "fieldId": 143,
                  "campaignKey": "test"
              },
              {
                  "contextKey": "offerBank",
                  "campaignKey": "testOfferBank"
              }
          ]
          },
          "forward": 8526
      }
  • Params example for state type ACTION_CHAT_SEND

    Options:

    • action: indicates the action to do, in the example send a chat message
    • forward: indicates the id of the next journey state
    • The phone number can be provided in two ways:
      1. Using a single field phoneNumberFieldId for the complete international number.
      2. Using two separate fields: prefixFieldId and phoneFieldId.
    {
      "action":{
        "phoneNumberFieldId": 151,
        // or
        // "prefixFieldId": 152,
        // "phoneFieldId": 151,
        "prefixFieldId": 152,
        "context": {},
        "messages": [
            {
                "to": "34661819101",
                "channel": "whatsapp",
                "sendType": "operator",
                "contentType": "text",
                "content": {
                    "body": "test chat"
                }
            }
        ]
      },
      "forward": 8526
      }
  • Params example for state type ACTION_WEBHOOK

    Options:

    • action: indicates the action to do, in the example use a webhook template id to send request
    • forward: indicates the id of the next journey state
    {
      "action": {
        "webhookTemplateId" : 1
      },
      "forward": 3
    }
  • Params example for state type ACTION_DELAY

    Delays customer progression to the next state. Supports four modes:

    waitDuration - Waits for a relative duration (ISO 8601):

    {
      "wait": {
        "mode": "waitDuration",
        "time": "P5D",
        "skipDaysOfWeek": [0, 6],
        "specifiedTime": "10:00",
        "timeZone": "Europe/Madrid"
      },
      "forward": 5
    }

    waitUntilDate - Waits until an absolute date/time:

    {
      "wait": {
        "mode": "waitUntilDate",
        "date": "2024-12-31T09:00:00.000Z"
      },
      "forward": 5
    }

    waitByAttribute - Waits based on a datetime customer field:

    {
      "wait": {
        "mode": "waitByAttribute",
        "fieldId": 33,
        "dateTrunc": "minute",
        "delay": "-P1D",
        "skipDaysOfWeek": [0, 6],
        "specifiedTime": "10:00",
        "timeZone": "Europe/Madrid"
      },
      "forward": 5
    }

    waitByContext - Waits based on a duration stored in the customer's context:

    {
      "wait": {
        "mode": "waitByContext",
        "contextKey": "offerDelay",
        "defaultDelay": "P1D",
        "skipDaysOfWeek": [0, 6],
        "specifiedTime": "10:00",
        "timeZone": "Europe/Madrid"
      },
      "forward": 5
    }

    Common optional fields:

    • skipDaysOfWeek: Array of weekday numbers to skip (0=Sunday, 6=Saturday). Max 6 values.
    • specifiedTime: Exact time of day to trigger the forward, in HH:MM format (00:00–23:59).
    • timeZone: Timezone for specifiedTime (e.g. Europe/Madrid). Must be a valid moment-timezone value. If not provided, defaults to UTC.
  • Params example for state type FLOW_PUSH_CLICK

    Notes

    • timeout.time: formatted with ISO_8601 Time_intervals
    {
      "click": {
        "forward": 5
      },
      "timeout": {
        "time": "P5D",
        "forward": 4
      }
    }
  • Params example for state type FLOW_SMS

    Notes

    • timeout.time: formatted with ISO_8601 Time_intervals
    {
      "click": [
        "url": "google.es",
        "urlMatchMode": "CONTAINS",
        "forward": 5
      ],
      "timeout": {
        "time": "P5D",
        "forward": 4
      }
    }
  • Params example for state type FLOW_FILTER

    Notes

    • Conditions (cond) has the same format as the one used in the IN_FILTER state
    • If field is date type, to check with today, follow birthday example.
    • filterType: Optional parameter. It is used to distinguish which type of filter will be applied. Field is stored and displayed only, not used in logic
    • filterOperator: optional, defines the logical operator between fields or between operations inside of fields ('AND' or 'OR'). Default: 'AND'
    {
      "filter": [
        {
          "cond": {
            "age": {
              "gt": 30,
              "lt": 90,
              "filterOperator": "AND"
            },
            "hair": {
              "eq": "bold"
            }
          },
          "filterOperator": "AND",
          "forward": 5
        },
        {
          "cond": {
            "birthday": {
              "useActualDate": {
                "active": true,
                "offset": "PT0S",
                "operator": "eq",
                "timezone": "Europe/Madrid"
              },
              "datePart": [
                "day",
                "month"
              ]}
            },
            "hair": {
              "eq": "long hair"
            }
          },
          "filterOperator": "OR",
          "forward": 8
        },
      ],
      "filterType": "or"
    }
  • Params example for state type FLOW_RANDOM

    Notes

    • weight: Optional parameter. If not indicated, the customers for each branch will be distributed proportionally.
    • name: Optional parameter. Name for each branch. If not indicated, it will be auto-generated.
    {
      "random":[
        {
          "forward":5,
          "weight":0.2,
          "name":"my branch 1"
        },
        {
          "forward":6,
          "weigth":0.8,
          "name":"my branch 2"
        }
      ]
    }
  • Params example for state type FLOW_CUSTOM_EVENT

      {
        "customEvent": {
          "eventName": "test_event_name",
          "forward": 5,
        },
        "timeout" : {
          "time" : "P5D",
          "forward": 4,
        }
      }
  • Params example for state type FLOW_BEST_PATH

  {
    "mode": "BEST_CHANNEL|BEST_OPTION|TEST_AB"
    "path": [
      {
        "forward": 5
      },
      {
        "forward": 6
      }
    ]
  }
  • Params example for state type FLOW_CHAT

Notes

  • timeout.time: formatted with ISO_8601 Time_intervals
{
  "sent": [
    forward: 5,
  ],
  "timeout": {
    "time": "P5D",
    "forward": 4
  }
}
Responses

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json