Schemas

Advanced Device Query

Schema for advanced device queries

Advanced Device Query Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "$and": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/advancedDeviceQuery"
      },
      "maxItems": 100
    },
    "$or": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/advancedDeviceQuery"
      },
      "maxItems": 100
    },
    "$nor": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/advancedDeviceQuery"
      },
      "maxItems": 100
    },
    "id": {
      "oneOf": [
        {
          "oneOf": [
            {
              "type": "string",
              "pattern": "^[A-Fa-f\\d]{24}$"
            },
            {
              "type": "null"
            }
          ]
        },
        {
          "type": "object",
          "properties": {
            "$eq": {
              "oneOf": [
                {
                  "type": "string",
                  "pattern": "^[A-Fa-f\\d]{24}$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "$ne": {
              "oneOf": [
                {
                  "type": "string",
                  "pattern": "^[A-Fa-f\\d]{24}$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "$in": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": "string",
                "pattern": "^[A-Fa-f\\d]{24}$"
              }
            },
            "$nin": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": "string",
                "pattern": "^[A-Fa-f\\d]{24}$"
              }
            }
          },
          "additionalProperties": false,
          "minProperties": 1,
          "maxProperties": 1
        }
      ]
    },
    "creationDate": {
      "oneOf": [
        {
          "type": [
            "string",
            "number",
            "boolean",
            "null"
          ]
        },
        {
          "type": "object",
          "properties": {
            "$eq": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$ne": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$gt": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$lt": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$gte": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$lte": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$startsWith": {
              "type": "string",
              "minLength": 1
            },
            "$endsWith": {
              "type": "string",
              "minLength": 1
            },
            "$contains": {
              "type": "string",
              "minLength": 1
            },
            "$ci": {
              "type": "boolean"
            },
            "$in": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": [
                  "string",
                  "number",
                  "boolean"
                ]
              }
            },
            "$nin": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": [
                  "string",
                  "number",
                  "boolean"
                ]
              }
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "lastUpdated": {
      "oneOf": [
        {
          "type": [
            "string",
            "number",
            "boolean",
            "null"
          ]
        },
        {
          "type": "object",
          "properties": {
            "$eq": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$ne": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$gt": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$lt": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$gte": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$lte": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$startsWith": {
              "type": "string",
              "minLength": 1
            },
            "$endsWith": {
              "type": "string",
              "minLength": 1
            },
            "$contains": {
              "type": "string",
              "minLength": 1
            },
            "$ci": {
              "type": "boolean"
            },
            "$in": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": [
                  "string",
                  "number",
                  "boolean"
                ]
              }
            },
            "$nin": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": [
                  "string",
                  "number",
                  "boolean"
                ]
              }
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "name": {
      "oneOf": [
        {
          "type": [
            "string",
            "number",
            "boolean",
            "null"
          ]
        },
        {
          "type": "object",
          "properties": {
            "$eq": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$ne": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$gt": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$lt": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$gte": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$lte": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$startsWith": {
              "type": "string",
              "minLength": 1
            },
            "$endsWith": {
              "type": "string",
              "minLength": 1
            },
            "$contains": {
              "type": "string",
              "minLength": 1
            },
            "$ci": {
              "type": "boolean"
            },
            "$in": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": [
                  "string",
                  "number",
                  "boolean"
                ]
              }
            },
            "$nin": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": [
                  "string",
                  "number",
                  "boolean"
                ]
              }
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "deviceClass": {
      "oneOf": [
        {
          "type": [
            "string",
            "number",
            "boolean",
            "null"
          ]
        },
        {
          "type": "object",
          "properties": {
            "$eq": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$ne": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$gt": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$lt": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$gte": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$lte": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$startsWith": {
              "type": "string",
              "minLength": 1
            },
            "$endsWith": {
              "type": "string",
              "minLength": 1
            },
            "$contains": {
              "type": "string",
              "minLength": 1
            },
            "$ci": {
              "type": "boolean"
            },
            "$in": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": [
                  "string",
                  "number",
                  "boolean"
                ]
              }
            },
            "$nin": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": [
                  "string",
                  "number",
                  "boolean"
                ]
              }
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "gatewayId": {
      "oneOf": [
        {
          "oneOf": [
            {
              "type": "string",
              "pattern": "^[A-Fa-f\\d]{24}$"
            },
            {
              "type": "null"
            }
          ]
        },
        {
          "type": "object",
          "properties": {
            "$eq": {
              "oneOf": [
                {
                  "type": "string",
                  "pattern": "^[A-Fa-f\\d]{24}$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "$ne": {
              "oneOf": [
                {
                  "type": "string",
                  "pattern": "^[A-Fa-f\\d]{24}$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "$in": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": "string",
                "pattern": "^[A-Fa-f\\d]{24}$"
              }
            },
            "$nin": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": "string",
                "pattern": "^[A-Fa-f\\d]{24}$"
              }
            }
          },
          "additionalProperties": false,
          "minProperties": 1,
          "maxProperties": 1
        }
      ]
    },
    "parentId": {
      "oneOf": [
        {
          "oneOf": [
            {
              "type": "string",
              "pattern": "^[A-Fa-f\\d]{24}$"
            },
            {
              "type": "null"
            }
          ]
        },
        {
          "type": "object",
          "properties": {
            "$eq": {
              "oneOf": [
                {
                  "type": "string",
                  "pattern": "^[A-Fa-f\\d]{24}$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "$ne": {
              "oneOf": [
                {
                  "type": "string",
                  "pattern": "^[A-Fa-f\\d]{24}$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "$in": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": "string",
                "pattern": "^[A-Fa-f\\d]{24}$"
              }
            },
            "$nin": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": "string",
                "pattern": "^[A-Fa-f\\d]{24}$"
              }
            }
          },
          "additionalProperties": false,
          "minProperties": 1,
          "maxProperties": 1
        }
      ]
    },
    "ancestorId": {
      "oneOf": [
        {
          "oneOf": [
            {
              "type": "string",
              "pattern": "^[A-Fa-f\\d]{24}$"
            },
            {
              "type": "null"
            }
          ]
        },
        {
          "type": "object",
          "properties": {
            "$eq": {
              "oneOf": [
                {
                  "type": "string",
                  "pattern": "^[A-Fa-f\\d]{24}$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "$ne": {
              "oneOf": [
                {
                  "type": "string",
                  "pattern": "^[A-Fa-f\\d]{24}$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "$in": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": "string",
                "pattern": "^[A-Fa-f\\d]{24}$"
              }
            },
            "$nin": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": "string",
                "pattern": "^[A-Fa-f\\d]{24}$"
              }
            }
          },
          "additionalProperties": false,
          "minProperties": 1,
          "maxProperties": 1
        }
      ]
    },
    "attributeName": {
      "oneOf": [
        {
          "type": [
            "string",
            "number",
            "boolean",
            "null"
          ]
        },
        {
          "type": "object",
          "properties": {
            "$eq": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$ne": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$gt": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$lt": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$gte": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$lte": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$startsWith": {
              "type": "string",
              "minLength": 1
            },
            "$endsWith": {
              "type": "string",
              "minLength": 1
            },
            "$contains": {
              "type": "string",
              "minLength": 1
            },
            "$ci": {
              "type": "boolean"
            },
            "$in": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": [
                  "string",
                  "number",
                  "boolean"
                ]
              }
            },
            "$nin": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": [
                  "string",
                  "number",
                  "boolean"
                ]
              }
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "experienceUserId": {
      "oneOf": [
        {
          "oneOf": [
            {
              "type": "string",
              "pattern": "^[A-Fa-f\\d]{24}$"
            },
            {
              "type": "null"
            }
          ]
        },
        {
          "type": "object",
          "properties": {
            "$eq": {
              "oneOf": [
                {
                  "type": "string",
                  "pattern": "^[A-Fa-f\\d]{24}$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "$ne": {
              "oneOf": [
                {
                  "type": "string",
                  "pattern": "^[A-Fa-f\\d]{24}$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "$in": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": "string",
                "pattern": "^[A-Fa-f\\d]{24}$"
              }
            },
            "$nin": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": "string",
                "pattern": "^[A-Fa-f\\d]{24}$"
              }
            }
          },
          "additionalProperties": false,
          "minProperties": 1,
          "maxProperties": 1
        }
      ]
    },
    "experienceGroupId": {
      "oneOf": [
        {
          "oneOf": [
            {
              "type": "string",
              "pattern": "^[A-Fa-f\\d]{24}$"
            },
            {
              "type": "null"
            }
          ]
        },
        {
          "type": "object",
          "properties": {
            "$eq": {
              "oneOf": [
                {
                  "type": "string",
                  "pattern": "^[A-Fa-f\\d]{24}$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "$ne": {
              "oneOf": [
                {
                  "type": "string",
                  "pattern": "^[A-Fa-f\\d]{24}$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "$in": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": "string",
                "pattern": "^[A-Fa-f\\d]{24}$"
              }
            },
            "$nin": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": "string",
                "pattern": "^[A-Fa-f\\d]{24}$"
              }
            }
          },
          "additionalProperties": false,
          "minProperties": 1,
          "maxProperties": 1
        }
      ]
    },
    "tags": {
      "oneOf": [
        {
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "$tagKey": {
                  "type": "string",
                  "maxLength": 255
                },
                "$tagValue": {
                  "type": "string",
                  "maxLength": 255
                }
              },
              "additionalProperties": false,
              "minProperties": 1
            },
            {
              "type": "object",
              "patternProperties": {
                "^[0-9a-zA-Z_-]{1,255}": {
                  "type": "string",
                  "maxLength": 255
                }
              },
              "additionalProperties": false
            }
          ]
        },
        {
          "type": "object",
          "properties": {
            "$eq": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "$tagKey": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "$tagValue": {
                      "type": "string",
                      "maxLength": 255
                    }
                  },
                  "additionalProperties": false,
                  "minProperties": 1
                },
                {
                  "type": "object",
                  "patternProperties": {
                    "^[0-9a-zA-Z_-]{1,255}": {
                      "type": "string",
                      "maxLength": 255
                    }
                  },
                  "additionalProperties": false
                }
              ]
            }
          },
          "required": [
            "$eq"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "$ne": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "$tagKey": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "$tagValue": {
                      "type": "string",
                      "maxLength": 255
                    }
                  },
                  "additionalProperties": false,
                  "minProperties": 1
                },
                {
                  "type": "object",
                  "patternProperties": {
                    "^[0-9a-zA-Z_-]{1,255}": {
                      "type": "string",
                      "maxLength": 255
                    }
                  },
                  "additionalProperties": false
                }
              ]
            }
          },
          "required": [
            "$ne"
          ],
          "additionalProperties": false
        }
      ]
    }
  },
  "additionalProperties": false
}

Advanced Device Query Example

{
  "$or": [
    {
      "name": {
        "$ne": "myValue"
      }
    },
    {
      "parentId": "575ec8687ae143cd83dc4a97"
    }
  ]
}

Advanced Event Query

Schema for advanced event queries

Advanced Event Query Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "$and": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/advancedEventQuery"
      },
      "maxItems": 100
    },
    "$or": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/advancedEventQuery"
      },
      "maxItems": 100
    },
    "$nor": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/advancedEventQuery"
      },
      "maxItems": 100
    },
    "id": {
      "oneOf": [
        {
          "type": [
            "string",
            "number",
            "boolean",
            "null"
          ]
        },
        {
          "type": "object",
          "properties": {
            "$eq": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$ne": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$gt": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$lt": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$gte": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$lte": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$startsWith": {
              "type": "string",
              "minLength": 1
            },
            "$endsWith": {
              "type": "string",
              "minLength": 1
            },
            "$contains": {
              "type": "string",
              "minLength": 1
            },
            "$ci": {
              "type": "boolean"
            },
            "$in": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": [
                  "string",
                  "number",
                  "boolean"
                ]
              }
            },
            "$nin": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": [
                  "string",
                  "number",
                  "boolean"
                ]
              }
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "creationDate": {
      "oneOf": [
        {
          "type": [
            "string",
            "number",
            "boolean",
            "null"
          ]
        },
        {
          "type": "object",
          "properties": {
            "$eq": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$ne": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$gt": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$lt": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$gte": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$lte": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$startsWith": {
              "type": "string",
              "minLength": 1
            },
            "$endsWith": {
              "type": "string",
              "minLength": 1
            },
            "$contains": {
              "type": "string",
              "minLength": 1
            },
            "$ci": {
              "type": "boolean"
            },
            "$in": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": [
                  "string",
                  "number",
                  "boolean"
                ]
              }
            },
            "$nin": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": [
                  "string",
                  "number",
                  "boolean"
                ]
              }
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "lastUpdated": {
      "oneOf": [
        {
          "type": [
            "string",
            "number",
            "boolean",
            "null"
          ]
        },
        {
          "type": "object",
          "properties": {
            "$eq": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$ne": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$gt": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$lt": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$gte": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$lte": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$startsWith": {
              "type": "string",
              "minLength": 1
            },
            "$endsWith": {
              "type": "string",
              "minLength": 1
            },
            "$contains": {
              "type": "string",
              "minLength": 1
            },
            "$ci": {
              "type": "boolean"
            },
            "$in": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": [
                  "string",
                  "number",
                  "boolean"
                ]
              }
            },
            "$nin": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": [
                  "string",
                  "number",
                  "boolean"
                ]
              }
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "sourceId": {
      "oneOf": [
        {
          "type": [
            "string",
            "number",
            "boolean",
            "null"
          ]
        },
        {
          "type": "object",
          "properties": {
            "$eq": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$ne": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$gt": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$lt": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$gte": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$lte": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$startsWith": {
              "type": "string",
              "minLength": 1
            },
            "$endsWith": {
              "type": "string",
              "minLength": 1
            },
            "$contains": {
              "type": "string",
              "minLength": 1
            },
            "$ci": {
              "type": "boolean"
            },
            "$in": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": [
                  "string",
                  "number",
                  "boolean"
                ]
              }
            },
            "$nin": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": [
                  "string",
                  "number",
                  "boolean"
                ]
              }
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "sourceType": {
      "oneOf": [
        {
          "type": [
            "string",
            "number",
            "boolean",
            "null"
          ]
        },
        {
          "type": "object",
          "properties": {
            "$eq": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$ne": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$gt": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$lt": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$gte": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$lte": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$startsWith": {
              "type": "string",
              "minLength": 1
            },
            "$endsWith": {
              "type": "string",
              "minLength": 1
            },
            "$contains": {
              "type": "string",
              "minLength": 1
            },
            "$ci": {
              "type": "boolean"
            },
            "$in": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": [
                  "string",
                  "number",
                  "boolean"
                ]
              }
            },
            "$nin": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": [
                  "string",
                  "number",
                  "boolean"
                ]
              }
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "level": {
      "oneOf": [
        {
          "type": [
            "string",
            "number",
            "boolean",
            "null"
          ]
        },
        {
          "type": "object",
          "properties": {
            "$eq": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$ne": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$gt": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$lt": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$gte": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$lte": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$startsWith": {
              "type": "string",
              "minLength": 1
            },
            "$endsWith": {
              "type": "string",
              "minLength": 1
            },
            "$contains": {
              "type": "string",
              "minLength": 1
            },
            "$ci": {
              "type": "boolean"
            },
            "$in": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": [
                  "string",
                  "number",
                  "boolean"
                ]
              }
            },
            "$nin": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": [
                  "string",
                  "number",
                  "boolean"
                ]
              }
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "state": {
      "oneOf": [
        {
          "type": [
            "string",
            "number",
            "boolean",
            "null"
          ]
        },
        {
          "type": "object",
          "properties": {
            "$eq": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$ne": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$gt": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$lt": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$gte": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$lte": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$startsWith": {
              "type": "string",
              "minLength": 1
            },
            "$endsWith": {
              "type": "string",
              "minLength": 1
            },
            "$contains": {
              "type": "string",
              "minLength": 1
            },
            "$ci": {
              "type": "boolean"
            },
            "$in": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": [
                  "string",
                  "number",
                  "boolean"
                ]
              }
            },
            "$nin": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": [
                  "string",
                  "number",
                  "boolean"
                ]
              }
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "subject": {
      "oneOf": [
        {
          "type": [
            "string",
            "number",
            "boolean",
            "null"
          ]
        },
        {
          "type": "object",
          "properties": {
            "$eq": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$ne": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$gt": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$lt": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$gte": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$lte": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$startsWith": {
              "type": "string",
              "minLength": 1
            },
            "$endsWith": {
              "type": "string",
              "minLength": 1
            },
            "$contains": {
              "type": "string",
              "minLength": 1
            },
            "$ci": {
              "type": "boolean"
            },
            "$in": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": [
                  "string",
                  "number",
                  "boolean"
                ]
              }
            },
            "$nin": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": [
                  "string",
                  "number",
                  "boolean"
                ]
              }
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "deviceId": {
      "oneOf": [
        {
          "type": [
            "string",
            "number",
            "boolean",
            "null"
          ]
        },
        {
          "type": "object",
          "properties": {
            "$eq": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$ne": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$gt": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$lt": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$gte": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$lte": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$startsWith": {
              "type": "string",
              "minLength": 1
            },
            "$endsWith": {
              "type": "string",
              "minLength": 1
            },
            "$contains": {
              "type": "string",
              "minLength": 1
            },
            "$ci": {
              "type": "boolean"
            },
            "$in": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": [
                  "string",
                  "number",
                  "boolean"
                ]
              }
            },
            "$nin": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": [
                  "string",
                  "number",
                  "boolean"
                ]
              }
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "experienceUserId": {
      "oneOf": [
        {
          "oneOf": [
            {
              "type": "string",
              "pattern": "^[A-Fa-f\\d]{24}$"
            },
            {
              "type": "null"
            }
          ]
        },
        {
          "type": "object",
          "properties": {
            "$eq": {
              "oneOf": [
                {
                  "type": "string",
                  "pattern": "^[A-Fa-f\\d]{24}$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "$ne": {
              "oneOf": [
                {
                  "type": "string",
                  "pattern": "^[A-Fa-f\\d]{24}$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "$in": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": "string",
                "pattern": "^[A-Fa-f\\d]{24}$"
              }
            },
            "$nin": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": "string",
                "pattern": "^[A-Fa-f\\d]{24}$"
              }
            }
          },
          "additionalProperties": false,
          "minProperties": 1,
          "maxProperties": 1
        }
      ]
    },
    "experienceGroupId": {
      "oneOf": [
        {
          "oneOf": [
            {
              "type": "string",
              "pattern": "^[A-Fa-f\\d]{24}$"
            },
            {
              "type": "null"
            }
          ]
        },
        {
          "type": "object",
          "properties": {
            "$eq": {
              "oneOf": [
                {
                  "type": "string",
                  "pattern": "^[A-Fa-f\\d]{24}$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "$ne": {
              "oneOf": [
                {
                  "type": "string",
                  "pattern": "^[A-Fa-f\\d]{24}$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "$in": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": "string",
                "pattern": "^[A-Fa-f\\d]{24}$"
              }
            },
            "$nin": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": "string",
                "pattern": "^[A-Fa-f\\d]{24}$"
              }
            }
          },
          "additionalProperties": false,
          "minProperties": 1,
          "maxProperties": 1
        }
      ]
    },
    "eventTags": {
      "oneOf": [
        {
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "$tagKey": {
                  "type": "string",
                  "maxLength": 255
                },
                "$tagValue": {
                  "type": "string",
                  "maxLength": 255
                }
              },
              "additionalProperties": false,
              "minProperties": 1
            },
            {
              "type": "object",
              "patternProperties": {
                "^[0-9a-zA-Z_-]{1,255}": {
                  "type": "string",
                  "maxLength": 255
                }
              },
              "additionalProperties": false
            }
          ]
        },
        {
          "type": "object",
          "properties": {
            "$eq": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "$tagKey": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "$tagValue": {
                      "type": "string",
                      "maxLength": 255
                    }
                  },
                  "additionalProperties": false,
                  "minProperties": 1
                },
                {
                  "type": "object",
                  "patternProperties": {
                    "^[0-9a-zA-Z_-]{1,255}": {
                      "type": "string",
                      "maxLength": 255
                    }
                  },
                  "additionalProperties": false
                }
              ]
            }
          },
          "required": [
            "$eq"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "$ne": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "$tagKey": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "$tagValue": {
                      "type": "string",
                      "maxLength": 255
                    }
                  },
                  "additionalProperties": false,
                  "minProperties": 1
                },
                {
                  "type": "object",
                  "patternProperties": {
                    "^[0-9a-zA-Z_-]{1,255}": {
                      "type": "string",
                      "maxLength": 255
                    }
                  },
                  "additionalProperties": false
                }
              ]
            }
          },
          "required": [
            "$ne"
          ],
          "additionalProperties": false
        }
      ]
    }
  },
  "additionalProperties": false
}

Advanced Event Query Example

{
  "$or": [
    {
      "level": {
        "$ne": "myValue"
      }
    },
    {
      "level": 5
    }
  ]
}

Advanced Query

Schema for advanced filters and queries

Advanced Query Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "$and": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/advancedQuery"
      },
      "maxItems": 100
    },
    "$or": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/advancedQuery"
      },
      "maxItems": 100
    },
    "$nor": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/advancedQuery"
      },
      "maxItems": 100
    }
  },
  "patternProperties": {
    "^[0-9a-zA-Z_-]{1,255}$": {
      "oneOf": [
        {
          "type": [
            "string",
            "number",
            "boolean",
            "null"
          ]
        },
        {
          "type": "object",
          "properties": {
            "$eq": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$ne": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$gt": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$lt": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$gte": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$lte": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "$startsWith": {
              "type": "string",
              "minLength": 1
            },
            "$endsWith": {
              "type": "string",
              "minLength": 1
            },
            "$contains": {
              "type": "string",
              "minLength": 1
            },
            "$ci": {
              "type": "boolean"
            },
            "$in": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": [
                  "string",
                  "number",
                  "boolean"
                ]
              }
            },
            "$nin": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": [
                  "string",
                  "number",
                  "boolean"
                ]
              }
            }
          },
          "additionalProperties": false
        }
      ]
    }
  },
  "additionalProperties": false
}

Advanced Query Example

{
  "$or": [
    {
      "level": {
        "$ne": "myValue"
      }
    },
    {
      "level": 5
    }
  ]
}

API Token

Schema for a single API Token

API Token Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "apiTokenId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "ownerId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "ownerType": {
      "type": "string",
      "enum": [
        "application"
      ]
    },
    "creatorId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "creatorType": {
      "type": "string",
      "enum": [
        "apiToken",
        "user",
        "flow"
      ]
    },
    "creatorName": {
      "type": "string",
      "maxLength": 1024
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "creationDate": {
      "type": "string",
      "format": "date-time"
    },
    "lastUpdated": {
      "type": "string",
      "format": "date-time"
    },
    "expirationDate": {
      "type": "string",
      "format": "date-time"
    },
    "scope": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1024
      }
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "inactive"
      ]
    },
    "token": {
      "type": "string",
      "minLength": 1
    }
  }
}

API Token Example

{
  "id": "575ec7417ae143cd83dc4a95",
  "apiTokenId": "575ec7417ae143cd83dc4a95",
  "creatorId": "575ed70c7ae143cd83dc4aa9",
  "creatorType": "user",
  "ownerId": "575ec8687ae143cd83dc4a97",
  "ownerType": "application",
  "name": "My API Token",
  "creationDate": "2016-06-13T04:00:00.000Z",
  "lastUpdated": "2016-06-13T04:00:00.000Z",
  "expirationDate": "2017-06-13T04:00:00.000Z",
  "scope": [
    "all.Application"
  ],
  "status": "active",
  "token": "the_actual_token_string"
}

API Token Patch

Schema for the body of an API Token modification request

API Token Patch Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "inactive"
      ]
    }
  },
  "additionalProperties": false
}

API Token Patch Example

{
  "name": "My Updated API Token",
  "status": "inactive"
}

API Tokens

Schema for a collection of API Tokens

API Tokens Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "title": "API Token",
        "description": "Schema for a single API Token",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "apiTokenId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "ownerId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "ownerType": {
            "type": "string",
            "enum": [
              "application"
            ]
          },
          "creatorId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "creatorType": {
            "type": "string",
            "enum": [
              "apiToken",
              "user",
              "flow"
            ]
          },
          "creatorName": {
            "type": "string",
            "maxLength": 1024
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "description": {
            "type": "string",
            "maxLength": 32767
          },
          "creationDate": {
            "type": "string",
            "format": "date-time"
          },
          "lastUpdated": {
            "type": "string",
            "format": "date-time"
          },
          "expirationDate": {
            "type": "string",
            "format": "date-time"
          },
          "scope": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "inactive"
            ]
          },
          "token": {
            "type": "string",
            "minLength": 1
          }
        }
      }
    },
    "count": {
      "type": "integer"
    },
    "totalCount": {
      "type": "integer"
    },
    "perPage": {
      "type": "integer"
    },
    "page": {
      "type": "integer"
    },
    "filter": {
      "type": "string"
    },
    "filterField": {
      "type": "string"
    },
    "sortField": {
      "type": "string"
    },
    "sortDirection": {
      "type": "string",
      "enum": [
        "asc",
        "desc",
        "ASC",
        "DESC",
        ""
      ]
    },
    "ownerId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "ownerType": {
      "type": "string",
      "enum": [
        "application"
      ]
    }
  }
}

API Tokens Example

{
  "items": [
    {
      "id": "575ec7417ae143cd83dc4a95",
      "apiTokenId": "575ec7417ae143cd83dc4a95",
      "creatorId": "575ed70c7ae143cd83dc4aa9",
      "creatorType": "user",
      "ownerId": "575ec8687ae143cd83dc4a97",
      "ownerType": "application",
      "name": "My API Token",
      "creationDate": "2016-06-13T04:00:00.000Z",
      "lastUpdated": "2016-06-13T04:00:00.000Z",
      "expirationDate": "2017-06-13T04:00:00.000Z",
      "scope": [
        "all.Application"
      ],
      "status": "active",
      "token": "the_actual_token_string"
    }
  ],
  "count": 1,
  "totalCount": 4,
  "perPage": 1,
  "page": 0,
  "sortField": "name",
  "sortDirection": "asc",
  "ownerId": "575ec8687ae143cd83dc4a97",
  "ownerType": "application"
}

Application

Schema for a single Application

Application Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "applicationId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "creationDate": {
      "type": "string",
      "format": "date-time"
    },
    "lastUpdated": {
      "type": "string",
      "format": "date-time"
    },
    "appliedTemplateIds": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[A-Fa-f\\d]{24}$"
      },
      "maxItems": 1000
    },
    "ownerId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "ownerType": {
      "type": "string",
      "enum": [
        "user",
        "organization"
      ]
    },
    "organizationName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "organizationIconColor": {
      "type": "string",
      "maxLength": 64
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "type": "string",
      "maxLength": 1024
    },
    "endpointSlug": {
      "type": "string",
      "minLength": 4,
      "maxLength": 63,
      "pattern": "^[0-9a-z-]*$"
    },
    "expUserTokenCutoff": {
      "type": "string",
      "format": "date-time"
    },
    "endpointDefaultCors": {
      "type": "boolean"
    },
    "globals": {
      "type": "array",
      "maxItems": 100,
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[0-9a-zA-Z_-]{1,255}$"
          },
          "json": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32767
          },
          "cloudOnly": {
            "type": "boolean",
            "default": false
          },
          "description": {
            "type": "string",
            "maxLength": 1024
          }
        },
        "additionalProperties": false,
        "required": [
          "key",
          "json"
        ]
      }
    },
    "blobUrlTTL": {
      "type": "number",
      "minimum": 3600,
      "maximum": 604800
    },
    "summary": {
      "type": "object",
      "properties": {
        "apiTokenCount": {
          "type": "number"
        },
        "dataTableCount": {
          "type": "number"
        },
        "deviceCount": {
          "type": "number"
        },
        "deviceRecipeCount": {
          "type": "number"
        },
        "eventCount": {
          "type": "number"
        },
        "experienceDomainCount": {
          "type": "number"
        },
        "experienceEndpointCount": {
          "type": "number"
        },
        "experienceGroupCount": {
          "type": "number"
        },
        "experienceSlugCount": {
          "type": "number"
        },
        "experienceUserCount": {
          "type": "number"
        },
        "experienceVersionCount": {
          "type": "number"
        },
        "experienceViewCount": {
          "type": "number"
        },
        "fileCount": {
          "type": "number"
        },
        "flowCount": {
          "type": "number"
        },
        "integrationCount": {
          "type": "number"
        },
        "keyCount": {
          "type": "number"
        },
        "storageStats": {
          "type": "object",
          "properties": {
            "count": {
              "type": "number"
            },
            "size": {
              "type": "number"
            }
          }
        },
        "webhookCount": {
          "type": "number"
        }
      }
    },
    "ftueTracking": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "pattern": "^[0-9a-zA-Z_-]{1,255}$"
          },
          "version": {
            "type": "number"
          },
          "status": {
            "type": "string",
            "enum": [
              "skipped",
              "completed"
            ]
          }
        },
        "required": [
          "name",
          "version",
          "status"
        ],
        "additionalProperties": false
      },
      "maxItems": 100
    },
    "archiveConfig": {
      "type": "object",
      "properties": {
        "directory": {
          "type": "string",
          "max": 255
        },
        "mode": {
          "type": "string",
          "enum": [
            "all",
            "whitelist",
            "blacklist"
          ]
        },
        "deviceIds": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "maxItems": 1000
        },
        "deviceTags": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "key": {
                "type": "string",
                "pattern": "^[0-9a-zA-Z_-]{1,255}$"
              },
              "value": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              }
            },
            "additionalProperties": false
          },
          "maxItems": 100
        },
        "includeDevices": {
          "type": "boolean",
          "default": true
        },
        "includeEvents": {
          "type": "boolean",
          "default": false
        },
        "includeDataTables": {
          "type": "boolean",
          "default": false
        },
        "dataTablesMode": {
          "type": "string",
          "enum": [
            "all",
            "whitelist",
            "blacklist"
          ]
        },
        "dataTableIds": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "maxItems": 1000
        },
        "s3": {
          "type": "object",
          "properties": {
            "bucket": {
              "type": "string",
              "max": 255
            },
            "accessKeyId": {
              "type": "string",
              "min": 4,
              "max": 128
            },
            "secretAccessKey": {
              "type": "string",
              "min": 4,
              "max": 128
            },
            "region": {
              "type": "string",
              "max": 128
            }
          },
          "required": [
            "bucket",
            "accessKeyId",
            "secretAccessKey",
            "region"
          ],
          "additionalProperties": false
        },
        "gcs": {
          "type": "object",
          "properties": {
            "projectId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            },
            "keyJson": {
              "type": "string",
              "maxLength": 32767,
              "minLength": 4
            },
            "bucket": {
              "type": "string",
              "max": 255
            }
          },
          "required": [
            "projectId",
            "keyJson",
            "bucket"
          ],
          "additionalProperties": false
        },
        "azure": {
          "type": "object",
          "properties": {
            "account": {
              "type": "string",
              "min": 3,
              "max": 24
            },
            "accountKey": {
              "type": "string",
              "max": 255
            },
            "bucket": {
              "type": "string",
              "min": 3,
              "max": 63
            }
          },
          "required": [
            "account",
            "accountKey",
            "bucket"
          ],
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    }
  }
}

Application Example

{
  "id": "575ec8687ae143cd83dc4a97",
  "applicationId": "575ec8687ae143cd83dc4a97",
  "creationDate": "2016-06-13T04:00:00.000Z",
  "lastUpdated": "2016-06-13T04:00:00.000Z",
  "ownerId": "575ed70c7ae143cd83dc4aa9",
  "ownerType": "user",
  "name": "My Application",
  "description": "The is the best application description",
  "summary": {
    "deviceCount": 5,
    "flowCount": 2,
    "webhookCount": 0,
    "eventCount": 0,
    "keyCount": 1,
    "deviceRecipeCount": 0
  },
  "archiveConfig": {
    "s3": {
      "bucket": "bucketName",
      "accessKeyId": "awsAccessKey",
      "accessSecretKey": "awsSecretKey",
      "region": "us-west-1"
    },
    "mode": "all",
    "deviceIds": [
      "575ec8687ae143cd83dc4a95",
      "575ec8687ae143cd83dc4a91"
    ]
  }
}

Application API Token Post

Schema for the body of an Application API Token creation request

Application API Token Post Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "expirationDate": {
      "type": "string",
      "format": "date-time"
    },
    "scope": {
      "type": "array",
      "uniqueItems": true,
      "items": {
        "type": "string",
        "enum": [
          "all.Application",
          "all.Application.read",
          "all.Device",
          "all.Device.read",
          "application.*",
          "applicationApiToken.*",
          "applicationApiTokens.*",
          "applicationCertificate.*",
          "applicationCertificates.*",
          "applicationCertificateAuthority.*",
          "applicationCertificateAuthorities.*",
          "applicationKey.*",
          "applicationKeys.*",
          "data.*",
          "dataTable.*",
          "dataTables.*",
          "dataTableRow.*",
          "dataTableRows.*",
          "device.*",
          "deviceRecipe.*",
          "deviceRecipes.*",
          "devices.*",
          "edgeDeployments.*",
          "event.*",
          "events.*",
          "experience.*",
          "experienceDomain.*",
          "experienceDomains.*",
          "experienceEndpoint.*",
          "experienceEndpoints.*",
          "experienceGroup.*",
          "experienceGroups.*",
          "experienceSlug.*",
          "experienceSlugs.*",
          "experienceUser.*",
          "experienceUsers.*",
          "experienceVersion.*",
          "experienceVersions.*",
          "experienceView.*",
          "experienceViews.*",
          "integration.*",
          "integrations.*",
          "file.*",
          "files.*",
          "flow.*",
          "flows.*",
          "flowVersion.*",
          "flowVersions.*",
          "notebook.*",
          "notebooks.*",
          "webhook.*",
          "webhooks.*",
          "application.applyTemplate",
          "application.archiveData",
          "application.backfillArchiveData",
          "application.clone",
          "application.export",
          "application.import",
          "application.fullEventsArchive",
          "application.fullDataTablesArchive",
          "application.debug",
          "application.delete",
          "application.get",
          "application.mqttPublishMessage",
          "application.mqttSubscriptionStream",
          "application.patch",
          "application.payloadCounts",
          "application.search",
          "applicationApiToken.delete",
          "applicationApiToken.get",
          "applicationApiToken.patch",
          "applicationApiTokens.get",
          "applicationApiTokens.post",
          "applicationCertificate.delete",
          "applicationCertificate.get",
          "applicationCertificate.patch",
          "applicationCertificates.get",
          "applicationCertificates.post",
          "applicationCertificateAuthority.delete",
          "applicationCertificateAuthority.get",
          "applicationCertificateAuthority.patch",
          "applicationCertificateAuthorities.get",
          "applicationCertificateAuthorities.post",
          "applicationKey.delete",
          "applicationKey.get",
          "applicationKey.patch",
          "applicationKeys.get",
          "applicationKeys.post",
          "data.export",
          "data.lastValueQuery",
          "data.timeSeriesQuery",
          "dataTable.addColumn",
          "dataTable.delete",
          "dataTable.get",
          "dataTable.patch",
          "dataTable.removeColumn",
          "dataTableRow.delete",
          "dataTableRow.get",
          "dataTableRow.patch",
          "dataTableRows.get",
          "dataTableRows.post",
          "dataTableRows.query",
          "dataTableRows.export",
          "dataTableRows.delete",
          "dataTableRows.truncate",
          "dataTables.get",
          "dataTables.post",
          "device.commandStream",
          "device.debug",
          "device.delete",
          "device.export",
          "device.get",
          "device.getCommand",
          "device.getCompositeState",
          "device.getLogEntries",
          "device.getState",
          "device.patch",
          "device.removeData",
          "device.sendCommand",
          "device.sendState",
          "device.setConnectionStatus",
          "device.stateStream",
          "deviceRecipe.bulkCreate",
          "deviceRecipe.delete",
          "deviceRecipe.get",
          "deviceRecipe.patch",
          "deviceRecipes.get",
          "deviceRecipes.post",
          "devices.patch",
          "devices.delete",
          "devices.removeData",
          "devices.detailedSummary",
          "devices.export",
          "devices.get",
          "devices.post",
          "devices.sendCommand",
          "edgeDeployments.get",
          "edgeDeployments.release",
          "edgeDeployments.remove",
          "edgeDeployments.replace",
          "event.delete",
          "event.get",
          "event.patch",
          "events.delete",
          "events.get",
          "events.mostRecentBySeverity",
          "events.patch",
          "events.post",
          "events.export",
          "experience.delete",
          "experience.bootstrap",
          "experienceDomain.delete",
          "experienceDomain.get",
          "experienceDomain.patch",
          "experienceDomains.get",
          "experienceDomains.post",
          "experienceEndpoint.delete",
          "experienceEndpoint.get",
          "experienceEndpoint.linkedResources",
          "experienceEndpoint.patch",
          "experienceEndpoints.get",
          "experienceEndpoints.post",
          "experienceEndpoints.stats",
          "experienceGroup.delete",
          "experienceGroup.get",
          "experienceGroup.patch",
          "experienceGroups.detailedSummary",
          "experienceGroups.get",
          "experienceGroups.post",
          "experienceSlug.delete",
          "experienceSlug.get",
          "experienceSlug.patch",
          "experienceSlugs.get",
          "experienceSlugs.post",
          "experienceUser.delete",
          "experienceUser.get",
          "experienceUser.patch",
          "experienceUsers.detailedSummary",
          "experienceUsers.get",
          "experienceUsers.post",
          "experienceVersion.delete",
          "experienceVersion.get",
          "experienceVersion.patch",
          "experienceVersions.get",
          "experienceVersions.post",
          "experienceView.debug",
          "experienceView.delete",
          "experienceView.get",
          "experienceView.linkedResources",
          "experienceView.patch",
          "experienceViews.debug",
          "experienceViews.detailedSummary",
          "experienceViews.get",
          "experienceViews.post",
          "file.get",
          "file.patch",
          "file.move",
          "file.delete",
          "file.upload",
          "files.get",
          "files.post",
          "flow.clearStorageEntries",
          "flow.debug",
          "flow.delete",
          "flow.errors",
          "flow.get",
          "flow.getStorageEntries",
          "flow.log",
          "flow.patch",
          "flow.pressVirtualButton",
          "flow.setStorageEntry",
          "flow.stats",
          "flows.get",
          "flows.getByVersion",
          "flows.import",
          "flows.post",
          "flowVersion.delete",
          "flowVersion.errors",
          "flowVersion.get",
          "flowVersion.log",
          "flowVersion.patch",
          "flowVersion.stats",
          "flowVersions.get",
          "flowVersions.post",
          "integration.delete",
          "integration.get",
          "integration.patch",
          "integrations.get",
          "integrations.post",
          "notebook.delete",
          "notebook.execute",
          "notebook.get",
          "notebook.logs",
          "notebook.patch",
          "notebook.requestInputDataExport",
          "notebook.upload",
          "notebooks.get",
          "notebooks.post",
          "webhook.delete",
          "webhook.get",
          "webhook.patch",
          "webhooks.get",
          "webhooks.post"
        ]
      }
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "inactive"
      ]
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}

Application API Token Post Example

{
  "name": "My New API Token",
  "expirationDate": "2017-06-13T04:00:00.000Z",
  "scope": [
    "all.Application"
  ],
  "status": "active"
}

Application Apply Template Patch Schema

Schema for the body of an application template import request

Application Apply Template Patch Schema Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "templateId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "email": {
      "type": "string",
      "format": "email",
      "maxLength": 1024
    }
  },
  "required": [
    "templateId"
  ],
  "additionalProperties": false
}

Application Apply Template Patch Schema Example

{
  "templateId": "575ec8687ae143cd83dc4a97",
  "email": "email.example.com"
}

Application Certificate

Schema for a single Application Certificate

Application Certificate Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "applicationCertificateId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "applicationId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "creationDate": {
      "type": "string",
      "format": "date-time"
    },
    "lastUpdated": {
      "type": "string",
      "format": "date-time"
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "inactive"
      ]
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "deviceIds": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[A-Fa-f\\d]{24}$"
      },
      "maxItems": 1000
    },
    "deviceTags": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[0-9a-zA-Z_-]{1,255}$"
          },
          "value": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          }
        },
        "additionalProperties": false
      },
      "maxItems": 100
    },
    "certificateInfo": {
      "type": "object",
      "properties": {
        "serialNumber": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "fingerprint": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "commonName": {
          "type": "string",
          "maxLength": 1024
        },
        "issuerName": {
          "type": "string",
          "maxLength": 1024
        },
        "notValidBefore": {
          "type": "string",
          "format": "date-time"
        },
        "notValidAfter": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "filterType": {
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "all",
            "whitelist",
            "blacklist"
          ]
        },
        {
          "type": "string",
          "enum": [
            "none"
          ]
        }
      ]
    },
    "pubTopics": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1024
      }
    },
    "subTopics": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1024
      }
    }
  }
}

Application Certificate Example

{
  "id": "5cd02a50df66feb0994c7196",
  "applicationCertificateId": "5cd02a50df66feb0994c7196",
  "applicationId": "575ec8687ae143cd83dc4a97",
  "creationDate": "2016-06-13T04:00:00.000Z",
  "lastUpdated": "2016-06-13T04:00:00.000Z",
  "status": "active",
  "description": "An example certificate description",
  "certificateInfo": {
    "serialNumber": "ad:0e:ff:63:27:83:e5:3e:6b:a9:fb:57:0d:37:fc:e9",
    "fingerprint": "FF:4A:88:5D:93:E7:FF:61:E4:72:94:EE:82:4B:56:B2:AB:71:38:06",
    "commonName": "myDomain.com",
    "issuerName": "Network Solutions OV Server CA 2",
    "notValidBefore": "2019-04-10T00:00:00.000Z",
    "notValidAfter": "2020-04-10T00:00:00.000Z"
  },
  "filterType": "all",
  "pubTopics": [],
  "subTopics": []
}

Application Certificate Authorities

Schema for a collection of Application Certificate Authorities

Application Certificate Authorities Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "title": "Application Certificate Authority",
        "description": "Schema for a single Application Certificate Authority",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "applicationCertificateAuthorityId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "applicationId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "creationDate": {
            "type": "string",
            "format": "date-time"
          },
          "lastUpdated": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "inactive"
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "description": {
            "type": "string",
            "maxLength": 32767
          },
          "caBundle": {
            "type": "string",
            "maxLength": 32767,
            "minLength": 50
          },
          "caInfo": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "serialNumber": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1024
                },
                "fingerprint": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1024
                },
                "commonName": {
                  "type": "string",
                  "maxLength": 1024
                },
                "issuerName": {
                  "type": "string",
                  "maxLength": 1024
                },
                "notValidBefore": {
                  "type": "string",
                  "format": "date-time"
                },
                "notValidAfter": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            }
          }
        }
      }
    },
    "count": {
      "type": "integer"
    },
    "totalCount": {
      "type": "integer"
    },
    "perPage": {
      "type": "integer"
    },
    "page": {
      "type": "integer"
    },
    "filter": {
      "type": "string"
    },
    "filterField": {
      "type": "string"
    },
    "sortField": {
      "type": "string"
    },
    "sortDirection": {
      "type": "string",
      "enum": [
        "asc",
        "desc",
        "ASC",
        "DESC",
        ""
      ]
    },
    "applicationId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    }
  }
}

Application Certificate Authorities Example

{
  "items": [
    {
      "id": "5cd02a7bdf66feb0994c7197",
      "applicationCertificateAuthorityId": "5cd02a7bdf66feb0994c7197",
      "applicationId": "575ec8687ae143cd83dc4a97",
      "creationDate": "2016-06-13T04:00:00.000Z",
      "lastUpdated": "2016-06-13T04:00:00.000Z",
      "status": "active",
      "name": "my certificate authority",
      "description": "An example certificate authority description",
      "caBundle": "MY_SSL_CERTIFICATE",
      "caInfo": [
        {
          "serialNumber": "ad:0e:ff:63:27:83:e5:3e:6b:a9:fb:57:0d:37:fc:e9",
          "fingerprint": "FF:4A:88:5D:93:E7:FF:61:E4:72:94:EE:82:4B:56:B2:AB:71:38:06",
          "commonName": "myDomain.com",
          "issuerName": "Network Solutions OV Server CA 2",
          "notValidBefore": "2019-04-10T00:00:00.000Z",
          "notValidAfter": "2020-04-10T00:00:00.000Z"
        }
      ]
    }
  ],
  "count": 1,
  "totalCount": 4,
  "perPage": 1,
  "page": 0,
  "sortField": "key",
  "sortDirection": "asc",
  "applicationId": "575ec8687ae143cd83dc4a97"
}

Application Certificate Authority

Schema for a single Application Certificate Authority

Application Certificate Authority Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "applicationCertificateAuthorityId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "applicationId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "creationDate": {
      "type": "string",
      "format": "date-time"
    },
    "lastUpdated": {
      "type": "string",
      "format": "date-time"
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "inactive"
      ]
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "caBundle": {
      "type": "string",
      "maxLength": 32767,
      "minLength": 50
    },
    "caInfo": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "serialNumber": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          },
          "fingerprint": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          },
          "commonName": {
            "type": "string",
            "maxLength": 1024
          },
          "issuerName": {
            "type": "string",
            "maxLength": 1024
          },
          "notValidBefore": {
            "type": "string",
            "format": "date-time"
          },
          "notValidAfter": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    }
  }
}

Application Certificate Authority Example

{
  "id": "5cd02a7bdf66feb0994c7197",
  "applicationCertificateAuthorityId": "5cd02a7bdf66feb0994c7197",
  "applicationId": "575ec8687ae143cd83dc4a97",
  "creationDate": "2016-06-13T04:00:00.000Z",
  "lastUpdated": "2016-06-13T04:00:00.000Z",
  "status": "active",
  "name": "my certificate authority",
  "description": "An example certificate authority description",
  "caBundle": "MY_SSL_CERTIFICATE",
  "caInfo": [
    {
      "serialNumber": "ad:0e:ff:63:27:83:e5:3e:6b:a9:fb:57:0d:37:fc:e9",
      "fingerprint": "FF:4A:88:5D:93:E7:FF:61:E4:72:94:EE:82:4B:56:B2:AB:71:38:06",
      "commonName": "myDomain.com",
      "issuerName": "Network Solutions OV Server CA 2",
      "notValidBefore": "2019-04-10T00:00:00.000Z",
      "notValidAfter": "2020-04-10T00:00:00.000Z"
    }
  ]
}

Application Certificate Authority Patch

Schema for the body of an Application Certificate Authority modification request

Application Certificate Authority Patch Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "inactive"
      ]
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "caBundle": {
      "type": "string",
      "maxLength": 32767,
      "minLength": 50
    }
  },
  "additionalProperties": false
}

Application Certificate Authority Patch Example

{
  "status": "active",
  "description": "An example updated authority description"
}

Application Certificate Authority Post

Schema for the body of an Application Certificate Authority creation request

Application Certificate Authority Post Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "inactive"
      ]
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "caBundle": {
      "type": "string",
      "maxLength": 32767,
      "minLength": 50
    }
  },
  "required": [
    "name",
    "caBundle"
  ],
  "additionalProperties": false
}

Application Certificate Authority Post Example

{
  "name": "my certificate authority",
  "description": "An example new authority description",
  "caBundle": "MY_SSL_CERTIFICATE"
}

Application Certificate Patch

Schema for the body of an Application Certificate modification request

Application Certificate Patch Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "active",
        "inactive"
      ]
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "certificate": {
      "type": "string",
      "maxLength": 32767,
      "minLength": 50
    },
    "filterType": {
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "all",
            "whitelist",
            "blacklist"
          ]
        },
        {
          "type": "string",
          "enum": [
            "none"
          ]
        }
      ]
    },
    "pubTopics": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1024
      }
    },
    "subTopics": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1024
      }
    }
  },
  "additionalProperties": false
}

Application Certificate Patch Example

{
  "status": "active",
  "description": "An example updated certificate description"
}

Application Certificate Post

Schema for the body of an Application Certificate creation request

Application Certificate Post Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "active",
        "inactive"
      ]
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "deviceIds": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[A-Fa-f\\d]{24}$"
      },
      "maxItems": 1000
    },
    "deviceTags": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[0-9a-zA-Z_-]{1,255}$"
          },
          "value": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          }
        },
        "additionalProperties": false
      },
      "maxItems": 100
    },
    "certificate": {
      "type": "string",
      "maxLength": 32767,
      "minLength": 50
    },
    "filterType": {
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "all",
            "whitelist",
            "blacklist"
          ]
        },
        {
          "type": "string",
          "enum": [
            "none"
          ]
        }
      ]
    },
    "pubTopics": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1024
      }
    },
    "subTopics": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1024
      }
    }
  },
  "required": [
    "certificate"
  ],
  "additionalProperties": false
}

Application Certificate Post Example

{
  "description": "An example new certificate description",
  "certificate": "MY_SSL_CERTIFICATE",
  "filterType": "all",
  "pubTopics": [],
  "subTopics": []
}

Application Certificates

Schema for a collection of Application Certificates

Application Certificates Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "title": "Application Certificate",
        "description": "Schema for a single Application Certificate",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "applicationCertificateId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "applicationId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "creationDate": {
            "type": "string",
            "format": "date-time"
          },
          "lastUpdated": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "inactive"
            ]
          },
          "description": {
            "type": "string",
            "maxLength": 32767
          },
          "deviceIds": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[A-Fa-f\\d]{24}$"
            },
            "maxItems": 1000
          },
          "deviceTags": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string",
                  "pattern": "^[0-9a-zA-Z_-]{1,255}$"
                },
                "value": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 255
                }
              },
              "additionalProperties": false
            },
            "maxItems": 100
          },
          "certificateInfo": {
            "type": "object",
            "properties": {
              "serialNumber": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1024
              },
              "fingerprint": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1024
              },
              "commonName": {
                "type": "string",
                "maxLength": 1024
              },
              "issuerName": {
                "type": "string",
                "maxLength": 1024
              },
              "notValidBefore": {
                "type": "string",
                "format": "date-time"
              },
              "notValidAfter": {
                "type": "string",
                "format": "date-time"
              }
            }
          },
          "filterType": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "all",
                  "whitelist",
                  "blacklist"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "none"
                ]
              }
            ]
          },
          "pubTopics": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            }
          },
          "subTopics": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            }
          }
        }
      }
    },
    "count": {
      "type": "integer"
    },
    "totalCount": {
      "type": "integer"
    },
    "perPage": {
      "type": "integer"
    },
    "page": {
      "type": "integer"
    },
    "filter": {
      "type": "string"
    },
    "filterField": {
      "type": "string"
    },
    "sortField": {
      "type": "string"
    },
    "sortDirection": {
      "type": "string",
      "enum": [
        "asc",
        "desc",
        "ASC",
        "DESC",
        ""
      ]
    },
    "applicationId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    }
  }
}

Application Certificates Example

{
  "items": [
    {
      "id": "5cd02a50df66feb0994c7196",
      "applicationCertificateId": "5cd02a50df66feb0994c7196",
      "applicationId": "575ec8687ae143cd83dc4a97",
      "creationDate": "2016-06-13T04:00:00.000Z",
      "lastUpdated": "2016-06-13T04:00:00.000Z",
      "status": "active",
      "description": "An example certificate description",
      "certificateInfo": {
        "serialNumber": "ad:0e:ff:63:27:83:e5:3e:6b:a9:fb:57:0d:37:fc:e9",
        "fingerprint": "FF:4A:88:5D:93:E7:FF:61:E4:72:94:EE:82:4B:56:B2:AB:71:38:06",
        "commonName": "myDomain.com",
        "issuerName": "Network Solutions OV Server CA 2",
        "notValidBefore": "2019-04-10T00:00:00.000Z",
        "notValidAfter": "2020-04-10T00:00:00.000Z"
      },
      "filterType": "all",
      "pubTopics": [],
      "subTopics": []
    }
  ],
  "count": 1,
  "totalCount": 4,
  "perPage": 1,
  "page": 0,
  "sortField": "key",
  "sortDirection": "asc",
  "applicationId": "575ec8687ae143cd83dc4a97"
}

Success Dry Run

Schema for reporting a successful dry run of clone application

Success Dry Run Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "enum": [
        true
      ]
    },
    "requiresJob": {
      "type": "boolean"
    }
  }
}

Success Dry Run Example

{
  "success": true,
  "jobRequired": false
}

Application Clone Post Schema

Schema for the body of an application clone request

Application Clone Post Schema Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "dryRun": {
      "type": "boolean",
      "default": false
    },
    "includeFiles": {
      "type": "boolean",
      "default": false
    },
    "includeDataTableRows": {
      "type": "boolean",
      "default": false
    },
    "includeDevices": {
      "type": "boolean",
      "default": false
    },
    "ownerId": {
      "oneOf": [
        {
          "type": "string",
          "pattern": "^[A-Fa-f\\d]{24}$"
        },
        {
          "type": "null"
        }
      ]
    },
    "ownerType": {
      "type": "string",
      "enum": [
        "user",
        "organization"
      ]
    },
    "email": {
      "type": "string",
      "format": "email",
      "maxLength": 1024
    }
  },
  "additionalProperties": false
}

Application Clone Post Schema Example

{
  "options": {
    "includeFiles": true,
    "includeDevices": true,
    "ownerType": "organization",
    "ownerId": "575ec8687ae143cd83dc4a98"
  }
}

Application Creation By Template Result

Schema for creating an application by template result

Application Creation By Template Result Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "application": {
      "title": "Application",
      "description": "Schema for a single Application",
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[A-Fa-f\\d]{24}$"
        },
        "applicationId": {
          "type": "string",
          "pattern": "^[A-Fa-f\\d]{24}$"
        },
        "creationDate": {
          "type": "string",
          "format": "date-time"
        },
        "lastUpdated": {
          "type": "string",
          "format": "date-time"
        },
        "appliedTemplateIds": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "maxItems": 1000
        },
        "ownerId": {
          "type": "string",
          "pattern": "^[A-Fa-f\\d]{24}$"
        },
        "ownerType": {
          "type": "string",
          "enum": [
            "user",
            "organization"
          ]
        },
        "organizationName": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        },
        "organizationIconColor": {
          "type": "string",
          "maxLength": 64
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        },
        "description": {
          "type": "string",
          "maxLength": 1024
        },
        "endpointSlug": {
          "type": "string",
          "minLength": 4,
          "maxLength": 63,
          "pattern": "^[0-9a-z-]*$"
        },
        "expUserTokenCutoff": {
          "type": "string",
          "format": "date-time"
        },
        "endpointDefaultCors": {
          "type": "boolean"
        },
        "globals": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "type": "object",
            "properties": {
              "key": {
                "type": "string",
                "pattern": "^[0-9a-zA-Z_-]{1,255}$"
              },
              "json": {
                "type": "string",
                "minLength": 1,
                "maxLength": 32767
              },
              "cloudOnly": {
                "type": "boolean",
                "default": false
              },
              "description": {
                "type": "string",
                "maxLength": 1024
              }
            },
            "additionalProperties": false,
            "required": [
              "key",
              "json"
            ]
          }
        },
        "blobUrlTTL": {
          "type": "number",
          "minimum": 3600,
          "maximum": 604800
        },
        "summary": {
          "type": "object",
          "properties": {
            "apiTokenCount": {
              "type": "number"
            },
            "dataTableCount": {
              "type": "number"
            },
            "deviceCount": {
              "type": "number"
            },
            "deviceRecipeCount": {
              "type": "number"
            },
            "eventCount": {
              "type": "number"
            },
            "experienceDomainCount": {
              "type": "number"
            },
            "experienceEndpointCount": {
              "type": "number"
            },
            "experienceGroupCount": {
              "type": "number"
            },
            "experienceSlugCount": {
              "type": "number"
            },
            "experienceUserCount": {
              "type": "number"
            },
            "experienceVersionCount": {
              "type": "number"
            },
            "experienceViewCount": {
              "type": "number"
            },
            "fileCount": {
              "type": "number"
            },
            "flowCount": {
              "type": "number"
            },
            "integrationCount": {
              "type": "number"
            },
            "keyCount": {
              "type": "number"
            },
            "storageStats": {
              "type": "object",
              "properties": {
                "count": {
                  "type": "number"
                },
                "size": {
                  "type": "number"
                }
              }
            },
            "webhookCount": {
              "type": "number"
            }
          }
        },
        "ftueTracking": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "pattern": "^[0-9a-zA-Z_-]{1,255}$"
              },
              "version": {
                "type": "number"
              },
              "status": {
                "type": "string",
                "enum": [
                  "skipped",
                  "completed"
                ]
              }
            },
            "required": [
              "name",
              "version",
              "status"
            ],
            "additionalProperties": false
          },
          "maxItems": 100
        },
        "archiveConfig": {
          "type": "object",
          "properties": {
            "directory": {
              "type": "string",
              "max": 255
            },
            "mode": {
              "type": "string",
              "enum": [
                "all",
                "whitelist",
                "blacklist"
              ]
            },
            "deviceIds": {
              "type": "array",
              "items": {
                "type": "string",
                "pattern": "^[A-Fa-f\\d]{24}$"
              },
              "maxItems": 1000
            },
            "deviceTags": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "pattern": "^[0-9a-zA-Z_-]{1,255}$"
                  },
                  "value": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  }
                },
                "additionalProperties": false
              },
              "maxItems": 100
            },
            "includeDevices": {
              "type": "boolean",
              "default": true
            },
            "includeEvents": {
              "type": "boolean",
              "default": false
            },
            "includeDataTables": {
              "type": "boolean",
              "default": false
            },
            "dataTablesMode": {
              "type": "string",
              "enum": [
                "all",
                "whitelist",
                "blacklist"
              ]
            },
            "dataTableIds": {
              "type": "array",
              "items": {
                "type": "string",
                "pattern": "^[A-Fa-f\\d]{24}$"
              },
              "maxItems": 1000
            },
            "s3": {
              "type": "object",
              "properties": {
                "bucket": {
                  "type": "string",
                  "max": 255
                },
                "accessKeyId": {
                  "type": "string",
                  "min": 4,
                  "max": 128
                },
                "secretAccessKey": {
                  "type": "string",
                  "min": 4,
                  "max": 128
                },
                "region": {
                  "type": "string",
                  "max": 128
                }
              },
              "required": [
                "bucket",
                "accessKeyId",
                "secretAccessKey",
                "region"
              ],
              "additionalProperties": false
            },
            "gcs": {
              "type": "object",
              "properties": {
                "projectId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1024
                },
                "keyJson": {
                  "type": "string",
                  "maxLength": 32767,
                  "minLength": 4
                },
                "bucket": {
                  "type": "string",
                  "max": 255
                }
              },
              "required": [
                "projectId",
                "keyJson",
                "bucket"
              ],
              "additionalProperties": false
            },
            "azure": {
              "type": "object",
              "properties": {
                "account": {
                  "type": "string",
                  "min": 3,
                  "max": 24
                },
                "accountKey": {
                  "type": "string",
                  "max": 255
                },
                "bucket": {
                  "type": "string",
                  "min": 3,
                  "max": 63
                }
              },
              "required": [
                "account",
                "accountKey",
                "bucket"
              ],
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        }
      }
    },
    "validationErrors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "id": {
            "oneOf": [
              {
                "type": "string",
                "pattern": "^[A-Fa-f\\d]{24}$"
              },
              {
                "type": "string"
              }
            ]
          },
          "message": {
            "type": "string"
          }
        }
      }
    }
  },
  "additionalProperties": false
}

Application Creation By Template Result Example

{
  "application": {
    "id": "575ec8687ae143cd83dc4a98",
    "applicationId": "575ec8687ae143cd83dc4a97",
    "creationDate": "2016-06-13T04:00:00.000Z",
    "lastUpdated": "2016-06-13T04:00:00.000Z",
    "ownerId": "575ed70c7ae143cd83dc4aa9",
    "ownerType": "user",
    "name": "My Application Cloned",
    "description": "The is the best application description",
    "summary": {
      "deviceCount": 5,
      "flowCount": 2,
      "webhookCount": 0,
      "eventCount": 0,
      "keyCount": 1,
      "deviceRecipeCount": 0
    },
    "archiveConfig": {
      "s3": {
        "bucket": "bucketName",
        "accessKeyId": "awsAccessKey",
        "accessSecretKey": "awsSecretKey",
        "region": "us-west-1"
      },
      "mode": "all",
      "deviceIds": [
        "575ec8687ae143cd83dc4a95",
        "575ec8687ae143cd83dc4a91"
      ]
    }
  }
}

Application Export Post Schema

Schema for the body of an application export request

Application Export Post Schema Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "includeFiles": {
      "type": "boolean",
      "default": false
    },
    "includeDataTableRows": {
      "type": "boolean",
      "default": false
    },
    "includeDevices": {
      "type": "boolean",
      "default": false
    },
    "email": {
      "type": "string",
      "format": "email",
      "maxLength": 1024
    }
  },
  "additionalProperties": false
}

Application Export Post Schema Example

{
  "includeFiles": true,
  "includeDevices": true,
  "email": "test@losant.com"
}

Application Export Result

Schema for an application export result

Application Export Result Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "url": {
      "type": "string"
    }
  },
  "additionalProperties": false
}

Application Export Result Example

{
  "url": "https://s3.us-west-1.amazonaws.com/a-bucket-on-amazon/applicationExport.zip"
}

Application Key

Schema for a single Application Key

Application Key Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "applicationKeyId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "applicationId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "creationDate": {
      "type": "string",
      "format": "date-time"
    },
    "lastUpdated": {
      "type": "string",
      "format": "date-time"
    },
    "key": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "inactive"
      ]
    },
    "deviceIds": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[A-Fa-f\\d]{24}$"
      },
      "maxItems": 1000
    },
    "deviceTags": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[0-9a-zA-Z_-]{1,255}$"
          },
          "value": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          }
        },
        "additionalProperties": false
      },
      "maxItems": 100
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "filterType": {
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "all",
            "whitelist",
            "blacklist"
          ]
        },
        {
          "type": "string",
          "enum": [
            "none"
          ]
        }
      ]
    },
    "pubTopics": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1024
      }
    },
    "subTopics": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1024
      }
    }
  }
}

Application Key Example

{
  "id": "575ec76c7ae143cd83dc4a96",
  "applicationKeyId": "575ec76c7ae143cd83dc4a96",
  "applicationId": "575ec8687ae143cd83dc4a97",
  "creationDate": "2016-06-13T04:00:00.000Z",
  "lastUpdated": "2016-06-13T04:00:00.000Z",
  "key": "this_would_be_the_key",
  "status": "active",
  "description": "An example key description",
  "filterType": "all",
  "pubTopics": [],
  "subTopics": []
}

Application Key Patch

Schema for the body of an Application Key modification request

Application Key Patch Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "active",
        "inactive"
      ]
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "filterType": {
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "all",
            "whitelist",
            "blacklist"
          ]
        },
        {
          "type": "string",
          "enum": [
            "none"
          ]
        }
      ]
    },
    "pubTopics": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1024
      }
    },
    "subTopics": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1024
      }
    }
  },
  "additionalProperties": false
}

Application Key Patch Example

{
  "status": "active",
  "description": "An example updated key description"
}

Application Key Post

Schema for the body of an Application Key creation request

Application Key Post Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "deviceIds": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[A-Fa-f\\d]{24}$"
      },
      "maxItems": 1000
    },
    "deviceTags": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[0-9a-zA-Z_-]{1,255}$"
          },
          "value": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          }
        },
        "additionalProperties": false
      },
      "maxItems": 100
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "filterType": {
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "all",
            "whitelist",
            "blacklist"
          ]
        },
        {
          "type": "string",
          "enum": [
            "none"
          ]
        }
      ]
    },
    "pubTopics": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1024
      }
    },
    "subTopics": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1024
      }
    }
  },
  "additionalProperties": false
}

Application Key Post Example

{
  "description": "An example new key description",
  "filterType": "all",
  "pubTopics": [],
  "subTopics": []
}

Application Key Post Response

Schema for a response of Application Key creation

Application Key Post Response Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "applicationKeyId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "applicationId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "creationDate": {
      "type": "string",
      "format": "date-time"
    },
    "lastUpdated": {
      "type": "string",
      "format": "date-time"
    },
    "key": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "inactive"
      ]
    },
    "secret": {
      "type": "string"
    },
    "deviceIds": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[A-Fa-f\\d]{24}$"
      },
      "maxItems": 1000
    },
    "deviceTags": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[0-9a-zA-Z_-]{1,255}$"
          },
          "value": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          }
        },
        "additionalProperties": false
      },
      "maxItems": 100
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "filterType": {
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "all",
            "whitelist",
            "blacklist"
          ]
        },
        {
          "type": "string",
          "enum": [
            "none"
          ]
        }
      ]
    },
    "pubTopics": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1024
      }
    },
    "subTopics": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1024
      }
    }
  }
}

Application Key Post Response Example

{
  "id": "575ec76c7ae143cd83dc4a96",
  "applicationKeyId": "575ec76c7ae143cd83dc4a96",
  "applicationId": "575ec8687ae143cd83dc4a97",
  "creationDate": "2016-06-13T04:00:00.000Z",
  "lastUpdated": "2016-06-13T04:00:00.000Z",
  "key": "this_would_be_the_key",
  "status": "active",
  "secret": "shhhSecret",
  "description": "An example key description",
  "filterType": "all",
  "pubTopics": [],
  "subTopics": []
}

Application Keys

Schema for a collection of Application Keys

Application Keys Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "title": "Application Key",
        "description": "Schema for a single Application Key",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "applicationKeyId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "applicationId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "creationDate": {
            "type": "string",
            "format": "date-time"
          },
          "lastUpdated": {
            "type": "string",
            "format": "date-time"
          },
          "key": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "inactive"
            ]
          },
          "deviceIds": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[A-Fa-f\\d]{24}$"
            },
            "maxItems": 1000
          },
          "deviceTags": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string",
                  "pattern": "^[0-9a-zA-Z_-]{1,255}$"
                },
                "value": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 255
                }
              },
              "additionalProperties": false
            },
            "maxItems": 100
          },
          "description": {
            "type": "string",
            "maxLength": 32767
          },
          "filterType": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "all",
                  "whitelist",
                  "blacklist"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "none"
                ]
              }
            ]
          },
          "pubTopics": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            }
          },
          "subTopics": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            }
          }
        }
      }
    },
    "count": {
      "type": "integer"
    },
    "totalCount": {
      "type": "integer"
    },
    "perPage": {
      "type": "integer"
    },
    "page": {
      "type": "integer"
    },
    "filter": {
      "type": "string"
    },
    "filterField": {
      "type": "string"
    },
    "sortField": {
      "type": "string"
    },
    "sortDirection": {
      "type": "string",
      "enum": [
        "asc",
        "desc",
        "ASC",
        "DESC",
        ""
      ]
    },
    "applicationId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    }
  }
}

Application Keys Example

{
  "items": [
    {
      "id": "575ec76c7ae143cd83dc4a96",
      "applicationKeyId": "575ec76c7ae143cd83dc4a96",
      "applicationId": "575ec8687ae143cd83dc4a97",
      "creationDate": "2016-06-13T04:00:00.000Z",
      "lastUpdated": "2016-06-13T04:00:00.000Z",
      "key": "this_would_be_the_key",
      "status": "active",
      "description": "An example key description",
      "filterType": "all",
      "pubTopics": [],
      "subTopics": []
    }
  ],
  "count": 1,
  "totalCount": 4,
  "perPage": 1,
  "page": 0,
  "sortField": "key",
  "sortDirection": "asc",
  "applicationId": "575ec8687ae143cd83dc4a97"
}

Application Patch

Schema for the body of an Application modification request

Application Patch Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "type": "string",
      "maxLength": 1024
    },
    "endpointSlug": {
      "type": "string",
      "minLength": 4,
      "maxLength": 63,
      "pattern": "^[0-9a-z-]*$"
    },
    "expUserTokenCutoff": {
      "type": "string",
      "format": "date-time"
    },
    "endpointDefaultCors": {
      "type": "boolean"
    },
    "globals": {
      "type": "array",
      "maxItems": 100,
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[0-9a-zA-Z_-]{1,255}$"
          },
          "json": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32767
          },
          "cloudOnly": {
            "type": "boolean",
            "default": false
          },
          "description": {
            "type": "string",
            "maxLength": 1024
          }
        },
        "additionalProperties": false,
        "required": [
          "key",
          "json"
        ]
      }
    },
    "ftueTracking": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "pattern": "^[0-9a-zA-Z_-]{1,255}$"
          },
          "version": {
            "type": "number"
          },
          "status": {
            "type": "string",
            "enum": [
              "skipped",
              "completed"
            ]
          }
        },
        "required": [
          "name",
          "version",
          "status"
        ],
        "additionalProperties": false
      },
      "maxItems": 100
    },
    "archiveConfig": {
      "type": "object",
      "properties": {
        "directory": {
          "type": "string",
          "max": 255
        },
        "mode": {
          "type": "string",
          "enum": [
            "all",
            "whitelist",
            "blacklist"
          ]
        },
        "deviceIds": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "maxItems": 1000
        },
        "deviceTags": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "key": {
                "type": "string",
                "pattern": "^[0-9a-zA-Z_-]{1,255}$"
              },
              "value": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              }
            },
            "additionalProperties": false
          },
          "maxItems": 100
        },
        "includeDevices": {
          "type": "boolean",
          "default": true
        },
        "includeEvents": {
          "type": "boolean",
          "default": false
        },
        "includeDataTables": {
          "type": "boolean",
          "default": false
        },
        "dataTablesMode": {
          "type": "string",
          "enum": [
            "all",
            "whitelist",
            "blacklist"
          ]
        },
        "dataTableIds": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "maxItems": 1000
        },
        "s3": {
          "type": "object",
          "properties": {
            "bucket": {
              "type": "string",
              "max": 255
            },
            "accessKeyId": {
              "type": "string",
              "min": 4,
              "max": 128
            },
            "secretAccessKey": {
              "type": "string",
              "min": 4,
              "max": 128
            },
            "region": {
              "type": "string",
              "max": 128
            }
          },
          "required": [
            "bucket",
            "accessKeyId",
            "secretAccessKey",
            "region"
          ],
          "additionalProperties": false
        },
        "gcs": {
          "type": "object",
          "properties": {
            "projectId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            },
            "keyJson": {
              "type": "string",
              "maxLength": 32767,
              "minLength": 4
            },
            "bucket": {
              "type": "string",
              "max": 255
            }
          },
          "required": [
            "projectId",
            "keyJson",
            "bucket"
          ],
          "additionalProperties": false
        },
        "azure": {
          "type": "object",
          "properties": {
            "account": {
              "type": "string",
              "min": 3,
              "max": 24
            },
            "accountKey": {
              "type": "string",
              "max": 255
            },
            "bucket": {
              "type": "string",
              "min": 3,
              "max": 63
            }
          },
          "required": [
            "account",
            "accountKey",
            "bucket"
          ],
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "blobUrlTTL": {
      "type": "number",
      "minimum": 3600,
      "maximum": 604800
    }
  },
  "additionalProperties": false
}

Application Patch Example

{
  "name": "My Updated Application",
  "description": "Description of my updated application"
}

Application Post

Schema for the body of an Application creation request

Application Post Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "orgId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "applicationTemplateId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "type": "string",
      "maxLength": 1024
    },
    "appliedTemplateIds": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[A-Fa-f\\d]{24}$"
      },
      "maxItems": 1000
    },
    "endpointSlug": {
      "type": "string",
      "minLength": 4,
      "maxLength": 63,
      "pattern": "^[0-9a-z-]*$"
    },
    "expUserTokenCutoff": {
      "type": "string",
      "format": "date-time"
    },
    "endpointDefaultCors": {
      "type": "boolean"
    },
    "globals": {
      "type": "array",
      "maxItems": 100,
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[0-9a-zA-Z_-]{1,255}$"
          },
          "json": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32767
          },
          "cloudOnly": {
            "type": "boolean",
            "default": false
          },
          "description": {
            "type": "string",
            "maxLength": 1024
          }
        },
        "additionalProperties": false,
        "required": [
          "key",
          "json"
        ]
      }
    },
    "archiveConfig": {
      "type": "object",
      "properties": {
        "directory": {
          "type": "string",
          "max": 255
        },
        "mode": {
          "type": "string",
          "enum": [
            "all",
            "whitelist",
            "blacklist"
          ]
        },
        "deviceIds": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "maxItems": 1000
        },
        "deviceTags": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "key": {
                "type": "string",
                "pattern": "^[0-9a-zA-Z_-]{1,255}$"
              },
              "value": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              }
            },
            "additionalProperties": false
          },
          "maxItems": 100
        },
        "includeDevices": {
          "type": "boolean",
          "default": true
        },
        "includeEvents": {
          "type": "boolean",
          "default": false
        },
        "includeDataTables": {
          "type": "boolean",
          "default": false
        },
        "dataTablesMode": {
          "type": "string",
          "enum": [
            "all",
            "whitelist",
            "blacklist"
          ]
        },
        "dataTableIds": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "maxItems": 1000
        },
        "s3": {
          "type": "object",
          "properties": {
            "bucket": {
              "type": "string",
              "max": 255
            },
            "accessKeyId": {
              "type": "string",
              "min": 4,
              "max": 128
            },
            "secretAccessKey": {
              "type": "string",
              "min": 4,
              "max": 128
            },
            "region": {
              "type": "string",
              "max": 128
            }
          },
          "required": [
            "bucket",
            "accessKeyId",
            "secretAccessKey",
            "region"
          ],
          "additionalProperties": false
        },
        "gcs": {
          "type": "object",
          "properties": {
            "projectId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            },
            "keyJson": {
              "type": "string",
              "maxLength": 32767,
              "minLength": 4
            },
            "bucket": {
              "type": "string",
              "max": 255
            }
          },
          "required": [
            "projectId",
            "keyJson",
            "bucket"
          ],
          "additionalProperties": false
        },
        "azure": {
          "type": "object",
          "properties": {
            "account": {
              "type": "string",
              "min": 3,
              "max": 24
            },
            "accountKey": {
              "type": "string",
              "max": 255
            },
            "bucket": {
              "type": "string",
              "min": 3,
              "max": 63
            }
          },
          "required": [
            "account",
            "accountKey",
            "bucket"
          ],
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "blobUrlTTL": {
      "type": "number",
      "minimum": 3600,
      "maximum": 604800
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}

Application Post Example

{
  "name": "My New Application",
  "description": "Description of my new application"
}

Application Readme

Schema for an Application Readme

Application Readme Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "applicationId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "lastUpdated": {
      "type": "string",
      "format": "date-time"
    },
    "lastUpdatedById": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "lastUpdatedByType": {
      "type": "string",
      "enum": [
        "flow",
        "user",
        "apiToken"
      ]
    },
    "content": {
      "type": "string"
    }
  }
}

Application Readme Example

{
  "applicationId": "575ec8687ae143cd83dc4a97",
  "creationDate": "2016-06-13T04:00:00.000Z",
  "lastUpdated": "2016-06-13T04:00:00.000Z",
  "lastUpdatedById": "575ed70c7ae143cd83dc4aa9",
  "lastUpdatedByType": "user",
  "content": "The readme content"
}

Application Readme Patch

Schema for the body of an Application Readme modification request

Application Readme Patch Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "content": {
      "type": "string",
      "maxLength": 131072
    }
  },
  "additionalProperties": false
}

Application Readme Patch Example

{
  "content": "The new readme content"
}

Application Search Result

Results of a search of an application’s resources

Application Search Result Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "pattern": "^[A-Fa-f\\d]{24}$"
      },
      "name": {
        "type": "string"
      },
      "metadata": {
        "type": "object"
      },
      "viewType": {
        "type": "string"
      },
      "version": {
        "type": "string"
      },
      "_type": {
        "type": "string",
        "enum": [
          "applicationApiToken",
          "dashboard",
          "dataTable",
          "deviceRecipe",
          "device",
          "experienceDomain",
          "event",
          "experienceEndpoint",
          "experienceGroup",
          "experienceSlug",
          "experienceUser",
          "experienceVersion",
          "experienceView",
          "file",
          "flow",
          "integration",
          "webhook"
        ]
      }
    },
    "required": [
      "id",
      "name",
      "_type"
    ]
  }
}

Application Search Result Example

[
  {
    "type": "device",
    "name": "My Device #1",
    "metadata": {
      "descriptor": "a basic description of device #1"
    },
    "id": "575ec8687ae143cd83dc4a97"
  }
]

Application Template

Schema for a single Application Template

Application Template Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "creationDate": {
      "type": "string",
      "format": "date-time"
    },
    "lastUpdated": {
      "type": "string",
      "format": "date-time"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "readme": {
      "type": "string",
      "maxLength": 131072
    },
    "categoryIds": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[A-Fa-f\\d]{24}$"
      },
      "maxItems": 1000
    },
    "keywords": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[0-9a-zA-Z_-]{1,255}$"
      },
      "maxItems": 100
    },
    "description": {
      "type": "string",
      "maxLength": 1024
    },
    "public": {
      "type": "boolean"
    },
    "authorName": {
      "type": "string",
      "maxLength": 255
    },
    "imageUrl": {
      "type": "string",
      "maxLength": 1024
    },
    "authorUrl": {
      "type": "string",
      "maxLength": 1024
    },
    "templateUrl": {
      "type": "string",
      "maxLength": 1024
    },
    "summary": {
      "type": "object",
      "properties": {
        "applicationCertificateAuthorityCount": {
          "type": "number"
        },
        "dashboardCount": {
          "type": "number"
        },
        "deviceCount": {
          "type": "number"
        },
        "deviceRecipeCount": {
          "type": "number"
        },
        "dataTableCount": {
          "type": "number"
        },
        "experienceGroupCount": {
          "type": "number"
        },
        "experienceUserCount": {
          "type": "number"
        },
        "experienceVersionCount": {
          "type": "number"
        },
        "experienceViewCount": {
          "type": "number"
        }