{
  "$id": "https://storage.googleapis.com/skiply-prod-ubiqod/schemas/ubiqodhook_new.json",
  "$schema": "http://json-schema.org/draft-07/schema",
  "default": {},
  "description": "JSON schema for data posted by Ubiqod to endpoints with new-style webhooks integrations.",
  "examples": [
    {
      "timestamp": "2022-04-15T06:44:19.472Z",
      "tracker": {
        "id": "15777e08-62da-4111-b863-413612a80f4e",
        "label": "861340049780123",
        "slug": "861340049780123",
        "type": "IOT",
        "model": "TAQTONE",
        "batteryLevel": 95,
        "externalReferences": {
          "custom_key": "custom_value"
        }
      },
      "site": {
        "id": "565ecb9c-31a0-4b0b-973a-ef00b992c6bc",
        "label": "My site",
        "location": "45.69712,5.91195",
        "contacts": [
          {
            "phone": "+33611223344",
            "fullName": "John",
            "email": "john@example.com",
            "type": "CUSTOMER"
          },
          {
            "phone": "+33655667788",
            "fullName": "Jack",
            "email": "jack@example.com",
            "type": "MANAGER"
          }
        ],
        "externalReferences": {
          "custom_key": "custom_value"
        }
      },
      "location": null,
      "account": {
        "name": "Example Organisation"
      },
      "eventType": "DATA",
      "data": {
        "interfaceType": "TAQTONE",
        "reference": "3",
        "label": "Arrival",
        "pressCount": 1,
        "code": {
          "label": "John Doe",
          "reference": "B557B557B557B5",
          "externalReferences": {}
        },
        "photo": null
      },
      "alert": null,
      "ubiqodValidity": {
        "onSite": true,
        "badgeSwiped": true,
        "codeValid": true,
        "codeFromCookie": false,
        "scanToken": false,
        "withPhoto": false
      }
    },
    {
      "timestamp": "2022-04-15T06:44:19.472Z",
      "tracker": {
        "id": "15777e08-62da-4111-b863-413612a80f5e",
        "label": "861340049780456",
        "slug": "861340049780456",
        "type": "IOT",
        "model": "TAQTONE",
        "batteryLevel": 95,
        "externalReferences": {
          "custom_key": "custom_value"
        }
      },
      "site": {
        "id": "565ecb9c-31a0-4b0b-973a-ef00b992c6bc",
        "label": "My site",
        "location": "45.69712,5.91195",
        "contacts": [
          {
            "phone": "+33611223344",
            "fullName": "John",
            "email": "john@example.com",
            "type": "CUSTOMER"
          },
          {
            "phone": "+33655667788",
            "fullName": "Jack",
            "email": "jack@example.com",
            "type": "MANAGER"
          }
        ],
        "externalReferences": {
          "custom_key": "custom_value"
        }
      },
      "location": null,
      "account": {
        "name": "Example Organisation"
      },
      "eventType": "DATA",
      "data": {
        "interfaceType": "TAQTONE",
        "reference": "4",
        "label": "Maintenance request",
        "pressCount": 1,
        "code": null,
        "photo": null
      },
      "alert": null,
      "ubiqodValidity": {
        "onSite": true,
        "badgeSwiped": false,
        "codeValid": false,
        "codeFromCookie": false,
        "scanToken": false,
        "withPhoto": false
      }
    },
    {
      "timestamp": "2022-04-15T06:44:19.472Z",
      "tracker": {
        "id": "15777e08-62da-4111-b863-413612a80f6e",
        "label": "861340049780789",
        "slug": "861340049780789",
        "type": "IOT",
        "model": "TAQTONE",
        "batteryLevel": 95,
        "externalReferences": {
          "custom_key": "custom_value"
        }
      },
      "site": {
        "id": "565ecb9c-31a0-4b0b-973a-ef00b992c6bc",
        "label": "My site",
        "location": "45.69712,5.91195",
        "contacts": [
          {
            "phone": "+33611223344",
            "fullName": "John",
            "email": "john@example.com",
            "type": "CUSTOMER"
          },
          {
            "phone": "+33655667788",
            "fullName": "Jack",
            "email": "jack@example.com",
            "type": "MANAGER"
          }
        ],
        "externalReferences": {
          "custom_key": "custom_value"
        }
      },
      "location": null,
      "account": {
        "name": "Example Organisation"
      },
      "eventType": "DATA",
      "data": {
        "interfaceType": "TAQTONE",
        "reference": "5",
        "label": "Excellent",
        "pressCount": 3,
        "rate": 5,
        "code": null,
        "photo": null
      },
      "alert": null,
      "ubiqodValidity": {
        "onSite": true,
        "badgeSwiped": false,
        "codeValid": false,
        "codeFromCookie": false,
        "scanToken": false,
        "withPhoto": false
      }
    },
    {
      "timestamp": "2022-04-15T06:44:19.472Z",
      "tracker": {
        "id": "15777e08-62da-4111-b863-413612a80f6e",
        "label": "AABBCCDDEEFF",
        "slug": "AABBCCDDEEFF",
        "type": "IOT",
        "model": "PIR_SENSOR_BLE",
        "batteryLevel": 95,
        "externalReferences": {
          "custom_key": "custom_value"
        }
      },
      "site": {
        "id": "565ecb9c-31a0-4b0b-973a-ef00b992c6bc",
        "label": "My site",
        "location": "45.69712,5.91195",
        "contacts": [
          {
            "phone": "+33611223344",
            "fullName": "John",
            "email": "john@example.com",
            "type": "CUSTOMER"
          },
          {
            "phone": "+33655667788",
            "fullName": "Jack",
            "email": "jack@example.com",
            "type": "MANAGER"
          }
        ],
        "externalReferences": {
          "custom_key": "custom_value"
        }
      },
      "location": null,
      "account": {
        "name": "Example Organisation"
      },
      "eventType": "DATA",
      "data": {
        "interfaceType": "PIR_SENSOR_BLE",
        "reference": "PIR_COUNT",
        "label": "Passage",
        "peopleCount": 10,
        "code": null,
        "photo": null
      },
      "alert": null,
      "ubiqodValidity": {
        "onSite": true,
        "badgeSwiped": false,
        "codeValid": false,
        "codeFromCookie": false,
        "scanToken": false,
        "withPhoto": false
      }
    },
    {
      "timestamp": "2022-04-15T06:44:19.472Z",
      "tracker": {
        "id": "15777e08-62da-4111-b863-1e08b0a80e4f",
        "label": "SA000853",
        "slug": "SA000853",
        "type": "IOT",
        "model": "SMILIO_A",
        "batteryLevel": 2.345,
        "externalReferences": {
          "custom_key": "custom_value"
        }
      },
      "site": {
        "id": "565ecb9c-31a0-4b0b-973a-ef00b992c6bc",
        "label": "My site",
        "location": "45.69712,5.91195",
        "contacts": [
          {
            "phone": "+33611223344",
            "fullName": "John",
            "email": "john@example.com",
            "type": "CUSTOMER"
          },
          {
            "phone": "+33655667788",
            "fullName": "Jack",
            "email": "jack@example.com",
            "type": "MANAGER"
          }
        ],
        "externalReferences": {
          "custom_key": "custom_value"
        }
      },
      "location": null,
      "account": {
        "name": "Example Organisation"
      },
      "eventType": "DATA",
      "data": {
        "interfaceType": "SMILIO_A",
        "reference": "1",
        "label": "Button 1",
        "pressCount": 1,
        "code": null,
        "photo": null
      },
      "alert": null,
      "ubiqodValidity": {
        "onSite": true,
        "badgeSwiped": false,
        "codeValid": true,
        "codeFromCookie": false,
        "scanToken": false,
        "withPhoto": false
      }
    },
    {
      "timestamp": "2022-04-15T06:44:19.472Z",
      "tracker": {
        "id": "4da72ba4-44b6-47d5-90b6-041f6ec4efc0",
        "label": "My Qod",
        "slug": "32e408d043539851ecf1a8a1a322a4c7",
        "type": "QOD",
        "batteryLevel": null,
        "externalReferences": {}
      },
      "site": {
        "id": "565ecb9c-31a0-4b0b-973a-ef00b992c6bc",
        "label": "My site",
        "location": "45.69712,5.91195",
        "contacts": [
          {
            "phone": "+33611223344",
            "fullName": "John",
            "email": "john@example.com",
            "type": "CUSTOMER"
          },
          {
            "phone": "+33655667788",
            "fullName": "Jack",
            "email": "jack@example.com",
            "type": "MANAGER"
          }
        ],
        "externalReferences": {}
      },
      "location": null,
      "account": {
        "name": "Example Organisation"
      },
      "eventType": "DATA",
      "data": {
        "interfaceType": "BUTTON_SINGLE",
        "reference": "1",
        "label": "Button 1",
        "code": null,
        "photo": null
      },
      "alert": null,
      "ubiqodValidity": {
        "onSite": false,
        "badgeSwiped": false,
        "codeValid": true,
        "codeFromCookie": false,
        "scanToken": false,
        "withPhoto": false
      }
    },
    {
      "timestamp": "2022-04-15T06:44:19.472Z",
      "tracker": {
        "id": "4da72ba4-44b6-47d5-90b6-041f6ec4efc0",
        "label": "My Qod",
        "slug": "32e408d043539851ecf1a8a1a322a4c7",
        "type": "QOD",
        "batteryLevel": null,
        "externalReferences": {}
      },
      "site": null,
      "location": null,
      "account": {
        "name": "Example Organisation"
      },
      "eventType": "DATA",
      "data": {
        "interfaceType": "BUTTON_SINGLE",
        "reference": "1",
        "label": "Button 1",
        "code": null,
        "photo": null
      },
      "alert": null,
      "ubiqodValidity": {
        "onSite": false,
        "badgeSwiped": false,
        "codeValid": true,
        "codeFromCookie": false,
        "scanToken": false,
        "withPhoto": false
      }
    },
    {
      "timestamp": "2022-04-15T06:45:19.472Z",
      "tracker": {
        "id": "15777e08-62da-4111-b863-413612a80f4e",
        "label": "861340049780123",
        "slug": "861340049780123",
        "type": "IOT",
        "model": "TAQTONE",
        "batteryLevel": 95,
        "externalReferences": {
          "custom_key": "custom_value"
        }
      },
      "site": {
        "id": "565ecb9c-31a0-4b0b-973a-ef00b992c6bc",
        "label": "My site",
        "location": "45.69712,5.91195",
        "contacts": [
          {
            "phone": "+33611223344",
            "fullName": "John",
            "email": "john@example.com",
            "type": "CUSTOMER"
          },
          {
            "phone": "+33655667788",
            "fullName": "Jack",
            "email": "jack@example.com",
            "type": "MANAGER"
          }
        ],
        "externalReferences": {
          "custom_key": "custom_value"
        }
      },
      "location": null,
      "account": {
        "name": "Example Organisation"
      },
      "eventType": "ALERT",
      "data": null,
      "alert": {
        "type": "ALERT_SATISFACTION",
        "subtype": "THRESHOLD",
        "count": 1,
        "config": {
          "rateThresh": 43.33
        }
      },
      "ubiqodValidity": {
        "onSite": true,
        "badgeSwiped": false,
        "codeValid": false,
        "codeFromCookie": false,
        "scanToken": false,
        "withPhoto": false
      }
    },
    {
      "timestamp": "2022-04-15T06:45:19.472Z",
      "tracker": {
        "id": "15777e08-62da-4111-b863-413612a80f4e",
        "label": "861340049780123",
        "slug": "861340049780123",
        "type": "IOT",
        "model": "TAQTONE",
        "batteryLevel": 95,
        "externalReferences": {
          "custom_key": "custom_value"
        }
      },
      "site": {
        "id": "565ecb9c-31a0-4b0b-973a-ef00b992c6bc",
        "label": "My site",
        "location": "45.69712,5.91195",
        "contacts": [
          {
            "phone": "+33611223344",
            "fullName": "John",
            "email": "john@example.com",
            "type": "CUSTOMER"
          },
          {
            "phone": "+33655667788",
            "fullName": "Jack",
            "email": "jack@example.com",
            "type": "MANAGER"
          }
        ],
        "externalReferences": {
          "custom_key": "custom_value"
        }
      },
      "location": null,
      "account": {
        "name": "Example Organisation"
      },
      "eventType": "ALERT",
      "data": null,
      "alert": {
        "type": "ALERT_SATISFACTION",
        "subtype": "VOTE_THRESHOLD",
        "count": 1,
        "config": {
          "voteThresh": 5
        }
      },
      "ubiqodValidity": {
        "onSite": true,
        "badgeSwiped": false,
        "codeValid": false,
        "codeFromCookie": false,
        "scanToken": false,
        "withPhoto": false
      }
    },
    {
      "timestamp": "2022-04-15T03:01:02.413Z",
      "tracker": {
        "id": "15777e08-62da-4111-b863-413612a80f4e",
        "label": "861340049780123",
        "slug": "861340049780123",
        "type": "IOT",
        "model": "TAQTONE",
        "batteryLevel": 95,
        "externalReferences": {
          "custom_key": "custom_value"
        }
      },
      "site": {
        "id": "565ecb9c-31a0-4b0b-973a-ef00b992c6bc",
        "label": "My site",
        "location": "45.69712,5.91195",
        "contacts": [
          {
            "phone": "+33611223344",
            "fullName": "John",
            "email": "john@example.com",
            "type": "CUSTOMER"
          },
          {
            "phone": "+33655667788",
            "fullName": "Jack",
            "email": "jack@example.com",
            "type": "MANAGER"
          }
        ],
        "externalReferences": {
          "custom_key": "custom_value"
        }
      },
      "location": null,
      "account": {
        "name": "Example Organisation"
      },
      "eventType": "KEEP_ALIVE",
      "data": null,
      "alert": null,
      "ubiqodValidity": {
        "onSite": true,
        "badgeSwiped": false,
        "codeValid": false,
        "codeFromCookie": false,
        "scanToken": false,
        "withPhoto": false
      }
    }
  ],
  "required": [
    "timestamp",
    "tracker",
    "site",
    "location",
    "account",
    "eventType",
    "data",
    "alert",
    "ubiqodValidity"
  ],
  "title": "Main payload schema",
  "type": "object",
  "properties": {
    "timestamp": {
      "$id": "#/properties/timestamp",
      "default": "",
      "description": "The ISO 8601 formatted date of the payload.",
      "examples": ["2022-04-12T08:52:22.169Z"],
      "title": "Timestamp of the payload",
      "type": "string"
    },
    "tracker": {
      "$id": "#/properties/tracker",
      "default": {},
      "description": "Information about the tracker.",
      "examples": [
        {
          "id": "15777e08-62da-4111-b863-413612a80f6e",
          "label": "861340049780789",
          "slug": "861340049780789",
          "type": "IOT",
          "model": "TAQTONE",
          "batteryLevel": 95,
          "externalReferences": {
            "custom_key": "custom_value"
          }
        },
        {
          "id": "fc66a0fd-b14d-4592-8d90-231fd8a14ad8",
          "label": "Label of the tracker",
          "slug": "32e408d043539851ecf1a8a1a322a4c7",
          "type": "QOD",
          "batteryLevel": null,
          "externalReferences": {}
        },
        {
          "id": "15777e08-62da-4111-b863-1e08b0a80e4f",
          "label": "My IOT - SA000853",
          "slug": "SA000853",
          "type": "IOT",
          "model": "SMILIO_A",
          "batteryLevel": 2.345,
          "externalReferences": {
            "custom_key": "custom_value"
          }
        }
      ],
      "required": ["id", "label", "slug", "type", "batteryLevel", "externalReferences"],
      "title": "Tracker information",
      "type": "object",
      "properties": {
        "id": {
          "$id": "#/properties/tracker/properties/id",
          "default": "",
          "description": "UUID of the tracker in Ubiqod.",
          "examples": ["fc66a0fd-b14d-4592-8d90-231fd8a14ad8"],
          "title": "Tracker ID",
          "type": "string"
        },
        "label": {
          "$id": "#/properties/tracker/properties/label",
          "default": "",
          "description": "Label of the tracker.",
          "examples": ["Label of the tracker"],
          "title": "Tracker Label",
          "type": "string"
        },
        "slug": {
          "$id": "#/properties/tracker/properties/slug",
          "default": "",
          "description": "The tracker slug. For tracker type 'QOD', this is the URL parameter used in the scan. For tracker types 'IOT' and 'SAFEQOD' (formerly 'UBIQODKEY'), this is the Serial Number of the device.",
          "examples": ["32e408d043539851ecf1a8a1a322a4c7", "SA000853"],
          "title": "Tracker Slug",
          "type": "string"
        },
        "type": {
          "$id": "#/properties/tracker/properties/type",
          "default": "",
          "description": "The tracker type. Note: 'UBIQODKEY' has been renamed to 'SAFEQOD' as of March 31, 2026.",
          "enum": ["QOD", "IOT", "UBIQODKEY", "SAFEQOD"],
          "title": "Tracker Type",
          "type": "string"
        },
        "model": {
          "$id": "#/properties/tracker/properties/model",
          "default": "",
          "description": "The tracker model. This value is only defined when tracker type is 'IOT'.",
          "enum": [
            "SMILIO_A",
            "SMILIO_S",
            "SMILIO_E",
            "CLOCK_ST",
            "CLOCK_R",
            "CLOCK_S",
            "CLOCK_E",
            "TAQTONE",
            "PIR_SENSOR_BLE"
          ],
          "title": "Tracker Model",
          "type": "string"
        },
        "batteryLevel": {
          "$id": "#/properties/tracker/properties/batteryLevel",
          "default": null,
          "description": "The tracker's battery level. The value is 'null' if the tracker type is 'QOD' or if the tracker's battery level is unknown.",
          "title": "Tracker Battery Level",
          "type": ["number", "null"]
        },
        "externalReferences": {
          "$id": "#/properties/tracker/properties/externalReferences",
          "default": {},
          "description": "An object containing all external references for the tracker. All values contained in this object will be of type string.",
          "examples": [
            {},
            { "key": "value" },
            {
              "internal_tracker_id": "413612",
              "use_case": "inventory"
            }
          ],
          "title": "Tracker External References",
          "type": "object",
          "required": [],
          "additionalProperties": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "additionalProperties": true
    },
    "site": {
      "$id": "#/properties/site",
      "default": {},
      "description": "Information about the site associated with the device. 'null' if no site is set.",
      "examples": [
        {
          "id": "a47254be-f98b-41e7-bd2a-93e154573b80",
          "label": "Label of the site",
          "location": "45.6968682,5.9113309",
          "contacts": [
            {
              "phone": "+33611223344",
              "fullName": "Contact name 1",
              "email": "contact1@acme.com",
              "type": "CUSTOMER"
            },
            {
              "phone": "+33655667788",
              "fullName": "Contact name 2",
              "email": "contact2@acme.com",
              "type": "MANAGER"
            }
          ]
        }
      ],
      "required": ["id", "label", "location", "contacts", "externalReferences"],
      "title": "Site information",
      "type": ["object", "null"],
      "properties": {
        "id": {
          "$id": "#/properties/site/properties/id",
          "default": 0,
          "description": "UUID of the site in Ubiqod.",
          "examples": ["a47254be-f98b-41e7-bd2a-93e154573b80"],
          "title": "Site ID",
          "type": "string"
        },
        "label": {
          "$id": "#/properties/site/properties/label",
          "default": "",
          "description": "Label of the site.",
          "examples": ["Label of the site"],
          "title": "Site Label",
          "type": "string"
        },
        "location": {
          "$id": "#/properties/site/properties/location",
          "default": "",
          "description": "GPS coordinates of the site.",
          "examples": ["45.6968682,5.9113309"],
          "title": "Site GPS coordinates",
          "type": "string"
        },
        "contacts": {
          "$id": "#/properties/site/properties/contacts",
          "default": {},
          "description": "Information about the contacts of the site.",
          "examples": [
            [
              {
                "phone": "+33611223344",
                "fullName": "Contact name 1",
                "email": "contact1@acme.com",
                "type": "CUSTOMER"
              },
              {
                "phone": "+33655667788",
                "fullName": "Contact name 2",
                "email": "contact2@acme.com",
                "type": "MANAGER"
              }
            ]
          ],
          "title": "Contact Information",
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "email": {
                "$id": "#/properties/site/properties/contact/properties/email",
                "default": "",
                "description": "Email of the contact.",
                "examples": ["contact1@acme.com"],
                "title": "Customer Email",
                "type": "string"
              },
              "phone": {
                "$id": "#/properties/site/properties/contact/properties/phone",
                "default": "",
                "description": "Phone number of the contact. International format only.",
                "examples": ["+33611223344"],
                "title": "Customer Phone",
                "type": "string"
              },
              "fullName": {
                "$id": "#/properties/site/properties/contact/properties/fullName",
                "default": "",
                "description": "Full name of the contact.",
                "examples": ["John Doe"],
                "title": "Customer Name",
                "type": "string"
              },
              "type": {
                "$id": "#/properties/site/properties/contact/properties/type",
                "default": "",
                "description": "Type of the contact.",
                "enum": ["CUSTOMER", "MANAGER"],
                "title": "Customer Type",
                "type": "string"
              }
            },
            "additionalProperties": true
          }
        },
        "externalReferences": {
          "$id": "#/properties/site/properties/externalReferences",
          "default": {},
          "description": "An object containing all external references for the site. All values contained in this object will be of type string.",
          "examples": [
            {},
            { "key": "value" },
            {
              "internal_site_id": "12345",
              "location_type": "warehouse"
            }
          ],
          "title": "Site External References",
          "type": "object",
          "required": [],
          "additionalProperties": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "additionalProperties": true
    },
    "location": {
      "$id": "#/properties/location",
      "default": null,
      "description": "For tracker type 'IOT', returns the GPS coordinates of the associated site. For tracker types 'QOD' and 'SAFEQOD' (formerly 'UBIQODKEY'), returns the GPS coordinates of the user if applicable, or null if not.",
      "examples": ["42.51223,5.21412", null],
      "title": "User GPS coordinates",
      "type": ["string", "null"]
    },
    "eventType": {
      "$id": "#/properties/eventType",
      "default": "",
      "description": "The event type.",
      "enum": ["DATA", "ALERT", "KEEP_ALIVE", "WAKE_UP"],
      "title": "Event Type",
      "type": ["string"]
    },
    "data": {
      "$id": "#/properties/data",
      "default": null,
      "description": "Data sent by the tracker. The object is only defined when the event type is \"DATA\".",
      "examples": [
        {
          "interfaceType": "TAQTONE",
          "reference": "3",
          "label": "Arrival",
          "pressCount": 1,
          "code": {
            "label": "John Doe",
            "reference": "B557B557B557B5",
            "externalReferences": {}
          },
          "photo": null
        },
        {
          "interfaceType": "TAQTONE",
          "reference": "4",
          "label": "Maintenance request",
          "pressCount": 1,
          "code": null,
          "photo": null
        },
        {
          "interfaceType": "TAQTONE",
          "reference": "5",
          "label": "Excellent",
          "pressCount": 3,
          "rate": 5,
          "code": null,
          "photo": null
        },
        {
          "interfaceType": "SMILIO_A",
          "reference": "1",
          "label": "Button 1",
          "pressCount": 1,
          "code": null,
          "photo": null
        },
        {
          "interfaceType": "SMILIO_A",
          "reference": "000123",
          "label": "Code 123",
          "pressCount": 3,
          "code": {
            "label": "Code 123",
            "reference": "000123",
            "externalReferences": {}
          },
          "photo": null
        },
        {
          "interfaceType": "CLOCK_ST",
          "reference": "1",
          "label": "Arrival",
          "pressCount": 1,
          "code": {
            "label": "John",
            "reference": "1234ABCD",
            "externalReferences": {
              "custom_key": "custom_value"
            }
          },
          "photo": null
        },
        {
          "interfaceType": "BUTTON_SINGLE",
          "reference": "1",
          "label": "Button 1",
          "code": null,
          "message": "",
          "photo": "data:image/jpeg;base64,AAAAAAAAAAAAAAAAAAAA"
        },
        {
          "interfaceType": "DIGIT",
          "reference": "12345",
          "label": "",
          "code": {
            "label": "999999",
            "reference": "999999",
            "externalReferences": {}
          },
          "message": null,
          "photo": null
        },
        {
          "interfaceType": "FEEDBACK",
          "rate": 5,
          "message": "Very good",
          "email": "",
          "code": null,
          "photo": null
        },
        null
      ],
      "required": ["interfaceType", "code", "photo"],
      "title": "Data from the tracker",
      "type": ["object", "null"],
      "properties": {
        "interfaceType": {
          "$id": "#/properties/data/properties/interfaceType",
          "default": null,
          "description": "Type of interface linked to the tracker. Trackers with type 'IOT' can send data without being linked to an interface, if they do then this value becomes null.",
          "enum": [
            null,
            "BUTTON_SINGLE",
            "BUTTON_MULTIPLE",
            "DIGIT",
            "FEEDBACK",
            "SMILIO_A",
            "SMILIO_S",
            "SMILIO_E",
            "CLOCK_ST",
            "CLOCK_R",
            "CLOCK_S",
            "CLOCK_E",
            "TAQTONE",
            "PIR_SENSOR_BLE"
          ],
          "title": "Interface Type",
          "type": ["string", "null"]
        },
        "reference": {
          "$id": "#/properties/data/properties/reference",
          "default": "",
          "description": "Reference of the input given by the user. If interface type is 'FEEDBACK' or feedback data is sent by 'TAQTONE', this value is undefined.",
          "examples": ["4", "789456", "000123"],
          "title": "Input Reference",
          "type": "string"
        },
        "label": {
          "$id": "#/properties/data/properties/label",
          "default": "",
          "description": "Label of the input corresponding to the reference. Can be an empty string if the button pressed is not configured. If interface type is 'FEEDBACK' or feedback data is sent by 'TAQTONE', this value is undefined.",
          "examples": ["Button Label", "Digit code Label", "IOT mode code Label", ""],
          "title": "Input Label",
          "type": "string"
        },
        "pressCount": {
          "$id": "#/properties/data/properties/pressCount",
          "default": 1,
          "description": "Number of button presses registered. If tracker type is not 'IOT' or if tracker subtype is 'PIR_SENSOR_BLE', this value is undefined.",
          "examples": [1, 3],
          "title": "IOT Press count",
          "type": "integer"
        },
        "peopleCount": {
          "$id": "#/properties/data/properties/peopleCount",
          "default": 1,
          "description": "Number of people passing through a PIR sensor. If tracker type is not 'IOT', or if tracker subtype is not 'PIR_SENSOR_BLE', this value is undefined.",
          "examples": [1, 3],
          "title": "IOT People count",
          "type": "integer"
        },
        "message": {
          "$id": "#/properties/data/properties/message",
          "default": "",
          "description": "Message sent by the user (for feedback or as an additional input). Is null when the option is not set. Can be an empty string. If tracker type is 'IOT', this value is undefined.",
          "examples": ["I liked it", "", null],
          "title": "User Message",
          "type": ["string", "null"]
        },
        "rate": {
          "$id": "#/properties/data/properties/rate",
          "default": 1,
          "description": "Rate of the feedback received. If interface type is not 'FEEDBACK' or non-feedback data is sent by 'TAQTONE', this value is undefined.",
          "minimum": 1,
          "maximum": 5,
          "examples": [5],
          "title": "Feedback Rate",
          "type": "integer"
        },
        "email": {
          "$id": "#/properties/data/properties/email",
          "default": "",
          "description": "Email given in the user feedback. Can be an empty string. If interface type is not 'FEEDBACK', this value is undefined.",
          "examples": ["contact@acme.com", ""],
          "title": "Feedback Email",
          "type": "string"
        },
        "code": {
          "$id": "#/properties/data/properties/code",
          "default": {},
          "description": "Data of the Code entered. Can be from a PIN Code, an IOT device in mode code, or a Badge. If not set, the value is null.",
          "examples": [
            {
              "reference": "7845",
              "label": "Label associated with code",
              "externalReferences": {
                "custom_key": "custom_value",
                "internal_user_id": "4321"
              }
            },
            {
              "reference": "1234ABCD",
              "label": "1234ABCD",
              "externalReferences": {}
            }
          ],
          "required": ["reference", "label", "externalReferences"],
          "title": "Code data",
          "type": ["object", "null"],
          "properties": {
            "reference": {
              "$id": "#/properties/data/properties/code/properties/reference",
              "default": "",
              "description": "Code as entered by the user or as read from the badge. It can be in numeric form, with or without '0' paddings, or in hexadecimal form, based on the tracker's type and subtype.",
              "examples": ["7845", "1234ABCD", "000123"],
              "title": "Code Reference",
              "type": "string"
            },
            "label": {
              "$id": "#/properties/data/properties/code/properties/label",
              "default": "",
              "description": "Label of the code corresponding to the reference. If 'reference' if not found, copies the Code Reference value.",
              "examples": [
                "Label associated with PIN Code",
                "Reference of the entered code",
                "12334ABCD"
              ],
              "title": "Code Label",
              "type": "string"
            },
            "externalReferences": {
              "$id": "#/properties/data/properties/code/properties/externalReferences",
              "default": {},
              "description": "An object containing all external references for the entered code. All values contained in this object will be of type string.",
              "examples": [
                {},
                { "key": "value" },
                {
                  "internal_user_id": "4321",
                  "other_user_id": "12345678-abcd-48c0-fefe-ba9876543210",
                  "name": "John Doe"
                }
              ],
              "title": "Code External References",
              "type": "object",
              "required": [],
              "additionalProperties": {
                "type": "string",
                "minLength": 1
              }
            }
          },
          "additionalProperties": true
        },
        "photo": {
          "$id": "#/properties/data/properties/photo",
          "default": "",
          "description": "A JPEG photo of the user, encoded in Base64. The value is null for trackers of type 'IOT' or if the photo option is not enabled in the tracker's interface.",
          "examples": ["data:image/jpeg;base64,AAAAAAAAAAAAAAAAAAAA", null],
          "title": "Base64 User Photo",
          "type": ["string", "null"]
        }
      },
      "additionalProperties": true
    },
    "alert": {
      "$id": "#/properties/alert",
      "default": null,
      "description": "Alert sent by the tracker. The object is only defined when the event type is \"ALERT\".",
      "examples": [
        {
          "type": "ALERT_SATISFACTION",
          "subtype": "THRESHOLD",
          "count": 1,
          "config": {
            "rateThresh": 43.33
          }
        },
        {
          "type": "ALERT_SATISFACTION",
          "subtype": "VOTE_THRESHOLD",
          "count": 1,
          "config": {
            "voteThresh": 5
          }
        },
        null
      ],
      "required": ["type", "subtype", "count", "config"],
      "title": "Alert from the tracker",
      "type": ["object", "null"],
      "properties": {
        "type": {
          "$id": "#/properties/alert/properties/type",
          "default": "",
          "description": "The alert type.",
          "enum": ["ALERT_SATISFACTION"],
          "title": "Alert Type",
          "type": "string"
        },
        "subtype": {
          "$id": "#/properties/alert/properties/subtype",
          "default": "GENERIC",
          "description": "The alert subtype.",
          "enum": ["GENERIC", "THRESHOLD", "VOTE_THRESHOLD"],
          "title": "Alert Subtype",
          "type": "string"
        },
        "count": {
          "$id": "#/properties/alert/properties/count",
          "default": 1,
          "description": "Number of alerts registered. This should always be set to 1.",
          "examples": [1],
          "title": "Alert Count",
          "type": "integer"
        },
        "config": {
          "$id": "#/properties/alert/properties/config",
          "default": {},
          "description": "The alert configuration.",
          "examples": [
            {
              "rateThresh": 43.33
            },
            {
              "voteThresh": 5
            }
          ],
          "required": [],
          "title": "Alert Configuration",
          "type": ["object"],
          "properties": {
            "rateThresh": {
              "$id": "#/properties/alert/properties/config/properties/rateThresh",
              "default": 0,
              "description": "Mean rating value (in percentage) to reach to trigger a \"ALERT_SATISFACTION - THRESHOLD\" alert. ",
              "examples": [50, 75],
              "title": "Rating Threshold",
              "type": "number"
            },
            "voteThresh": {
              "$id": "#/properties/alert/properties/config/properties/voteThresh",
              "default": 1,
              "description": "Number of consecutive presses to trigger a \"ALERT_SATISFACTION - VOTE_THRESHOLD\" alert.",
              "examples": [1, 5],
              "title": "Vote Threshold",
              "type": "number"
            }
          },
          "additionalProperties": true
        }
      },
      "additionalProperties": true
    },
    "ubiqodValidity": {
      "$id": "#/properties/ubiqodValidity",
      "default": {},
      "description": "Validation results.",
      "examples": [
        {
          "onSite": false,
          "badgeSwiped": false,
          "codeValid": false,
          "codeFromCookie": false,
          "scanToken": false,
          "withPhoto": false
        }
      ],
      "required": [
        "onSite",
        "badgeSwiped",
        "codeValid",
        "codeFromCookie",
        "scanToken",
        "withPhoto"
      ],
      "title": "Validation conditions",
      "type": "object",
      "properties": {
        "onSite": {
          "$id": "#/properties/ubiqodValidity/properties/onSite",
          "default": false,
          "description": "True if the user position is at the expected location (in the geofencing range of the site, or on an IOT device).",
          "examples": [false],
          "title": "On Site condition",
          "type": "boolean"
        },
        "badgeSwiped": {
          "$id": "#/properties/ubiqodValidity/properties/badgeSwiped",
          "default": false,
          "description": "Used for tracker of type 'IOT'. True if a badge was swiped or detected.",
          "examples": [false],
          "title": "Badge Swiped condition",
          "type": "boolean"
        },
        "codeValid": {
          "$id": "#/properties/ubiqodValidity/properties/codeValid",
          "default": false,
          "description": "True if the code entered by the user has a corresponding entry in it's code list.",
          "examples": [false],
          "title": "Valid Code condition",
          "type": "boolean"
        },
        "codeFromCookie": {
          "$id": "#/properties/ubiqodValidity/properties/codeFromCookie",
          "default": false,
          "description": "True if the code entered by the user was fetched from a cookie and not entered manually.",
          "examples": [false],
          "title": "Code From Cookie condition",
          "type": "boolean"
        },
        "scanToken": {
          "$id": "#/properties/ubiqodValidity/properties/scanToken",
          "default": false,
          "description": "For trackers of type 'SAFEQOD' (formerly 'UBIQODKEY'). True if the SafeQod scan token is valid.",
          "examples": [false],
          "title": "Scan Token condition",
          "type": "boolean"
        },
        "withPhoto": {
          "$id": "#/properties/ubiqodValidity/properties/withPhoto",
          "default": false,
          "description": "For trackers of type 'QOD' or 'SAFEQOD' (formerly 'UBIQODKEY'). True if the user sent a photo.",
          "examples": [false],
          "title": "Photo Sent condition",
          "type": "boolean"
        }
      },
      "additionalProperties": true
    }
  },
  "additionalProperties": true
}
