{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/fnlowl-com/json-schema/fnlowl-com-sequence-activation-request-schema.json",
  "title": "SequenceActivationRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/fnlowl-com-sequences-api-openapi.yml#/components/schemas/SequenceActivationRequest",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "sequenceId": {
      "type": "string"
    },
    "requestedBy": {
      "type": "string"
    },
    "createdAt": {
      "type": "integer"
    },
    "plan": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "widgetId": {
          "type": [
            "string",
            "null"
          ]
        },
        "steps": {
          "type": "array",
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "email"
                    ]
                  },
                  "subject": {
                    "type": "string"
                  },
                  "body": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "type",
                  "subject",
                  "body"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "delay"
                    ]
                  },
                  "delayDays": {
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "required": [
                  "id",
                  "type",
                  "delayDays"
                ]
              }
            ]
          }
        },
        "branch": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "filters": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "field": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "unsubscribed",
                      "quizTierLabel"
                    ]
                  },
                  "equals": {
                    "type": "string"
                  },
                  "steps": {
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string",
                              "enum": [
                                "email"
                              ]
                            },
                            "subject": {
                              "type": "string"
                            },
                            "body": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "type",
                            "subject",
                            "body"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string",
                              "enum": [
                                "delay"
                              ]
                            },
                            "delayDays": {
                              "type": "integer",
                              "minimum": 0
                            }
                          },
                          "required": [
                            "id",
                            "type",
                            "delayDays"
                          ]
                        }
                      ]
                    }
                  }
                },
                "required": [
                  "id",
                  "field",
                  "equals",
                  "steps"
                ]
              }
            }
          },
          "required": [
            "filters"
          ]
        }
      },
      "required": [
        "name",
        "widgetId",
        "steps",
        "branch"
      ]
    }
  },
  "required": [
    "id",
    "sequenceId",
    "requestedBy",
    "createdAt",
    "plan"
  ]
}