{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/loadsmart/json-schema/loadsmart-trigger-schema.json",
  "title": "Trigger",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/loadsmart-custom-forms-triggers-api-openapi.yml#/components/schemas/Trigger",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The unique identifier of the record",
      "readOnly": true
    },
    "createDateTime": {
      "format": "date-time",
      "type": "string",
      "description": "The date and time when the record was created",
      "readOnly": true
    },
    "createdBy": {
      "type": "object",
      "description": "The ID of the user who created the record",
      "readOnly": true
    },
    "lastChangedDateTime": {
      "format": "date-time",
      "type": "string",
      "description": "The date and time when the record was last changed",
      "readOnly": true
    },
    "app": {
      "$ref": "#/$defs/AppsEnum"
    },
    "category": {
      "$ref": "#/$defs/CustomFormFlowCategoryEnum"
    },
    "feature": {
      "$ref": "#/$defs/CustomFormsFeatures"
    },
    "flowId": {
      "type": "object",
      "description": "The ID of the flow that this trigger will load, Flow has one or two Forms"
    },
    "objectId": {
      "type": "string",
      "description": "The ID of the object that this trigger will be activated on events"
    },
    "entityName": {
      "$ref": "#/$defs/CustomFormFlowEntitiesEnum"
    },
    "dataEntityName": {
      "$ref": "#/$defs/CustomFormDataEntitiesEnum"
    }
  },
  "required": [
    "id",
    "createDateTime",
    "createdBy",
    "lastChangedDateTime",
    "app",
    "category",
    "objectId",
    "entityName",
    "dataEntityName"
  ],
  "$defs": {
    "AppsEnum": {
      "type": "string",
      "description": "The app that this trigger will be activated, based on the source of the request",
      "enum": [
        "api",
        "warehouse",
        "carrier",
        "driver",
        "all"
      ]
    },
    "CustomFormDataEntitiesEnum": {
      "type": "string",
      "description": "The entity name of the object that this data belongs to",
      "enum": [
        "appointment",
        "assetvisit",
        "assetcontainer"
      ]
    },
    "CustomFormFlowCategoryEnum": {
      "type": "string",
      "description": "The event category that this trigger will be activated on",
      "enum": [
        "appointmentStatusCompleted",
        "appointmentStatusArrived",
        "appointmentCreated",
        "assetVisitCreated",
        "manualTrigger"
      ]
    },
    "CustomFormFlowEntitiesEnum": {
      "type": "string",
      "description": "The entity name that qualifies the objectId this trigger will be activated",
      "enum": [
        "loadtype",
        "dock",
        "warehouse"
      ]
    },
    "CustomFormsFeatures": {
      "type": "string",
      "description": "The feature that this trigger is related, used to group triggers by feature",
      "enum": [
        "check-out",
        "check-in",
        "check-in additional asset details",
        "asset container details",
        "Inbound Claim",
        "Outbound Claim",
        "Book Load Type",
        "appointment-completed"
      ]
    }
  }
}