> ## Documentation Index
> Fetch the complete documentation index at: https://docs.suprsend.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create or Update Workflow

> Create a new workflow or update the draft version of an existing one



## OpenAPI

````yaml POST /v1/{workspace}/workflow/{slug}/
openapi: 3.1.1
info:
  title: SuprSend API
  description: APIs supported on suprsend platform
  version: 1.2.2
servers:
  - url: https://hub.suprsend.com
security:
  - sec0: []
  - BearerAuth: []
paths:
  /v1/{workspace}/workflow/{slug}/:
    post:
      summary: Create or Update Workflow
      description: Create a new workflow or update the draft version of an existing one
      operationId: upsert-workflow
      parameters:
        - in: path
          name: workspace
          required: true
          schema:
            type: string
          description: >-
            Workspace where the workflow should be created (staging, production,
            etc.)
        - in: path
          name: slug
          required: true
          schema:
            type: string
          description: >-
            Unique identifier of the workflow. You can get it from workflow
            settings for existing workflows.
        - in: query
          name: commit
          schema:
            type: boolean
            default: false
          description: >-
            Whether to commit the workflow immediately. Workflow will be
            successfully committed only if validation_result.is_valid is true.
        - in: query
          name: commit_message
          schema:
            type: string
          description: >-
            Optional commit message describing the changes. Used only when
            commit=true.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkflowCreateUpdate'
            examples:
              workflow_example:
                summary: Example workflow creation
                description: Example of creating a simple email workflow
                value:
                  name: Welcome Email
                  description: Sends welcome email to new users
                  category: transactional
                  trigger_type: api
                  tags:
                    - welcome
                    - onboarding
                  tree:
                    nodes:
                      - name: Send Email
                        node_type: send_email
                        properties:
                          template: welcome-email-template
                        description: Send welcome email to new users
      responses:
        '201':
          description: >-
            Workflow created. The response includes the saved workflow object
            along with a validation_result field that indicates whether the
            workflow configuration is valid. When `commit=true` is passed, a
            `commit_result` field is also returned.
          content:
            application/json:
              examples:
                workflow_example:
                  summary: Example workflow creation
                  description: Example of creating a simple email workflow
                  value:
                    name: Welcome Email
                    description: Sends welcome email to new users
                    category: transactional
                    trigger_type: api
                    tags:
                      - welcome
                      - onboarding
                    tree:
                      nodes:
                        - name: Send Email
                          node_type: send_email
                          properties:
                            template: welcome-email-template
                          description: Send welcome email to new users
                    validation_result:
                      is_valid: true
                      errors: []
              schema:
                type: object
                properties:
                  validation_result:
                    type: object
                    properties:
                      is_valid:
                        type: boolean
                        description: >-
                          Whether the workflow configuration is valid and can be
                          committed
                      errors:
                        type: array
                        description: >-
                          List of validation errors if the workflow is invalid
                          and `is_valid` is false.
                        items:
                          type: string
                  commit_result:
                    type: object
                    description: >-
                      Present only when `commit=true` is passed. `is_committed`
                      is false if validation failed or the commit raised an
                      error; the upsert itself is still saved.
                    properties:
                      is_committed:
                        type: boolean
                      errors:
                        type: array
                        items:
                          type: string
        '202':
          description: Existing workflow updated. Same response body as `201`.
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/AuthenticationError'
        '404':
          $ref: '#/components/responses/NotFoundError'
      security:
        - ServiceTokenAuth: []
      servers:
        - url: https://management-api.suprsend.com
      x-codeSamples:
        - lang: cURL
          source: >
            curl -X POST
            "https://management-api.suprsend.com/v1/{workspace}/workflow/{slug}/"
            \
              --header 'Authorization: ServiceToken <token>' \
              --header 'Content-Type: application/json' \
              --data '{
                "name": "Welcome Email",
                "description": "Sends welcome email to new users",
                "category": "transactional",
                "trigger_type": "api",
                "tags": ["welcome", "onboarding"],
                "tree": {
                  "nodes": [
                    {
                      "name": "Send Email",
                      "node_type": "send_email",
                      "properties": {
                        "template": "welcome-email-template"
                      },
                      "description": "Send welcome email to new users"
                    }
                  ]
                }
              }'
components:
  schemas:
    WorkflowCreateUpdate:
      type: object
      required:
        - name
        - trigger_type
        - category
        - tree
      properties:
        name:
          type: string
          maxLength: 255
          description: >-
            Human-readable name of the workflow. The workflow slug is taken from
            the URL path, not generated from this name.
          example: Welcome Sequence
        description:
          type: string
          nullable: true
          maxLength: 500
          description: Description explaining the usecase of the workflow
        is_enabled:
          type: boolean
          default: true
          description: Whether the workflow should be enabled
        category:
          type: string
          description: >-
            Notification category of the workflow. Used to apply
            category-specific settings and preferences.
          example: transactional
        tags:
          type: array
          maxItems: 25
          items:
            type: string
            maxLength: 128
          description: Tags are used for grouping and filtering workflows in list (max 25).
          example:
            - onboarding-sequence
        trigger_type:
          type: string
          enum:
            - event
            - api
          description: >-
            You can trigger a workflow either via API by passing its slug
            directly, or through an event-based system where the workflow runs
            when a specific event occurs. You can compare both methods
            [here](https://docs.suprsend.com/docs/event-vs-api-trigger). If the
            workflow should run when a user enters or exits a list, use
            `trigger_type = event`.
        payload_schema:
          type: object
          nullable: true
          properties:
            schema:
              type: string
              description: >-
                Linked schema slug. You can create a schema via [Create
                Schema](/reference/create-schema) endpoint and then link it
                here.
              example: onboarding-sequence-schema
            version_no:
              type: integer
              description: >-
                Schema version number to link. By default, live version is
                always picked for validation
              example: 1
          description: >-
            Schema to validate workflow api data structure. Used only when
            trigger_type = api.
        trigger_events:
          type: array
          maxItems: 10
          items:
            type: string
            maxLength: 255
          description: >-
            Events that trigger this workflow (required if trigger_type = event,
            max 10). In case of list entry/exit, event names will be
            `$USER_ENTERED_LIST - <list_id>` and `$USER_EXITED_LIST - <list_id>`
            respectively.
        ratelimit:
          type: object
          nullable: true
          description: >-
            Throttle settings for the workflow. This is used to limit the number
            of times a workflow can be executed per user in a given time period.
          properties:
            count:
              type: integer
              minimum: 1
              maximum: 100
              description: >-
                Maximum number of executions allowed within the sliding window
                (1-100)
              example: 4
            sliding_window:
              type: string
              maxLength: 16
              description: >-
                Time window for rate limiting to be passed in format
                `00d00h00m00s`, d (days), h (hours), m (minutes), s (seconds).
                Must be > 0 and <= 90 days. Rate limit is applied within this
                window.
              example: 6m
        conditions:
          type: array
          nullable: true
          maxItems: 10
          description: >-
            Trigger Conditions (max 10). Workflow will be executed if any of the
            conditions in this array evaluate to true.
          items:
            type: object
            properties:
              type:
                type: string
                description: >-
                  Type of condition expression. Currently only `expression_v1`
                  is supported.
                example: expression_v1
                enum:
                  - expression_v1
              expression_v1:
                type: object
                description: Expression object containing the condition logic
                properties:
                  op:
                    type: string
                    description: >-
                      Logical operator to combine conditions. Currently only
                      `AND` is supported.
                    enum:
                      - AND
                  args:
                    type: array
                    maxItems: 10
                    description: >-
                      Array of conditions (max 10). Each condition is defined as
                      key (variable) <op> value. Refer to [how to construct a
                      condition
                      here](https://docs.suprsend.com/docs/branch#constructing-a-condition).
                    items:
                      type: object
                      properties:
                        op:
                          type: string
                          description: >-
                            Comparison operator between variable and value.
                            Refer to list of [comparison operators
                            here](https://docs.suprsend.com/docs/branch#key-value-pair).
                          example: '=='
                          enum:
                            - '=='
                            - '!='
                            - '>'
                            - <
                            - '>='
                            - <=
                            - EMPTY
                            - NON_EMPTY
                            - CONTAINS
                            - NOT_CONTAINS
                            - ARRAY_INTERSECTS
                            - NOT_ARRAY_INTERSECTS
                            - DATETIME_EQUALS
                            - DATETIME_LT
                            - DATETIME_GT
                        value:
                          type: string
                          description: >-
                            Value to compare against. Can add fixed value as
                            ".." or variable in JSONNET format as data.<prop>.
                          example: '"admin"'
                        variable:
                          type: string
                          description: >-
                            key from your trigger payload to compare the value
                            against. Direct key name is passed here.
                          example: role
                        variable_ns:
                          type: string
                          description: >-
                            Variable namespace (empty for data passed in
                            trigger, `$recipient` for recipient or object
                            subscription properties, `$actor` for actor
                            properties, `$tenant` / `$brand` for tenant
                            properties, `$organization` for organization
                            properties, `$category` for preference category
                            condition properties)
                          example: $recipient
                          enum:
                            - ''
                            - $recipient
                            - $actor
                            - $tenant
                            - $brand
                            - $organization
                            - $category
        override_recipients_type:
          type: string
          description: >-
            Override recipients using a property from the trigger payload. Type
            defines if the workflow should run for a list of users or a single
            [object](https://docs.suprsend.com/docs/objects). Only applicable
            for trigger_type = `event`.
          example: user
          enum:
            - user
            - single_object_fields
        override_recipients_user_expr:
          type: string
          nullable: true
          description: >-
            JQ expression to override recipients when override_recipients_type =
            `user`. Only applicable for trigger_type = `event`.
          example: .distinct_id
        override_recipients_single_object_fields_expr:
          type: object
          nullable: true
          description: >-
            JQ expression to override recipients with object when
            override_recipients_type = `single_object_fields`. Only applicable
            for trigger_type = `event`.
          properties:
            id:
              type: string
              description: JQ expression to extract object ID from trigger payload
              example: .object_id
            object_type:
              type: string
              description: >-
                JQ expression to extract object type from trigger payload. You
                can also pass fixed value as "..".
              example: .object_type
            $object_subscriptions_query.depth:
              type: string
              description: >-
                Depth [Optional] is used to specify how deep to traverse object
                subscriptions. `depth=0`  would only send notification to object
                channels and not its subscribers,  `depth=1`  would fetch 1
                level of subscriptions, `depth=2`  (maximum) → Also fetches
                subscriptions of child objects, eg. <department -> teams -> team
                members>.
              example: '2'
          example:
            id: .object_id
            object_type: .object_type
            $object_subscriptions_query.depth: '2'
        override_actor_user_expr:
          type: string
          nullable: true
          description: >-
            JQ expression to override actor. Only applicable for trigger_type =
            `event`.
          example: .actor_id
        override_tenant_expr:
          type: string
          nullable: true
          description: >-
            JQ expression to override
            [tenant](https://docs.suprsend.com/docs/tenants). Only applicable
            for trigger_type = `event`.
          example: .tenant_id
        tree:
          type: object
          properties:
            nodes:
              type: array
              items:
                oneOf:
                  - $ref: '#/components/schemas/DelayNode'
                  - $ref: '#/components/schemas/BatchNode'
                  - $ref: '#/components/schemas/DigestNode'
                  - $ref: '#/components/schemas/HttpApiWebhookNode'
                  - $ref: '#/components/schemas/HttpApiFetchNode'
                  - $ref: '#/components/schemas/BranchWaitUntilNode'
                  - $ref: '#/components/schemas/BranchNode'
                  - $ref: '#/components/schemas/TransformNode'
                  - $ref: '#/components/schemas/TimeWindowNode'
                  - $ref: '#/components/schemas/SubscriberListOperationAddUserNode'
                  - $ref: '#/components/schemas/SubscriberListOperationRemoveUserNode'
                  - $ref: '#/components/schemas/ObjectOperationAddSubscriptionNode'
                  - $ref: '#/components/schemas/ObjectOperationRemoveSubscriptionNode'
                  - $ref: '#/components/schemas/UserUpdateNode'
                  - $ref: '#/components/schemas/InvokeWorkflowNode'
                  - $ref: '#/components/schemas/SendEmailNode'
                  - $ref: '#/components/schemas/SendSmsNode'
                  - $ref: '#/components/schemas/SendWhatsappNode'
                  - $ref: '#/components/schemas/SendMobilePushNode'
                  - $ref: '#/components/schemas/SendInboxNode'
                  - $ref: '#/components/schemas/SendWebpushNode'
                  - $ref: '#/components/schemas/SendSlackNode'
                  - $ref: '#/components/schemas/SendMsTeamsNode'
                  - $ref: '#/components/schemas/SendMultiChannelNode'
                  - $ref: '#/components/schemas/SendSmartChannelRoutingNode'
              description: Array of nodes in the workflow tree structure.
          description: >-
            Node tree structure of the workflow. Contains the nodes array with
            all workflow nodes and their configuration.
    DelayNode:
      title: Delay
      type: object
      description: >-
        [**Delay**](https://docs.suprsend.com/docs/delay): Pauses workflow
        execution for a specified duration.
      required:
        - node_type
        - properties
      properties:
        name:
          type: string
          maxLength: 64
          description: >-
            Human-readable name of the node. Optional; a default name is
            assigned based on node_type if omitted.
          example: Wait 30 minutes
        description:
          type: string
          nullable: true
          description: Description of what this node does
        node_type:
          type: string
          const: delay
        ref:
          type: string
          maxLength: 64
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
          description: >-
            Optional unique reference for the node (letters, numbers,
            underscore; must not start with a number). Auto-generated if
            omitted.
        properties:
          type: object
          description: Node-specific configuration.
          required:
            - delay_type
          properties:
            delay_type:
              type: string
              enum:
                - fixed
                - dynamic
                - relative_to
              description: |-
                Type of delay. Determines how the duration is calculated. 

                **Fixed**: Static duration added as XXdXXhXXmXXs.

                 **Dynamic**: duration is passed as variable in your trigger payload in jq format. Eg. `.delay_duration`, `."$recipient".delay_duration`, `."$actor".delay_duration`, `."$tenant".delay_duration`.

                 **Relative to**: delay is relative to a future timestamp passed in your trigger payload. Eg. `.start_time` before 15m.
            value:
              type: string
              description: >-
                Duration value. Required for 'fixed' and 'dynamic' delay types.
                Fixed durations must be > 0 and <= 90 days.
              examples:
                fixed_duration:
                  summary: Fixed duration example
                  value: 30s
                dynamic_duration:
                  summary: Dynamic duration from trigger payload
                  value: .delay_duration
                recipient_duration:
                  summary: Dynamic duration from recipient properties
                  value: ."$recipient".delay_duration
            relative_to:
              type: object
              description: >-
                Relative delay configuration. Required when delay_type is
                'relative_to'.
              properties:
                pivot_expr:
                  type: string
                  description: >-
                    (jq-expression) variable defining the future timestamp from
                    trigger payload relative to which delay is calculated.
                  example: .start_time
                offset_type:
                  type: string
                  enum:
                    - before
                    - after
                  description: Whether offset is to be added or subtracted from pivot_expr.
                offset_value_type:
                  type: string
                  enum:
                    - fixed
                    - dynamic
                  description: >-
                    Defines if the offset value is fixed or dynamic. 


                    **Fixed**: Static duration added as XXdXXhXXmXXs. Eg. 15m
                    before meeting_start_time. 


                    **Dynamic**: offset is passed as variable in your trigger
                    payload or recipient, tenant properties in jq format. Eg.
                    `."$recipient".reminder_offset` before meeting_start_time.
                offset_value:
                  type: string
                  description: Offset value
                  examples:
                    fixed_offset:
                      summary: Fixed duration offset
                      value: 15m
                    dynamic_offset:
                      summary: Dynamic offset from recipient properties
                      value: ."$recipient".reminder_offset
    BatchNode:
      title: Batch
      type: object
      description: >-
        [**Batch**](https://docs.suprsend.com/docs/batch): Batches incoming
        workflow triggers/events for a duration to send consolidated
        notifications.
      required:
        - node_type
        - properties
      properties:
        name:
          type: string
          maxLength: 64
          description: >-
            Human-readable name of the node. Optional; a default name is
            assigned based on node_type if omitted.
          example: Batch notifications
        description:
          type: string
          nullable: true
          description: Description of what this node does
        node_type:
          type: string
          const: batch
        ref:
          type: string
          maxLength: 64
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
          description: >-
            Optional unique reference for the node (letters, numbers,
            underscore; must not start with a number). Auto-generated if
            omitted.
        properties:
          type: object
          description: Node-specific configuration.
          required:
            - window_type
          properties:
            mode:
              type: string
              enum:
                - accumulate_all
                - flush_leading_item
              default: accumulate_all
              description: >-
                **accumulate_all**: All events are accumulated in the batch and
                notification is sent once after batch window closes. 


                **flush_leading_item**: Notification is sent immediately for the
                first event in the batch and rest of the events are batched and
                sent after batch window closes. Eg. Send anomaly alert with
                first notification sent at the occurrence of first error and
                next alert sent after 30 minutes if there are further errors.
            window_type:
              type: string
              enum:
                - fixed
                - dynamic
                - relative_to
              description: >-
                Type of batching window. 


                **fixed**: Static window duration added as XXdXXhXXmXXs. Eg.
                30s, 1h, 1d. 


                **dynamic**: Batch window duration is passed as variable in your
                trigger payload. Add the variable in jq format. Eg.
                `.window_duration`, `."$recipient".batch_duration`,
                `."$actor".window_duration`, `."$tenant".window_duration`. 


                **relative_to**: Batch window is relative to a future timestamp
                passed in your trigger payload. Eg. 15 m before
                `.task_end_time`.
            fixed_window:
              type: string
              description: >-
                Batch window when window_type is 'fixed'. Static batch window
                for all users. Format: XXdXXhXXmXXs.
              example: 30s
            dynamic_window_expr:
              type: string
              description: >-
                Batch window when window_type is 'dynamic'. jq-expression for
                deriving batch window duration at runtime.
              examples:
                trigger_payload:
                  summary: From trigger payload
                  value: .window_duration
                recipient_property:
                  summary: From recipient properties
                  value: ."$recipient".batch_duration
                actor_property:
                  summary: From actor properties
                  value: ."$actor".window_duration
                tenant_property:
                  summary: From tenant properties
                  value: ."$tenant".window_duration
            relative_to:
              type: object
              description: >-
                Batch window when window_type is 'relative_to'. Batch window is
                calculated relative to a future timestamp.
              properties:
                pivot_expr:
                  type: string
                  description: >-
                    (jq-expression) variable defining the future timestamp from
                    trigger payload relative to which batch window is
                    calculated.
                  examples:
                    trigger_payload:
                      summary: From trigger payload
                      value: .start_time
                    recipient_property:
                      summary: From recipient properties
                      value: ."$recipient".task_end_time
                offset_type:
                  type: string
                  enum:
                    - before
                    - after
                  description: >-
                    Whether offset is to be added or subtracted from pivot
                    timestamp.
                offset_value_type:
                  type: string
                  enum:
                    - fixed
                    - dynamic
                  description: >-
                    Defines if the offset value is fixed or dynamic. 


                    **Fixed**: Static duration added as XXdXXhXXmXXs. Eg. 15m
                    before meeting_start_time. 


                    **Dynamic**: offset is passed as variable in your trigger
                    payload or recipient, tenant properties in jq format. Eg.
                    `."$recipient".reminder_offset` before meeting_start_time.
                offset_value:
                  type: string
                  description: Offset value.
                  examples:
                    fixed_offset:
                      summary: Fixed duration offset
                      value: 15m
                    dynamic_offset:
                      summary: Dynamic offset from recipient properties
                      value: ."$recipient".reminder_offset
            retain_count:
              type: integer
              minimum: 1
              maximum: 100
              default: 10
              description: >-
                Maximum number of items to retain after batch closes (1-100).
                The output variable set will have the latest or first n items
                based on the retain_order.
            retain_order:
              type: string
              enum:
                - first
                - last
              default: first
              description: Retain items in this order when retain_count is specified.
            batch_key:
              type: string
              description: >-
                jq-expression used to group events into separate batches. For
                example, when sending batched notifications for comments on
                different documents, use `.document_id` as the batch key to
                ensure comments from different documents are not combined into
                the same batch.
              example: .document_id
    DigestNode:
      title: Digest
      type: object
      description: >-
        [**Digest**](https://docs.suprsend.com/docs/digest): Batches and sends
        summary notifications at a recurring digest schedule.
      required:
        - node_type
        - properties
      properties:
        name:
          type: string
          maxLength: 64
          description: >-
            Human-readable name of the node. Optional; a default name is
            assigned based on node_type if omitted.
          example: Daily digest
        node_type:
          type: string
          const: digest
        description:
          type: string
          nullable: true
          description: Description of what this node does
        ref:
          type: string
          maxLength: 64
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
          description: >-
            Optional unique reference for the node (letters, numbers,
            underscore; must not start with a number). Auto-generated if
            omitted.
        properties:
          type: object
          description: Node-specific configuration.
          required:
            - schedule_type
          properties:
            schedule_type:
              type: string
              enum:
                - static
                - dynamic
                - category_digest_schedule
              description: >-
                Type of schedule. Determines how the digest schedule is
                resolved. 


                **static**: Schedule is fixed and will be used for all
                recipients. 


                **dynamic**: Schedule is dynamic and will be computed at runtime
                using the `dynamic_schedule_expr`. 


                **category_digest_schedule**: Uses the digest schedule
                configured on the notification category linked to this workflow.
                The recipient's selected digest option (or the category default)
                determines the schedule.
            dynamic_schedule_expr:
              type: string
              description: >-
                jq-expression for deriving dynamic digest schedule at runtime.
                Eg. `.digest_schedule`
              example: .digest_schedule
            schedule:
              $ref: '#/components/schemas/Schedule'
            retain_count:
              type: integer
              minimum: 1
              maximum: 100
              default: 10
              description: >-
                Maximum number of items to retain after digest closes (1-100).
                By default, 10 items are retained.
            retain_order:
              type: string
              enum:
                - first
                - last
              default: first
              description: Retain items in this order when retain_count is specified.
            trigger_min_count:
              type: integer
              minimum: 1
              maximum: 1000000
              default: 1
              description: >-
                Digest will be sent if number of triggers in the batch are
                greater than or equal to this count, else skipped.
    HttpApiWebhookNode:
      title: Webhook
      type: object
      description: >-
        [**Webhook**](https://docs.suprsend.com/docs/webhook): Makes an HTTP API
        request to an endpoint.
      required:
        - node_type
        - properties
      properties:
        name:
          type: string
          maxLength: 64
          description: >-
            Human-readable name of the node. Optional; a default name is
            assigned based on node_type if omitted.
          example: Notify internal CRM
        node_type:
          type: string
          const: httpapi_webhook
        description:
          type: string
          nullable: true
          description: Description of what this node does
        ref:
          type: string
          maxLength: 64
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
          description: >-
            Optional unique reference for the node (letters, numbers,
            underscore; must not start with a number). Auto-generated if
            omitted.
        properties:
          type: object
          description: Node-specific configuration.
          required:
            - http_method
            - url
          properties:
            http_method:
              type: string
              enum:
                - GET
                - PUT
                - POST
                - PATCH
                - DELETE
              description: HTTP method of the API call.
            url:
              type: string
              maxLength: 2048
              description: >-
                Endpoint URL of the API call. You can add variables in JSONNET
                format. Eg.
                `"https://api.example.com/webhook?id="+data["$recipient"].id`
              example: '"https://api.example.com/webhook"'
            headers:
              type: array
              description: >-
                List of headers as key-value pairs. You can add variables in
                JSONNET format. Eg. `"Bearer"+data["$tenant"].api_key`
              items:
                type: object
                properties:
                  key:
                    type: string
                    description: header key
                    example:
                      - '"Authorization"'
                      - '"Content-Type"'
                  value:
                    type: string
                    description: header value
                    example:
                      - '"Bearer "+data["$tenant"].api_key'
                      - '"application/json"'
            body_content_type:
              type: string
              enum:
                - application/json
              default: application/json
              description: Content type for the body. Only `application/json` is supported.
            body:
              type: string
              maxLength: 2048
              description: JSONNET script to evaluate request body.
            query_params:
              type: array
              description: >-
                List of query parameters as key-value pairs. You can add
                variables in JSONNET format. Eg. `data["$recipient"].id`
              items:
                type: object
                properties:
                  key:
                    type: string
                    description: Query Parameter Key
                  value:
                    type: string
                    description: Query Parameter Value
            output_key:
              type: string
              maxLength: 64
              description: >-
                Optional key to store the response body of API call. Keys
                starting with `$` or `ss_` are reserved. If not provided, the
                response will be appended at the root of the workflow payload.
                It's recommended to provide a unique key here to avoid
                overwriting existing data.
    HttpApiFetchNode:
      title: Fetch
      type: object
      description: >-
        [**Fetch**](https://docs.suprsend.com/docs/fetch): Fetches data from an
        API endpoint using GET method only.
      required:
        - node_type
        - properties
      properties:
        name:
          type: string
          maxLength: 64
          description: >-
            Human-readable name of the node. Optional; a default name is
            assigned based on node_type if omitted.
          example: Fetch user data
        node_type:
          type: string
          const: httpapi_fetch
        description:
          type: string
          nullable: true
          description: Description of what this node does
        ref:
          type: string
          maxLength: 64
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
          description: >-
            Optional unique reference for the node (letters, numbers,
            underscore; must not start with a number). Auto-generated if
            omitted.
        properties:
          type: object
          description: Node-specific configuration.
          required:
            - url
          properties:
            http_method:
              type: string
              const: GET
              default: GET
              description: >-
                HTTP method to use. Only GET is supported for fetch operations
                (defaults to GET if omitted).
            url:
              type: string
              maxLength: 2048
              description: >-
                Endpoint URL to fetch data from (JSONNET expression; wrap static
                URLs in double quotes).
              example: '"https://api.example.com/data"'
            headers:
              type: array
              description: >-
                List of headers as key-value pairs. You can add variables in
                JSONNET format. Eg. `"Bearer"+data["$tenant"].api_key`
              items:
                type: object
                properties:
                  key:
                    type: string
                    description: header key
                    examples:
                      authorization:
                        summary: Authorization header
                        value: '"Authorization"'
                      content_type:
                        summary: Content-Type header
                        value: '"Content-Type"'
                  value:
                    type: string
                    description: header value
                    example:
                      - '"Bearer "+data["$tenant"].api_key'
                      - '"application/json"'
            query_params:
              type: array
              description: >-
                List of query parameters as key-value pairs. You can add
                variables in JSONNET format. Eg. `data["$recipient"].id`
              items:
                type: object
                properties:
                  key:
                    type: string
                    description: Query Parameter Key
                    examples:
                      id_param:
                        summary: ID parameter
                        value: '"id"'
                      name_param:
                        summary: Name parameter
                        value: '"name"'
                  value:
                    type: string
                    description: Query Parameter Value
                    examples:
                      data_id:
                        summary: Data ID from payload
                        value: data.id
                      recipient_name:
                        summary: Recipient name from data
                        value: data["$recipient"].name
            output_key:
              type: string
              maxLength: 64
              description: >-
                Optional key to store the response of API call. Keys starting
                with `$` or `ss_` are reserved. If not provided, the response
                will be appended at the root of the workflow payload. It's
                recommended to provide a unique key here to avoid overwriting
                existing data.
    BranchWaitUntilNode:
      title: Wait Until
      type: object
      description: >-
        [**Wait Until**](https://docs.suprsend.com/docs/wait-until): Waits until
        a condition is met or the maximum time is reached. Uses branch structure
        with conditions.
      required:
        - node_type
        - branches
      properties:
        name:
          type: string
          maxLength: 64
          description: >-
            Human-readable name of the node. Optional; a default name is
            assigned based on node_type if omitted.
          example: Wait for approval
        node_type:
          type: string
          const: branch_waituntil
        description:
          type: string
          nullable: true
          description: Description of what this node does
        ref:
          type: string
          maxLength: 64
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
          description: >-
            Optional unique reference for the node (letters, numbers,
            underscore; must not start with a number). Auto-generated if
            omitted.
        branches:
          type: array
          description: >-
            Array of branches with conditions to evaluate. Minimum 2 branches
            required.
          minItems: 2
          maxItems: 2
          items:
            type: object
            properties:
              name:
                type: string
                description: Name of the branch for identification.
              description:
                type: string
                description: Description of what this branch does.
              is_default:
                type: boolean
                description: >-
                  Whether this is the default branch. In case of wait until,
                  branch with condition->type as 'delay' (max time) should
                  always be the default branch.
              conditions:
                type: array
                description: >-
                  Array of conditions to evaluate for this branch. The
                  non-default branch takes up to 5 `future_event` conditions,
                  each with a unique `event_name`; the default branch must
                  contain exactly one `delay` condition.
                maxItems: 5
                items:
                  type: object
                  required:
                    - type
                  properties:
                    type:
                      type: string
                      enum:
                        - future_event
                        - delay
                      description: Type of condition to evaluate.
                    event_name:
                      type: string
                      description: >-
                        Name of the future event to wait for. Required when type
                        is 'future_event'. Eg. `"request_approved"`
                      maxLength: 255
                    event_conditions:
                      type: array
                      description: >-
                        Additional conditions (max 5) to evaluate when the
                        future event occurs. Each item is an `expression_v1`
                        condition.
                      maxItems: 5
                      items:
                        type: object
                        properties:
                          type:
                            type: string
                            const: expression_v1
                          expression_v1:
                            type: object
                            properties:
                              op:
                                type: string
                                enum:
                                  - AND
                                description: >-
                                  Logical operator for combining args. Only AND
                                  is supported.
                              args:
                                type: array
                                maxItems: 10
                                items:
                                  type: object
                                  properties:
                                    variable_ns:
                                      type: string
                                      description: >-
                                        Namespace for the variable on left-hand
                                        side of expression. "" (payload data),
                                        "$future_event" (future event
                                        properties), "$actor", "$recipient",
                                        "$brand", "$tenant", "$organization",
                                        "$category".
                                      enum:
                                        - ''
                                        - $future_event
                                        - $actor
                                        - $recipient
                                        - $brand
                                        - $tenant
                                        - $organization
                                        - $category
                                    variable:
                                      type: string
                                      description: >-
                                        Variable name on left-hand side of
                                        expression.
                                      example: status
                                    op:
                                      type: string
                                      enum:
                                        - '=='
                                        - '!='
                                        - '>'
                                        - '>='
                                        - <
                                        - <=
                                        - EMPTY
                                        - NON_EMPTY
                                        - CONTAINS
                                        - NOT_CONTAINS
                                        - ARRAY_INTERSECTS
                                        - NOT_ARRAY_INTERSECTS
                                        - DATETIME_EQUALS
                                        - DATETIME_LT
                                        - DATETIME_GT
                                      description: Comparison operator for the expression.
                                    value:
                                      type: string
                                      description: >-
                                        Right-hand side operand. Required unless
                                        op is EMPTY/NON_EMPTY.
                                      example: approved
                    delay_properties:
                      type: object
                      description: >-
                        Timeout value after which the branch will be executed.
                        Required when condition->type is 'delay'.
                      properties:
                        delay_type:
                          type: string
                          enum:
                            - fixed
                            - dynamic
                            - relative_to
                          description: >-
                            Type of delay calculation. 


                            **fixed**: Static duration added as XXdXXhXXmXXs. 


                            **dynamic**: duration is passed as variable in your
                            trigger payload in jq format. Eg. `.delay_duration`,
                            `."$recipient".delay_duration`,
                            `."$actor".delay_duration`,
                            `."$tenant".delay_duration`. 


                            **relative_to**: delay is relative to a future
                            timestamp passed in your trigger payload. Eg.
                            `.start_time` before 15m.
                        value:
                          type: string
                          description: >-
                            Delay value. Required for 'fixed' and 'dynamic'
                            delay types.
                          examples:
                            fixed_duration:
                              summary: Fixed duration example
                              value: 30s
                            dynamic_duration:
                              summary: Dynamic duration from trigger payload
                              value: .delay_duration
                            recipient_duration:
                              summary: Dynamic duration from recipient properties
                              value: ."$recipient".delay_duration
                        relative_to:
                          type: object
                          description: >-
                            Relative delay configuration. Required when
                            delay_type is 'relative_to'.
                          example:
                            pivot_expr: .start_time
                            offset_type: before
                            offset_value_type: fixed
                            offset_value: 15m
                          properties:
                            pivot_expr:
                              type: string
                              description: >-
                                (jq-expression) variable defining the future
                                timestamp from trigger payload relative to which
                                delay is calculated.
                            offset_type:
                              type: string
                              enum:
                                - before
                                - after
                              description: Whether to add or subtract offset from pivot.
                            offset_value_type:
                              type: string
                              enum:
                                - fixed
                                - dynamic
                              description: >-
                                How to determine offset value. 


                                **fixed**: Static duration added as
                                XXdXXhXXmXXs. Eg. 15m before
                                meeting_start_time. 


                                **dynamic**: offset is passed as variable in
                                your trigger payload or recipient, tenant
                                properties in jq format. Eg.
                                `."$recipient".reminder_offset` before
                                meeting_start_time.
                            offset_value:
                              type: string
                              description: >-
                                Offset value. Required for 'fixed' and 'dynamic'
                                offset_value_types.
                              examples:
                                fixed_offset:
                                  summary: Fixed duration offset
                                  value: 15m
                                dynamic_offset:
                                  summary: Dynamic offset from recipient properties
                                  value: ."$recipient".reminder_offset
              nodes:
                type: array
                description: Array of nodes to execute when this branch condition is met.
    BranchNode:
      title: Branch
      type: object
      description: >-
        [**Branch**](https://docs.suprsend.com/docs/branch): Divides the
        workflow in different branches and executes the first branch that
        matches the branch condition.
      required:
        - node_type
        - branches
      properties:
        name:
          type: string
          maxLength: 64
          description: >-
            Human-readable name of the node. Optional; a default name is
            assigned based on node_type if omitted.
          example: Check user type
        node_type:
          type: string
          const: branch
        description:
          type: string
          nullable: true
          description: Description of what this node does
        ref:
          type: string
          maxLength: 64
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
          description: >-
            Optional unique reference for the node (letters, numbers,
            underscore; must not start with a number). Auto-generated if
            omitted.
        branches:
          type: array
          description: >-
            Array of branches with conditions to evaluate. Minimum 2 branches
            required.
          minItems: 2
          maxItems: 10
          items:
            type: object
            properties:
              name:
                type: string
                description: Name of the branch for identification.
              description:
                type: string
                description: Description of what this branch does.
              is_default:
                type: boolean
                description: >-
                  Whether this is the default branch. Default branch is executed
                  if no other branch conditions are met.
              conditions:
                type: array
                description: >-
                  Array of conditions to evaluate for this branch (max 10).
                  Required for non-default branches; must be empty for the
                  default branch.
                maxItems: 10
                items:
                  type: object
                  properties:
                    type:
                      type: string
                      const: expression_v1
                      description: >-
                        Type of condition to evaluate. Only expression_v1 is
                        supported for regular branch nodes.
                    expression_v1:
                      type: object
                      description: Boolean expression evaluation structure.
                      properties:
                        op:
                          type: string
                          enum:
                            - AND
                          description: >-
                            Logical operator for combining conditions. Only AND
                            is supported.
                        args:
                          type: array
                          description: Array of individual condition expressions (max 10).
                          maxItems: 10
                          items:
                            type: object
                            properties:
                              variable_ns:
                                type: string
                                description: >-
                                  Namespace for the variable on left-hand side
                                  of expression. Allowed values: "" (Default
                                  namespace - payload data), "$tenant" /
                                  "$brand" (tenant properties), "$actor" (user
                                  properties of the actor), "$recipient" (user
                                  properties of the recipient), "$organization",
                                  "$category" (preference category condition
                                  properties), "$future_event" (Future event
                                  properties), "$ref" (status of a previous send
                                  node, used with `ref` and op IS/IS_NOT).
                                enum:
                                  - ''
                                  - $tenant
                                  - $brand
                                  - $actor
                                  - $recipient
                                  - $organization
                                  - $category
                                  - $future_event
                                  - $ref
                              ref:
                                type: string
                                description: >-
                                  Ref of a previous send node. Required when
                                  variable_ns is `$ref`.
                              variable:
                                type: string
                                description: Variable name on left-hand side of expression.
                              op:
                                type: string
                                enum:
                                  - '=='
                                  - '!='
                                  - '>'
                                  - '>='
                                  - <
                                  - <=
                                  - EMPTY
                                  - NON_EMPTY
                                  - CONTAINS
                                  - NOT_CONTAINS
                                  - ARRAY_INTERSECTS
                                  - NOT_ARRAY_INTERSECTS
                                  - DATETIME_EQUALS
                                  - DATETIME_LT
                                  - DATETIME_GT
                                  - IS
                                  - IS_NOT
                                description: >-
                                  Comparison operator for the expression. IS /
                                  IS_NOT are only applicable when variable_ns is
                                  `$ref`.
                              value:
                                type: string
                                description: >-
                                  Right-hand side operand. Required unless op is
                                  EMPTY/NON_EMPTY.
              nodes:
                type: array
                description: Array of nodes to execute when this branch condition is met.
    TransformNode:
      title: Data Transform
      type: object
      description: >-
        [**Data Transform**](https://docs.suprsend.com/docs/data-transform):
        Transforms data or generates/overrides variables using scripting
        languages like JSONNET or Handlebars.
      required:
        - node_type
        - properties
      properties:
        name:
          type: string
          maxLength: 64
          description: >-
            Human-readable name of the node. Optional; a default name is
            assigned based on node_type if omitted.
          example: Transform data
        node_type:
          type: string
          const: transform
        description:
          type: string
          nullable: true
          description: Description of what this node does
        ref:
          type: string
          maxLength: 64
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
          description: >-
            Optional unique reference for the node (letters, numbers,
            underscore; must not start with a number). Auto-generated if
            omitted.
        properties:
          type: object
          description: Node-specific configuration.
          required:
            - variables
          properties:
            variables:
              type: array
              description: >-
                Array of variables to generate or override (max 25). Each
                variable must have a unique key.
              minItems: 1
              maxItems: 25
              items:
                type: object
                required:
                  - key
                  - value_lang
                  - value
                properties:
                  key:
                    type: string
                    description: >-
                      Literal string key for the variable. Reserved SuprSend
                      variables (e.g. `$recipient`, `$actor`, `$tenant`,
                      `$batched_events`) are not allowed.
                    minLength: 1
                    maxLength: 64
                  value_lang:
                    type: string
                    enum:
                      - jsonnet
                      - handlebars
                    description: >-
                      Scripting language to use for deriving the variable value
                      at runtime.
                  value:
                    type: string
                    description: >-
                      Script in the selected language to derive the value of the
                      variable at runtime.
                    minLength: 1
                    maxLength: 1024
    TimeWindowNode:
      title: Time Window
      type: object
      description: >-
        [**Time Window**](https://docs.suprsend.com/docs/time-window): Restricts
        workflow execution to specific time windows based on recurrence rules.
      required:
        - node_type
        - properties
      properties:
        name:
          type: string
          maxLength: 64
          description: >-
            Human-readable name of the node. Optional; a default name is
            assigned based on node_type if omitted.
          example: Business hours only
        node_type:
          type: string
          const: timewindow
        description:
          type: string
          nullable: true
          description: Description of what this node does
        ref:
          type: string
          maxLength: 64
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
          description: >-
            Optional unique reference for the node (letters, numbers,
            underscore; must not start with a number). Auto-generated if
            omitted.
        properties:
          type: object
          description: Node-specific configuration.
          required:
            - windows
          properties:
            windows:
              type: array
              description: >-
                Array of time windows defined using recurrence rule structure
                (max 5).
              minItems: 1
              maxItems: 5
              items:
                type: object
                properties:
                  frequency:
                    type: string
                    enum:
                      - daily
                      - weekly_mo2fr
                      - weekly
                      - monthly
                    description: Frequency of the time window recurrence.
                  weekdays:
                    type: array
                    items:
                      type: string
                      enum:
                        - su
                        - mo
                        - tu
                        - we
                        - th
                        - fr
                        - sa
                    description: Which days to include when frequency is 'weekly'.
                  monthdays:
                    type: array
                    description: Which days to include when frequency is 'monthly'.
                    items:
                      type: object
                      properties:
                        pos:
                          type: integer
                          minimum: -31
                          maximum: 31
                          description: Day number (-31 to 31).
                        day:
                          type: string
                          enum:
                            - null
                            - su
                            - mo
                            - tu
                            - we
                            - th
                            - fr
                            - sa
                          description: >-
                            Weekday when specifying nth weekday of month.
                            Negative values indicate the nth last occurrence of
                            the weekday in the month.
                  stime:
                    type: string
                    description: Clock start time of the window in HH:MM format (24-hour).
                    example: '08:00'
                  etime:
                    type: string
                    description: Clock end time of the window in HH:MM format (24-hour).
                    example: '17:00'
            tz_selection:
              type: string
              enum:
                - fixed
                - recipient
              default: fixed
              description: >-
                Where to pick timezone from for calculating datetime from
                recurrence rule. 


                **fixed**: Use a fixed timezone. 


                **recipient**: Use the timezone set in recipient properties.
            tz_fixed:
              type: string
              description: >-
                Fixed IANA timezone for calculating datetime in recurrence rule.
                Defaults to UTC when tz_selection is `fixed`.
              example: America/New_York
    SubscriberListOperationAddUserNode:
      title: Add User to List
      type: object
      description: >-
        [**Add User to List**](https://docs.suprsend.com/docs/add-user-to-list):
        Adds users (actor or recipient) to a subscriber list. Can create the
        list if it doesn't exist.
      required:
        - node_type
        - properties
      properties:
        name:
          type: string
          maxLength: 64
          description: >-
            Human-readable name of the node. Optional; a default name is
            assigned based on node_type if omitted.
          example: Add to newsletter list
        node_type:
          type: string
          const: subscriberlistoperation_adduser
        description:
          type: string
          nullable: true
          description: Description of what this node does
        ref:
          type: string
          maxLength: 64
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
          description: >-
            Optional unique reference for the node (letters, numbers,
            underscore; must not start with a number). Auto-generated if
            omitted.
        properties:
          type: object
          description: Node-specific configuration.
          required:
            - list_id
            - user_selection
          properties:
            is_list_id_dynamic:
              type: boolean
              default: false
              description: >-
                Whether list_id is a static literal string or a handlebars
                expression.
            list_id:
              type: string
              description: >-
                List identifier. Can be a static literal string (alphanumeric,
                hyphen, underscore; max 64 chars) or, when `is_list_id_dynamic`
                is true, a handlebars expression added as {{list_id}}.
              minLength: 1
              maxLength: 512
            create_list_if_missing:
              type: boolean
              default: false
              description: Whether to create the list if it doesn't exist.
            list_name:
              type: string
              description: >-
                Name for the list when creating it. Pass when
                `create_list_if_missing` is true.
              minLength: 1
            user_selection:
              type: array
              description: >-
                Which users to add to the list. Can select actor, recipient, or
                both.
              minItems: 1
              items:
                type: string
                enum:
                  - actor
                  - recipient
    SubscriberListOperationRemoveUserNode:
      title: Remove User from List
      type: object
      description: >-
        [**Remove User from
        List**](https://docs.suprsend.com/docs/remove-user-from-list): Removes
        users (actor or recipient) from the list. List must exist for the
        operation to succeed.
      required:
        - node_type
        - properties
      properties:
        name:
          type: string
          maxLength: 64
          description: >-
            Human-readable name of the node. Optional; a default name is
            assigned based on node_type if omitted.
          example: Remove from newsletter list
        node_type:
          type: string
          const: subscriberlistoperation_removeuser
        description:
          type: string
          nullable: true
          description: Description of what this node does
        ref:
          type: string
          maxLength: 64
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
          description: >-
            Optional unique reference for the node (letters, numbers,
            underscore; must not start with a number). Auto-generated if
            omitted.
        properties:
          type: object
          description: Node-specific configuration.
          required:
            - list_id
            - user_selection
          properties:
            is_list_id_dynamic:
              type: boolean
              default: false
              description: >-
                Whether list_id is a static literal string or a handlebars
                expression.
            list_id:
              type: string
              description: >-
                List identifier. Can be a static literal string (alphanumeric,
                hyphen, underscore; max 64 chars) or, when `is_list_id_dynamic`
                is true, a handlebars expression (to compute the list id at
                runtime. Eg. {{list_id}}).
              minLength: 1
              maxLength: 512
            user_selection:
              type: array
              description: >-
                Which users to remove from the list. Can select actor,
                recipient, or both.
              minItems: 1
              items:
                type: string
                enum:
                  - actor
                  - recipient
    ObjectOperationAddSubscriptionNode:
      title: Subscribe to Object
      type: object
      description: >-
        [**Subscribe to
        Object**](https://docs.suprsend.com/docs/subscribe-to-object): Adds
        users (actor or recipient) as subscribers to an object. Can create the
        object if it doesn't exist.
      required:
        - node_type
        - properties
      properties:
        name:
          type: string
          maxLength: 64
          description: >-
            Human-readable name of the node. Optional; a default name is
            assigned based on node_type if omitted.
          example: Add use to team object
        node_type:
          type: string
          const: objectoperation_addsubscription
        description:
          type: string
          nullable: true
          description: Description of what this node does
        ref:
          type: string
          maxLength: 64
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
          description: >-
            Optional unique reference for the node (letters, numbers,
            underscore; must not start with a number). Auto-generated if
            omitted.
        properties:
          type: object
          description: Node-specific configuration.
          required:
            - object_type
            - object_id
            - user_selection
          properties:
            is_object_id_dynamic:
              type: boolean
              default: false
              description: >-
                Whether object_type and object_id are static literal strings or
                handlebars expressions.
            object_type:
              type: string
              description: Type/collection name of the object.
              minLength: 1
              maxLength: 512
            object_id:
              type: string
              description: Unique identifier of the object within the object_type.
              minLength: 1
              maxLength: 512
            create_object_if_missing:
              type: boolean
              default: false
              description: Whether to create the object if it doesn't exist.
            user_selection:
              type: array
              description: >-
                Which users to add as subscribers to the object. Can select
                actor, recipient, or both.
              minItems: 1
              items:
                type: string
                enum:
                  - actor
                  - recipient
            subscription_properties:
              type: string
              maxLength: 2048
              description: >-
                Additional subscription properties which defines the
                relationship between object and user. Eg. role, designation,
                etc. Pass as JSONNET expression.
              example: '{"role": "admin"}'
    ObjectOperationRemoveSubscriptionNode:
      title: Unsubscribe from Object
      type: object
      description: >-
        [**Unsubscribe from
        Object**](https://docs.suprsend.com/docs/unsubscribe-from-object):
        Removes users (actor or recipient) as subscribers from an object. Object
        must exist for the operation to succeed.
      required:
        - node_type
        - properties
      properties:
        name:
          type: string
          maxLength: 64
          description: >-
            Human-readable name of the node. Optional; a default name is
            assigned based on node_type if omitted.
          example: Unsubscribe from project
        node_type:
          type: string
          const: objectoperation_removesubscription
        description:
          type: string
          nullable: true
          description: Description of what this node does
        ref:
          type: string
          maxLength: 64
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
          description: >-
            Optional unique reference for the node (letters, numbers,
            underscore; must not start with a number). Auto-generated if
            omitted.
        properties:
          type: object
          description: Node-specific configuration.
          required:
            - object_type
            - object_id
            - user_selection
          properties:
            is_object_id_dynamic:
              type: boolean
              default: false
              description: >-
                Whether object_type and object_id are static literal strings or
                handlebars expressions.
            object_type:
              type: string
              description: Type/collection name of the object.
              minLength: 1
              maxLength: 512
            object_id:
              type: string
              description: Unique identifier of the object within the object_type.
              minLength: 1
              maxLength: 512
            user_selection:
              type: array
              description: >-
                Which users to remove as subscribers from the object. Can select
                actor, recipient, or both.
              minItems: 1
              items:
                type: string
                enum:
                  - actor
                  - recipient
    UserUpdateNode:
      title: Update User Profile
      type: object
      description: >-
        [**Update User
        Profile**](https://docs.suprsend.com/docs/update-user-profile): Updates
        user profile properties for either the actor or recipient using JSONNET
        expression.
      required:
        - node_type
        - properties
      properties:
        name:
          type: string
          maxLength: 64
          description: >-
            Human-readable name of the node. Optional; a default name is
            assigned based on node_type if omitted.
          example: Update user profile
        node_type:
          type: string
          const: userupdate
        description:
          type: string
          nullable: true
          description: Description of what this node does
        ref:
          type: string
          maxLength: 64
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
          description: >-
            Optional unique reference for the node (letters, numbers,
            underscore; must not start with a number). Auto-generated if
            omitted.
        properties:
          type: object
          description: Node-specific configuration.
          required:
            - user_selection
            - properties
          properties:
            user_selection:
              type: string
              enum:
                - actor
                - recipient
              description: >-
                Select which user to update - actor who triggered the workflow
                or the recipient of the workflow.
            properties:
              type: string
              description: >-
                JSONNET script that evaluates at runtime to a map/dictionary of
                user properties to update.
              minLength: 1
              maxLength: 2048
              example: '{"name": "John Doe", "email": "john.doe@example.com"}'
    InvokeWorkflowNode:
      title: Invoke Workflow
      type: object
      description: >-
        [**Invoke Workflow**](https://docs.suprsend.com/docs/invoke-workflow):
        Triggers another workflow using data from the current workflow run.
        Generally used when you have to notify different recipients at different
        stages of the workflow.
      required:
        - node_type
        - properties
      properties:
        name:
          type: string
          maxLength: 64
          description: >-
            Human-readable name of the node. Optional; a default name is
            assigned based on node_type if omitted.
          example: Escalate to the manager
        node_type:
          type: string
          const: invokeworkflow
        description:
          type: string
          nullable: true
          description: Description of what this node does
        ref:
          type: string
          maxLength: 64
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
          description: >-
            Optional unique reference for the node (letters, numbers,
            underscore; must not start with a number). Auto-generated if
            omitted.
        properties:
          type: object
          description: Node-specific configuration.
          required:
            - workflow
            - recipient_selection
          properties:
            workflow:
              type: string
              description: Slug of the workflow to invoke.
              minLength: 1
              maxLength: 255
              pattern: ^[a-zA-Z0-9_-]+$
            actor_selection:
              type: string
              enum:
                - null
                - recipient
                - actor
                - expression
              description: >-
                Where to pick the actor from for the invoke-workflow payload. 


                **recipient**: Use the recipient of the current workflow run. 


                **actor**: Use the actor who triggered the current workflow
                run. 


                **expression**: Use a JSONNET expression to derive the actor at
                runtime using data from the current workflow run.
            actor_expression:
              type: string
              maxLength: 1024
              description: >-
                JSONNET expression to derive the actor at runtime for the
                invoked workflow. Pass when `actor_selection` is 'expression'.
                Eg. `data["$recipient"].id`
              minLength: 1
            recipient_selection:
              type: string
              enum:
                - recipient
                - actor
                - expression
              description: >-
                Where to pick the recipient from for the invoke-workflow
                payload. 


                **recipient**: Use the recipient of the current workflow run. 


                **actor**: Use the actor who triggered the current workflow
                run. 


                **expression**: Use a JSONNET expression to derive the recipient
                at runtime using data from the current workflow run.
            recipient_expression:
              type: string
              maxLength: 1024
              description: >-
                JSONNET expression to derive the recipient at runtime for the
                invoked workflow. Pass when `recipient_selection` is
                'expression'. Eg. `data["$recipient"].manager_id`
              minLength: 1
            data:
              type: string
              maxLength: 2048
              description: >-
                JSONNET expression to derive the data field for the
                invoke-workflow payload.
            append_current_run_data:
              type: boolean
              default: false
              description: >-
                Whether the current workflow-run data should be passed as
                payload of the invoked workflow.
            cancellation_key:
              type: string
              maxLength: 1024
              description: >-
                Optional JSONNET expression evaluated against the current run's
                data; the result is passed as the cancellation key of the
                invoked workflow run.
    SendEmailNode:
      title: Send Email
      type: object
      description: >-
        [**Email**](https://docs.suprsend.com/docs/delivery-single-channel):
        Sends email notifications using a specified template.
      required:
        - node_type
        - properties
      properties:
        name:
          type: string
          maxLength: 64
          description: >-
            Human-readable name of the node. Optional; a default name is
            assigned based on node_type if omitted.
          example: Send welcome email
        node_type:
          type: string
          const: send_email
        description:
          type: string
          nullable: true
          description: Description of what this node does
        ref:
          type: string
          maxLength: 64
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
          description: >-
            Optional unique reference for the node (letters, numbers,
            underscore; must not start with a number). Auto-generated if
            omitted. Send-node refs can be referenced in branch conditions
            (variable_ns `$ref`).
        properties:
          type: object
          description: Node-specific configuration.
          required:
            - template
          properties:
            template:
              type: string
              description: Slug of the template used for notification content.
              minLength: 1
              maxLength: 120
              pattern: ^[a-z0-9-_]+$
            success:
              type: string
              maxLength: 512
              description: >-
                Success metric to track for this notification: `delivered`,
                `seen`, `interaction`, or a custom event name. Defaults to
                `seen`.
    SendSmsNode:
      title: Send SMS
      type: object
      description: >-
        [**SMS**](https://docs.suprsend.com/docs/delivery-single-channel)):
        Sends SMS text message notifications using a specified template.
      required:
        - node_type
        - properties
      properties:
        name:
          type: string
          maxLength: 64
          description: >-
            Human-readable name of the node. Optional; a default name is
            assigned based on node_type if omitted.
          example: Send OTP SMS
        node_type:
          type: string
          const: send_sms
        description:
          type: string
          nullable: true
          description: Description of what this node does
        ref:
          type: string
          maxLength: 64
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
          description: >-
            Optional unique reference for the node (letters, numbers,
            underscore; must not start with a number). Auto-generated if
            omitted. Send-node refs can be referenced in branch conditions
            (variable_ns `$ref`).
        properties:
          type: object
          description: Node-specific configuration.
          required:
            - template
          properties:
            template:
              type: string
              description: Slug of the template used for SMS notification content.
              minLength: 1
              maxLength: 120
              pattern: ^[a-z0-9-_]+$
            success:
              type: string
              maxLength: 512
              description: >-
                Success metric to track for this notification: `delivered`,
                `seen`, `interaction`, or a custom event name. Defaults to
                `seen`.
    SendWhatsappNode:
      title: Send WhatsApp
      type: object
      description: >-
        [**WhatsApp**](https://docs.suprsend.com/docs/delivery-single-channel):
        Sends WhatsApp message notifications using a specified template.
      required:
        - node_type
        - properties
      properties:
        name:
          type: string
          maxLength: 64
          description: >-
            Human-readable name of the node. Optional; a default name is
            assigned based on node_type if omitted.
          example: Send WhatsApp order confirmation
        node_type:
          type: string
          const: send_whatsapp
        description:
          type: string
          nullable: true
          description: Description of what this node does
        ref:
          type: string
          maxLength: 64
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
          description: >-
            Optional unique reference for the node (letters, numbers,
            underscore; must not start with a number). Auto-generated if
            omitted. Send-node refs can be referenced in branch conditions
            (variable_ns `$ref`).
        properties:
          type: object
          description: Node-specific configuration.
          required:
            - template
          properties:
            template:
              type: string
              description: Slug of the template used for WhatsApp notification content.
              minLength: 1
              maxLength: 120
              pattern: ^[a-z0-9-_]+$
            success:
              type: string
              maxLength: 512
              description: >-
                Success metric to track for this notification: `delivered`,
                `seen`, `interaction`, or a custom event name. Defaults to
                `seen`.
    SendMobilePushNode:
      title: Send Mobile Push
      type: object
      description: >-
        [**Mobile
        Push**](https://docs.suprsend.com/docs/delivery-single-channel): Sends
        push notifications to mobile devices (Android and iOS) using a specified
        template.
      required:
        - node_type
        - properties
      properties:
        name:
          type: string
          maxLength: 64
          description: >-
            Human-readable name of the node. Optional; a default name is
            assigned based on node_type if omitted.
          example: Send mobile push notification
        node_type:
          type: string
          const: send_mobile_push
        description:
          type: string
          nullable: true
          description: Description of what this node does
        ref:
          type: string
          maxLength: 64
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
          description: >-
            Optional unique reference for the node (letters, numbers,
            underscore; must not start with a number). Auto-generated if
            omitted. Send-node refs can be referenced in branch conditions
            (variable_ns `$ref`).
        properties:
          type: object
          description: Node-specific configuration.
          required:
            - template
          properties:
            template:
              type: string
              description: Slug of the template used for mobile push notification content.
              minLength: 1
              maxLength: 120
              pattern: ^[a-z0-9-_]+$
            success:
              type: string
              maxLength: 512
              description: >-
                Success metric to track for this notification: `delivered`,
                `seen`, `interaction`, or a custom event name. Defaults to
                `seen`.
    SendInboxNode:
      title: Send Inbox
      type: object
      description: >-
        [**Inbox**](https://docs.suprsend.com/docs/delivery-single-channel):
        Sends in-app inbox notifications using a specified template.
      required:
        - node_type
        - properties
      properties:
        name:
          type: string
          maxLength: 64
          description: >-
            Human-readable name of the node. Optional; a default name is
            assigned based on node_type if omitted.
          example: Send in-app notification
        node_type:
          type: string
          const: send_inbox
        description:
          type: string
          nullable: true
          description: Description of what this node does
        ref:
          type: string
          maxLength: 64
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
          description: >-
            Optional unique reference for the node (letters, numbers,
            underscore; must not start with a number). Auto-generated if
            omitted. Send-node refs can be referenced in branch conditions
            (variable_ns `$ref`).
        properties:
          type: object
          description: Node-specific configuration.
          required:
            - template
          properties:
            template:
              type: string
              description: Slug of the template used for in-app inbox notification content.
              minLength: 1
              maxLength: 120
              pattern: ^[a-z0-9-_]+$
            success:
              type: string
              maxLength: 512
              description: >-
                Success metric to track for this notification: `delivered`,
                `seen`, `interaction`, or a custom event name. Defaults to
                `seen`.
    SendWebpushNode:
      title: Send Web Push
      type: object
      description: >-
        [**Web Push**](https://docs.suprsend.com/docs/delivery-single-channel):
        Sends web push notifications using a specified template.
      required:
        - node_type
        - properties
      properties:
        name:
          type: string
          maxLength: 64
          description: >-
            Human-readable name of the node. Optional; a default name is
            assigned based on node_type if omitted.
          example: Send web push notification
        node_type:
          type: string
          const: send_webpush
        description:
          type: string
          nullable: true
          description: Description of what this node does
        ref:
          type: string
          maxLength: 64
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
          description: >-
            Optional unique reference for the node (letters, numbers,
            underscore; must not start with a number). Auto-generated if
            omitted. Send-node refs can be referenced in branch conditions
            (variable_ns `$ref`).
        properties:
          type: object
          description: Node-specific configuration.
          required:
            - template
          properties:
            template:
              type: string
              description: Slug of the template used for web push notification content.
              minLength: 1
              maxLength: 120
              pattern: ^[a-z0-9-_]+$
            success:
              type: string
              maxLength: 512
              description: >-
                Success metric to track for this notification: `delivered`,
                `seen`, `interaction`, or a custom event name. Defaults to
                `seen`.
    SendSlackNode:
      title: Send Slack
      type: object
      description: >-
        [**Slack**](https://docs.suprsend.com/docs/delivery-single-channel):
        Sends Slack message notifications using a specified template.
      required:
        - node_type
        - properties
      properties:
        name:
          type: string
          maxLength: 64
          description: >-
            Human-readable name of the node. Optional; a default name is
            assigned based on node_type if omitted.
          example: Send Slack notification
        node_type:
          type: string
          const: send_slack
        description:
          type: string
          nullable: true
          description: Description of what this node does
        ref:
          type: string
          maxLength: 64
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
          description: >-
            Optional unique reference for the node (letters, numbers,
            underscore; must not start with a number). Auto-generated if
            omitted. Send-node refs can be referenced in branch conditions
            (variable_ns `$ref`).
        properties:
          type: object
          description: Node-specific configuration.
          required:
            - template
          properties:
            template:
              type: string
              description: Slug of the template used for Slack notification content.
              minLength: 1
              maxLength: 120
              pattern: ^[a-z0-9-_]+$
            success:
              type: string
              maxLength: 512
              description: >-
                Success metric to track for this notification: `delivered`,
                `seen`, `interaction`, or a custom event name. Defaults to
                `seen`.
    SendMsTeamsNode:
      title: Send Microsoft Teams
      type: object
      description: >-
        [**Microsoft
        Teams**](https://docs.suprsend.com/docs/delivery-single-channel): Sends
        Microsoft Teams chat notifications using a specified template.
      required:
        - node_type
        - properties
      properties:
        name:
          type: string
          maxLength: 64
          description: >-
            Human-readable name of the node. Optional; a default name is
            assigned based on node_type if omitted.
          example: Send Teams notification
        node_type:
          type: string
          const: send_ms_teams
        description:
          type: string
          nullable: true
          description: Description of what this node does
        ref:
          type: string
          maxLength: 64
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
          description: >-
            Optional unique reference for the node (letters, numbers,
            underscore; must not start with a number). Auto-generated if
            omitted. Send-node refs can be referenced in branch conditions
            (variable_ns `$ref`).
        properties:
          type: object
          description: Node-specific configuration.
          required:
            - template
          properties:
            template:
              type: string
              description: >-
                Slug of the template used for Microsoft Teams notification
                content.
              minLength: 1
              maxLength: 120
              pattern: ^[a-z0-9-_]+$
            success:
              type: string
              maxLength: 512
              description: >-
                Success metric to track for this notification: `delivered`,
                `seen`, `interaction`, or a custom event name. Defaults to
                `seen`.
    SendMultiChannelNode:
      title: Send Multi-Channel
      type: object
      description: >-
        [**Multi-Channel**](https://docs.suprsend.com/docs/delivery-multi-channel):
        Sends notifications across multiple channels simultaneously using a
        specified template.
      required:
        - node_type
        - properties
      properties:
        name:
          type: string
          maxLength: 64
          description: >-
            Human-readable name of the node. Optional; a default name is
            assigned based on node_type if omitted.
          example: Send multi-channel notification
        node_type:
          type: string
          const: send_multi_channel
        description:
          type: string
          nullable: true
          description: Description of what this node does
        ref:
          type: string
          maxLength: 64
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
          description: >-
            Optional unique reference for the node (letters, numbers,
            underscore; must not start with a number). Auto-generated if
            omitted. Send-node refs can be referenced in branch conditions
            (variable_ns `$ref`).
        properties:
          type: object
          description: Node-specific configuration.
          required:
            - template
          properties:
            template:
              type: string
              description: >-
                Slug of the template used for notification content across all
                channels.
              minLength: 1
              maxLength: 120
              pattern: ^[a-z0-9-_]+$
            channels:
              type: array
              description: >-
                Specific channels to use when sending multi-channel
                notification. If not provided, all channels will be used.
              items:
                type: string
                enum:
                  - sms
                  - email
                  - androidpush
                  - iospush
                  - webpush
                  - inbox
                  - whatsapp
                  - slack
                  - ms_teams
            channels_expr:
              type: string
              description: jq-expression for preparing channel list dynamically at runtime.
              minLength: 2
              maxLength: 512
            success:
              type: string
              maxLength: 512
              description: >-
                Success metric to track for this notification: `delivered`,
                `seen`, `interaction`, or a custom event name. Defaults to
                `seen`.
    SendSmartChannelRoutingNode:
      title: Smart Channel Routing
      type: object
      description: >-
        [**Smart Channel
        Routing**](https://docs.suprsend.com/docs/smart-delivery): Sends
        notification subsequently at each consecutive channel with a delay
        (computed using time-to-live) between each channel.
      required:
        - node_type
        - properties
      properties:
        name:
          type: string
          maxLength: 64
          description: >-
            Human-readable name of the node. Optional; a default name is
            assigned based on node_type if omitted.
          example: Send smart channel notification
        node_type:
          type: string
          const: send_smart_channel_routing
        description:
          type: string
          nullable: true
          description: Description of what this node does
        ref:
          type: string
          maxLength: 64
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
          description: >-
            Optional unique reference for the node (letters, numbers,
            underscore; must not start with a number). Auto-generated if
            omitted. Send-node refs can be referenced in branch conditions
            (variable_ns `$ref`).
        properties:
          type: object
          description: Node-specific configuration.
          required:
            - template
            - success
          properties:
            template:
              type: string
              description: >-
                Slug of the template used for smart channel routing notification
                content.
              minLength: 1
              maxLength: 120
              pattern: ^[a-z0-9-_]+$
            channels_expr:
              type: string
              description: >-
                jq-expression for preparing available channel list dynamically
                at runtime.
              minLength: 2
              maxLength: 512
            success:
              type: string
              maxLength: 512
              description: >-
                Success metric to track for smart channel routing: `delivered`,
                `seen`, `interaction`, or a custom event name.
              examples:
                delivered:
                  summary: Notification delivered
                  value: delivered
                seen:
                  summary: Notification seen
                  value: seen
                interaction:
                  summary: User interacted with (clicked) the notification
                  value: interaction
                custom_event:
                  summary: Custom event name
                  value: <custom_event_name>
            success_is_event:
              type: boolean
              readOnly: true
              description: >-
                Derived by the server from `success`: true when the success
                metric is a custom event, false when it is a notification status
                (delivered/seen/interaction).
            ttl_value:
              type: string
              maxLength: 16
              default: 1h
              description: >-
                Time-to-live value for the smart channel routing notification in
                static duration format (> 0 and <= 90 days). Defaults to 1h.
              example: 1h
            mandatory_channels:
              type: array
              description: >-
                Channels that will be sent immediately regardless of smart
                routing logic.
              items:
                type: string
                enum:
                  - sms
                  - email
                  - androidpush
                  - iospush
                  - webpush
                  - inbox
                  - whatsapp
                  - slack
                  - ms_teams
            routing_basis:
              type: string
              readOnly: true
              enum:
                - cost_low_to_high
              description: >-
                Basis for smart channel routing. Determines the order in which
                channels are tried. Set by the server to `cost_low_to_high`;
                values passed in the request are ignored.
    ErrorResponse:
      type: object
      properties:
        code:
          type: integer
          description: HTTP status code
        error_code:
          type: string
          description: Specific error code identifier
        type:
          type: string
          description: Error type classification
        message:
          type: string
          description: Human-readable error message
        detail:
          oneOf:
            - type: string
            - type: object
            - type: array
              items:
                type: string
          description: >-
            Additional error details. A string for most errors. For validation
            errors, either an object mapping field names to their error
            messages, or an array of messages when the error is not tied to a
            field.
    Schedule:
      type: object
      description: Static schedule configuration for digest notifications.
      properties:
        frequency:
          type: string
          enum:
            - minutely
            - hourly
            - daily
            - weekly_mo2fr
            - weekly
            - monthly
          description: Frequency of the digest schedule.
        interval:
          type: integer
          minimum: 1
          description: >-
            Multiplier for recurrence schedule. Eg. 2 for every 2 hours, 3 for
            every 3 days, etc.
        weekdays:
          type: array
          items:
            type: string
            enum:
              - su
              - mo
              - tu
              - we
              - th
              - fr
              - sa
          description: Which days to include when frequency is 'weekly'.
        monthdays:
          type: array
          items:
            type: object
            properties:
              pos:
                type: integer
                minimum: -31
                maximum: 31
              day:
                type: string
                enum:
                  - null
                  - su
                  - mo
                  - tu
                  - we
                  - th
                  - fr
                  - sa
          description: Which days to include when frequency is 'monthly'.
        time:
          type: string
          description: Time of day to send digest in HH:MM format (24-hour).
          examples:
            - '09:00'
            - '18:30'
        dtstart:
          type: string
          description: When to start schedule calculation from in ISO datetime format.
        tz_selection:
          type: string
          enum:
            - fixed
            - recipient
          description: |-
            timezone of the recurring schedule. 

            **fixed**: Fixed timezone. 

            **recipient**: Recipient's timezone picked from user properties.
        tz_fixed:
          type: string
          description: Fixed IANA timezone.
          examples:
            new_york:
              summary: New York timezone
              value: America/New_York
            london:
              summary: London timezone
              value: Europe/London
  responses:
    BadRequestError:
      description: Bad request - invalid input data
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    AuthenticationError:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 401
            error_code: authentication_failed
            type: AuthenticationFailed
            message: Invalid service token.
            detail: Invalid service token.
    NotFoundError:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 404
            error_code: not_found
            type: NotFound
            message: workspace 'demo' not found
            detail: workspace 'demo' not found
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: Authorization
      x-bearer-format: bearer
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where <token>
        is your auth token.
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API_Key
      description: >-
        Pass as `Bearer <API_KEY>`. Get API Key from SuprSend dashboard
        Developers -> API Keys section.
    ServiceTokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Pass as `Authorization: ServiceToken <token>`. You can get Service Token
        from [SuprSend dashboard -> Account Settings -> Service
        Tokens](https://app.suprsend.com/en/account-settings/service-tokens)
        section.

````

## Related topics

- [Create or Update Preference Category](https://docs.suprsend.com/reference/create-update-category.md)
- [Create/Update Schema](https://docs.suprsend.com/reference/upsert-schema.md)
- [Create / Update Tenants](https://docs.suprsend.com/reference/create-update-tenants.md)
- [Create / Update Objects](https://docs.suprsend.com/reference/create-update-objects.md)
- [Create / Update Users](https://docs.suprsend.com/reference/create-update-users.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.