{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/intely/json-schema/intely-integration-schema.json",
  "title": "Integration",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/intely-connect-api-openapi.yml#/components/schemas/Integration",
  "type": "object",
  "properties": {
    "_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "steps": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/IntegrationStep"
      }
    },
    "organizationId": {
      "type": "string"
    },
    "userId": {
      "type": "string"
    },
    "status": {
      "type": "integer",
      "enum": [
        1,
        2,
        3
      ]
    },
    "isTemplate": {
      "type": "boolean"
    },
    "deletedAt": {
      "type": "string",
      "format": "date-time"
    },
    "runTime": {
      "type": "string",
      "format": "date-time"
    },
    "isRunning": {
      "type": "boolean"
    }
  },
  "$defs": {
    "IntegrationStep": {
      "type": "object",
      "properties": {
        "stepType": {
          "type": "string"
        },
        "stepId": {
          "type": "integer"
        },
        "descripton": {
          "type": "string"
        },
        "prevSteps": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "nextSteps": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "continueIfFailed": {
          "type": "boolean"
        },
        "numberOfRetries": {
          "type": "integer"
        },
        "parameters": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "vendorId": {
          "type": "string"
        },
        "vendorInstanceId": {
          "type": "string"
        },
        "action": {
          "type": "string"
        },
        "resource": {
          "type": "string"
        },
        "triggerType": {
          "type": "string"
        },
        "startTime": {
          "type": "string",
          "format": "date-time"
        },
        "freq": {
          "type": "integer",
          "enum": [
            0,
            1
          ]
        },
        "interval": {
          "type": "integer"
        },
        "monthlyInterval": {
          "type": "string"
        }
      }
    }
  }
}