{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/fusehealth-com/json-schema/fusehealth-com-sequence-schema.json",
  "title": "Sequence",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/fusehealth-com-crm-sequences-api-openapi.yml#/components/schemas/Sequence",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "clinicId": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "draft",
        "active",
        "paused",
        "archived"
      ]
    },
    "trigger": {
      "type": "object",
      "additionalProperties": true
    },
    "steps": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/SequenceStep"
      }
    },
    "analytics": {
      "type": "object",
      "additionalProperties": true
    },
    "isActive": {
      "type": "boolean"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "SequenceStep": {
      "type": "object",
      "description": "A delay, email, or sms step. Requires an id (or step_id) and a type (or stepType). delay steps carry timeSeconds; email/sms steps carry a templateId or custom text.",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "enum": [
            "delay",
            "email",
            "sms"
          ]
        },
        "timeSeconds": {
          "type": "number",
          "minimum": 0
        },
        "useCustomText": {
          "type": "boolean"
        },
        "templateId": {
          "type": "string",
          "format": "uuid"
        },
        "customText": {
          "type": "string"
        },
        "customSubject": {
          "type": "string"
        }
      }
    }
  }
}