Schemas

API Token

Schema for a single 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
    }
  }
}

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

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
}

Example

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


Application

Schema for a single 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"
    },
    "ownerId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "ownerType": {
      "type": "string",
      "enum": [
        "user",
        "organization"
      ]
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "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
          }
        },
        "additionalProperties": false,
        "required": [
          "key",
          "json"
        ]
      }
    },
    "summary": {
      "type": "object",
      "properties": {
        "apiTokenCount": {
          "type": "number"
        },
        "keyCount": {
          "type": "number"
        },
        "deviceCount": {
          "type": "number"
        },
        "dataTableCount": {
          "type": "number"
        },
        "deviceRecipeCount": {
          "type": "number"
        },
        "eventCount": {
          "type": "number"
        },
        "experienceDomainCount": {
          "type": "number"
        },
        "experienceEndpointCount": {
          "type": "number"
        },
        "experienceGroupCount": {
          "type": "number"
        },
        "experienceUserCount": {
          "type": "number"
        },
        "experienceViewCount": {
          "type": "number"
        },
        "fileCount": {
          "type": "number"
        },
        "flowCount": {
          "type": "number"
        },
        "integrationCount": {
          "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
        },
        "s3": {
          "type": "object",
          "properties": {
            "bucket": {
              "type": "string",
              "max": 255
            },
            "accessKeyId": {
              "type": "string",
              "min": 16,
              "max": 128
            },
            "secretAccessKey": {
              "type": "string",
              "min": 16,
              "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": 50
            },
            "bucket": {
              "type": "string",
              "max": 255
            }
          },
          "required": [
            "projectId",
            "keyJson",
            "bucket"
          ],
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    }
  }
}

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

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.*",
          "applicationKey.*",
          "applicationKeys.*",
          "data.*",
          "dataTable.*",
          "dataTables.*",
          "dataTableRow.*",
          "dataTableRows.*",
          "device.*",
          "deviceRecipe.*",
          "deviceRecipes.*",
          "devices.*",
          "edgeDeployments.*",
          "event.*",
          "events.*",
          "experience.*",
          "experienceDomain.*",
          "experienceDomains.*",
          "experienceEndpoint.*",
          "experienceEndpoints.*",
          "experienceGroup.*",
          "experienceGroups.*",
          "experienceUser.*",
          "experienceUsers.*",
          "experienceView.*",
          "experienceViews.*",
          "integration.*",
          "integrations.*",
          "file.*",
          "files.*",
          "flow.*",
          "flows.*",
          "flowVersion.*",
          "flowVersions.*",
          "webhook.*",
          "webhooks.*",
          "application.archiveData",
          "application.backfillArchiveData",
          "application.debug",
          "application.delete",
          "application.get",
          "application.patch",
          "application.payloadCounts",
          "applicationApiToken.delete",
          "applicationApiToken.get",
          "applicationApiToken.patch",
          "applicationApiTokens.get",
          "applicationApiTokens.post",
          "applicationKey.delete",
          "applicationKey.get",
          "applicationKey.patch",
          "applicationKeys.get",
          "applicationKeys.post",
          "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.detailedSummary",
          "devices.export",
          "devices.get",
          "devices.post",
          "devices.sendCommand",
          "edgeDeployments.get",
          "edgeDeployments.release",
          "edgeDeployments.remove",
          "edgeDeployments.replace",
          "event.delete",
          "event.get",
          "event.patch",
          "events.get",
          "events.mostRecentBySeverity",
          "events.patch",
          "events.post",
          "experience.delete",
          "experienceDomain.delete",
          "experienceDomain.get",
          "experienceDomain.patch",
          "experienceDomains.get",
          "experienceDomains.post",
          "experienceEndpoint.delete",
          "experienceEndpoint.get",
          "experienceEndpoint.patch",
          "experienceEndpoints.get",
          "experienceEndpoints.post",
          "experienceEndpoints.stats",
          "experienceGroup.delete",
          "experienceGroup.get",
          "experienceGroup.patch",
          "experienceGroups.detailedSummary",
          "experienceGroups.get",
          "experienceGroups.post",
          "experienceUser.delete",
          "experienceUser.get",
          "experienceUser.patch",
          "experienceUsers.detailedSummary",
          "experienceUsers.get",
          "experienceUsers.post",
          "experienceView.debug",
          "experienceView.delete",
          "experienceView.get",
          "experienceView.patch",
          "experienceViews.debug",
          "experienceViews.detailedSummary",
          "experienceViews.get",
          "experienceViews.post",
          "file.get",
          "file.patch",
          "file.move",
          "file.delete",
          "files.get",
          "files.post",
          "flow.debug",
          "flow.delete",
          "flow.clearStorageEntries",
          "flow.get",
          "flow.getStorageEntries",
          "flow.log",
          "flow.patch",
          "flow.pressVirtualButton",
          "flow.setStorageEntry",
          "flows.get",
          "flows.import",
          "flows.post",
          "flowVersion.delete",
          "flowVersion.get",
          "flowVersion.log",
          "flowVersion.patch",
          "flowVersions.get",
          "flowVersions.post",
          "integration.delete",
          "integration.get",
          "integration.patch",
          "integrations.get",
          "integrations.post",
          "webhook.delete",
          "webhook.get",
          "webhook.patch",
          "webhooks.get",
          "webhooks.post"
        ]
      }
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "inactive"
      ]
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}

Example

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


Application Key

Schema for a single 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
    }
  }
}

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"
}


Application Key Patch

Schema for the body of an Application Key modification request

Schema

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

Example

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


Application Key Post

Schema for the body of an Application Key creation request

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
    }
  },
  "additionalProperties": false
}

Example

{
  "description": "An example new key description"
}


Application Key Post Response

Schema for a response of Application Key creation

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
    }
  }
}

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"
}


Application Keys

Schema for a collection of 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
          }
        }
      }
    },
    "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"
      ]
    },
    "applicationId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    }
  }
}

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"
    }
  ],
  "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

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "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
          }
        },
        "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
        },
        "s3": {
          "type": "object",
          "properties": {
            "bucket": {
              "type": "string",
              "max": 255
            },
            "accessKeyId": {
              "type": "string",
              "min": 16,
              "max": 128
            },
            "secretAccessKey": {
              "type": "string",
              "min": 16,
              "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": 50
            },
            "bucket": {
              "type": "string",
              "max": 255
            }
          },
          "required": [
            "projectId",
            "keyJson",
            "bucket"
          ],
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}

Example

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


Application Post

Schema for the body of an Application creation request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "orgId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "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
          }
        },
        "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
        },
        "s3": {
          "type": "object",
          "properties": {
            "bucket": {
              "type": "string",
              "max": 255
            },
            "accessKeyId": {
              "type": "string",
              "min": 16,
              "max": 128
            },
            "secretAccessKey": {
              "type": "string",
              "min": 16,
              "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": 50
            },
            "bucket": {
              "type": "string",
              "max": 255
            }
          },
          "required": [
            "projectId",
            "keyJson",
            "bucket"
          ],
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}

Example

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


Applications

Schema for a collection of Applications

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "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"
          },
          "ownerId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "ownerType": {
            "type": "string",
            "enum": [
              "user",
              "organization"
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "description": {
            "type": "string",
            "maxLength": 32767
          },
          "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
                }
              },
              "additionalProperties": false,
              "required": [
                "key",
                "json"
              ]
            }
          },
          "summary": {
            "type": "object",
            "properties": {
              "apiTokenCount": {
                "type": "number"
              },
              "keyCount": {
                "type": "number"
              },
              "deviceCount": {
                "type": "number"
              },
              "dataTableCount": {
                "type": "number"
              },
              "deviceRecipeCount": {
                "type": "number"
              },
              "eventCount": {
                "type": "number"
              },
              "experienceDomainCount": {
                "type": "number"
              },
              "experienceEndpointCount": {
                "type": "number"
              },
              "experienceGroupCount": {
                "type": "number"
              },
              "experienceUserCount": {
                "type": "number"
              },
              "experienceViewCount": {
                "type": "number"
              },
              "fileCount": {
                "type": "number"
              },
              "flowCount": {
                "type": "number"
              },
              "integrationCount": {
                "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
              },
              "s3": {
                "type": "object",
                "properties": {
                  "bucket": {
                    "type": "string",
                    "max": 255
                  },
                  "accessKeyId": {
                    "type": "string",
                    "min": 16,
                    "max": 128
                  },
                  "secretAccessKey": {
                    "type": "string",
                    "min": 16,
                    "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": 50
                  },
                  "bucket": {
                    "type": "string",
                    "max": 255
                  }
                },
                "required": [
                  "projectId",
                  "keyJson",
                  "bucket"
                ],
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          }
        }
      }
    },
    "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"
      ]
    }
  }
}

Example

{
  "items": [
    {
      "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"
        ]
      }
    }
  ],
  "count": 1,
  "totalCount": 8,
  "perPage": 1,
  "page": 0,
  "sortField": "name",
  "sortDirection": "asc"
}


Audit Log

Schema for a single Audit Log entry

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "auditLogId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "creationDate": {
      "type": "string",
      "format": "date-time"
    },
    "orgId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "primaryTargetId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "primaryTargetType": {
      "type": "string",
      "enum": [
        "Application",
        "Dashboard",
        "Solution",
        "OrgInvite"
      ]
    },
    "primaryTargetName": {
      "type": "string",
      "maxLength": 1024
    },
    "secondaryTargetId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "secondaryTargetType": {
      "type": "string",
      "enum": [
        "ApiToken",
        "ApplicationKey",
        "DataTable",
        "Device",
        "DeviceRecipe",
        "Event",
        "ExperienceDomain",
        "ExperienceEndpoint",
        "ExperienceGroup",
        "ExperienceView",
        "ExperienceUser",
        "File",
        "Flow",
        "SolutionUser",
        "Integration",
        "Webhook"
      ]
    },
    "secondaryTargetName": {
      "type": "string",
      "maxLength": 1024
    },
    "actorId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "actorType": {
      "type": "string",
      "enum": [
        "Application",
        "Device",
        "Flow",
        "SolutionUser",
        "User",
        "ApiToken"
      ]
    },
    "actorName": {
      "type": "string",
      "maxLength": 1024
    },
    "requestResource": {
      "type": "string",
      "maxLength": 1024
    },
    "requestAction": {
      "type": "string",
      "maxLength": 1024
    },
    "requestQueryParams": {
      "type": "object"
    },
    "requestBody": {
      "type": "object"
    },
    "requestPathParams": {
      "type": "object"
    },
    "responseBody": {
      "type": "object"
    },
    "responseStatus": {
      "type": "integer",
      "minimum": 100,
      "maximum": 599
    }
  }
}

Example

{
  "id": "586e9d5151265cb9d72f6ec6",
  "auditLogId": "586e9d5151265cb9d72f6ec6",
  "creationDate": "2016-06-13T04:00:00.000Z",
  "orgId": "575ed6e87ae143cd83dc4aa8",
  "primaryTargetId": "575ec8687ae143cd83dc4a97",
  "primaryTargetType": "Application",
  "primaryTargetName": "My Application",
  "actorId": "575ed70c7ae143cd83dc4aa9",
  "actorType": "User",
  "actorName": "example@losant.com",
  "requestResource": "application",
  "requestAction": "delete",
  "requestQueryParams": {},
  "requestBody": {},
  "requestPathParams": {
    "applicationId": "575ec8687ae143cd83dc4a97"
  },
  "responseBody": {
    "success": true
  },
  "responseStatus": 200
}


Audit Log Filter

Schema for the filter of an audit log query

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "primaryTarget": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "type": {
            "type": "string",
            "enum": [
              "Application",
              "Dashboard",
              "Solution",
              "OrgInvite"
            ]
          },
          "name": {
            "type": "string",
            "maxLength": 1024
          }
        },
        "additionalProperties": false
      }
    },
    "secondaryTarget": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "type": {
            "type": "string",
            "enum": [
              "ApiToken",
              "ApplicationKey",
              "DataTable",
              "Device",
              "DeviceRecipe",
              "Event",
              "ExperienceDomain",
              "ExperienceEndpoint",
              "ExperienceGroup",
              "ExperienceView",
              "ExperienceUser",
              "File",
              "Flow",
              "SolutionUser",
              "Integration",
              "Webhook"
            ]
          },
          "name": {
            "type": "string",
            "maxLength": 1024
          }
        },
        "additionalProperties": false
      }
    },
    "actor": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "type": {
            "type": "string",
            "enum": [
              "Application",
              "Device",
              "Flow",
              "SolutionUser",
              "User",
              "ApiToken"
            ]
          },
          "name": {
            "type": "string",
            "maxLength": 1024
          }
        },
        "additionalProperties": false
      }
    },
    "request": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "resource": {
            "type": "string",
            "maxLength": 1024
          },
          "action": {
            "type": "string",
            "maxLength": 1024
          }
        },
        "additionalProperties": false
      }
    },
    "responseCode": {
      "type": "array",
      "items": {
        "type": "integer",
        "minimum": 100,
        "maximum": 599
      }
    }
  },
  "additionalProperties": false
}

Example

{
  "primaryTarget": [
    {
      "type": "Dashboard"
    },
    {
      "type": "Application",
      "id": "575ec8687ae143cd83dc4a97"
    }
  ],
  "actor": [
    {
      "type": "User",
      "id": "575ed70c7ae143cd83dc4aa9"
    }
  ]
}


Audit Logs

Schema for a collection of Audit Logs

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "title": "Audit Log",
        "description": "Schema for a single Audit Log entry",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "auditLogId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "creationDate": {
            "type": "string",
            "format": "date-time"
          },
          "orgId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "primaryTargetId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "primaryTargetType": {
            "type": "string",
            "enum": [
              "Application",
              "Dashboard",
              "Solution",
              "OrgInvite"
            ]
          },
          "primaryTargetName": {
            "type": "string",
            "maxLength": 1024
          },
          "secondaryTargetId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "secondaryTargetType": {
            "type": "string",
            "enum": [
              "ApiToken",
              "ApplicationKey",
              "DataTable",
              "Device",
              "DeviceRecipe",
              "Event",
              "ExperienceDomain",
              "ExperienceEndpoint",
              "ExperienceGroup",
              "ExperienceView",
              "ExperienceUser",
              "File",
              "Flow",
              "SolutionUser",
              "Integration",
              "Webhook"
            ]
          },
          "secondaryTargetName": {
            "type": "string",
            "maxLength": 1024
          },
          "actorId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "actorType": {
            "type": "string",
            "enum": [
              "Application",
              "Device",
              "Flow",
              "SolutionUser",
              "User",
              "ApiToken"
            ]
          },
          "actorName": {
            "type": "string",
            "maxLength": 1024
          },
          "requestResource": {
            "type": "string",
            "maxLength": 1024
          },
          "requestAction": {
            "type": "string",
            "maxLength": 1024
          },
          "requestQueryParams": {
            "type": "object"
          },
          "requestBody": {
            "type": "object"
          },
          "requestPathParams": {
            "type": "object"
          },
          "responseBody": {
            "type": "object"
          },
          "responseStatus": {
            "type": "integer",
            "minimum": 100,
            "maximum": 599
          }
        }
      }
    },
    "count": {
      "type": "integer"
    },
    "totalCount": {
      "type": "integer"
    },
    "perPage": {
      "type": "integer"
    },
    "page": {
      "type": "integer"
    },
    "sortField": {
      "type": "string"
    },
    "sortDirection": {
      "type": "string",
      "enum": [
        "asc",
        "desc"
      ]
    },
    "orgId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    }
  }
}

Example

{
  "items": [
    {
      "id": "586e9d5151265cb9d72f6ec6",
      "auditLogId": "586e9d5151265cb9d72f6ec6",
      "creationDate": "2016-06-13T04:00:00.000Z",
      "orgId": "575ed6e87ae143cd83dc4aa8",
      "primaryTargetId": "575ec8687ae143cd83dc4a97",
      "primaryTargetType": "Application",
      "primaryTargetName": "My Application",
      "actorId": "575ed70c7ae143cd83dc4aa9",
      "actorType": "User",
      "actorName": "example@losant.com",
      "requestResource": "application",
      "requestAction": "delete",
      "requestQueryParams": {},
      "requestBody": {},
      "requestPathParams": {
        "applicationId": "575ec8687ae143cd83dc4a97"
      },
      "responseBody": {
        "success": true
      },
      "responseStatus": 200
    }
  ],
  "count": 1,
  "totalCount": 4,
  "perPage": 1,
  "page": 0,
  "sortField": "creationDate",
  "sortDirection": "desc",
  "orgId": "575ed6e87ae143cd83dc4aa8"
}


Authenticated Device

Schema for the successful response when authenticating a Device

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "applicationId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "deviceId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "deviceClass": {
      "type": "string",
      "enum": [
        "standalone",
        "gateway",
        "peripheral",
        "floating",
        "edgeCompute"
      ]
    },
    "token": {
      "type": "string",
      "minLength": 1
    }
  },
  "required": [
    "applicationId",
    "deviceId",
    "deviceClass",
    "token"
  ]
}

Example

{
  "applicationId": "575ec8687ae143cd83dc4a97",
  "deviceId": "575ecf887ae143cd83dc4aa2",
  "deviceClass": "standalone",
  "token": "token_to_use_for_authenticating_subsequent_requests"
}


Authenticated Solution User

Schema for the successful response when authenticating a Solution User

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "solutionUserId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "token": {
      "type": "string",
      "minLength": 1
    }
  },
  "required": [
    "solutionUserId",
    "token"
  ]
}

Example

{
  "solutionUserId": "566116085df4b701000258e3",
  "token": "token_to_use_for_authenticating_subsequent_requests"
}


Authenticated User

Schema for the successful response when authenticating a User

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "userId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "token": {
      "type": "string",
      "minLength": 1
    }
  },
  "required": [
    "userId",
    "token"
  ]
}

Example

{
  "userId": "575ed70c7ae143cd83dc4aa9",
  "token": "token_to_use_for_authenticating_subsequent_requests"
}


Change Password

Schema for the body of a request to change the current user's password

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "twoFactorCode": {
      "type": "string",
      "maxLength": 2048
    },
    "password": {
      "type": "string",
      "minLength": 8,
      "maxLength": 2048
    },
    "newPassword": {
      "type": "string",
      "minLength": 8,
      "maxLength": 2048,
      "pattern": "^(?=.*[A-Z])(?=.*[^A-z0-9])(?=.*[0-9])(?=.*[a-z]).{8,}$"
    },
    "invalidateExistingTokens": {
      "type": "boolean"
    },
    "tokenTTL": {
      "type": "integer",
      "minimum": 0
    }
  },
  "required": [
    "password",
    "newPassword"
  ],
  "additionalProperties": false
}

Example

{
  "newPassword": "yourNewPassword",
  "password": "yourCurrentPassword",
  "invalidateExistingTokens": true
}


Composite Device State

Schema for a composite Device state

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "patternProperties": {
    "^[0-9a-zA-Z_-]{1,255}$": {
      "type": "object",
      "properties": {
        "value": {
          "type": [
            "number",
            "string",
            "boolean"
          ]
        },
        "time": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            },
            {
              "type": "object",
              "properties": {
                "$date": {
                  "type": "string"
                }
              },
              "additionalProperties": false,
              "required": [
                "$date"
              ]
            }
          ]
        },
        "relayId": {
          "type": "string"
        }
      }
    }
  },
  "additionalProperties": false
}

Example

{
  "voltage": {
    "time": "2016-06-13T04:00:00.000Z",
    "value": 22.4
  },
  "loaded": {
    "time": "2016-06-13T03:00:00.000Z",
    "value": false
  }
}


Dashboard

Schema for a single Dashboard

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "dashboardId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "creationDate": {
      "type": "string",
      "format": "date-time"
    },
    "lastUpdated": {
      "type": "string",
      "format": "date-time"
    },
    "ownerId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "ownerType": {
      "type": "string",
      "enum": [
        "user",
        "organization"
      ]
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "refreshRate": {
      "type": "number",
      "minimum": 5,
      "maximum": 600
    },
    "defaultTheme": {
      "type": "string",
      "enum": [
        "dark",
        "light"
      ]
    },
    "isPasswordProtected": {
      "type": "boolean"
    },
    "public": {
      "type": "boolean"
    },
    "reportConfigs": {
      "type": "array",
      "max": 10,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "cron",
          "toEmail"
        ],
        "properties": {
          "id": {
            "type": "string",
            "max": 14
          },
          "cron": {
            "type": "string",
            "max": 255
          },
          "toEmail": {
            "type": "array",
            "min": 1,
            "max": 10,
            "items": {
              "type": "string",
              "format": "email",
              "maxLength": 1024
            }
          },
          "subject": {
            "type": "string",
            "max": 255
          },
          "message": {
            "type": "string",
            "max": 32767
          },
          "theme": {
            "type": "string",
            "enum": [
              "dark",
              "light"
            ]
          },
          "timezone": {
            "type": "string",
            "max": 255
          }
        }
      }
    },
    "blocks": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 255
          },
          "blockType": {
            "type": "string",
            "enum": [
              "application-list",
              "bar",
              "custom-chart",
              "dashboard-list",
              "data-table",
              "device-list",
              "device-log",
              "device-state-table",
              "event-list",
              "gauge",
              "graph",
              "heatmap",
              "iframe",
              "indicator",
              "input",
              "map",
              "open-event-indicator",
              "pie",
              "position-chart",
              "section-header",
              "workflow-list"
            ]
          },
          "title": {
            "type": "string",
            "maxLength": 255
          },
          "description": {
            "type": "string",
            "maxLength": 32767
          },
          "applicationId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "startX": {
            "type": "number"
          },
          "startY": {
            "type": "number"
          },
          "width": {
            "type": "number"
          },
          "height": {
            "type": "number"
          },
          "config": {
            "type": "object"
          }
        },
        "required": [
          "blockType",
          "startX",
          "startY",
          "width",
          "height"
        ],
        "additionalProperties": false
      }
    },
    "contextConfiguration": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "pattern": "^[0-9a-zA-Z_-]{1,255}$"
          },
          "type": {
            "type": "string",
            "enum": [
              "deviceAttribute",
              "deviceId",
              "deviceTag",
              "number",
              "string"
            ]
          },
          "applicationId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "defaultValue": {
            "oneOf": [
              {
                "type": "string",
                "maxLength": 32767
              },
              {
                "type": "number"
              },
              {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "pattern": "^[0-9a-zA-Z_-]{1,255}$"
                  },
                  "value": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  }
                },
                "additionalProperties": false
              }
            ]
          },
          "validationEnabled": {
            "type": "boolean"
          },
          "validationConfig": {
            "type": "object",
            "properties": {
              "min": {
                "type": "number"
              },
              "max": {
                "type": "number"
              },
              "regExp": {
                "type": "string",
                "maxLength": 1024
              },
              "attributes": {
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[0-9a-zA-Z_-]{1,255}$"
                },
                "maxItems": 100
              },
              "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
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "name",
          "type",
          "defaultValue"
        ],
        "additionalProperties": false
      },
      "maxItems": 100
    }
  }
}

Example

{
  "id": "575ece2b7ae143cd83dc4a9b",
  "dashboardId": "575ece2b7ae143cd83dc4a9b",
  "creationDate": "2016-06-13T04:00:00.000Z",
  "lastUpdated": "2016-06-13T04:00:00.000Z",
  "ownerId": "575ed70c7ae143cd83dc4aa9",
  "ownerType": "user",
  "name": "My Dashboard",
  "description": "The best dashboard description",
  "refreshRate": 60,
  "public": false,
  "blocks": [],
  "reportConfigs": [
    {
      "toEmail": [
        "test@email.com"
      ],
      "cron": "0 0 12 * * MON-FRI *",
      "theme": "dark",
      "subject": "Daily Dashboard Report"
    }
  ]
}


Dashboard Context Instance

Schema for a dashboard context instance

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "patternProperties": {
    "^[0-9a-zA-Z_-]{1,255}$": {
      "oneOf": [
        {
          "type": "string",
          "maxLength": 32767
        },
        {
          "type": "number"
        },
        {
          "type": "object",
          "properties": {
            "key": {
              "type": "string",
              "pattern": "^[0-9a-zA-Z_-]{1,255}$"
            },
            "value": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          },
          "additionalProperties": false
        }
      ]
    }
  },
  "additionalProperties": false
}

Example

{
  "myContextVariable": "myValue",
  "myOtherVariable": "575ecf887ae143cd83dc4aa2"
}


Dashboard Patch

Schema for the body of a Dashboard modification request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "blocks": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 255
          },
          "blockType": {
            "type": "string",
            "enum": [
              "application-list",
              "bar",
              "custom-chart",
              "dashboard-list",
              "data-table",
              "device-list",
              "device-log",
              "device-state-table",
              "event-list",
              "gauge",
              "graph",
              "heatmap",
              "iframe",
              "indicator",
              "input",
              "map",
              "open-event-indicator",
              "pie",
              "position-chart",
              "section-header",
              "workflow-list"
            ]
          },
          "title": {
            "type": "string",
            "maxLength": 255
          },
          "description": {
            "type": "string",
            "maxLength": 32767
          },
          "applicationId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "startX": {
            "type": "number"
          },
          "startY": {
            "type": "number"
          },
          "width": {
            "type": "number"
          },
          "height": {
            "type": "number"
          },
          "config": {
            "type": "object"
          }
        },
        "required": [
          "blockType",
          "startX",
          "startY",
          "width",
          "height"
        ],
        "additionalProperties": false
      }
    },
    "reportConfigs": {
      "type": "array",
      "max": 10,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "cron",
          "toEmail"
        ],
        "properties": {
          "id": {
            "type": "string",
            "max": 14
          },
          "cron": {
            "type": "string",
            "max": 255
          },
          "toEmail": {
            "type": "array",
            "min": 1,
            "max": 10,
            "items": {
              "type": "string",
              "format": "email",
              "maxLength": 1024
            }
          },
          "subject": {
            "type": "string",
            "max": 255
          },
          "message": {
            "type": "string",
            "max": 32767
          },
          "theme": {
            "type": "string",
            "enum": [
              "dark",
              "light"
            ]
          },
          "timezone": {
            "type": "string",
            "max": 255
          }
        }
      }
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "refreshRate": {
      "type": "number",
      "minimum": 5,
      "maximum": 600
    },
    "defaultTheme": {
      "type": "string",
      "enum": [
        "dark",
        "light"
      ]
    },
    "public": {
      "type": "boolean"
    },
    "password": {
      "type": [
        "string",
        "null"
      ]
    },
    "contextConfiguration": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "pattern": "^[0-9a-zA-Z_-]{1,255}$"
          },
          "type": {
            "type": "string",
            "enum": [
              "deviceAttribute",
              "deviceId",
              "deviceTag",
              "number",
              "string"
            ]
          },
          "applicationId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "defaultValue": {
            "oneOf": [
              {
                "type": "string",
                "maxLength": 32767
              },
              {
                "type": "number"
              },
              {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "pattern": "^[0-9a-zA-Z_-]{1,255}$"
                  },
                  "value": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  }
                },
                "additionalProperties": false
              }
            ]
          },
          "validationEnabled": {
            "type": "boolean"
          },
          "validationConfig": {
            "type": "object",
            "properties": {
              "min": {
                "type": "number"
              },
              "max": {
                "type": "number"
              },
              "regExp": {
                "type": "string",
                "maxLength": 1024
              },
              "attributes": {
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[0-9a-zA-Z_-]{1,255}$"
                },
                "maxItems": 100
              },
              "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
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "name",
          "type",
          "defaultValue"
        ],
        "additionalProperties": false
      },
      "maxItems": 100
    }
  },
  "additionalProperties": false
}

Example

{
  "name": "My Updated Dashboard",
  "description": "Description of my updated dashboard",
  "refreshRate": 300,
  "public": true
}


Dashboard Post

Schema for the body of a Dashboard creation request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "orgId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "blocks": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 255
          },
          "blockType": {
            "type": "string",
            "enum": [
              "application-list",
              "bar",
              "custom-chart",
              "dashboard-list",
              "data-table",
              "device-list",
              "device-log",
              "device-state-table",
              "event-list",
              "gauge",
              "graph",
              "heatmap",
              "iframe",
              "indicator",
              "input",
              "map",
              "open-event-indicator",
              "pie",
              "position-chart",
              "section-header",
              "workflow-list"
            ]
          },
          "title": {
            "type": "string",
            "maxLength": 255
          },
          "description": {
            "type": "string",
            "maxLength": 32767
          },
          "applicationId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "startX": {
            "type": "number"
          },
          "startY": {
            "type": "number"
          },
          "width": {
            "type": "number"
          },
          "height": {
            "type": "number"
          },
          "config": {
            "type": "object"
          }
        },
        "required": [
          "blockType",
          "startX",
          "startY",
          "width",
          "height"
        ],
        "additionalProperties": false
      }
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "refreshRate": {
      "type": "number",
      "minimum": 5,
      "maximum": 600
    },
    "defaultTheme": {
      "type": "string",
      "enum": [
        "dark",
        "light"
      ]
    },
    "reportConfigs": {
      "type": "array",
      "max": 10,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "cron",
          "toEmail"
        ],
        "properties": {
          "id": {
            "type": "string",
            "max": 14
          },
          "cron": {
            "type": "string",
            "max": 255
          },
          "toEmail": {
            "type": "array",
            "min": 1,
            "max": 10,
            "items": {
              "type": "string",
              "format": "email",
              "maxLength": 1024
            }
          },
          "subject": {
            "type": "string",
            "max": 255
          },
          "message": {
            "type": "string",
            "max": 32767
          },
          "theme": {
            "type": "string",
            "enum": [
              "dark",
              "light"
            ]
          },
          "timezone": {
            "type": "string",
            "max": 255
          }
        }
      }
    },
    "public": {
      "type": "boolean"
    },
    "password": {
      "type": [
        "string",
        "null"
      ]
    },
    "contextConfiguration": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "pattern": "^[0-9a-zA-Z_-]{1,255}$"
          },
          "type": {
            "type": "string",
            "enum": [
              "deviceAttribute",
              "deviceId",
              "deviceTag",
              "number",
              "string"
            ]
          },
          "applicationId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "defaultValue": {
            "oneOf": [
              {
                "type": "string",
                "maxLength": 32767
              },
              {
                "type": "number"
              },
              {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "pattern": "^[0-9a-zA-Z_-]{1,255}$"
                  },
                  "value": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  }
                },
                "additionalProperties": false
              }
            ]
          },
          "validationEnabled": {
            "type": "boolean"
          },
          "validationConfig": {
            "type": "object",
            "properties": {
              "min": {
                "type": "number"
              },
              "max": {
                "type": "number"
              },
              "regExp": {
                "type": "string",
                "maxLength": 1024
              },
              "attributes": {
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[0-9a-zA-Z_-]{1,255}$"
                },
                "maxItems": 100
              },
              "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
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "name",
          "type",
          "defaultValue"
        ],
        "additionalProperties": false
      },
      "maxItems": 100
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}

Example

{
  "name": "My New Dashboard",
  "public": false
}


Dashboards

Schema for a collection of Dashboards

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "title": "Dashboard",
        "description": "Schema for a single Dashboard",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "dashboardId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "creationDate": {
            "type": "string",
            "format": "date-time"
          },
          "lastUpdated": {
            "type": "string",
            "format": "date-time"
          },
          "ownerId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "ownerType": {
            "type": "string",
            "enum": [
              "user",
              "organization"
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "description": {
            "type": "string",
            "maxLength": 32767
          },
          "refreshRate": {
            "type": "number",
            "minimum": 5,
            "maximum": 600
          },
          "defaultTheme": {
            "type": "string",
            "enum": [
              "dark",
              "light"
            ]
          },
          "isPasswordProtected": {
            "type": "boolean"
          },
          "public": {
            "type": "boolean"
          },
          "reportConfigs": {
            "type": "array",
            "max": 10,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "cron",
                "toEmail"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "max": 14
                },
                "cron": {
                  "type": "string",
                  "max": 255
                },
                "toEmail": {
                  "type": "array",
                  "min": 1,
                  "max": 10,
                  "items": {
                    "type": "string",
                    "format": "email",
                    "maxLength": 1024
                  }
                },
                "subject": {
                  "type": "string",
                  "max": 255
                },
                "message": {
                  "type": "string",
                  "max": 32767
                },
                "theme": {
                  "type": "string",
                  "enum": [
                    "dark",
                    "light"
                  ]
                },
                "timezone": {
                  "type": "string",
                  "max": 255
                }
              }
            }
          },
          "blocks": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "maxLength": 255
                },
                "blockType": {
                  "type": "string",
                  "enum": [
                    "application-list",
                    "bar",
                    "custom-chart",
                    "dashboard-list",
                    "data-table",
                    "device-list",
                    "device-log",
                    "device-state-table",
                    "event-list",
                    "gauge",
                    "graph",
                    "heatmap",
                    "iframe",
                    "indicator",
                    "input",
                    "map",
                    "open-event-indicator",
                    "pie",
                    "position-chart",
                    "section-header",
                    "workflow-list"
                  ]
                },
                "title": {
                  "type": "string",
                  "maxLength": 255
                },
                "description": {
                  "type": "string",
                  "maxLength": 32767
                },
                "applicationId": {
                  "type": "string",
                  "pattern": "^[A-Fa-f\\d]{24}$"
                },
                "startX": {
                  "type": "number"
                },
                "startY": {
                  "type": "number"
                },
                "width": {
                  "type": "number"
                },
                "height": {
                  "type": "number"
                },
                "config": {
                  "type": "object"
                }
              },
              "required": [
                "blockType",
                "startX",
                "startY",
                "width",
                "height"
              ],
              "additionalProperties": false
            }
          },
          "contextConfiguration": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "pattern": "^[0-9a-zA-Z_-]{1,255}$"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "deviceAttribute",
                    "deviceId",
                    "deviceTag",
                    "number",
                    "string"
                  ]
                },
                "applicationId": {
                  "type": "string",
                  "pattern": "^[A-Fa-f\\d]{24}$"
                },
                "defaultValue": {
                  "oneOf": [
                    {
                      "type": "string",
                      "maxLength": 32767
                    },
                    {
                      "type": "number"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string",
                          "pattern": "^[0-9a-zA-Z_-]{1,255}$"
                        },
                        "value": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                },
                "validationEnabled": {
                  "type": "boolean"
                },
                "validationConfig": {
                  "type": "object",
                  "properties": {
                    "min": {
                      "type": "number"
                    },
                    "max": {
                      "type": "number"
                    },
                    "regExp": {
                      "type": "string",
                      "maxLength": 1024
                    },
                    "attributes": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[0-9a-zA-Z_-]{1,255}$"
                      },
                      "maxItems": 100
                    },
                    "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
                    }
                  },
                  "additionalProperties": false
                }
              },
              "required": [
                "name",
                "type",
                "defaultValue"
              ],
              "additionalProperties": false
            },
            "maxItems": 100
          }
        }
      }
    },
    "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"
      ]
    }
  }
}

Example

{
  "items": [
    {
      "id": "575ece2b7ae143cd83dc4a9b",
      "dashboardId": "575ece2b7ae143cd83dc4a9b",
      "creationDate": "2016-06-13T04:00:00.000Z",
      "lastUpdated": "2016-06-13T04:00:00.000Z",
      "ownerId": "575ed70c7ae143cd83dc4aa9",
      "ownerType": "user",
      "name": "My Dashboard",
      "description": "The best dashboard description",
      "refreshRate": 60,
      "public": false,
      "blocks": [],
      "reportConfigs": [
        {
          "toEmail": [
            "test@email.com"
          ],
          "cron": "0 0 12 * * MON-FRI *",
          "theme": "dark",
          "subject": "Daily Dashboard Report"
        }
      ]
    }
  ],
  "count": 1,
  "totalCount": 5,
  "perPage": 1,
  "page": 0,
  "sortField": "name",
  "sortDirection": "asc"
}


Data Table

Schema for a single Data Table

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "dataTableId": {
      "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"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "columns": {
      "type": "array",
      "items": {
        "title": "Data Table Column",
        "description": "Schema for a single Data Table Column",
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "pattern": "^[0-9a-zA-Z_-]{1,255}$"
          },
          "dataType": {
            "type": "string",
            "enum": [
              "string",
              "number",
              "boolean"
            ]
          },
          "constraint": {
            "type": "string",
            "enum": [
              "unique",
              "required",
              "optional"
            ]
          },
          "defaultValue": {
            "type": [
              "string",
              "number",
              "boolean"
            ]
          }
        },
        "required": [
          "name",
          "dataType",
          "constraint"
        ],
        "additionalProperties": false
      },
      "maxItems": 50
    }
  }
}

Example

{
  "id": "596e6ce831761df4231708f1",
  "dataTableId": "596e6ce831761df4231708f1",
  "applicationId": "575ec8687ae143cd83dc4a97",
  "creationDate": "2016-06-13T04:00:00.000Z",
  "lastUpdated": "2016-06-13T04:00:00.000Z",
  "name": "My Data Table",
  "columns": [
    {
      "name": "myColumn1",
      "dataType": "string",
      "defaultValue": "aDefault"
    }
  ]
}


Data Table Column

Schema for a single Data Table Column

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "pattern": "^[0-9a-zA-Z_-]{1,255}$"
    },
    "dataType": {
      "type": "string",
      "enum": [
        "string",
        "number",
        "boolean"
      ]
    },
    "constraint": {
      "type": "string",
      "enum": [
        "unique",
        "required",
        "optional"
      ]
    },
    "defaultValue": {
      "type": [
        "string",
        "number",
        "boolean"
      ]
    }
  },
  "required": [
    "name",
    "dataType",
    "constraint"
  ],
  "additionalProperties": false
}

Example

{
  "name": "myOptionalColumn",
  "dataType": "string",
  "constraint": "optional",
  "defaultValue": "aDefault"
}


Data Table Patch

Schema for the body of a Data Table modification request

Schema

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

Example

{
  "name": "My Updated Data Table"
}


Data Table Post

Schema for the body of a Data Table creation request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "columns": {
      "type": "array",
      "items": {
        "title": "Data Table Column",
        "description": "Schema for a single Data Table Column",
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "pattern": "^[0-9a-zA-Z_-]{1,255}$"
          },
          "dataType": {
            "type": "string",
            "enum": [
              "string",
              "number",
              "boolean"
            ]
          },
          "constraint": {
            "type": "string",
            "enum": [
              "unique",
              "required",
              "optional"
            ]
          },
          "defaultValue": {
            "type": [
              "string",
              "number",
              "boolean"
            ]
          }
        },
        "required": [
          "name",
          "dataType",
          "constraint"
        ],
        "additionalProperties": false
      },
      "maxItems": 50
    }
  },
  "required": [
    "name"
  ],
  "additionalProperties": false
}

Example

{
  "name": "My Data Table",
  "columns": [
    {
      "name": "myColumn1",
      "dataType": "string",
      "constraint": "unique"
    }
  ]
}


Data Table Query

Schema for a data table query

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "$and": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/dataTableQuery"
      }
    },
    "$or": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/dataTableQuery"
      }
    }
  },
  "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"
              ]
            }
          }
        }
      ]
    }
  },
  "additionalProperties": false
}

Example

{
  "$or": [
    {
      "myCol1": {
        "$ne": 0
      }
    },
    {
      "myCol2": 5
    }
  ]
}


Data Table Row

Schema for a single Data Table Row

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "patternProperties": {
    "^[0-9a-zA-Z_-]{1,255}$": {
      "type": [
        "string",
        "number",
        "boolean",
        "null"
      ]
    }
  }
}

Example

{
  "id": "596fbb703fc088453872e609",
  "creationDate": "2016-06-13T04:00:00.000Z",
  "lastUpdated": "2016-06-13T04:00:00.000Z",
  "myColumn": "myValue"
}


Data Table Row Insert/Update

Schema for inserting or updating a data table row

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "patternProperties": {
    "^[0-9a-zA-Z_-]{1,255}$": {
      "type": [
        "string",
        "number",
        "boolean",
        "null"
      ]
    }
  },
  "additionalProperties": false
}

Example

{
  "myColumn1": "myValue"
}


Data Table Rows

Schema for a collection of Data Table Rows

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "title": "Data Table Row",
        "description": "Schema for a single Data Table Row",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "patternProperties": {
          "^[0-9a-zA-Z_-]{1,255}$": {
            "type": [
              "string",
              "number",
              "boolean",
              "null"
            ]
          }
        }
      }
    },
    "count": {
      "type": "integer"
    },
    "totalCount": {
      "type": "integer"
    },
    "limit": {
      "type": "integer"
    },
    "offset": {
      "type": "integer"
    },
    "sortColumn": {
      "type": "string"
    },
    "sortDirection": {
      "type": "string",
      "enum": [
        "asc",
        "desc"
      ]
    },
    "dataTableId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "applicationId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    }
  }
}

Example

{
  "items": [
    {
      "id": "596fbb703fc088453872e609",
      "creationDate": "2016-06-13T04:00:00.000Z",
      "lastUpdated": "2016-06-13T04:00:00.000Z",
      "myColumn": "myValue"
    }
  ],
  "count": 1,
  "totalCount": 4,
  "offset": 0,
  "limit": 1,
  "sortColumn": "myColumn1",
  "sortDirection": "asc",
  "dataTableId": "596e6ce831761df4231708f1",
  "applicationId": "575ec8687ae143cd83dc4a97"
}


Data Table Rows Delete

Schema for response to data table rows removal

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "removed": {
      "type": "Number"
    }
  }
}

Example

{
  "removed": 100
}


Data Table Export

Schema for the body of a data table export

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "format": "email",
      "maxLength": 1024
    },
    "query": {
      "title": "Data Table Query",
      "description": "Schema for a data table query",
      "type": "object",
      "properties": {
        "$and": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/dataTableQuery"
          }
        },
        "$or": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/dataTableQuery"
          }
        }
      },
      "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"
                  ]
                }
              }
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "queryOptions": {
      "type": "object",
      "properties": {
        "sortDirection": {
          "type": "string",
          "enum": [
            "desc",
            "asc"
          ]
        },
        "limit": {
          "type": "number"
        },
        "sortColumn": {
          "type": "string"
        },
        "offset": {
          "type": "number"
        }
      }
    }
  },
  "additionalProperties": false
}

Example

{
  "email": "email@example.com",
  "query": {
    "$or": [
      {
        "myCol1": {
          "$ne": 0
        }
      },
      {
        "myCol2": 5
      }
    ]
  },
  "queryOptions": {
    "limit": 10000
  }
}


Data Tables

Schema for a collection of Data Tables

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "title": "Data Table",
        "description": "Schema for a single Data Table",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "dataTableId": {
            "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"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "description": {
            "type": "string",
            "maxLength": 32767
          },
          "columns": {
            "type": "array",
            "items": {
              "title": "Data Table Column",
              "description": "Schema for a single Data Table Column",
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "pattern": "^[0-9a-zA-Z_-]{1,255}$"
                },
                "dataType": {
                  "type": "string",
                  "enum": [
                    "string",
                    "number",
                    "boolean"
                  ]
                },
                "constraint": {
                  "type": "string",
                  "enum": [
                    "unique",
                    "required",
                    "optional"
                  ]
                },
                "defaultValue": {
                  "type": [
                    "string",
                    "number",
                    "boolean"
                  ]
                }
              },
              "required": [
                "name",
                "dataType",
                "constraint"
              ],
              "additionalProperties": false
            },
            "maxItems": 50
          }
        }
      }
    },
    "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"
      ]
    },
    "applicationId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    }
  }
}

Example

{
  "items": [
    {
      "id": "596e6ce831761df4231708f1",
      "dataTableId": "596e6ce831761df4231708f1",
      "applicationId": "575ec8687ae143cd83dc4a97",
      "creationDate": "2016-06-13T04:00:00.000Z",
      "lastUpdated": "2016-06-13T04:00:00.000Z",
      "name": "My Data Table",
      "columns": [
        {
          "name": "myColumn1",
          "dataType": "string",
          "defaultValue": "aDefault"
        }
      ]
    }
  ],
  "count": 1,
  "totalCount": 4,
  "perPage": 1,
  "page": 0,
  "sortField": "name",
  "sortDirection": "asc",
  "applicationId": "575ec8687ae143cd83dc4a97"
}


Device

Schema for a single Device

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "deviceId": {
      "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"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[0-9a-zA-Z_-]{1,255}$"
          },
          "value": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          }
        },
        "required": [
          "key",
          "value"
        ],
        "additionalProperties": false
      },
      "maxItems": 100
    },
    "attributes": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "pattern": "^[0-9a-zA-Z_-]{1,255}$"
          },
          "dataType": {
            "type": "string",
            "enum": [
              "string",
              "number",
              "gps",
              "boolean"
            ]
          }
        },
        "required": [
          "name",
          "dataType"
        ],
        "additionalProperties": false
      },
      "maxItems": 256
    },
    "deviceClass": {
      "type": "string",
      "enum": [
        "standalone",
        "gateway",
        "peripheral",
        "floating",
        "edgeCompute"
      ]
    },
    "gatewayId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "edgeAgentVersion": {
      "type": "string",
      "pattern": "^(0|([1-9]\\d*))\\.(0|([1-9]\\d*))\\.(0|([1-9]\\d*))$"
    },
    "connectionInfo": {
      "type": "object",
      "properties": {
        "time": {
          "type": "string",
          "format": "date-time"
        },
        "connected": {
          "enum": [
            1,
            0,
            null
          ]
        }
      }
    }
  }
}

Example

{
  "id": "575ecf887ae143cd83dc4aa2",
  "deviceId": "575ecf887ae143cd83dc4aa2",
  "applicationId": "575ec8687ae143cd83dc4a97",
  "creationDate": "2016-06-13T04:00:00.000Z",
  "lastUpdated": "2016-06-13T04:00:00.000Z",
  "name": "My Device",
  "description": "A device description",
  "tags": [
    {
      "key": "TagKey",
      "value": "TagValue"
    },
    {
      "key": "floor",
      "value": "8"
    }
  ],
  "attributes": [
    {
      "name": "voltage",
      "dataType": "number"
    }
  ],
  "deviceClass": "standalone",
  "connectionInfo": {
    "time": "2016-06-14T08:15:00.000Z",
    "connected": 1
  }
}


Device Command

Schema for a command for a single Device

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "time": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "number"
        },
        {
          "type": "object",
          "properties": {
            "$date": {
              "type": "string"
            }
          },
          "additionalProperties": false,
          "required": [
            "$date"
          ]
        }
      ]
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "payload": {}
  },
  "required": [
    "name"
  ],
  "additionalProperties": false
}

Example

{
  "time": "2016-06-13T04:00:00.000Z",
  "name": "myCommand",
  "payload": [
    1,
    1,
    2,
    3,
    5
  ]
}


Device Commands

Schema for an array of Device Commands

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array",
  "items": {
    "title": "Device Command",
    "description": "Schema for a command for a single Device",
    "type": "object",
    "properties": {
      "time": {
        "oneOf": [
          {
            "type": "string"
          },
          {
            "type": "number"
          },
          {
            "type": "object",
            "properties": {
              "$date": {
                "type": "string"
              }
            },
            "additionalProperties": false,
            "required": [
              "$date"
            ]
          }
        ]
      },
      "name": {
        "type": "string",
        "minLength": 1,
        "maxLength": 255
      },
      "payload": {}
    },
    "required": [
      "name"
    ],
    "additionalProperties": false
  }
}

Example

[
  {
    "time": "2016-06-13T04:00:00.000Z",
    "name": "myCommand",
    "payload": [
      1,
      1,
      2,
      3,
      5
    ]
  },
  {
    "time": "2016-06-13T04:00:00.000Z",
    "name": "myCommand",
    "payload": [
      1,
      1,
      2,
      3,
      5
    ]
  }
]


Device Connection Status

Schema for the body of a request to set a device's connection status

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "oneOf": [
    {
      "title": "Device Connected",
      "description": "Schema for marking a device as connected",
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "connected"
          ]
        },
        "connectedAt": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            },
            {
              "type": "object",
              "properties": {
                "$date": {
                  "type": "string"
                }
              },
              "additionalProperties": false,
              "required": [
                "$date"
              ]
            }
          ]
        }
      },
      "required": [
        "status"
      ],
      "additionalProperties": false
    },
    {
      "title": "Device Disconnected",
      "description": "Schema for marking a device as disconnected",
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "disconnected"
          ]
        },
        "connectedAt": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            },
            {
              "type": "object",
              "properties": {
                "$date": {
                  "type": "string"
                }
              },
              "additionalProperties": false,
              "required": [
                "$date"
              ]
            }
          ]
        },
        "disconnectedAt": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            },
            {
              "type": "object",
              "properties": {
                "$date": {
                  "type": "string"
                }
              },
              "additionalProperties": false,
              "required": [
                "$date"
              ]
            }
          ]
        },
        "disconnectReason": {
          "type": "string",
          "maxLength": 1024
        },
        "messagesFromClient": {
          "type": "number"
        },
        "messagesToClient": {
          "type": "number"
        }
      },
      "required": [
        "status"
      ],
      "additionalProperties": false
    }
  ]
}

Example

{
  "status": "connected"
}


Device Credentials

Schema for the body of a Device authentication request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "deviceId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "key": {
      "type": "string"
    },
    "secret": {
      "type": "string"
    },
    "tokenTTL": {
      "type": "integer",
      "minimum": 0
    },
    "requestedScopes": {
      "type": "array",
      "uniqueItems": true,
      "items": {
        "type": "string",
        "enum": [
          "all.Device",
          "all.Device.read",
          "data.timeSeriesQuery",
          "data.lastValueQuery",
          "device.commandStream",
          "device.get",
          "device.getCompositeState",
          "device.getState",
          "device.stateStream",
          "device.getLogEntries",
          "device.getCommand",
          "device.debug",
          "device.sendState",
          "device.sendCommand",
          "device.setConnectionStatus",
          "devices.get",
          "devices.sendCommand"
        ]
      }
    }
  },
  "required": [
    "deviceId",
    "key",
    "secret"
  ],
  "additionalProperties": false
}

Example

{
  "deviceId": "575ecf887ae143cd83dc4aa2",
  "key": "this_would_be_the_key",
  "secret": "this_would_be_the_secret"
}


Device Log

Log of connection information for a Device

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "connected": {
        "enum": [
          1,
          0
        ]
      },
      "time": {
        "type": "string",
        "format": "date-time"
      },
      "disconnectReason": {
        "type": "string"
      },
      "messagesFromClient": {
        "type": "number"
      },
      "messagesToClient": {
        "type": "number"
      }
    }
  }
}

Example

[
  {
    "connected": 1,
    "time": "2016-06-03T00:56:22.447Z"
  },
  {
    "connected": 0,
    "disconnectReason": "Connection Lost",
    "messagesFromClient": 2548,
    "messagesToClient": 0,
    "time": "2016-06-03T00:56:21.028Z"
  },
  {
    "connected": 1,
    "time": "2016-06-01T06:24:39.190Z"
  },
  {
    "connected": 0,
    "disconnectReason": "Connection Lost",
    "messagesFromClient": 479,
    "messagesToClient": 0,
    "time": "2016-06-01T06:24:37.925Z"
  },
  {
    "connected": 1,
    "time": "2016-05-31T22:24:48.777Z"
  }
]


Device Patch

Schema for the body of a Device modification request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[0-9a-zA-Z_-]{1,255}$"
          },
          "value": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          }
        },
        "required": [
          "key",
          "value"
        ],
        "additionalProperties": false
      },
      "maxItems": 100
    },
    "attributes": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "pattern": "^[0-9a-zA-Z_-]{1,255}$"
          },
          "dataType": {
            "type": "string",
            "enum": [
              "string",
              "number",
              "gps",
              "boolean"
            ]
          }
        },
        "required": [
          "name",
          "dataType"
        ],
        "additionalProperties": false
      },
      "maxItems": 256
    },
    "deviceClass": {
      "type": "string",
      "enum": [
        "standalone",
        "gateway",
        "peripheral",
        "floating",
        "edgeCompute"
      ]
    },
    "gatewayId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    }
  },
  "additionalProperties": false
}

Example

{
  "name": "My Updated Device",
  "description": "Description of my updated device",
  "tags": [
    {
      "key": "TagKey",
      "value": "TagValue"
    }
  ],
  "attributes": [
    {
      "name": "voltage",
      "dataType": "number"
    }
  ],
  "deviceClass": "standalone"
}


Device Post

Schema for the body of a Device creation request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[0-9a-zA-Z_-]{1,255}$"
          },
          "value": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          }
        },
        "required": [
          "key",
          "value"
        ],
        "additionalProperties": false
      },
      "maxItems": 100
    },
    "attributes": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "pattern": "^[0-9a-zA-Z_-]{1,255}$"
          },
          "dataType": {
            "type": "string",
            "enum": [
              "string",
              "number",
              "gps",
              "boolean"
            ]
          }
        },
        "required": [
          "name",
          "dataType"
        ],
        "additionalProperties": false
      },
      "maxItems": 256
    },
    "deviceClass": {
      "type": "string",
      "enum": [
        "standalone",
        "gateway",
        "peripheral",
        "floating",
        "edgeCompute"
      ]
    },
    "gatewayId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}

Example

{
  "name": "My New Device",
  "description": "Description of my new device",
  "tags": [
    {
      "key": "TagKey",
      "value": "TagValue"
    }
  ],
  "attributes": [
    {
      "name": "voltage",
      "dataType": "number"
    }
  ],
  "deviceClass": "standalone"
}


Device Recipe

Schema for a single Device Recipe

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "deviceRecipeId": {
      "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"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "deviceName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "deviceDescription": {
      "type": "string",
      "maxLength": 32767
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[0-9a-zA-Z_-]{1,255}$"
          },
          "value": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          }
        },
        "required": [
          "key",
          "value"
        ],
        "additionalProperties": false
      },
      "maxItems": 100
    },
    "attributes": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "pattern": "^[0-9a-zA-Z_-]{1,255}$"
          },
          "dataType": {
            "type": "string",
            "enum": [
              "string",
              "number",
              "gps",
              "boolean"
            ]
          }
        },
        "required": [
          "name",
          "dataType"
        ],
        "additionalProperties": false
      },
      "maxItems": 256
    },
    "deviceClass": {
      "type": "string",
      "enum": [
        "standalone",
        "gateway",
        "peripheral",
        "floating",
        "edgeCompute"
      ]
    },
    "gatewayId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    }
  }
}

Example

{
  "id": "575ecec57ae143cd83dc4a9f",
  "deviceRecipeId": "575ecec57ae143cd83dc4a9f",
  "applicationId": "575ec8687ae143cd83dc4a97",
  "creationDate": "2016-06-13T04:00:00.000Z",
  "lastUpdated": "2016-06-13T04:00:00.000Z",
  "name": "Actual recipe name",
  "deviceName": "Future device name",
  "description": "My recipe description",
  "deviceDescription": "Future device description",
  "tags": [
    {
      "key": "TagKey",
      "value": "TagValue"
    }
  ],
  "attributes": [
    {
      "name": "voltage",
      "dataType": "number"
    }
  ],
  "deviceClass": "standalone"
}


Device Recipe Bulk Create

Schema for the result of a bulk Device creation request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "created": {
      "type": "number"
    },
    "failed": {
      "type": "number"
    },
    "csvResult": {
      "type": "string"
    }
  }
}

Example

{
  "created": 10,
  "failed": 0,
  "csvResult": "a,comma,separated,string,of,results"
}


Device Recipe Bulk Create Enqueue

Schema for the result of a bulk Device creation request when creating more than 750 devices

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "jobQueued": {
      "type": "boolean"
    }
  }
}

Example

{
  "jobQueued": true
}


Device Recipe Bulk Create Post

Schema for the body of a bulk Device creation request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "nameColumn": {
      "type": "string"
    },
    "descriptionColumn": {
      "type": "string"
    },
    "csv": {
      "type": "string"
    },
    "makeUniqueKeySecret": {
      "type": "boolean"
    },
    "email": {
      "type": "string",
      "format": "email",
      "maxLength": 1024
    }
  },
  "additionalProperties": false,
  "required": [
    "csv"
  ]
}

Example

{
  "nameColumn": "myNameColumn",
  "descriptionColumn": "column2",
  "csv": "a,comma,separated,string,of,input,data"
}


Device Recipe Patch

Schema for the body of a Device Recipe modification request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "deviceName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "deviceDescription": {
      "type": "string",
      "maxLength": 32767
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[0-9a-zA-Z_-]{1,255}$"
          },
          "value": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          }
        },
        "required": [
          "key",
          "value"
        ],
        "additionalProperties": false
      },
      "maxItems": 100
    },
    "attributes": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "pattern": "^[0-9a-zA-Z_-]{1,255}$"
          },
          "dataType": {
            "type": "string",
            "enum": [
              "string",
              "number",
              "gps",
              "boolean"
            ]
          }
        },
        "required": [
          "name",
          "dataType"
        ],
        "additionalProperties": false
      },
      "maxItems": 256
    },
    "deviceClass": {
      "type": "string",
      "enum": [
        "standalone",
        "gateway",
        "peripheral",
        "floating",
        "edgeCompute"
      ]
    },
    "gatewayId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    }
  },
  "additionalProperties": false
}

Example

{
  "name": "My Updated Device Recipe",
  "deviceName": "Future device name",
  "description": "Description of my updated device recipe",
  "deviceDescription": "Future device description",
  "tags": [
    {
      "key": "TagKey",
      "value": "TagValue"
    }
  ],
  "attributes": [
    {
      "name": "voltage",
      "dataType": "number"
    }
  ],
  "deviceClass": "standalone"
}


Device Recipe Post

Schema for the body of a Device Recipe creation request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "deviceName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "deviceDescription": {
      "type": "string",
      "maxLength": 32767
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[0-9a-zA-Z_-]{1,255}$"
          },
          "value": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          }
        },
        "required": [
          "key",
          "value"
        ],
        "additionalProperties": false
      },
      "maxItems": 100
    },
    "attributes": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "pattern": "^[0-9a-zA-Z_-]{1,255}$"
          },
          "dataType": {
            "type": "string",
            "enum": [
              "string",
              "number",
              "gps",
              "boolean"
            ]
          }
        },
        "required": [
          "name",
          "dataType"
        ],
        "additionalProperties": false
      },
      "maxItems": 256
    },
    "deviceClass": {
      "type": "string",
      "enum": [
        "standalone",
        "gateway",
        "peripheral",
        "floating",
        "edgeCompute"
      ]
    },
    "gatewayId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}

Example

{
  "name": "My New Device Recipe",
  "deviceName": "Future device name",
  "description": "Description of my new device recipe",
  "deviceDescription": "Future device description",
  "tags": [
    {
      "key": "TagKey",
      "value": "TagValue"
    }
  ],
  "attributes": [
    {
      "name": "voltage",
      "dataType": "number"
    }
  ],
  "deviceClass": "standalone"
}


Device Recipes

Schema for a collection of Device Recipes

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "title": "Device Recipe",
        "description": "Schema for a single Device Recipe",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "deviceRecipeId": {
            "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"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "deviceName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "description": {
            "type": "string",
            "maxLength": 32767
          },
          "deviceDescription": {
            "type": "string",
            "maxLength": 32767
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string",
                  "pattern": "^[0-9a-zA-Z_-]{1,255}$"
                },
                "value": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 255
                }
              },
              "required": [
                "key",
                "value"
              ],
              "additionalProperties": false
            },
            "maxItems": 100
          },
          "attributes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "pattern": "^[0-9a-zA-Z_-]{1,255}$"
                },
                "dataType": {
                  "type": "string",
                  "enum": [
                    "string",
                    "number",
                    "gps",
                    "boolean"
                  ]
                }
              },
              "required": [
                "name",
                "dataType"
              ],
              "additionalProperties": false
            },
            "maxItems": 256
          },
          "deviceClass": {
            "type": "string",
            "enum": [
              "standalone",
              "gateway",
              "peripheral",
              "floating",
              "edgeCompute"
            ]
          },
          "gatewayId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          }
        }
      }
    },
    "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"
      ]
    },
    "applicationId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    }
  }
}

Example

{
  "items": [
    {
      "id": "575ecec57ae143cd83dc4a9f",
      "deviceRecipeId": "575ecec57ae143cd83dc4a9f",
      "applicationId": "575ec8687ae143cd83dc4a97",
      "creationDate": "2016-06-13T04:00:00.000Z",
      "lastUpdated": "2016-06-13T04:00:00.000Z",
      "name": "Actual recipe name",
      "deviceName": "Future device name",
      "description": "My recipe description",
      "deviceDescription": "Future device description",
      "tags": [
        {
          "key": "TagKey",
          "value": "TagValue"
        }
      ],
      "attributes": [
        {
          "name": "voltage",
          "dataType": "number"
        }
      ],
      "deviceClass": "standalone"
    }
  ],
  "count": 1,
  "totalCount": 4,
  "perPage": 1,
  "page": 0,
  "sortField": "name",
  "sortDirection": "asc",
  "applicationId": "575ec8687ae143cd83dc4a97"
}


Device State

Schema for a single Device state

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "time": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "number"
        },
        {
          "type": "object",
          "properties": {
            "$date": {
              "type": "string"
            }
          },
          "additionalProperties": false,
          "required": [
            "$date"
          ]
        }
      ]
    },
    "relayId": {
      "type": "string"
    },
    "meta": {},
    "data": {
      "type": "object",
      "patternProperties": {
        "^[0-9a-zA-Z_-]{1,255}$": {
          "type": [
            "number",
            "string",
            "boolean"
          ]
        }
      },
      "additionalProperties": false
    },
    "flowVersion": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    }
  },
  "required": [
    "data"
  ],
  "additionalProperties": false
}

Example

{
  "time": "2016-06-13T04:00:00.000Z",
  "data": {
    "voltage": 22.4
  }
}


Single or Multiple Device States

Schema for a single device state or an array of device states

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "oneOf": [
    {
      "title": "Device State",
      "description": "Schema for a single Device state",
      "type": "object",
      "properties": {
        "time": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            },
            {
              "type": "object",
              "properties": {
                "$date": {
                  "type": "string"
                }
              },
              "additionalProperties": false,
              "required": [
                "$date"
              ]
            }
          ]
        },
        "relayId": {
          "type": "string"
        },
        "meta": {},
        "data": {
          "type": "object",
          "patternProperties": {
            "^[0-9a-zA-Z_-]{1,255}$": {
              "type": [
                "number",
                "string",
                "boolean"
              ]
            }
          },
          "additionalProperties": false
        },
        "flowVersion": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        }
      },
      "required": [
        "data"
      ],
      "additionalProperties": false
    },
    {
      "title": "Device States",
      "description": "Schema for an array of Device states",
      "type": "array",
      "items": {
        "title": "Device State",
        "description": "Schema for a single Device state",
        "type": "object",
        "properties": {
          "time": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "object",
                "properties": {
                  "$date": {
                    "type": "string"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "$date"
                ]
              }
            ]
          },
          "relayId": {
            "type": "string"
          },
          "meta": {},
          "data": {
            "type": "object",
            "patternProperties": {
              "^[0-9a-zA-Z_-]{1,255}$": {
                "type": [
                  "number",
                  "string",
                  "boolean"
                ]
              }
            },
            "additionalProperties": false
          },
          "flowVersion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      }
    }
  ]
}

Example

{
  "time": "2016-06-13T04:00:00.000Z",
  "data": {
    "voltage": 22.4
  }
}


Device States

Schema for an array of Device states

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array",
  "items": {
    "title": "Device State",
    "description": "Schema for a single Device state",
    "type": "object",
    "properties": {
      "time": {
        "oneOf": [
          {
            "type": "string"
          },
          {
            "type": "number"
          },
          {
            "type": "object",
            "properties": {
              "$date": {
                "type": "string"
              }
            },
            "additionalProperties": false,
            "required": [
              "$date"
            ]
          }
        ]
      },
      "relayId": {
        "type": "string"
      },
      "meta": {},
      "data": {
        "type": "object",
        "patternProperties": {
          "^[0-9a-zA-Z_-]{1,255}$": {
            "type": [
              "number",
              "string",
              "boolean"
            ]
          }
        },
        "additionalProperties": false
      },
      "flowVersion": {
        "type": "string",
        "minLength": 1,
        "maxLength": 255
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
}

Example

[
  {
    "time": "2016-06-13T04:00:00.000Z",
    "data": {
      "voltage": 22.4
    }
  },
  {
    "time": "2016-06-13T04:00:00.000Z",
    "data": {
      "voltage": 22.4
    }
  }
]


Device Tag Filter

Array of Tags for filtering devices. Tag keys and tag values are optional.

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "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
}

Example

[
  {
    "key": "Floor",
    "value": "2"
  },
  {
    "key": "Serial"
  }
]


Devices

Schema for a collection of Devices

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "title": "Device",
        "description": "Schema for a single Device",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "deviceId": {
            "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"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "description": {
            "type": "string",
            "maxLength": 32767
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string",
                  "pattern": "^[0-9a-zA-Z_-]{1,255}$"
                },
                "value": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 255
                }
              },
              "required": [
                "key",
                "value"
              ],
              "additionalProperties": false
            },
            "maxItems": 100
          },
          "attributes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "pattern": "^[0-9a-zA-Z_-]{1,255}$"
                },
                "dataType": {
                  "type": "string",
                  "enum": [
                    "string",
                    "number",
                    "gps",
                    "boolean"
                  ]
                }
              },
              "required": [
                "name",
                "dataType"
              ],
              "additionalProperties": false
            },
            "maxItems": 256
          },
          "deviceClass": {
            "type": "string",
            "enum": [
              "standalone",
              "gateway",
              "peripheral",
              "floating",
              "edgeCompute"
            ]
          },
          "gatewayId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "edgeAgentVersion": {
            "type": "string",
            "pattern": "^(0|([1-9]\\d*))\\.(0|([1-9]\\d*))\\.(0|([1-9]\\d*))$"
          },
          "connectionInfo": {
            "type": "object",
            "properties": {
              "time": {
                "type": "string",
                "format": "date-time"
              },
              "connected": {
                "enum": [
                  1,
                  0,
                  null
                ]
              }
            }
          }
        }
      }
    },
    "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"
      ]
    },
    "applicationId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "deviceClass": {
      "type": "string",
      "enum": [
        "standalone",
        "gateway",
        "peripheral",
        "floating",
        "edgeCompute"
      ]
    },
    "tagFilter": {
      "title": "Device Tag Filter",
      "description": "Array of Tags for filtering devices. Tag keys and tag values are optional.",
      "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
    }
  }
}

Example

{
  "items": [
    {
      "id": "575ecf887ae143cd83dc4aa2",
      "deviceId": "575ecf887ae143cd83dc4aa2",
      "applicationId": "575ec8687ae143cd83dc4a97",
      "creationDate": "2016-06-13T04:00:00.000Z",
      "lastUpdated": "2016-06-13T04:00:00.000Z",
      "name": "My Device",
      "description": "A device description",
      "tags": [
        {
          "key": "TagKey",
          "value": "TagValue"
        },
        {
          "key": "floor",
          "value": "8"
        }
      ],
      "attributes": [
        {
          "name": "voltage",
          "dataType": "number"
        }
      ],
      "deviceClass": "standalone",
      "connectionInfo": {
        "time": "2016-06-14T08:15:00.000Z",
        "connected": 1
      }
    }
  ],
  "count": 1,
  "totalCount": 4,
  "perPage": 1,
  "page": 0,
  "sortField": "name",
  "sortDirection": "asc",
  "applicationId": "575ec8687ae143cd83dc4a97"
}


Disable Two Factor Auth

Schema for the body of a request to disable two factor auth

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "twoFactorCode": {
      "type": "string",
      "maxLength": 2048
    },
    "password": {
      "type": "string",
      "minLength": 8,
      "maxLength": 2048
    }
  },
  "required": [
    "password",
    "twoFactorCode"
  ],
  "additionalProperties": false
}

Example

{
  "twoFactorCode": "123123",
  "password": "this would be your password"
}


Edge Deployment Release

Schema for deploying an edge workflow to one or more edge devices

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "flowId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "version": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 1,
      "maxLength": 255
    },
    "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
    }
  },
  "additionalProperties": false,
  "required": [
    "flowId",
    "version"
  ]
}

Example

{
  "flowId": "575ed18f7ae143cd83dc4aa6",
  "version": "v1.2.3",
  "deviceIds": [
    "575ecf887ae143cd83dc4aa2"
  ]
}


Edge Deployment Remove

Schema for removing edge deployments. Can remove a specific workflow from a specific device, can remove all workflows from a specific device, or can remove a specific workflow from all devices.

Schema

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

Example

{
  "flowId": "575ed18f7ae143cd83dc4aa6",
  "deviceId": null
}


Edge Deployment Replace

Schema for replacing a deployment of a workflow version with a different workflow version

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "flowId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "oldVersion": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "newVersion": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 1,
      "maxLength": 255
    }
  },
  "additionalProperties": false,
  "required": [
    "flowId",
    "oldVersion",
    "newVersion"
  ]
}

Example

{
  "flowId": "575ed18f7ae143cd83dc4aa6",
  "oldVersion": "v1.2.3",
  "newVersion": "v1.2.4"
}


Edge Deployments

Schema for a collection of Edge Deployments

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "title": "Edge Deployment",
        "description": "Schema for a single deployment of an edge workflow to an edge device",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "edgeDeploymentId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "applicationId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "deviceId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "deviceName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "flowId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "flowName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "creationDate": {
            "type": "string",
            "format": "date-time"
          },
          "lastUpdated": {
            "type": "string",
            "format": "date-time"
          },
          "currentVersion": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 255
          },
          "desiredVersion": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 255
          },
          "logs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "sourceType": {
                  "type": "string",
                  "enum": [
                    "flow",
                    "user",
                    "device",
                    "apiToken"
                  ]
                },
                "sourceId": {
                  "type": "string",
                  "pattern": "^[A-Fa-f\\d]{24}$"
                },
                "date": {
                  "type": "string",
                  "format": "date-time"
                },
                "changeType": {
                  "type": "string",
                  "enum": [
                    "current",
                    "desired"
                  ]
                },
                "newValue": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "minLength": 1,
                  "maxLength": 255
                },
                "previousValue": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "minLength": 1,
                  "maxLength": 255
                },
                "attemptedValue": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "minLength": 1,
                  "maxLength": 255
                },
                "error": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "count": {
      "type": "integer"
    },
    "totalCount": {
      "type": "integer"
    },
    "applicationId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "deviceId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "flowId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "version": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    }
  }
}

Example

{
  "items": [
    {
      "id": "5a591be186b70d7b9f9b0954",
      "edgeDeploymentId": "5a591be186b70d7b9f9b0954",
      "applicationId": "575ec8687ae143cd83dc4a97",
      "deviceId": "575ecf887ae143cd83dc4aa2",
      "flowId": "575ed18f7ae143cd83dc4aa6",
      "creationDate": "2016-06-13T04:00:00.000Z",
      "lastUpdated": "2016-06-13T04:00:00.000Z",
      "desiredVersion": "v1.4.0",
      "currentVersion": null,
      "logs": [
        {
          "sourceType": "user",
          "sourceId": "575ed70c7ae143cd83dc4aa9",
          "date": "2016-06-13T04:00:00.000Z",
          "changeType": "desired",
          "newValue": "v1.4.0",
          "previousValue": null
        }
      ]
    }
  ],
  "count": 1,
  "totalCount": 4,
  "perPage": 1,
  "page": 0,
  "sortField": "id",
  "sortDirection": "asc",
  "applicationId": "575ec8687ae143cd83dc4a97"
}


Enable Two Factor Auth

Schema for the body of a request to enable two factor auth

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "twoFactorAuthKey": {
      "type": "string",
      "minLength": 52,
      "maxLength": 52
    },
    "password": {
      "type": "string",
      "minLength": 8,
      "maxLength": 2048
    }
  },
  "required": [
    "password",
    "twoFactorAuthKey"
  ],
  "additionalProperties": false
}

Example

{
  "twoFactorAuthKey": "HBBGWJJVOVLXS4ZGNRTDOUKTMESFUR3BMRWVQND2HJYT44TOMVJA",
  "password": "this would be your password"
}


Error

Schema for errors returned by the API

Schema

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

Example

{
  "type": "NotFound",
  "message": "Application was not found"
}


Event

Schema for a single Event

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "eventId": {
      "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"
    },
    "sourceType": {
      "type": "string",
      "enum": [
        "flow",
        "user",
        "device",
        "apiToken"
      ]
    },
    "sourceId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "level": {
      "type": "string",
      "enum": [
        "info",
        "warning",
        "error",
        "critical"
      ]
    },
    "state": {
      "type": "string",
      "enum": [
        "new",
        "acknowledged",
        "resolved"
      ]
    },
    "subject": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "message": {
      "type": "string",
      "maxLength": 32767
    },
    "data": {},
    "updates": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "sourceType": {
            "type": "string",
            "enum": [
              "flow",
              "user",
              "device",
              "apiToken"
            ]
          },
          "sourceId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "creationDate": {
            "type": "string",
            "format": "date-time"
          },
          "comment": {
            "type": "string",
            "maxLength": 32767
          },
          "data": {},
          "stateChange": {
            "type": "object",
            "properties": {
              "old": {
                "type": "string",
                "enum": [
                  "new",
                  "acknowledged",
                  "resolved"
                ]
              },
              "new": {
                "type": "string",
                "enum": [
                  "new",
                  "acknowledged",
                  "resolved"
                ]
              }
            }
          }
        }
      }
    }
  }
}

Example

{
  "id": "575ed0de7ae143cd83dc4aa5",
  "eventId": "575ed0de7ae143cd83dc4aa5",
  "applicationId": "575ec8687ae143cd83dc4a97",
  "creationDate": "2016-06-13T04:00:00.000Z",
  "lastUpdated": "2016-06-13T04:00:00.000Z",
  "sourceType": "user",
  "sourceId": "575ed70c7ae143cd83dc4aa9",
  "level": "info",
  "state": "new",
  "subject": "Power levels critical",
  "message": "Power levels on device 432 have surpassed critical thresholds",
  "updates": []
}


Event Patch

Schema for the body of an Event modification request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "state": {
      "type": "string",
      "enum": [
        "new",
        "acknowledged",
        "resolved"
      ]
    },
    "comment": {
      "type": "string",
      "maxLength": 32767
    },
    "data": {}
  },
  "additionalProperties": false
}

Example

{
  "state": "acknowledged",
  "comment": "Looking into this issue"
}


Event Post

Schema for the body of an Event creation request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "level": {
      "type": "string",
      "enum": [
        "info",
        "warning",
        "error",
        "critical"
      ]
    },
    "state": {
      "type": "string",
      "enum": [
        "new",
        "acknowledged",
        "resolved"
      ]
    },
    "subject": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "message": {
      "type": "string",
      "maxLength": 32767
    },
    "data": {}
  },
  "required": [
    "level",
    "state",
    "subject"
  ],
  "additionalProperties": false
}

Example

{
  "level": "info",
  "state": "new",
  "subject": "Power levels critical",
  "message": "Power levels on device 432 have surpassed critical thresholds"
}


Events

Schema for a collection of Events

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "title": "Event",
        "description": "Schema for a single Event",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "eventId": {
            "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"
          },
          "sourceType": {
            "type": "string",
            "enum": [
              "flow",
              "user",
              "device",
              "apiToken"
            ]
          },
          "sourceId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "level": {
            "type": "string",
            "enum": [
              "info",
              "warning",
              "error",
              "critical"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "new",
              "acknowledged",
              "resolved"
            ]
          },
          "subject": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "message": {
            "type": "string",
            "maxLength": 32767
          },
          "data": {},
          "updates": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "sourceType": {
                  "type": "string",
                  "enum": [
                    "flow",
                    "user",
                    "device",
                    "apiToken"
                  ]
                },
                "sourceId": {
                  "type": "string",
                  "pattern": "^[A-Fa-f\\d]{24}$"
                },
                "creationDate": {
                  "type": "string",
                  "format": "date-time"
                },
                "comment": {
                  "type": "string",
                  "maxLength": 32767
                },
                "data": {},
                "stateChange": {
                  "type": "object",
                  "properties": {
                    "old": {
                      "type": "string",
                      "enum": [
                        "new",
                        "acknowledged",
                        "resolved"
                      ]
                    },
                    "new": {
                      "type": "string",
                      "enum": [
                        "new",
                        "acknowledged",
                        "resolved"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "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"
      ]
    },
    "state": {
      "type": "string",
      "enum": [
        "new",
        "acknowledged",
        "resolved"
      ]
    },
    "applicationId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    }
  }
}

Example

{
  "items": [
    {
      "id": "575ed0de7ae143cd83dc4aa5",
      "eventId": "575ed0de7ae143cd83dc4aa5",
      "applicationId": "575ec8687ae143cd83dc4a97",
      "creationDate": "2016-06-13T04:00:00.000Z",
      "lastUpdated": "2016-06-13T04:00:00.000Z",
      "sourceType": "user",
      "sourceId": "575ed70c7ae143cd83dc4aa9",
      "level": "info",
      "state": "new",
      "subject": "Power levels critical",
      "message": "Power levels on device 432 have surpassed critical thresholds",
      "updates": []
    }
  ],
  "count": 1,
  "totalCount": 4,
  "perPage": 1,
  "page": 0,
  "sortField": "subject",
  "sortDirection": "asc",
  "applicationId": "575ec8687ae143cd83dc4a97",
  "state": "new"
}


Experience Domain

Schema for a single Experience Domain

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "experienceDomainId": {
      "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"
    },
    "sslCert": {
      "type": "string",
      "maxLength": 32767,
      "minLength": 50
    },
    "sslBundle": {
      "type": "string",
      "maxLength": 32767,
      "minLength": 50
    },
    "domainName": {
      "type": "string",
      "maxLength": 1024,
      "minLength": 3
    }
  }
}

Example

{
  "id": "58c1de6c8f812590d8e82980",
  "experienceDomainId": "58c1de6c8f812590d8e82980",
  "applicationId": "575ec8687ae143cd83dc4a97",
  "creationDate": "2016-06-13T04:00:00.000Z",
  "lastUpdated": "2016-06-13T04:00:00.000Z",
  "domainName": "my.example.domain.com"
}


Experience Domain Patch

Schema for the body of an Experience Domain modification request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "sslKey": {
      "$oneOf": [
        {
          "type": "string",
          "maxLength": 32767,
          "minLength": 50
        },
        {
          "type": null
        }
      ]
    },
    "sslCert": {
      "$oneOf": [
        {
          "type": "string",
          "maxLength": 32767,
          "minLength": 50
        },
        {
          "type": null
        }
      ]
    },
    "sslBundle": {
      "$oneOf": [
        {
          "type": "string",
          "maxLength": 32767,
          "minLength": 50
        },
        {
          "type": null
        }
      ]
    },
    "domainName": {
      "type": "string",
      "maxLength": 1024,
      "minLength": 3
    }
  },
  "additionalProperties": false
}

Example

{
  "domainName": "my.example.domain.com",
  "sslCert": "MY_SSL_CERTIFICATE",
  "sslKey": "MY_SSL_KEY"
}


Experience Domain Post

Schema for the body of an Experience Domain creation request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "sslKey": {
      "type": "string",
      "maxLength": 32767,
      "minLength": 50
    },
    "sslCert": {
      "type": "string",
      "maxLength": 32767,
      "minLength": 50
    },
    "sslBundle": {
      "type": "string",
      "maxLength": 32767,
      "minLength": 50
    },
    "domainName": {
      "type": "string",
      "maxLength": 1024,
      "minLength": 3
    }
  },
  "additionalProperties": false,
  "required": [
    "domainName"
  ]
}

Example

{
  "domainName": "my.example.domain.com",
  "sslCert": "MY_SSL_CERTIFICATE",
  "sslKey": "MY_SSL_KEY"
}


Experience Domains

Schema for a collection of Experience Domains

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "title": "Experience Domain",
        "description": "Schema for a single Experience Domain",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "experienceDomainId": {
            "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"
          },
          "sslCert": {
            "type": "string",
            "maxLength": 32767,
            "minLength": 50
          },
          "sslBundle": {
            "type": "string",
            "maxLength": 32767,
            "minLength": 50
          },
          "domainName": {
            "type": "string",
            "maxLength": 1024,
            "minLength": 3
          }
        }
      }
    },
    "count": {
      "type": "integer"
    },
    "totalCount": {
      "type": "integer"
    },
    "applicationId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    }
  }
}

Example

{
  "items": [
    {
      "id": "58c1de6c8f812590d8e82980",
      "experienceDomainId": "58c1de6c8f812590d8e82980",
      "applicationId": "575ec8687ae143cd83dc4a97",
      "creationDate": "2016-06-13T04:00:00.000Z",
      "lastUpdated": "2016-06-13T04:00:00.000Z",
      "domainName": "my.example.domain.com"
    }
  ],
  "count": 1,
  "totalCount": 1,
  "applicationId": "575ec8687ae143cd83dc4a97"
}


Experience Endpoint

Schema for a single Experience Endpoint

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "experienceEndpointId": {
      "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"
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "route": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1024
    },
    "enabled": {
      "type": "boolean"
    },
    "method": {
      "type": "string",
      "enum": [
        "delete",
        "get",
        "options",
        "patch",
        "post",
        "put"
      ]
    },
    "access": {
      "type": "string",
      "enum": [
        "public",
        "authenticated",
        "group"
      ]
    },
    "endpointTags": {
      "type": "object",
      "patternProperties": {
        "^[0-9a-zA-Z_-]{1,255}$": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        }
      },
      "additionalProperties": false
    },
    "staticReply": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "value": {
              "type": "string"
            },
            "statusCode": {
              "type": "number",
              "min": 100,
              "max": 599,
              "integer": true
            },
            "type": {
              "type": "string",
              "enum": [
                "page",
                "redirect"
              ]
            }
          },
          "required": [
            "value",
            "type"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "unauthorizedReply": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "value": {
              "type": "string"
            },
            "statusCode": {
              "type": "number",
              "min": 100,
              "max": 599,
              "integer": true
            },
            "type": {
              "type": "string",
              "enum": [
                "page",
                "redirect"
              ]
            }
          },
          "required": [
            "value",
            "type"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "experienceGroups": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          }
        }
      }
    }
  }
}

Example

{
  "id": "58c1de6c8f812590d8e82980",
  "experienceEndpointId": "58c1de6c8f812590d8e82980",
  "applicationId": "575ec8687ae143cd83dc4a97",
  "creationDate": "2016-06-13T04:00:00.000Z",
  "lastUpdated": "2016-06-13T04:00:00.000Z",
  "route": "/my/route/{id}",
  "enabled": true,
  "method": "get",
  "access": "group",
  "experienceGroups": [
    {
      "name": "myGroup",
      "id": "58b9d794cbfafe1be675744f"
    }
  ]
}


Experience Endpoint Patch

Schema for the body of an Experience Endpoint modification request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "route": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1024
    },
    "enabled": {
      "type": "boolean"
    },
    "method": {
      "type": "string",
      "enum": [
        "delete",
        "get",
        "options",
        "patch",
        "post",
        "put"
      ]
    },
    "access": {
      "type": "string",
      "enum": [
        "public",
        "authenticated",
        "group"
      ]
    },
    "endpointTags": {
      "type": "object",
      "patternProperties": {
        "^[0-9a-zA-Z_-]{1,255}$": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        }
      },
      "additionalProperties": false
    },
    "experienceGroupIds": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[A-Fa-f\\d]{24}$"
      },
      "maxItems": 1000
    },
    "staticReply": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "value": {
              "type": "string"
            },
            "statusCode": {
              "type": "number",
              "min": 100,
              "max": 599,
              "integer": true
            },
            "type": {
              "type": "string",
              "enum": [
                "page",
                "redirect"
              ]
            }
          },
          "required": [
            "value",
            "type"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "unauthorizedReply": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "value": {
              "type": "string"
            },
            "statusCode": {
              "type": "number",
              "min": 100,
              "max": 599,
              "integer": true
            },
            "type": {
              "type": "string",
              "enum": [
                "page",
                "redirect"
              ]
            }
          },
          "required": [
            "value",
            "type"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "additionalProperties": false
}

Example

{
  "access": "group",
  "experienceGroupIds": [
    "58c1de6f8f812590d8e82983"
  ]
}


Experience Endpoint Post

Schema for the body of an Experience Endpoint creation request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "route": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1024
    },
    "enabled": {
      "type": "boolean"
    },
    "method": {
      "type": "string",
      "enum": [
        "delete",
        "get",
        "options",
        "patch",
        "post",
        "put"
      ]
    },
    "access": {
      "type": "string",
      "enum": [
        "public",
        "authenticated",
        "group"
      ]
    },
    "endpointTags": {
      "type": "object",
      "patternProperties": {
        "^[0-9a-zA-Z_-]{1,255}$": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        }
      },
      "additionalProperties": false
    },
    "experienceGroupIds": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[A-Fa-f\\d]{24}$"
      },
      "maxItems": 1000
    },
    "staticReply": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "value": {
              "type": "string"
            },
            "statusCode": {
              "type": "number",
              "min": 100,
              "max": 599,
              "integer": true
            },
            "type": {
              "type": "string",
              "enum": [
                "page",
                "redirect"
              ]
            }
          },
          "required": [
            "value",
            "type"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "unauthorizedReply": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "value": {
              "type": "string"
            },
            "statusCode": {
              "type": "number",
              "min": 100,
              "max": 599,
              "integer": true
            },
            "type": {
              "type": "string",
              "enum": [
                "page",
                "redirect"
              ]
            }
          },
          "required": [
            "value",
            "type"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "additionalProperties": false,
  "required": [
    "route",
    "method"
  ]
}

Example

{
  "route": "/my/route/{id}",
  "method": "get",
  "access": "public"
}


Experience Endpoint Stats

Schema for stats for an experience's endpoints

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "patternProperties": {
    ".*": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "time": {
            "type": "string",
            "format": "date-time"
          },
          "count": {
            "type": "number"
          }
        }
      }
    }
  }
}

Example

{
  "58cae95a0f5fcd000138ed0d": [
    {
      "time": "2017-03-21T20:00:00.000Z",
      "count": 10
    },
    {
      "time": "2017-03-21T21:00:00.000Z",
      "count": 1
    }
  ],
  "NotFound": [
    {
      "time": "2017-03-21T20:00:00.000Z",
      "count": 1
    },
    {
      "time": "2017-03-21T21:00:00.000Z",
      "count": 4
    }
  ]
}


Experience Endpoints

Schema for a collection of Experience Endpoints

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "title": "Experience Endpoint",
        "description": "Schema for a single Experience Endpoint",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "experienceEndpointId": {
            "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"
          },
          "description": {
            "type": "string",
            "maxLength": 32767
          },
          "route": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          },
          "enabled": {
            "type": "boolean"
          },
          "method": {
            "type": "string",
            "enum": [
              "delete",
              "get",
              "options",
              "patch",
              "post",
              "put"
            ]
          },
          "access": {
            "type": "string",
            "enum": [
              "public",
              "authenticated",
              "group"
            ]
          },
          "endpointTags": {
            "type": "object",
            "patternProperties": {
              "^[0-9a-zA-Z_-]{1,255}$": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              }
            },
            "additionalProperties": false
          },
          "staticReply": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "string"
                  },
                  "statusCode": {
                    "type": "number",
                    "min": 100,
                    "max": 599,
                    "integer": true
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "page",
                      "redirect"
                    ]
                  }
                },
                "required": [
                  "value",
                  "type"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "unauthorizedReply": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "string"
                  },
                  "statusCode": {
                    "type": "number",
                    "min": 100,
                    "max": 599,
                    "integer": true
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "page",
                      "redirect"
                    ]
                  }
                },
                "required": [
                  "value",
                  "type"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "experienceGroups": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 255
                },
                "id": {
                  "type": "string",
                  "pattern": "^[A-Fa-f\\d]{24}$"
                }
              }
            }
          }
        }
      }
    },
    "count": {
      "type": "integer"
    },
    "totalCount": {
      "type": "integer"
    },
    "filter": {
      "type": "string"
    },
    "filterField": {
      "type": "string"
    },
    "sortField": {
      "type": "string"
    },
    "sortDirection": {
      "type": "string",
      "enum": [
        "asc",
        "desc"
      ]
    },
    "applicationId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "experienceGroupId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "notFoundRequestCount": {
      "type": "number"
    }
  }
}

Example

{
  "items": [
    {
      "id": "58c1de6c8f812590d8e82980",
      "experienceEndpointId": "58c1de6c8f812590d8e82980",
      "applicationId": "575ec8687ae143cd83dc4a97",
      "creationDate": "2016-06-13T04:00:00.000Z",
      "lastUpdated": "2016-06-13T04:00:00.000Z",
      "route": "/my/route/{id}",
      "enabled": true,
      "method": "get",
      "access": "group",
      "experienceGroups": [
        {
          "name": "myGroup",
          "id": "58b9d794cbfafe1be675744f"
        }
      ]
    }
  ],
  "count": 1,
  "totalCount": 4,
  "perPage": 1,
  "page": 0,
  "sortField": "name",
  "sortDirection": "asc",
  "applicationId": "575ec8687ae143cd83dc4a97"
}


Experience Group

Schema for a single Experience Group

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "experienceGroupId": {
      "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"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "experienceUserIds": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[A-Fa-f\\d]{24}$"
      },
      "maxItems": 1000
    },
    "experienceEndpointIds": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[A-Fa-f\\d]{24}$"
      },
      "maxItems": 1000
    },
    "groupTags": {
      "type": "object",
      "patternProperties": {
        "^[0-9a-zA-Z_-]{1,255}$": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        }
      },
      "additionalProperties": false
    }
  }
}

Example

{
  "id": "58b9d794cbfafe1be675744f",
  "experienceGroupId": "58b9d794cbfafe1be675744f",
  "applicationId": "575ec8687ae143cd83dc4a97",
  "creationDate": "2016-06-13T04:00:00.000Z",
  "lastUpdated": "2016-06-13T04:00:00.000Z",
  "name": "My Group",
  "experienceUserIds": [
    "58b9d782cbfafe1be675744d",
    "58b9d787cbfafe1be675744e"
  ],
  "experienceEndpointIds": [
    "58b9d743cbfafe1be675744b",
    "58b9d743cbfafe1be675744c"
  ]
}


Experience Group Patch

Schema for the body of an Experience Group modification request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "experienceUserIds": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[A-Fa-f\\d]{24}$"
      },
      "maxItems": 1000
    },
    "experienceEndpointIds": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[A-Fa-f\\d]{24}$"
      },
      "maxItems": 1000
    },
    "groupTags": {
      "type": "object",
      "patternProperties": {
        "^[0-9a-zA-Z_-]{1,255}$": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}

Example

{
  "name": "My New Group Name",
  "experienceUserIds": [
    "575ed70c7ae143cd83dc4aa9",
    "675ed70c7ae143cd83dc4aa9"
  ],
  "experienceEndpointIds": [
    "58b9d743cbfafe1be675744b",
    "58b9d743cbfafe1be675744c"
  ]
}


Experience Group Post

Schema for the body of an Experience Group creation request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "experienceUserIds": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[A-Fa-f\\d]{24}$"
      },
      "maxItems": 1000
    },
    "experienceEndpointIds": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[A-Fa-f\\d]{24}$"
      },
      "maxItems": 1000
    },
    "groupTags": {
      "type": "object",
      "patternProperties": {
        "^[0-9a-zA-Z_-]{1,255}$": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}

Example

{
  "name": "My Group",
  "experienceUserIds": [
    "575ed70c7ae143cd83dc4aa9",
    "675ed70c7ae143cd83dc4aa9"
  ],
  "experienceEndpointIds": [
    "58b9d743cbfafe1be675744b",
    "58b9d743cbfafe1be675744c"
  ]
}


Experience Groups

Schema for a collection of Experience Groups

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "title": "Experience Group",
        "description": "Schema for a single Experience Group",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "experienceGroupId": {
            "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"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "description": {
            "type": "string",
            "maxLength": 32767
          },
          "experienceUserIds": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[A-Fa-f\\d]{24}$"
            },
            "maxItems": 1000
          },
          "experienceEndpointIds": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[A-Fa-f\\d]{24}$"
            },
            "maxItems": 1000
          },
          "groupTags": {
            "type": "object",
            "patternProperties": {
              "^[0-9a-zA-Z_-]{1,255}$": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              }
            },
            "additionalProperties": false
          }
        }
      }
    },
    "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"
      ]
    },
    "applicationId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    }
  }
}

Example

{
  "items": [
    {
      "id": "58b9d794cbfafe1be675744f",
      "experienceGroupId": "58b9d794cbfafe1be675744f",
      "applicationId": "575ec8687ae143cd83dc4a97",
      "creationDate": "2016-06-13T04:00:00.000Z",
      "lastUpdated": "2016-06-13T04:00:00.000Z",
      "name": "My Group",
      "experienceUserIds": [
        "58b9d782cbfafe1be675744d",
        "58b9d787cbfafe1be675744e"
      ],
      "experienceEndpointIds": [
        "58b9d743cbfafe1be675744b",
        "58b9d743cbfafe1be675744c"
      ]
    }
  ],
  "count": 1,
  "totalCount": 4,
  "perPage": 1,
  "page": 0,
  "sortField": "name",
  "sortDirection": "asc",
  "applicationId": "575ec8687ae143cd83dc4a97"
}


Experience User

Schema for a single Experience User

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "experienceUserId": {
      "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"
    },
    "passwordLastUpdated": {
      "type": "string",
      "format": "date-time"
    },
    "lastLogin": {
      "type": "string",
      "format": "date-time"
    },
    "email": {
      "type": "string",
      "format": "email",
      "maxLength": 1024
    },
    "firstName": {
      "type": "string",
      "maxLength": 1024
    },
    "lastName": {
      "type": "string",
      "maxLength": 1024
    },
    "avatarUrl": {
      "type": "string",
      "format": "url"
    },
    "tokenCutoff": {
      "type": "string",
      "format": "date-time"
    },
    "userTags": {
      "type": "object",
      "patternProperties": {
        "^[0-9a-zA-Z_-]{1,255}$": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        }
      },
      "additionalProperties": false
    },
    "experienceGroups": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          }
        }
      }
    }
  }
}

Example

{
  "id": "58b9d782cbfafe1be675744d",
  "experienceUserId": "58b9d782cbfafe1be675744d",
  "applicationId": "575ec8687ae143cd83dc4a97",
  "creationDate": "2016-06-13T04:00:00.000Z",
  "lastUpdated": "2016-06-13T04:00:00.000Z",
  "passwordLastUpdated": "2016-06-13T04:00:00.000Z",
  "lastLogin": "2016-06-13T04:00:00.000Z",
  "email": "example@experienceuser.com",
  "firstName": "Example",
  "lastName": "Name",
  "avatarUrl": "https://example.avatar.url/is_here.png",
  "userTags": {
    "customKey": "customValue"
  }
}


Experience User Patch

Schema for the body of an Experience User modification request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "format": "email",
      "maxLength": 1024
    },
    "firstName": {
      "type": "string",
      "maxLength": 1024
    },
    "lastName": {
      "type": "string",
      "maxLength": 1024
    },
    "password": {
      "type": "string",
      "minLength": 8,
      "maxLength": 2048
    },
    "tokenCutoff": {
      "type": "string",
      "format": "date-time"
    },
    "userTags": {
      "type": "object",
      "patternProperties": {
        "^[0-9a-zA-Z_-]{1,255}$": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        }
      },
      "additionalProperties": false
    },
    "experienceGroupIds": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[A-Fa-f\\d]{24}$"
      },
      "maxItems": 1000
    }
  },
  "additionalProperties": false
}

Example

{
  "password": "aNewPassword",
  "userTags": {
    "customKey": "newCustomValue"
  }
}


Experience User Post

Schema for the body of an Experience User creation request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "format": "email",
      "maxLength": 1024
    },
    "firstName": {
      "type": "string",
      "maxLength": 1024
    },
    "lastName": {
      "type": "string",
      "maxLength": 1024
    },
    "password": {
      "type": "string",
      "minLength": 8,
      "maxLength": 2048
    },
    "tokenCutoff": {
      "type": "string",
      "format": "date-time"
    },
    "userTags": {
      "type": "object",
      "patternProperties": {
        "^[0-9a-zA-Z_-]{1,255}$": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        }
      },
      "additionalProperties": false
    },
    "experienceGroupIds": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[A-Fa-f\\d]{24}$"
      },
      "maxItems": 1000
    }
  },
  "additionalProperties": false,
  "required": [
    "email",
    "password"
  ]
}

Example

{
  "email": "example@experienceuser.com",
  "firstName": "Example",
  "lastName": "Name",
  "password": "aUserPassword",
  "userTags": {
    "customKey": "customValue"
  }
}


Experience Users

Schema for a collection of Experience Users

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "title": "Experience User",
        "description": "Schema for a single Experience User",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "experienceUserId": {
            "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"
          },
          "passwordLastUpdated": {
            "type": "string",
            "format": "date-time"
          },
          "lastLogin": {
            "type": "string",
            "format": "date-time"
          },
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 1024
          },
          "firstName": {
            "type": "string",
            "maxLength": 1024
          },
          "lastName": {
            "type": "string",
            "maxLength": 1024
          },
          "avatarUrl": {
            "type": "string",
            "format": "url"
          },
          "tokenCutoff": {
            "type": "string",
            "format": "date-time"
          },
          "userTags": {
            "type": "object",
            "patternProperties": {
              "^[0-9a-zA-Z_-]{1,255}$": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              }
            },
            "additionalProperties": false
          },
          "experienceGroups": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 255
                },
                "id": {
                  "type": "string",
                  "pattern": "^[A-Fa-f\\d]{24}$"
                }
              }
            }
          }
        }
      }
    },
    "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"
      ]
    },
    "applicationId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "experienceGroupId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    }
  }
}

Example

{
  "items": [
    {
      "id": "58b9d782cbfafe1be675744d",
      "experienceUserId": "58b9d782cbfafe1be675744d",
      "applicationId": "575ec8687ae143cd83dc4a97",
      "creationDate": "2016-06-13T04:00:00.000Z",
      "lastUpdated": "2016-06-13T04:00:00.000Z",
      "passwordLastUpdated": "2016-06-13T04:00:00.000Z",
      "lastLogin": "2016-06-13T04:00:00.000Z",
      "email": "example@experienceuser.com",
      "firstName": "Example",
      "lastName": "Name",
      "avatarUrl": "https://example.avatar.url/is_here.png",
      "userTags": {
        "customKey": "customValue"
      }
    }
  ],
  "count": 1,
  "totalCount": 4,
  "perPage": 1,
  "page": 0,
  "sortField": "name",
  "sortDirection": "asc",
  "applicationId": "575ec8687ae143cd83dc4a97"
}


Experience View

Schema for a single Experience View

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "experienceViewId": {
      "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"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "viewType": {
      "type": "string",
      "enum": [
        "layout",
        "page",
        "component"
      ]
    },
    "layoutId": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "layoutName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "body": {
      "type": "string",
      "maxLength": 131072,
      "minLength": 1
    },
    "viewTags": {
      "type": "object",
      "patternProperties": {
        "^[0-9a-zA-Z_-]{1,255}$": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        }
      },
      "additionalProperties": false
    }
  }
}

Example

{
  "id": "59cc5c628246c6caed4b16c1",
  "experienceViewId": "59cc5c628246c6caed4b16c1",
  "applicationId": "575ec8687ae143cd83dc4a97",
  "creationDate": "2016-06-13T04:00:00.000Z",
  "lastUpdated": "2016-06-13T04:00:00.000Z",
  "name": "My Page View",
  "viewType": "page",
  "body": "<p>{{data}}</p>",
  "layoutId": "59cc5cad8246c6caed4b16c2",
  "viewTags": {
    "customKey": "customValue"
  }
}


Experience View Patch

Schema for the body of an Experience View modification request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "layoutId": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "body": {
      "type": "string",
      "maxLength": 131072,
      "minLength": 1
    },
    "viewTags": {
      "type": "object",
      "patternProperties": {
        "^[0-9a-zA-Z_-]{1,255}$": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}

Example

{
  "body": "New Content! <p>{{newData}}</p>",
  "viewTags": {
    "customKey": "newCustomValue"
  }
}


Experience View Post

Schema for the body of an Experience View creation request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "viewType": {
      "type": "string",
      "enum": [
        "layout",
        "page",
        "component"
      ]
    },
    "layoutId": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "body": {
      "type": "string",
      "maxLength": 131072,
      "minLength": 1
    },
    "viewTags": {
      "type": "object",
      "patternProperties": {
        "^[0-9a-zA-Z_-]{1,255}$": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false,
  "required": [
    "name",
    "viewType",
    "body"
  ]
}

Example

{
  "name": "My Page View",
  "viewType": "page",
  "body": "<p>{{data}}</p>",
  "layoutId": "59cc5cad8246c6caed4b16c2",
  "viewTags": {
    "customKey": "customValue"
  }
}


Experience Views

Schema for a collection of Experience Views

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "title": "Experience View",
        "description": "Schema for a single Experience View",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "experienceViewId": {
            "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"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "description": {
            "type": "string",
            "maxLength": 32767
          },
          "viewType": {
            "type": "string",
            "enum": [
              "layout",
              "page",
              "component"
            ]
          },
          "layoutId": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "layoutName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "body": {
            "type": "string",
            "maxLength": 131072,
            "minLength": 1
          },
          "viewTags": {
            "type": "object",
            "patternProperties": {
              "^[0-9a-zA-Z_-]{1,255}$": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              }
            },
            "additionalProperties": false
          }
        }
      }
    },
    "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"
      ]
    },
    "applicationId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "viewType": {
      "type": "string",
      "enum": [
        "layout",
        "page",
        "component"
      ]
    }
  }
}

Example

{
  "items": [
    {
      "id": "59cc5c628246c6caed4b16c1",
      "experienceViewId": "59cc5c628246c6caed4b16c1",
      "applicationId": "575ec8687ae143cd83dc4a97",
      "creationDate": "2016-06-13T04:00:00.000Z",
      "lastUpdated": "2016-06-13T04:00:00.000Z",
      "name": "My Page View",
      "viewType": "page",
      "body": "<p>{{data}}</p>",
      "layoutId": "59cc5cad8246c6caed4b16c2",
      "viewTags": {
        "customKey": "customValue"
      }
    }
  ],
  "count": 1,
  "totalCount": 4,
  "perPage": 1,
  "page": 0,
  "sortField": "name",
  "sortDirection": "asc",
  "applicationId": "575ec8687ae143cd83dc4a97"
}


File Schema

Schema for a single file

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"
    },
    "authorId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "authorType": {
      "type": "string",
      "enum": [
        "flow",
        "user",
        "device",
        "apiToken"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "moving",
        "deleting",
        "completed"
      ]
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1024
    },
    "parentDirectory": {
      "type": "string",
      "maxLength": 1024
    },
    "type": {
      "type": "string",
      "enum": [
        "file",
        "directory"
      ]
    },
    "fileSize": {
      "type": "number"
    },
    "contentType": {
      "type": "string",
      "maxLength": 1024
    },
    "fileDimensions": {
      "type": "object",
      "properties": {
        "width": {
          "type": "number"
        },
        "height": {
          "type": "number"
        }
      }
    },
    "moveIntoId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "url": {
      "type": "string"
    }
  }
}

Example

{
  "id": "575ec8687ae143cd83dc4a97",
  "applicationId": "575ec8687ae143cd83dc4a97",
  "creationDate": "2016-06-13T04:00:00.000Z",
  "lastUpdated": "2016-06-13T04:00:00.000Z",
  "authorId": "575ed70c7ae143cd83dc4aa9",
  "authorType": "user",
  "status": "pending",
  "name": "file.csv",
  "type": "file",
  "parentDirectory": "/",
  "fileSize": 500,
  "contentType": "text/csv"
}


File Patch

Schema to patch a file

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "fileSize": {
      "type": "number"
    },
    "contentType": {
      "type": "string",
      "maxLength": 1024
    },
    "fileDimensions": {
      "type": "object",
      "properties": {
        "width": {
          "type": "number"
        },
        "height": {
          "type": "number"
        }
      }
    }
  }
}

Example

{
  "fileSize": 500,
  "contentType": "image",
  "fileDimensions": {
    "width": 200,
    "height": 200
  }
}


File Post

Schema to create a single file or directory

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1024
    },
    "parentDirectory": {
      "type": "string",
      "maxLength": 1024
    },
    "type": {
      "type": "string",
      "enum": [
        "file",
        "directory"
      ]
    },
    "fileSize": {
      "type": "number"
    },
    "contentType": {
      "type": "string",
      "maxLength": 1024
    },
    "fileDimensions": {
      "type": "object",
      "properties": {
        "width": {
          "type": "number"
        },
        "height": {
          "type": "number"
        }
      }
    }
  }
}

Example

{
  "name": "file.csv",
  "type": "file",
  "parentDirectory": "/",
  "fileSize": 500,
  "contentType": "text/csv"
}


File Post Response

Schema to upload the file to s3

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"
    },
    "authorId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "authorType": {
      "type": "string",
      "enum": [
        "flow",
        "user",
        "device",
        "apiToken"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "moving",
        "deleting",
        "completed"
      ]
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1024
    },
    "parentDirectory": {
      "type": "string",
      "maxLength": 1024
    },
    "type": {
      "type": "string",
      "enum": [
        "file",
        "directory"
      ]
    },
    "fileSize": {
      "type": "number"
    },
    "contentType": {
      "type": "string",
      "maxLength": 1024
    },
    "fileDimensions": {
      "type": "object",
      "properties": {
        "width": {
          "type": "number"
        },
        "height": {
          "type": "number"
        }
      }
    },
    "upload": {
      "url": {
        "type": "string"
      },
      "fields": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "bucket": {
            "type": "string"
          },
          "X-Amz-Algorithm": {
            "type": "string"
          },
          "X-Amz-Credential": {
            "type": "string"
          },
          "X-Amz-Date": {
            "type": "string"
          },
          "Policy": {
            "type": "string"
          },
          "X-Amz-Signature": {
            "type": "string"
          }
        }
      }
    }
  }
}

Example

{
  "id": "575ec8687ae143cd83dc4a97",
  "applicationId": "575ec8687ae143cd83dc4a97",
  "creationDate": "2016-06-13T04:00:00.000Z",
  "lastUpdated": "2016-06-13T04:00:00.000Z",
  "authorId": "575ed70c7ae143cd83dc4aa9",
  "authorType": "user",
  "status": "pending",
  "name": "file.csv",
  "type": "file",
  "parentDirectory": "/",
  "fileSize": 500,
  "contentType": "text/csv",
  "upload": {
    "url": "https://s3.us-west-1.amazonaws.com/a-bucket-on-amazon",
    "fields": {
      "key": "5630dcbe1035c9d0011/file.js",
      "bucket": "a-bucket-on-amazon",
      "X-Amz-Algorithm": "AWS4-HMAC-SHA256",
      "X-Amz-Credential": "AKIAJPGQGBQX4PYM6FXA/20180416/us-west-1/s3/aws4_request",
      "X-Amz-Date": "20180416T142402Z",
      "Policy": "wMloiLCJjb25kaXRpb25zIjpbeyJrZXkiOiI1NjMwZGNiZTEwM2Y4ZTQ4NWM5ZDAwMTEvZmlsZS5qcyJ9LHsiYnVja2V0IjoibG9zYW50LWZpbGVzIn0seyJYLUFtei1BbGdvcml0aG0iOiJBV1M0LUhNQUMtU0hBMjU2In0seyJYLUFtei1DcmVkZW50aWFsIjoiQUtJQUpQR1FHQlFYNFBZTTZGWEEvMjAxODA0MTYvdXMtd2VzdC0xL3MzL2F3czRfcmVxdWVzdCJ9LHsiWC1BbXotRGF0ZSI6IjIwMTgwNDE2VDE0MjQwMloifV19",
      "X-Amz-Signature": "a4a411df572c43b4427ff08ef51763bc2d834fa399c3688f347d936370"
    }
  }
}


Files Schema

Schema for a collection of files

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "title": "File Schema",
        "description": "Schema for a single file",
        "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"
          },
          "authorId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "authorType": {
            "type": "string",
            "enum": [
              "flow",
              "user",
              "device",
              "apiToken"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "moving",
              "deleting",
              "completed"
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          },
          "parentDirectory": {
            "type": "string",
            "maxLength": 1024
          },
          "type": {
            "type": "string",
            "enum": [
              "file",
              "directory"
            ]
          },
          "fileSize": {
            "type": "number"
          },
          "contentType": {
            "type": "string",
            "maxLength": 1024
          },
          "fileDimensions": {
            "type": "object",
            "properties": {
              "width": {
                "type": "number"
              },
              "height": {
                "type": "number"
              }
            }
          },
          "moveIntoId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "url": {
            "type": "string"
          }
        }
      }
    },
    "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"
      ]
    }
  }
}

Example

{
  "items": [
    {
      "id": "575ec8687ae143cd83dc4a97",
      "applicationId": "575ec8687ae143cd83dc4a97",
      "creationDate": "2016-06-13T04:00:00.000Z",
      "lastUpdated": "2016-06-13T04:00:00.000Z",
      "authorId": "575ed70c7ae143cd83dc4aa9",
      "authorType": "user",
      "status": "pending",
      "name": "file.csv",
      "type": "file",
      "parentDirectory": "/",
      "fileSize": 500,
      "contentType": "text/csv"
    },
    {
      "id": "575ec8687ae143cd83dc4a96",
      "applicationId": "575ec8687ae143cd83dc4a97",
      "creationDate": "2016-06-13T04:00:00.000Z",
      "lastUpdated": "2016-06-13T04:00:00.000Z",
      "authorId": "575ed70c7ae143cd83dc4aa9",
      "authorType": "user",
      "status": "completed",
      "name": "b",
      "type": "directory",
      "parentDirectory": "/a/",
      "fileSize": 500,
      "contentType": "text/csv"
    }
  ],
  "count": 2
}


Workflow

Schema for a single Workflow

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "flowId": {
      "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"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "iconData": {
      "type": "string",
      "maxLength": 32767,
      "pattern": "^data:image/(jpg|jpeg|png|svg\\+xml);base64,[0-9a-zA-Z+/=]*$"
    },
    "enabled": {
      "type": "boolean"
    },
    "defaultVersionId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "minimumAgentVersion": {
      "type": "string",
      "pattern": "^(0|([1-9]\\d*))\\.(0|([1-9]\\d*))\\.(0|([1-9]\\d*))$"
    },
    "flowClass": {
      "type": "string",
      "enum": [
        "cloud",
        "edge",
        "customNode"
      ]
    },
    "triggers": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "maxLength": 1024
          },
          "type": {
            "type": "string",
            "enum": [
              "dataTable",
              "deviceCommand",
              "deviceId",
              "deviceIdConnect",
              "deviceIdDisconnect",
              "deviceIdInactivity",
              "deviceTag",
              "deviceTagConnect",
              "deviceTagDisconnect",
              "deviceTagInactivity",
              "endpoint",
              "event",
              "integration",
              "mqttTopic",
              "request",
              "customNodeStart",
              "timer",
              "udp",
              "virtualButton",
              "webhook"
            ]
          },
          "config": {
            "type": "object"
          },
          "meta": {
            "type": "object"
          },
          "outputIds": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 255
              },
              "maxItems": 100
            },
            "maxItems": 100
          }
        },
        "additionalProperties": false,
        "required": [
          "type"
        ]
      }
    },
    "nodes": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 1024
          },
          "type": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          },
          "config": {
            "type": "object"
          },
          "meta": {
            "type": "object"
          },
          "outputIds": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 255
              },
              "maxItems": 100
            },
            "maxItems": 100
          }
        },
        "additionalProperties": false,
        "required": [
          "type"
        ]
      }
    },
    "customNodeConfig": {
      "type": "object",
      "properties": {
        "outputCount": {
          "type": "number",
          "enum": [
            1,
            2
          ]
        },
        "resultMode": {
          "type": "string",
          "enum": [
            "optional",
            "required",
            "none"
          ]
        },
        "resultDescription": {
          "type": "string",
          "maxLength": 32767
        },
        "fields": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "checkbox"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 32767
                  },
                  "defaultValue": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "type",
                  "label"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "select"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 32767
                  },
                  "defaultValue": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "options": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 100,
                    "items": {
                      "type": "object",
                      "properties": {
                        "label": {
                          "type": "string",
                          "maxLength": 1024
                        },
                        "value": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "value"
                      ]
                    }
                  }
                },
                "additionalProperties": false,
                "required": [
                  "type",
                  "label",
                  "defaultValue",
                  "options"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "stringTemplate"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 32767
                  },
                  "defaultValue": {
                    "type": "string",
                    "maxLength": 1024
                  },
                  "required": {
                    "type": "boolean"
                  },
                  "validRegExp": {
                    "type": "string",
                    "maxLength": 1024
                  }
                },
                "additionalProperties": false,
                "required": [
                  "type",
                  "label"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "numberTemplate"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 32767
                  },
                  "defaultValue": {
                    "type": "number"
                  },
                  "required": {
                    "type": "boolean"
                  },
                  "validMin": {
                    "type": "number"
                  },
                  "validMax": {
                    "type": "number"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "type",
                  "label"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "jsonTemplate"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 32767
                  },
                  "defaultValue": {
                    "type": "string",
                    "maxLength": 32767
                  },
                  "required": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "type",
                  "label"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "payloadPath"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 32767
                  },
                  "required": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "type",
                  "label"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "section"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 32767
                  }
                },
                "additionalProperties": false,
                "required": [
                  "type",
                  "label"
                ]
              }
            ]
          }
        }
      },
      "additionalProperties": false,
      "required": [
        "outputCount",
        "resultMode",
        "fields"
      ]
    },
    "customNodeSupports": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "cloud"
        ]
      }
    },
    "customNodeUseCount": {
      "type": "number"
    },
    "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
          }
        },
        "additionalProperties": false,
        "required": [
          "key",
          "json"
        ]
      }
    },
    "stats": {
      "type": "object",
      "properties": {
        "runCount": {
          "type": "number"
        },
        "errorCount": {
          "type": "number"
        },
        "byVersion": {
          "type": "object",
          "patternProperties": {
            ".*": {
              "type": "object",
              "properties": {
                "runCount": {
                  "type": "number"
                },
                "errorCount": {
                  "type": "number"
                }
              }
            }
          }
        }
      }
    }
  }
}

Example

{
  "id": "575ed18f7ae143cd83dc4aa6",
  "flowId": "575ed18f7ae143cd83dc4aa6",
  "applicationId": "575ec8687ae143cd83dc4a97",
  "creationDate": "2016-06-13T04:00:00.000Z",
  "lastUpdated": "2016-06-13T04:00:00.000Z",
  "name": "My Workflow",
  "description": "Description of my empty workflow",
  "enabled": true,
  "triggers": [],
  "nodes": [],
  "globals": [],
  "stats": {
    "runCount": 0,
    "errorCount": 0
  }
}


Workflow Log

Log of aggregated workflow run information

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "flowVersionId": {
        "type": "string"
      },
      "time": {
        "type": "string",
        "format": "date-time"
      },
      "pathsFailed": {
        "type": "number"
      },
      "pathsCompleted": {
        "type": "number"
      },
      "runCount": {
        "type": "number"
      },
      "wallTime": {
        "type": "number"
      },
      "errors": {
        "type": "array",
        "items": {}
      }
    }
  }
}

Example

[
  {
    "flowVersionId": "develop",
    "time": "2016-06-03T00:56:22.447Z",
    "pathsFailed": 0,
    "pathsCompleted": 1,
    "runCount": 1,
    "wallTime": 450,
    "errors": []
  },
  {
    "flowVersionId": "develop",
    "time": "2016-06-03T00:56:22.447Z",
    "pathsFailed": 0,
    "pathsCompleted": 1,
    "runCount": 3,
    "wallTime": 152,
    "errors": []
  }
]


Workflow Patch

Schema for the body of a Workflow modification request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "iconData": {
      "oneOf": [
        {
          "type": "string",
          "maxLength": 32767,
          "pattern": "^data:image/(jpg|jpeg|png|svg\\+xml);base64,[0-9a-zA-Z+/=]*$"
        },
        {
          "type": "null"
        }
      ]
    },
    "enabled": {
      "type": "boolean"
    },
    "defaultVersionId": {
      "oneOf": [
        {
          "type": "string",
          "pattern": "^[A-Fa-f\\d]{24}$"
        },
        {
          "type": "null"
        }
      ]
    },
    "triggers": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "maxLength": 1024
          },
          "type": {
            "type": "string",
            "enum": [
              "dataTable",
              "deviceCommand",
              "deviceId",
              "deviceIdConnect",
              "deviceIdDisconnect",
              "deviceIdInactivity",
              "deviceTag",
              "deviceTagConnect",
              "deviceTagDisconnect",
              "deviceTagInactivity",
              "endpoint",
              "event",
              "integration",
              "mqttTopic",
              "request",
              "customNodeStart",
              "timer",
              "udp",
              "virtualButton",
              "webhook"
            ]
          },
          "config": {
            "type": "object"
          },
          "meta": {
            "type": "object"
          },
          "outputIds": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 255
              },
              "maxItems": 100
            },
            "maxItems": 100
          }
        },
        "additionalProperties": false,
        "required": [
          "type"
        ]
      }
    },
    "nodes": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 1024
          },
          "type": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          },
          "config": {
            "type": "object"
          },
          "meta": {
            "type": "object"
          },
          "outputIds": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 255
              },
              "maxItems": 100
            },
            "maxItems": 100
          }
        },
        "additionalProperties": false,
        "required": [
          "type"
        ]
      }
    },
    "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
          }
        },
        "additionalProperties": false,
        "required": [
          "key",
          "json"
        ]
      }
    },
    "minimumAgentVersion": {
      "type": "string",
      "pattern": "^(0|([1-9]\\d*))\\.(0|([1-9]\\d*))\\.(0|([1-9]\\d*))$"
    },
    "customNodeConfig": {
      "type": "object",
      "properties": {
        "outputCount": {
          "type": "number",
          "enum": [
            1,
            2
          ]
        },
        "resultMode": {
          "type": "string",
          "enum": [
            "optional",
            "required",
            "none"
          ]
        },
        "resultDescription": {
          "type": "string",
          "maxLength": 32767
        },
        "fields": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "checkbox"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 32767
                  },
                  "defaultValue": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "type",
                  "label"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "select"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 32767
                  },
                  "defaultValue": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "options": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 100,
                    "items": {
                      "type": "object",
                      "properties": {
                        "label": {
                          "type": "string",
                          "maxLength": 1024
                        },
                        "value": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "value"
                      ]
                    }
                  }
                },
                "additionalProperties": false,
                "required": [
                  "type",
                  "label",
                  "defaultValue",
                  "options"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "stringTemplate"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 32767
                  },
                  "defaultValue": {
                    "type": "string",
                    "maxLength": 1024
                  },
                  "required": {
                    "type": "boolean"
                  },
                  "validRegExp": {
                    "type": "string",
                    "maxLength": 1024
                  }
                },
                "additionalProperties": false,
                "required": [
                  "type",
                  "label"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "numberTemplate"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 32767
                  },
                  "defaultValue": {
                    "type": "number"
                  },
                  "required": {
                    "type": "boolean"
                  },
                  "validMin": {
                    "type": "number"
                  },
                  "validMax": {
                    "type": "number"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "type",
                  "label"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "jsonTemplate"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 32767
                  },
                  "defaultValue": {
                    "type": "string",
                    "maxLength": 32767
                  },
                  "required": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "type",
                  "label"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "payloadPath"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 32767
                  },
                  "required": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "type",
                  "label"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "section"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 32767
                  }
                },
                "additionalProperties": false,
                "required": [
                  "type",
                  "label"
                ]
              }
            ]
          }
        }
      },
      "additionalProperties": false,
      "required": [
        "outputCount",
        "resultMode",
        "fields"
      ]
    }
  },
  "additionalProperties": false
}

Example

{
  "name": "My Updated Workflow",
  "description": "Description of my updated workflow",
  "enabled": false
}


Workflow Post

Schema for the body of a Workflow creation request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "iconData": {
      "oneOf": [
        {
          "type": "string",
          "maxLength": 32767,
          "pattern": "^data:image/(jpg|jpeg|png|svg\\+xml);base64,[0-9a-zA-Z+/=]*$"
        },
        {
          "type": "null"
        }
      ]
    },
    "enabled": {
      "type": "boolean"
    },
    "triggers": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "maxLength": 1024
          },
          "type": {
            "type": "string",
            "enum": [
              "dataTable",
              "deviceCommand",
              "deviceId",
              "deviceIdConnect",
              "deviceIdDisconnect",
              "deviceIdInactivity",
              "deviceTag",
              "deviceTagConnect",
              "deviceTagDisconnect",
              "deviceTagInactivity",
              "endpoint",
              "event",
              "integration",
              "mqttTopic",
              "request",
              "customNodeStart",
              "timer",
              "udp",
              "virtualButton",
              "webhook"
            ]
          },
          "config": {
            "type": "object"
          },
          "meta": {
            "type": "object"
          },
          "outputIds": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 255
              },
              "maxItems": 100
            },
            "maxItems": 100
          }
        },
        "additionalProperties": false,
        "required": [
          "type"
        ]
      }
    },
    "nodes": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 1024
          },
          "type": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          },
          "config": {
            "type": "object"
          },
          "meta": {
            "type": "object"
          },
          "outputIds": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 255
              },
              "maxItems": 100
            },
            "maxItems": 100
          }
        },
        "additionalProperties": false,
        "required": [
          "type"
        ]
      }
    },
    "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
          }
        },
        "additionalProperties": false,
        "required": [
          "key",
          "json"
        ]
      }
    },
    "flowClass": {
      "type": "string",
      "enum": [
        "cloud",
        "edge",
        "customNode"
      ]
    },
    "minimumAgentVersion": {
      "type": "string",
      "pattern": "^(0|([1-9]\\d*))\\.(0|([1-9]\\d*))\\.(0|([1-9]\\d*))$"
    },
    "customNodeConfig": {
      "type": "object",
      "properties": {
        "outputCount": {
          "type": "number",
          "enum": [
            1,
            2
          ]
        },
        "resultMode": {
          "type": "string",
          "enum": [
            "optional",
            "required",
            "none"
          ]
        },
        "resultDescription": {
          "type": "string",
          "maxLength": 32767
        },
        "fields": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "checkbox"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 32767
                  },
                  "defaultValue": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "type",
                  "label"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "select"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 32767
                  },
                  "defaultValue": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "options": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 100,
                    "items": {
                      "type": "object",
                      "properties": {
                        "label": {
                          "type": "string",
                          "maxLength": 1024
                        },
                        "value": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "value"
                      ]
                    }
                  }
                },
                "additionalProperties": false,
                "required": [
                  "type",
                  "label",
                  "defaultValue",
                  "options"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "stringTemplate"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 32767
                  },
                  "defaultValue": {
                    "type": "string",
                    "maxLength": 1024
                  },
                  "required": {
                    "type": "boolean"
                  },
                  "validRegExp": {
                    "type": "string",
                    "maxLength": 1024
                  }
                },
                "additionalProperties": false,
                "required": [
                  "type",
                  "label"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "numberTemplate"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 32767
                  },
                  "defaultValue": {
                    "type": "number"
                  },
                  "required": {
                    "type": "boolean"
                  },
                  "validMin": {
                    "type": "number"
                  },
                  "validMax": {
                    "type": "number"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "type",
                  "label"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "jsonTemplate"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 32767
                  },
                  "defaultValue": {
                    "type": "string",
                    "maxLength": 32767
                  },
                  "required": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "type",
                  "label"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "payloadPath"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 32767
                  },
                  "required": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "type",
                  "label"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "section"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 32767
                  }
                },
                "additionalProperties": false,
                "required": [
                  "type",
                  "label"
                ]
              }
            ]
          }
        }
      },
      "additionalProperties": false,
      "required": [
        "outputCount",
        "resultMode",
        "fields"
      ]
    },
    "customNodeSupports": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "cloud"
        ]
      }
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}

Example

{
  "name": "My New Workflow",
  "description": "Description of my new workflow"
}


Workflow Storage Entries

Set of persistent workflow storage values

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "patternProperties": {
    "^.{1,255}$": {}
  }
}

Example

{
  "myStorageKey": "hello",
  "other key": [
    13,
    21,
    34
  ]
}


Workflow Storage Entry

Schema for the body of a request to set a Workflow storage entry

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "key": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "value": {}
  },
  "additionalProperties": false,
  "required": [
    "key"
  ]
}

Example

{
  "key": "myStorageKey",
  "value": 12
}


Workflow Trigger Filter

Array of triggers for filtering workflows. Trigger keys and trigger types are optional.

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "key": {
        "type": "string",
        "maxLength": 1024
      },
      "type": {
        "type": "string",
        "maxLength": 1024
      }
    },
    "additionalProperties": false
  },
  "maxItems": 100
}

Example

[
  {
    "type": "webhook",
    "key": "575ed78e7ae143cd83dc4aab"
  }
]


Workflow Version

Schema for a single Workflow Version

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "flowVersionId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "flowId": {
      "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"
    },
    "version": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "notes": {
      "type": "string",
      "maxLength": 32767
    },
    "enabled": {
      "type": "boolean"
    },
    "triggers": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "maxLength": 1024
          },
          "type": {
            "type": "string",
            "enum": [
              "dataTable",
              "deviceCommand",
              "deviceId",
              "deviceIdConnect",
              "deviceIdDisconnect",
              "deviceIdInactivity",
              "deviceTag",
              "deviceTagConnect",
              "deviceTagDisconnect",
              "deviceTagInactivity",
              "endpoint",
              "event",
              "integration",
              "mqttTopic",
              "request",
              "customNodeStart",
              "timer",
              "udp",
              "virtualButton",
              "webhook"
            ]
          },
          "config": {
            "type": "object"
          },
          "meta": {
            "type": "object"
          },
          "outputIds": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 255
              },
              "maxItems": 100
            },
            "maxItems": 100
          }
        },
        "additionalProperties": false,
        "required": [
          "type"
        ]
      }
    },
    "nodes": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 1024
          },
          "type": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          },
          "config": {
            "type": "object"
          },
          "meta": {
            "type": "object"
          },
          "outputIds": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 255
              },
              "maxItems": 100
            },
            "maxItems": 100
          }
        },
        "additionalProperties": false,
        "required": [
          "type"
        ]
      }
    },
    "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
          }
        },
        "additionalProperties": false,
        "required": [
          "key",
          "json"
        ]
      }
    },
    "minimumAgentVersion": {
      "type": "string",
      "pattern": "^(0|([1-9]\\d*))\\.(0|([1-9]\\d*))\\.(0|([1-9]\\d*))$"
    },
    "customNodeConfig": {
      "type": "object",
      "properties": {
        "outputCount": {
          "type": "number",
          "enum": [
            1,
            2
          ]
        },
        "resultMode": {
          "type": "string",
          "enum": [
            "optional",
            "required",
            "none"
          ]
        },
        "resultDescription": {
          "type": "string",
          "maxLength": 32767
        },
        "fields": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "checkbox"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 32767
                  },
                  "defaultValue": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "type",
                  "label"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "select"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 32767
                  },
                  "defaultValue": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "options": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 100,
                    "items": {
                      "type": "object",
                      "properties": {
                        "label": {
                          "type": "string",
                          "maxLength": 1024
                        },
                        "value": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "value"
                      ]
                    }
                  }
                },
                "additionalProperties": false,
                "required": [
                  "type",
                  "label",
                  "defaultValue",
                  "options"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "stringTemplate"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 32767
                  },
                  "defaultValue": {
                    "type": "string",
                    "maxLength": 1024
                  },
                  "required": {
                    "type": "boolean"
                  },
                  "validRegExp": {
                    "type": "string",
                    "maxLength": 1024
                  }
                },
                "additionalProperties": false,
                "required": [
                  "type",
                  "label"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "numberTemplate"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 32767
                  },
                  "defaultValue": {
                    "type": "number"
                  },
                  "required": {
                    "type": "boolean"
                  },
                  "validMin": {
                    "type": "number"
                  },
                  "validMax": {
                    "type": "number"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "type",
                  "label"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "jsonTemplate"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 32767
                  },
                  "defaultValue": {
                    "type": "string",
                    "maxLength": 32767
                  },
                  "required": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "type",
                  "label"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "payloadPath"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 32767
                  },
                  "required": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "type",
                  "label"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "section"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 32767
                  }
                },
                "additionalProperties": false,
                "required": [
                  "type",
                  "label"
                ]
              }
            ]
          }
        }
      },
      "additionalProperties": false,
      "required": [
        "outputCount",
        "resultMode",
        "fields"
      ]
    }
  }
}

Example

{
  "id": "675ed18f7ae143cd83dc4bb7",
  "flowVersionId": "675ed18f7ae143cd83dc4bb7",
  "flowId": "575ed18f7ae143cd83dc4aa6",
  "applicationId": "575ec8687ae143cd83dc4a97",
  "creationDate": "2016-06-13T04:00:00.000Z",
  "lastUpdated": "2016-06-13T04:00:00.000Z",
  "version": "v1.2.3",
  "notes": "Description of my workflow version",
  "enabled": true,
  "triggers": [],
  "nodes": [],
  "globals": []
}


Workflow Version Patch

Schema for the body of a Workflow Version modification request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "notes": {
      "type": "string",
      "maxLength": 32767
    },
    "enabled": {
      "type": "boolean"
    }
  },
  "additionalProperties": false
}

Example

{
  "notes": "Updated workflow version notes",
  "enabled": false
}


Workflow Version Post

Schema for the body of a Workflow Version creation request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "version": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "notes": {
      "type": "string",
      "maxLength": 32767
    },
    "enabled": {
      "type": "boolean"
    },
    "triggers": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "maxLength": 1024
          },
          "type": {
            "type": "string",
            "enum": [
              "dataTable",
              "deviceCommand",
              "deviceId",
              "deviceIdConnect",
              "deviceIdDisconnect",
              "deviceIdInactivity",
              "deviceTag",
              "deviceTagConnect",
              "deviceTagDisconnect",
              "deviceTagInactivity",
              "endpoint",
              "event",
              "integration",
              "mqttTopic",
              "request",
              "customNodeStart",
              "timer",
              "udp",
              "virtualButton",
              "webhook"
            ]
          },
          "config": {
            "type": "object"
          },
          "meta": {
            "type": "object"
          },
          "outputIds": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 255
              },
              "maxItems": 100
            },
            "maxItems": 100
          }
        },
        "additionalProperties": false,
        "required": [
          "type"
        ]
      }
    },
    "nodes": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 1024
          },
          "type": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          },
          "config": {
            "type": "object"
          },
          "meta": {
            "type": "object"
          },
          "outputIds": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 255
              },
              "maxItems": 100
            },
            "maxItems": 100
          }
        },
        "additionalProperties": false,
        "required": [
          "type"
        ]
      }
    },
    "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
          }
        },
        "additionalProperties": false,
        "required": [
          "key",
          "json"
        ]
      }
    },
    "minimumAgentVersion": {
      "type": "string",
      "pattern": "^(0|([1-9]\\d*))\\.(0|([1-9]\\d*))\\.(0|([1-9]\\d*))$"
    },
    "customNodeConfig": {
      "type": "object",
      "properties": {
        "outputCount": {
          "type": "number",
          "enum": [
            1,
            2
          ]
        },
        "resultMode": {
          "type": "string",
          "enum": [
            "optional",
            "required",
            "none"
          ]
        },
        "resultDescription": {
          "type": "string",
          "maxLength": 32767
        },
        "fields": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "checkbox"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 32767
                  },
                  "defaultValue": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "type",
                  "label"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "select"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 32767
                  },
                  "defaultValue": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "options": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 100,
                    "items": {
                      "type": "object",
                      "properties": {
                        "label": {
                          "type": "string",
                          "maxLength": 1024
                        },
                        "value": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "value"
                      ]
                    }
                  }
                },
                "additionalProperties": false,
                "required": [
                  "type",
                  "label",
                  "defaultValue",
                  "options"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "stringTemplate"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 32767
                  },
                  "defaultValue": {
                    "type": "string",
                    "maxLength": 1024
                  },
                  "required": {
                    "type": "boolean"
                  },
                  "validRegExp": {
                    "type": "string",
                    "maxLength": 1024
                  }
                },
                "additionalProperties": false,
                "required": [
                  "type",
                  "label"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "numberTemplate"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 32767
                  },
                  "defaultValue": {
                    "type": "number"
                  },
                  "required": {
                    "type": "boolean"
                  },
                  "validMin": {
                    "type": "number"
                  },
                  "validMax": {
                    "type": "number"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "type",
                  "label"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "jsonTemplate"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 32767
                  },
                  "defaultValue": {
                    "type": "string",
                    "maxLength": 32767
                  },
                  "required": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "type",
                  "label"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "payloadPath"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 32767
                  },
                  "required": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "type",
                  "label"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "section"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 32767
                  }
                },
                "additionalProperties": false,
                "required": [
                  "type",
                  "label"
                ]
              }
            ]
          }
        }
      },
      "additionalProperties": false,
      "required": [
        "outputCount",
        "resultMode",
        "fields"
      ]
    }
  },
  "additionalProperties": false,
  "required": [
    "version"
  ]
}

Example

{
  "version": "v1.2.3",
  "notes": "Notes about my new workflow version",
  "enabled": false
}


Workflow Versions

Schema for a collection of Workflow Versions

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "title": "Workflow Version",
        "description": "Schema for a single Workflow Version",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "flowVersionId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "flowId": {
            "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"
          },
          "version": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "notes": {
            "type": "string",
            "maxLength": 32767
          },
          "enabled": {
            "type": "boolean"
          },
          "triggers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string",
                  "maxLength": 1024
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "dataTable",
                    "deviceCommand",
                    "deviceId",
                    "deviceIdConnect",
                    "deviceIdDisconnect",
                    "deviceIdInactivity",
                    "deviceTag",
                    "deviceTagConnect",
                    "deviceTagDisconnect",
                    "deviceTagInactivity",
                    "endpoint",
                    "event",
                    "integration",
                    "mqttTopic",
                    "request",
                    "customNodeStart",
                    "timer",
                    "udp",
                    "virtualButton",
                    "webhook"
                  ]
                },
                "config": {
                  "type": "object"
                },
                "meta": {
                  "type": "object"
                },
                "outputIds": {
                  "type": "array",
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "maxItems": 100
                  },
                  "maxItems": 100
                }
              },
              "additionalProperties": false,
              "required": [
                "type"
              ]
            }
          },
          "nodes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "maxLength": 1024
                },
                "type": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1024
                },
                "config": {
                  "type": "object"
                },
                "meta": {
                  "type": "object"
                },
                "outputIds": {
                  "type": "array",
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "maxItems": 100
                  },
                  "maxItems": 100
                }
              },
              "additionalProperties": false,
              "required": [
                "type"
              ]
            }
          },
          "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
                }
              },
              "additionalProperties": false,
              "required": [
                "key",
                "json"
              ]
            }
          },
          "minimumAgentVersion": {
            "type": "string",
            "pattern": "^(0|([1-9]\\d*))\\.(0|([1-9]\\d*))\\.(0|([1-9]\\d*))$"
          },
          "customNodeConfig": {
            "type": "object",
            "properties": {
              "outputCount": {
                "type": "number",
                "enum": [
                  1,
                  2
                ]
              },
              "resultMode": {
                "type": "string",
                "enum": [
                  "optional",
                  "required",
                  "none"
                ]
              },
              "resultDescription": {
                "type": "string",
                "maxLength": 32767
              },
              "fields": {
                "type": "array",
                "maxItems": 100,
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "checkbox"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "defaultValue": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "select"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "defaultValue": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "options": {
                          "type": "array",
                          "minItems": 1,
                          "maxItems": 100,
                          "items": {
                            "type": "object",
                            "properties": {
                              "label": {
                                "type": "string",
                                "maxLength": 1024
                              },
                              "value": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 1024
                              }
                            },
                            "additionalProperties": false,
                            "required": [
                              "value"
                            ]
                          }
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label",
                        "defaultValue",
                        "options"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "stringTemplate"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "defaultValue": {
                          "type": "string",
                          "maxLength": 1024
                        },
                        "required": {
                          "type": "boolean"
                        },
                        "validRegExp": {
                          "type": "string",
                          "maxLength": 1024
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "numberTemplate"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "defaultValue": {
                          "type": "number"
                        },
                        "required": {
                          "type": "boolean"
                        },
                        "validMin": {
                          "type": "number"
                        },
                        "validMax": {
                          "type": "number"
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "jsonTemplate"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "defaultValue": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "required": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "payloadPath"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "required": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "section"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label"
                      ]
                    }
                  ]
                }
              }
            },
            "additionalProperties": false,
            "required": [
              "outputCount",
              "resultMode",
              "fields"
            ]
          }
        }
      }
    },
    "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"
      ]
    },
    "applicationId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "flowId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    }
  }
}

Example

{
  "items": [
    {
      "id": "675ed18f7ae143cd83dc4bb7",
      "flowVersionId": "675ed18f7ae143cd83dc4bb7",
      "flowId": "575ed18f7ae143cd83dc4aa6",
      "applicationId": "575ec8687ae143cd83dc4a97",
      "creationDate": "2016-06-13T04:00:00.000Z",
      "lastUpdated": "2016-06-13T04:00:00.000Z",
      "version": "v1.2.3",
      "notes": "Description of my workflow version",
      "enabled": true,
      "triggers": [],
      "nodes": [],
      "globals": []
    }
  ],
  "count": 1,
  "totalCount": 4,
  "perPage": 1,
  "page": 0,
  "sortField": "version",
  "sortDirection": "asc",
  "applicationId": "575ec8687ae143cd83dc4a97",
  "flowId": "575ed18f7ae143cd83dc4aa6"
}


Workflows

Schema for a collection of Workflows

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "title": "Workflow",
        "description": "Schema for a single Workflow",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "flowId": {
            "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"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "description": {
            "type": "string",
            "maxLength": 32767
          },
          "iconData": {
            "type": "string",
            "maxLength": 32767,
            "pattern": "^data:image/(jpg|jpeg|png|svg\\+xml);base64,[0-9a-zA-Z+/=]*$"
          },
          "enabled": {
            "type": "boolean"
          },
          "defaultVersionId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "minimumAgentVersion": {
            "type": "string",
            "pattern": "^(0|([1-9]\\d*))\\.(0|([1-9]\\d*))\\.(0|([1-9]\\d*))$"
          },
          "flowClass": {
            "type": "string",
            "enum": [
              "cloud",
              "edge",
              "customNode"
            ]
          },
          "triggers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string",
                  "maxLength": 1024
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "dataTable",
                    "deviceCommand",
                    "deviceId",
                    "deviceIdConnect",
                    "deviceIdDisconnect",
                    "deviceIdInactivity",
                    "deviceTag",
                    "deviceTagConnect",
                    "deviceTagDisconnect",
                    "deviceTagInactivity",
                    "endpoint",
                    "event",
                    "integration",
                    "mqttTopic",
                    "request",
                    "customNodeStart",
                    "timer",
                    "udp",
                    "virtualButton",
                    "webhook"
                  ]
                },
                "config": {
                  "type": "object"
                },
                "meta": {
                  "type": "object"
                },
                "outputIds": {
                  "type": "array",
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "maxItems": 100
                  },
                  "maxItems": 100
                }
              },
              "additionalProperties": false,
              "required": [
                "type"
              ]
            }
          },
          "nodes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "maxLength": 1024
                },
                "type": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1024
                },
                "config": {
                  "type": "object"
                },
                "meta": {
                  "type": "object"
                },
                "outputIds": {
                  "type": "array",
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "maxItems": 100
                  },
                  "maxItems": 100
                }
              },
              "additionalProperties": false,
              "required": [
                "type"
              ]
            }
          },
          "customNodeConfig": {
            "type": "object",
            "properties": {
              "outputCount": {
                "type": "number",
                "enum": [
                  1,
                  2
                ]
              },
              "resultMode": {
                "type": "string",
                "enum": [
                  "optional",
                  "required",
                  "none"
                ]
              },
              "resultDescription": {
                "type": "string",
                "maxLength": 32767
              },
              "fields": {
                "type": "array",
                "maxItems": 100,
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "checkbox"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "defaultValue": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "select"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "defaultValue": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "options": {
                          "type": "array",
                          "minItems": 1,
                          "maxItems": 100,
                          "items": {
                            "type": "object",
                            "properties": {
                              "label": {
                                "type": "string",
                                "maxLength": 1024
                              },
                              "value": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 1024
                              }
                            },
                            "additionalProperties": false,
                            "required": [
                              "value"
                            ]
                          }
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label",
                        "defaultValue",
                        "options"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "stringTemplate"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "defaultValue": {
                          "type": "string",
                          "maxLength": 1024
                        },
                        "required": {
                          "type": "boolean"
                        },
                        "validRegExp": {
                          "type": "string",
                          "maxLength": 1024
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "numberTemplate"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "defaultValue": {
                          "type": "number"
                        },
                        "required": {
                          "type": "boolean"
                        },
                        "validMin": {
                          "type": "number"
                        },
                        "validMax": {
                          "type": "number"
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "jsonTemplate"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "defaultValue": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "required": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "payloadPath"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "required": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "section"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label"
                      ]
                    }
                  ]
                }
              }
            },
            "additionalProperties": false,
            "required": [
              "outputCount",
              "resultMode",
              "fields"
            ]
          },
          "customNodeSupports": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "cloud"
              ]
            }
          },
          "customNodeUseCount": {
            "type": "number"
          },
          "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
                }
              },
              "additionalProperties": false,
              "required": [
                "key",
                "json"
              ]
            }
          },
          "stats": {
            "type": "object",
            "properties": {
              "runCount": {
                "type": "number"
              },
              "errorCount": {
                "type": "number"
              },
              "byVersion": {
                "type": "object",
                "patternProperties": {
                  ".*": {
                    "type": "object",
                    "properties": {
                      "runCount": {
                        "type": "number"
                      },
                      "errorCount": {
                        "type": "number"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "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"
      ]
    },
    "applicationId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "flowClass": {
      "type": "string",
      "enum": [
        "cloud",
        "edge",
        "customNode"
      ]
    }
  }
}

Example

{
  "items": [
    {
      "id": "575ed18f7ae143cd83dc4aa6",
      "flowId": "575ed18f7ae143cd83dc4aa6",
      "applicationId": "575ec8687ae143cd83dc4a97",
      "creationDate": "2016-06-13T04:00:00.000Z",
      "lastUpdated": "2016-06-13T04:00:00.000Z",
      "name": "My Workflow",
      "description": "Description of my empty workflow",
      "enabled": true,
      "triggers": [],
      "nodes": [],
      "globals": [],
      "stats": {
        "runCount": 0,
        "errorCount": 0
      }
    }
  ],
  "count": 1,
  "totalCount": 4,
  "perPage": 1,
  "page": 0,
  "sortField": "name",
  "sortDirection": "asc",
  "applicationId": "575ec8687ae143cd83dc4a97"
}


Workflow Import

Schema for the body of a workflow import request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "flows": {
      "maxItems": 1000,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "applicationId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "description": {
            "type": "string",
            "maxLength": 32767
          },
          "iconData": {
            "type": "string",
            "maxLength": 32767,
            "pattern": "^data:image/(jpg|jpeg|png|svg\\+xml);base64,[0-9a-zA-Z+/=]*$"
          },
          "enabled": {
            "type": "boolean"
          },
          "triggers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string",
                  "maxLength": 1024
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "dataTable",
                    "deviceCommand",
                    "deviceId",
                    "deviceIdConnect",
                    "deviceIdDisconnect",
                    "deviceIdInactivity",
                    "deviceTag",
                    "deviceTagConnect",
                    "deviceTagDisconnect",
                    "deviceTagInactivity",
                    "endpoint",
                    "event",
                    "integration",
                    "mqttTopic",
                    "request",
                    "customNodeStart",
                    "timer",
                    "udp",
                    "virtualButton",
                    "webhook"
                  ]
                },
                "config": {
                  "type": "object"
                },
                "meta": {
                  "type": "object"
                },
                "outputIds": {
                  "type": "array",
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "maxItems": 100
                  },
                  "maxItems": 100
                }
              },
              "additionalProperties": false,
              "required": [
                "type"
              ]
            }
          },
          "nodes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "maxLength": 1024
                },
                "type": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1024
                },
                "config": {
                  "type": "object"
                },
                "meta": {
                  "type": "object"
                },
                "outputIds": {
                  "type": "array",
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "maxItems": 100
                  },
                  "maxItems": 100
                }
              },
              "additionalProperties": false,
              "required": [
                "type"
              ]
            }
          },
          "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
                }
              },
              "additionalProperties": false,
              "required": [
                "key",
                "json"
              ]
            }
          },
          "flowClass": {
            "type": "string",
            "enum": [
              "cloud",
              "edge",
              "customNode"
            ]
          },
          "defaultVersionId": {
            "oneOf": [
              {
                "type": "string",
                "pattern": "^[A-Fa-f\\d]{24}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "minimumAgentVersion": {
            "type": "string",
            "pattern": "^(0|([1-9]\\d*))\\.(0|([1-9]\\d*))\\.(0|([1-9]\\d*))$"
          },
          "customNodeConfig": {
            "type": "object",
            "properties": {
              "outputCount": {
                "type": "number",
                "enum": [
                  1,
                  2
                ]
              },
              "resultMode": {
                "type": "string",
                "enum": [
                  "optional",
                  "required",
                  "none"
                ]
              },
              "resultDescription": {
                "type": "string",
                "maxLength": 32767
              },
              "fields": {
                "type": "array",
                "maxItems": 100,
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "checkbox"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "defaultValue": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "select"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "defaultValue": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "options": {
                          "type": "array",
                          "minItems": 1,
                          "maxItems": 100,
                          "items": {
                            "type": "object",
                            "properties": {
                              "label": {
                                "type": "string",
                                "maxLength": 1024
                              },
                              "value": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 1024
                              }
                            },
                            "additionalProperties": false,
                            "required": [
                              "value"
                            ]
                          }
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label",
                        "defaultValue",
                        "options"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "stringTemplate"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "defaultValue": {
                          "type": "string",
                          "maxLength": 1024
                        },
                        "required": {
                          "type": "boolean"
                        },
                        "validRegExp": {
                          "type": "string",
                          "maxLength": 1024
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "numberTemplate"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "defaultValue": {
                          "type": "number"
                        },
                        "required": {
                          "type": "boolean"
                        },
                        "validMin": {
                          "type": "number"
                        },
                        "validMax": {
                          "type": "number"
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "jsonTemplate"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "defaultValue": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "required": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "payloadPath"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "required": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "section"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label"
                      ]
                    }
                  ]
                }
              }
            },
            "additionalProperties": false,
            "required": [
              "outputCount",
              "resultMode",
              "fields"
            ]
          },
          "customNodeSupports": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "cloud"
              ]
            }
          }
        },
        "additionalProperties": {
          "type": "string",
          "maxLength": 1024
        },
        "required": [
          "name"
        ]
      }
    },
    "flowVersions": {
      "maxItems": 1000,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "flowId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "applicationId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "version": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "notes": {
            "type": "string",
            "maxLength": 32767
          },
          "enabled": {
            "type": "boolean"
          },
          "triggers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string",
                  "maxLength": 1024
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "dataTable",
                    "deviceCommand",
                    "deviceId",
                    "deviceIdConnect",
                    "deviceIdDisconnect",
                    "deviceIdInactivity",
                    "deviceTag",
                    "deviceTagConnect",
                    "deviceTagDisconnect",
                    "deviceTagInactivity",
                    "endpoint",
                    "event",
                    "integration",
                    "mqttTopic",
                    "request",
                    "customNodeStart",
                    "timer",
                    "udp",
                    "virtualButton",
                    "webhook"
                  ]
                },
                "config": {
                  "type": "object"
                },
                "meta": {
                  "type": "object"
                },
                "outputIds": {
                  "type": "array",
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "maxItems": 100
                  },
                  "maxItems": 100
                }
              },
              "additionalProperties": false,
              "required": [
                "type"
              ]
            }
          },
          "nodes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "maxLength": 1024
                },
                "type": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1024
                },
                "config": {
                  "type": "object"
                },
                "meta": {
                  "type": "object"
                },
                "outputIds": {
                  "type": "array",
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "maxItems": 100
                  },
                  "maxItems": 100
                }
              },
              "additionalProperties": false,
              "required": [
                "type"
              ]
            }
          },
          "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
                }
              },
              "additionalProperties": false,
              "required": [
                "key",
                "json"
              ]
            }
          },
          "minimumAgentVersion": {
            "type": "string",
            "pattern": "^(0|([1-9]\\d*))\\.(0|([1-9]\\d*))\\.(0|([1-9]\\d*))$"
          },
          "customNodeConfig": {
            "type": "object",
            "properties": {
              "outputCount": {
                "type": "number",
                "enum": [
                  1,
                  2
                ]
              },
              "resultMode": {
                "type": "string",
                "enum": [
                  "optional",
                  "required",
                  "none"
                ]
              },
              "resultDescription": {
                "type": "string",
                "maxLength": 32767
              },
              "fields": {
                "type": "array",
                "maxItems": 100,
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "checkbox"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "defaultValue": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "select"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "defaultValue": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "options": {
                          "type": "array",
                          "minItems": 1,
                          "maxItems": 100,
                          "items": {
                            "type": "object",
                            "properties": {
                              "label": {
                                "type": "string",
                                "maxLength": 1024
                              },
                              "value": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 1024
                              }
                            },
                            "additionalProperties": false,
                            "required": [
                              "value"
                            ]
                          }
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label",
                        "defaultValue",
                        "options"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "stringTemplate"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "defaultValue": {
                          "type": "string",
                          "maxLength": 1024
                        },
                        "required": {
                          "type": "boolean"
                        },
                        "validRegExp": {
                          "type": "string",
                          "maxLength": 1024
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "numberTemplate"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "defaultValue": {
                          "type": "number"
                        },
                        "required": {
                          "type": "boolean"
                        },
                        "validMin": {
                          "type": "number"
                        },
                        "validMax": {
                          "type": "number"
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "jsonTemplate"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "defaultValue": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "required": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "payloadPath"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "required": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "section"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label"
                      ]
                    }
                  ]
                }
              }
            },
            "additionalProperties": false,
            "required": [
              "outputCount",
              "resultMode",
              "fields"
            ]
          }
        },
        "additionalProperties": {
          "type": "string",
          "maxLength": 1024
        },
        "required": [
          "version"
        ]
      }
    }
  },
  "additionalProperties": false
}

Example

{
  "flows": [
    {
      "id": "575ed18f7ae143cd83dc4aa6",
      "flowId": "575ed18f7ae143cd83dc4aa6",
      "applicationId": "575ec8687ae143cd83dc4a97",
      "creationDate": "2016-06-13T04:00:00.000Z",
      "lastUpdated": "2016-06-13T04:00:00.000Z",
      "name": "My Workflow",
      "description": "Description of my empty workflow",
      "enabled": true,
      "triggers": [],
      "nodes": [],
      "globals": [],
      "stats": {
        "runCount": 0,
        "errorCount": 0
      }
    }
  ],
  "flowVersions": []
}


Workflow Import Result

Schema for the result of a workflow import request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "flows": {
      "maxItems": 1000,
      "type": "array",
      "items": {
        "title": "Workflow",
        "description": "Schema for a single Workflow",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "flowId": {
            "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"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "description": {
            "type": "string",
            "maxLength": 32767
          },
          "iconData": {
            "type": "string",
            "maxLength": 32767,
            "pattern": "^data:image/(jpg|jpeg|png|svg\\+xml);base64,[0-9a-zA-Z+/=]*$"
          },
          "enabled": {
            "type": "boolean"
          },
          "defaultVersionId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "minimumAgentVersion": {
            "type": "string",
            "pattern": "^(0|([1-9]\\d*))\\.(0|([1-9]\\d*))\\.(0|([1-9]\\d*))$"
          },
          "flowClass": {
            "type": "string",
            "enum": [
              "cloud",
              "edge",
              "customNode"
            ]
          },
          "triggers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string",
                  "maxLength": 1024
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "dataTable",
                    "deviceCommand",
                    "deviceId",
                    "deviceIdConnect",
                    "deviceIdDisconnect",
                    "deviceIdInactivity",
                    "deviceTag",
                    "deviceTagConnect",
                    "deviceTagDisconnect",
                    "deviceTagInactivity",
                    "endpoint",
                    "event",
                    "integration",
                    "mqttTopic",
                    "request",
                    "customNodeStart",
                    "timer",
                    "udp",
                    "virtualButton",
                    "webhook"
                  ]
                },
                "config": {
                  "type": "object"
                },
                "meta": {
                  "type": "object"
                },
                "outputIds": {
                  "type": "array",
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "maxItems": 100
                  },
                  "maxItems": 100
                }
              },
              "additionalProperties": false,
              "required": [
                "type"
              ]
            }
          },
          "nodes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "maxLength": 1024
                },
                "type": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1024
                },
                "config": {
                  "type": "object"
                },
                "meta": {
                  "type": "object"
                },
                "outputIds": {
                  "type": "array",
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "maxItems": 100
                  },
                  "maxItems": 100
                }
              },
              "additionalProperties": false,
              "required": [
                "type"
              ]
            }
          },
          "customNodeConfig": {
            "type": "object",
            "properties": {
              "outputCount": {
                "type": "number",
                "enum": [
                  1,
                  2
                ]
              },
              "resultMode": {
                "type": "string",
                "enum": [
                  "optional",
                  "required",
                  "none"
                ]
              },
              "resultDescription": {
                "type": "string",
                "maxLength": 32767
              },
              "fields": {
                "type": "array",
                "maxItems": 100,
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "checkbox"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "defaultValue": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "select"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "defaultValue": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "options": {
                          "type": "array",
                          "minItems": 1,
                          "maxItems": 100,
                          "items": {
                            "type": "object",
                            "properties": {
                              "label": {
                                "type": "string",
                                "maxLength": 1024
                              },
                              "value": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 1024
                              }
                            },
                            "additionalProperties": false,
                            "required": [
                              "value"
                            ]
                          }
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label",
                        "defaultValue",
                        "options"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "stringTemplate"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "defaultValue": {
                          "type": "string",
                          "maxLength": 1024
                        },
                        "required": {
                          "type": "boolean"
                        },
                        "validRegExp": {
                          "type": "string",
                          "maxLength": 1024
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "numberTemplate"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "defaultValue": {
                          "type": "number"
                        },
                        "required": {
                          "type": "boolean"
                        },
                        "validMin": {
                          "type": "number"
                        },
                        "validMax": {
                          "type": "number"
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "jsonTemplate"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "defaultValue": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "required": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "payloadPath"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "required": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "section"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label"
                      ]
                    }
                  ]
                }
              }
            },
            "additionalProperties": false,
            "required": [
              "outputCount",
              "resultMode",
              "fields"
            ]
          },
          "customNodeSupports": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "cloud"
              ]
            }
          },
          "customNodeUseCount": {
            "type": "number"
          },
          "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
                }
              },
              "additionalProperties": false,
              "required": [
                "key",
                "json"
              ]
            }
          },
          "stats": {
            "type": "object",
            "properties": {
              "runCount": {
                "type": "number"
              },
              "errorCount": {
                "type": "number"
              },
              "byVersion": {
                "type": "object",
                "patternProperties": {
                  ".*": {
                    "type": "object",
                    "properties": {
                      "runCount": {
                        "type": "number"
                      },
                      "errorCount": {
                        "type": "number"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "flowVersions": {
      "maxItems": 1000,
      "type": "array",
      "items": {
        "title": "Workflow Version",
        "description": "Schema for a single Workflow Version",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "flowVersionId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "flowId": {
            "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"
          },
          "version": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "notes": {
            "type": "string",
            "maxLength": 32767
          },
          "enabled": {
            "type": "boolean"
          },
          "triggers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string",
                  "maxLength": 1024
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "dataTable",
                    "deviceCommand",
                    "deviceId",
                    "deviceIdConnect",
                    "deviceIdDisconnect",
                    "deviceIdInactivity",
                    "deviceTag",
                    "deviceTagConnect",
                    "deviceTagDisconnect",
                    "deviceTagInactivity",
                    "endpoint",
                    "event",
                    "integration",
                    "mqttTopic",
                    "request",
                    "customNodeStart",
                    "timer",
                    "udp",
                    "virtualButton",
                    "webhook"
                  ]
                },
                "config": {
                  "type": "object"
                },
                "meta": {
                  "type": "object"
                },
                "outputIds": {
                  "type": "array",
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "maxItems": 100
                  },
                  "maxItems": 100
                }
              },
              "additionalProperties": false,
              "required": [
                "type"
              ]
            }
          },
          "nodes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "maxLength": 1024
                },
                "type": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1024
                },
                "config": {
                  "type": "object"
                },
                "meta": {
                  "type": "object"
                },
                "outputIds": {
                  "type": "array",
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "maxItems": 100
                  },
                  "maxItems": 100
                }
              },
              "additionalProperties": false,
              "required": [
                "type"
              ]
            }
          },
          "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
                }
              },
              "additionalProperties": false,
              "required": [
                "key",
                "json"
              ]
            }
          },
          "minimumAgentVersion": {
            "type": "string",
            "pattern": "^(0|([1-9]\\d*))\\.(0|([1-9]\\d*))\\.(0|([1-9]\\d*))$"
          },
          "customNodeConfig": {
            "type": "object",
            "properties": {
              "outputCount": {
                "type": "number",
                "enum": [
                  1,
                  2
                ]
              },
              "resultMode": {
                "type": "string",
                "enum": [
                  "optional",
                  "required",
                  "none"
                ]
              },
              "resultDescription": {
                "type": "string",
                "maxLength": 32767
              },
              "fields": {
                "type": "array",
                "maxItems": 100,
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "checkbox"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "defaultValue": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "select"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "defaultValue": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "options": {
                          "type": "array",
                          "minItems": 1,
                          "maxItems": 100,
                          "items": {
                            "type": "object",
                            "properties": {
                              "label": {
                                "type": "string",
                                "maxLength": 1024
                              },
                              "value": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 1024
                              }
                            },
                            "additionalProperties": false,
                            "required": [
                              "value"
                            ]
                          }
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label",
                        "defaultValue",
                        "options"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "stringTemplate"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "defaultValue": {
                          "type": "string",
                          "maxLength": 1024
                        },
                        "required": {
                          "type": "boolean"
                        },
                        "validRegExp": {
                          "type": "string",
                          "maxLength": 1024
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "numberTemplate"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "defaultValue": {
                          "type": "number"
                        },
                        "required": {
                          "type": "boolean"
                        },
                        "validMin": {
                          "type": "number"
                        },
                        "validMax": {
                          "type": "number"
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "jsonTemplate"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "defaultValue": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "required": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "payloadPath"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        },
                        "required": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "section"
                          ]
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1024
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 32767
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "label"
                      ]
                    }
                  ]
                }
              }
            },
            "additionalProperties": false,
            "required": [
              "outputCount",
              "resultMode",
              "fields"
            ]
          }
        }
      }
    },
    "importedFlowIdMap": {
      "type": "object",
      "patternProperties": {
        "^[A-Fa-f\\d]{24}$": {
          "type": "string",
          "pattern": "^[A-Fa-f\\d]{24}$"
        }
      }
    },
    "importedVersionIdMap": {
      "type": "object",
      "patternProperties": {
        "^[A-Fa-f\\d]{24}$": {
          "type": "string",
          "pattern": "^[A-Fa-f\\d]{24}$"
        }
      }
    }
  }
}

Example

{
  "flows": [
    {
      "id": "575ed18f7ae143cd83dc4aa6",
      "flowId": "575ed18f7ae143cd83dc4aa6",
      "applicationId": "575ec8687ae143cd83dc4a97",
      "creationDate": "2016-06-13T04:00:00.000Z",
      "lastUpdated": "2016-06-13T04:00:00.000Z",
      "name": "My Workflow",
      "description": "Description of my empty workflow",
      "enabled": true,
      "triggers": [],
      "nodes": [],
      "globals": [],
      "stats": {
        "runCount": 0,
        "errorCount": 0
      }
    }
  ],
  "flowVersions": [],
  "importedFlowIdMap": {
    "575ed18f7ae143cd83dc4aa6": "575efbcc7ae143cd83dc4aae"
  },
  "importedVersionIdMap": {}
}


Github Login

Schema for the body of a Github login request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "accessToken": {
      "type": "string",
      "minLength": 1
    },
    "requestedScopes": {
      "type": "array",
      "uniqueItems": true,
      "items": {
        "oneOf": [
          {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "all.Application",
                  "all.Application.read",
                  "all.Device",
                  "all.Device.read",
                  "application.*",
                  "applicationApiToken.*",
                  "applicationApiTokens.*",
                  "applicationKey.*",
                  "applicationKeys.*",
                  "data.*",
                  "dataTable.*",
                  "dataTables.*",
                  "dataTableRow.*",
                  "dataTableRows.*",
                  "device.*",
                  "deviceRecipe.*",
                  "deviceRecipes.*",
                  "devices.*",
                  "edgeDeployments.*",
                  "event.*",
                  "events.*",
                  "experience.*",
                  "experienceDomain.*",
                  "experienceDomains.*",
                  "experienceEndpoint.*",
                  "experienceEndpoints.*",
                  "experienceGroup.*",
                  "experienceGroups.*",
                  "experienceUser.*",
                  "experienceUsers.*",
                  "experienceView.*",
                  "experienceViews.*",
                  "integration.*",
                  "integrations.*",
                  "file.*",
                  "files.*",
                  "flow.*",
                  "flows.*",
                  "flowVersion.*",
                  "flowVersions.*",
                  "webhook.*",
                  "webhooks.*",
                  "application.archiveData",
                  "application.backfillArchiveData",
                  "application.debug",
                  "application.delete",
                  "application.get",
                  "application.patch",
                  "application.payloadCounts",
                  "applicationApiToken.delete",
                  "applicationApiToken.get",
                  "applicationApiToken.patch",
                  "applicationApiTokens.get",
                  "applicationApiTokens.post",
                  "applicationKey.delete",
                  "applicationKey.get",
                  "applicationKey.patch",
                  "applicationKeys.get",
                  "applicationKeys.post",
                  "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.detailedSummary",
                  "devices.export",
                  "devices.get",
                  "devices.post",
                  "devices.sendCommand",
                  "edgeDeployments.get",
                  "edgeDeployments.release",
                  "edgeDeployments.remove",
                  "edgeDeployments.replace",
                  "event.delete",
                  "event.get",
                  "event.patch",
                  "events.get",
                  "events.mostRecentBySeverity",
                  "events.patch",
                  "events.post",
                  "experience.delete",
                  "experienceDomain.delete",
                  "experienceDomain.get",
                  "experienceDomain.patch",
                  "experienceDomains.get",
                  "experienceDomains.post",
                  "experienceEndpoint.delete",
                  "experienceEndpoint.get",
                  "experienceEndpoint.patch",
                  "experienceEndpoints.get",
                  "experienceEndpoints.post",
                  "experienceEndpoints.stats",
                  "experienceGroup.delete",
                  "experienceGroup.get",
                  "experienceGroup.patch",
                  "experienceGroups.detailedSummary",
                  "experienceGroups.get",
                  "experienceGroups.post",
                  "experienceUser.delete",
                  "experienceUser.get",
                  "experienceUser.patch",
                  "experienceUsers.detailedSummary",
                  "experienceUsers.get",
                  "experienceUsers.post",
                  "experienceView.debug",
                  "experienceView.delete",
                  "experienceView.get",
                  "experienceView.patch",
                  "experienceViews.debug",
                  "experienceViews.detailedSummary",
                  "experienceViews.get",
                  "experienceViews.post",
                  "file.get",
                  "file.patch",
                  "file.move",
                  "file.delete",
                  "files.get",
                  "files.post",
                  "flow.debug",
                  "flow.delete",
                  "flow.clearStorageEntries",
                  "flow.get",
                  "flow.getStorageEntries",
                  "flow.log",
                  "flow.patch",
                  "flow.pressVirtualButton",
                  "flow.setStorageEntry",
                  "flows.get",
                  "flows.import",
                  "flows.post",
                  "flowVersion.delete",
                  "flowVersion.get",
                  "flowVersion.log",
                  "flowVersion.patch",
                  "flowVersions.get",
                  "flowVersions.post",
                  "integration.delete",
                  "integration.get",
                  "integration.patch",
                  "integrations.get",
                  "integrations.post",
                  "webhook.delete",
                  "webhook.get",
                  "webhook.patch",
                  "webhooks.get",
                  "webhooks.post"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "all.Organization",
                  "all.Organization.read",
                  "applications.*",
                  "auditLog.*",
                  "auditLogs.*",
                  "dashboard.*",
                  "dashboards.*",
                  "org.*",
                  "solution.*",
                  "solutions.*",
                  "solutionUser.*",
                  "solutionUsers.*",
                  "applications.get",
                  "applications.post",
                  "auditLog.get",
                  "auditLogs.get",
                  "dashboard.patch",
                  "dashboard.delete",
                  "dashboards.get",
                  "dashboards.post",
                  "org.get",
                  "org.patch",
                  "org.delete",
                  "org.pendingInvites",
                  "org.inviteMember",
                  "org.revokeInvite",
                  "org.modifyMember",
                  "org.removeMember",
                  "org.payloadCounts",
                  "org.invoices",
                  "org.currentCard",
                  "org.chargeDetails",
                  "org.transferResources",
                  "solutionUser.get",
                  "solutionUser.patch",
                  "solutionUser.delete",
                  "solutionUsers.get",
                  "solutionUsers.post",
                  "solution.get",
                  "solution.patch",
                  "solution.delete",
                  "solutions.get",
                  "solutions.post"
                ]
              }
            ]
          },
          {
            "type": "string",
            "enum": [
              "all.User",
              "all.User.read",
              "me.*",
              "orgs.*",
              "me.get",
              "me.patch",
              "me.delete",
              "me.verifyEmail",
              "me.changePassword",
              "me.enableTwoFactorAuth",
              "me.disableTwoFactorAuth",
              "me.disconnectGithub",
              "me.connectGithub",
              "me.disconnectTwitter",
              "me.connectTwitter",
              "me.addRecentItem",
              "me.fetchRecentItems",
              "me.payloadCounts",
              "me.transferResources",
              "orgs.get",
              "orgs.post"
            ]
          }
        ]
      }
    },
    "tokenTTL": {
      "type": "integer",
      "minimum": 0
    }
  },
  "required": [
    "accessToken"
  ],
  "additionalProperties": false
}

Example

{
  "accessToken": "the github access token"
}


Integration

Schema for a single Integration

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "integrationId": {
      "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"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1024
    },
    "integrationType": {
      "type": "string",
      "enum": [
        "googlePubSub",
        "meridian",
        "mqtt",
        "particle"
      ]
    },
    "enabled": {
      "type": "boolean"
    },
    "topics": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1024
      }
    },
    "googlePubSubConfig": {
      "type": "object",
      "properties": {
        "projectId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "keyJson": {
          "type": "string",
          "maxLength": 32767,
          "minLength": 50
        }
      },
      "additionalProperties": false,
      "required": [
        "projectId",
        "keyJson"
      ]
    },
    "mqttConfig": {
      "type": "object",
      "properties": {
        "clientId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "username": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "password": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "clean": {
          "type": "boolean"
        },
        "port": {
          "type": "number",
          "minimum": 1,
          "maximum": 65535
        },
        "protocol": {
          "type": "string",
          "enum": [
            "mqtt",
            "mqtts",
            "ws",
            "wss"
          ]
        },
        "host": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "privateKey": {
          "type": "string",
          "maxLength": 32767,
          "minLength": 50
        },
        "certificate": {
          "type": "string",
          "maxLength": 32767,
          "minLength": 50
        },
        "caCertificate": {
          "type": "string",
          "maxLength": 32767,
          "minLength": 50
        }
      },
      "additionalProperties": false,
      "required": [
        "port",
        "protocol",
        "host"
      ]
    },
    "particleConfig": {
      "type": "object",
      "properties": {
        "accessToken": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "productSlugOrId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "orgSlugOrId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "deviceNameOrId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        }
      },
      "additionalProperties": false,
      "required": [
        "accessToken"
      ]
    },
    "meridianConfig": {
      "type": "object",
      "properties": {
        "authenticationToken": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "locationId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "assetUpdates": {
          "type": "boolean"
        },
        "zoneUpdates": {
          "type": "boolean"
        }
      },
      "additionalProperties": false,
      "required": [
        "authenticationToken",
        "locationId"
      ]
    },
    "status": {
      "lastKeepAlive": {
        "type": [
          "number"
        ]
      },
      "nextAttempt": {
        "type": [
          "number"
        ]
      },
      "connectInfo": {
        "type": "object",
        "properties": {
          "ts": {
            "type": [
              "number",
              "null"
            ]
          }
        }
      },
      "disconnectInfo": {
        "type": "object",
        "properties": {
          "ts": {
            "type": [
              "number",
              "null"
            ]
          },
          "error": {
            "type": "string"
          }
        }
      }
    }
  }
}

Example

{
  "id": "58ec07f20c747f65243d0d76",
  "integrationId": "58ec07f20c747f65243d0d76",
  "applicationId": "575ec8687ae143cd83dc4a97",
  "creationDate": "2016-06-13T04:00:00.000Z",
  "lastUpdated": "2016-06-13T04:00:00.000Z",
  "name": "Example Integrations",
  "integrationType": "mqtt",
  "enabled": true,
  "topics": [
    "myTopic"
  ],
  "mqttConfig": {
    "clientId": "exampleClientId",
    "username": "exampleUsername",
    "password": "examplePassword",
    "port": 8883,
    "protocol": "mqtts",
    "host": "broker.example.com"
  },
  "status": {
    "lastKeepAlive": 1491863679994,
    "connectInfo": {
      "ts": 1490629589313
    },
    "disconnectInfo": {
      "ts": 1490629587190,
      "error": "Keepalive Timeout"
    }
  }
}


Integration Patch

Schema for the body of an Integration modification request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1024
    },
    "integrationType": {
      "type": "string",
      "enum": [
        "googlePubSub",
        "meridian",
        "mqtt",
        "particle"
      ]
    },
    "enabled": {
      "type": "boolean"
    },
    "topics": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1024
      }
    },
    "googlePubSubConfig": {
      "type": "object",
      "properties": {
        "projectId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "keyJson": {
          "type": "string",
          "maxLength": 32767,
          "minLength": 50
        }
      },
      "additionalProperties": false,
      "required": [
        "projectId",
        "keyJson"
      ]
    },
    "mqttConfig": {
      "type": "object",
      "properties": {
        "clientId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "username": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "password": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "clean": {
          "type": "boolean"
        },
        "port": {
          "type": "number",
          "minimum": 1,
          "maximum": 65535
        },
        "protocol": {
          "type": "string",
          "enum": [
            "mqtt",
            "mqtts",
            "ws",
            "wss"
          ]
        },
        "host": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "privateKey": {
          "type": "string",
          "maxLength": 32767,
          "minLength": 50
        },
        "certificate": {
          "type": "string",
          "maxLength": 32767,
          "minLength": 50
        },
        "caCertificate": {
          "type": "string",
          "maxLength": 32767,
          "minLength": 50
        }
      },
      "additionalProperties": false,
      "required": [
        "port",
        "protocol",
        "host"
      ]
    },
    "particleConfig": {
      "type": "object",
      "properties": {
        "accessToken": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "productSlugOrId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "orgSlugOrId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "deviceNameOrId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        }
      },
      "additionalProperties": false,
      "required": [
        "accessToken"
      ]
    },
    "meridianConfig": {
      "type": "object",
      "properties": {
        "authenticationToken": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "locationId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "assetUpdates": {
          "type": "boolean"
        },
        "zoneUpdates": {
          "type": "boolean"
        }
      },
      "additionalProperties": false,
      "required": [
        "authenticationToken",
        "locationId"
      ]
    }
  },
  "additionalProperties": false
}

Example

{
  "topics": [
    "differentTopic"
  ]
}


Integration Post

Schema for the body of an Integration creation request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1024
    },
    "integrationType": {
      "type": "string",
      "enum": [
        "googlePubSub",
        "meridian",
        "mqtt",
        "particle"
      ]
    },
    "enabled": {
      "type": "boolean"
    },
    "topics": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1024
      }
    },
    "googlePubSubConfig": {
      "type": "object",
      "properties": {
        "projectId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "keyJson": {
          "type": "string",
          "maxLength": 32767,
          "minLength": 50
        }
      },
      "additionalProperties": false,
      "required": [
        "projectId",
        "keyJson"
      ]
    },
    "mqttConfig": {
      "type": "object",
      "properties": {
        "clientId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "username": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "password": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "clean": {
          "type": "boolean"
        },
        "port": {
          "type": "number",
          "minimum": 1,
          "maximum": 65535
        },
        "protocol": {
          "type": "string",
          "enum": [
            "mqtt",
            "mqtts",
            "ws",
            "wss"
          ]
        },
        "host": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "privateKey": {
          "type": "string",
          "maxLength": 32767,
          "minLength": 50
        },
        "certificate": {
          "type": "string",
          "maxLength": 32767,
          "minLength": 50
        },
        "caCertificate": {
          "type": "string",
          "maxLength": 32767,
          "minLength": 50
        }
      },
      "additionalProperties": false,
      "required": [
        "port",
        "protocol",
        "host"
      ]
    },
    "particleConfig": {
      "type": "object",
      "properties": {
        "accessToken": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "productSlugOrId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "orgSlugOrId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "deviceNameOrId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        }
      },
      "additionalProperties": false,
      "required": [
        "accessToken"
      ]
    },
    "meridianConfig": {
      "type": "object",
      "properties": {
        "authenticationToken": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "locationId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "assetUpdates": {
          "type": "boolean"
        },
        "zoneUpdates": {
          "type": "boolean"
        }
      },
      "additionalProperties": false,
      "required": [
        "authenticationToken",
        "locationId"
      ]
    }
  },
  "additionalProperties": false,
  "required": [
    "name",
    "integrationType"
  ]
}

Example

{
  "name": "Example Integrations",
  "integrationType": "mqtt",
  "topics": [
    "myTopic"
  ],
  "mqttConfig": {
    "clientId": "exampleClientId",
    "username": "exampleUsername",
    "password": "examplePassword",
    "port": 8883,
    "protocol": "mqtts",
    "host": "broker.example.com"
  }
}


Integrations

Schema for a collection of Integrations

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "title": "Integration",
        "description": "Schema for a single Integration",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "integrationId": {
            "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"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          },
          "integrationType": {
            "type": "string",
            "enum": [
              "googlePubSub",
              "meridian",
              "mqtt",
              "particle"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "topics": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            }
          },
          "googlePubSubConfig": {
            "type": "object",
            "properties": {
              "projectId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1024
              },
              "keyJson": {
                "type": "string",
                "maxLength": 32767,
                "minLength": 50
              }
            },
            "additionalProperties": false,
            "required": [
              "projectId",
              "keyJson"
            ]
          },
          "mqttConfig": {
            "type": "object",
            "properties": {
              "clientId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1024
              },
              "username": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1024
              },
              "password": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1024
              },
              "clean": {
                "type": "boolean"
              },
              "port": {
                "type": "number",
                "minimum": 1,
                "maximum": 65535
              },
              "protocol": {
                "type": "string",
                "enum": [
                  "mqtt",
                  "mqtts",
                  "ws",
                  "wss"
                ]
              },
              "host": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1024
              },
              "privateKey": {
                "type": "string",
                "maxLength": 32767,
                "minLength": 50
              },
              "certificate": {
                "type": "string",
                "maxLength": 32767,
                "minLength": 50
              },
              "caCertificate": {
                "type": "string",
                "maxLength": 32767,
                "minLength": 50
              }
            },
            "additionalProperties": false,
            "required": [
              "port",
              "protocol",
              "host"
            ]
          },
          "particleConfig": {
            "type": "object",
            "properties": {
              "accessToken": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1024
              },
              "productSlugOrId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1024
              },
              "orgSlugOrId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1024
              },
              "deviceNameOrId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1024
              }
            },
            "additionalProperties": false,
            "required": [
              "accessToken"
            ]
          },
          "meridianConfig": {
            "type": "object",
            "properties": {
              "authenticationToken": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1024
              },
              "locationId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1024
              },
              "assetUpdates": {
                "type": "boolean"
              },
              "zoneUpdates": {
                "type": "boolean"
              }
            },
            "additionalProperties": false,
            "required": [
              "authenticationToken",
              "locationId"
            ]
          },
          "status": {
            "lastKeepAlive": {
              "type": [
                "number"
              ]
            },
            "nextAttempt": {
              "type": [
                "number"
              ]
            },
            "connectInfo": {
              "type": "object",
              "properties": {
                "ts": {
                  "type": [
                    "number",
                    "null"
                  ]
                }
              }
            },
            "disconnectInfo": {
              "type": "object",
              "properties": {
                "ts": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "error": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "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"
      ]
    },
    "applicationId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    }
  }
}

Example

{
  "items": [
    {
      "$ref": "#/examples/integrations"
    }
  ],
  "count": 1,
  "totalCount": 4,
  "perPage": 1,
  "page": 0,
  "sortField": "name",
  "sortDirection": "asc",
  "applicationId": "575ec8687ae143cd83dc4a97"
}


Last Value Data

Schema for the result of a last value query

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "patternProperties": {
    "^[A-Fa-f\\d]{24}$": {
      "type": "object",
      "properties": {
        "time": {
          "type": "string",
          "format": "date-time"
        },
        "data": {
          "type": "object",
          "patternProperties": {
            "^[0-9a-zA-Z_-]{1,255}$": {
              "type": [
                "number",
                "string",
                "boolean"
              ]
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false,
      "required": [
        "data",
        "time"
      ]
    }
  },
  "additionalProperties": false
}

Example

{
  "575ecf887ae143cd83dc4aa2": {
    "time": "2016-06-13T04:00:00.000Z",
    "data": {
      "voltage": 12
    }
  },
  "575ef5c97ae143cd83dc4aac": {
    "time": "2016-06-12T08:30:00.000Z",
    "data": {
      "voltage": 19
    }
  }
}


Last Value Query

Schema for the body of a last value query request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "attribute": {
      "type": "string",
      "pattern": "^[0-9a-zA-Z_-]{1,255}$"
    },
    "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
    },
    "deviceIds": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[A-Fa-f\\d]{24}$"
      },
      "maxItems": 1000
    }
  },
  "additionalProperties": false
}

Example

{
  "deviceIds": [
    "575ecf887ae143cd83dc4aa2",
    "575ef5c97ae143cd83dc4aac"
  ],
  "attribute": "voltage"
}


Me

Schema for information about the currently authenticated user

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "userId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "creationDate": {
      "type": "string",
      "format": "date-time"
    },
    "lastUpdated": {
      "type": "string",
      "format": "date-time"
    },
    "passwordLastUpdated": {
      "type": "string",
      "format": "date-time"
    },
    "email": {
      "type": "string",
      "format": "email",
      "maxLength": 1024
    },
    "firstName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1024
    },
    "lastName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1024
    },
    "companyName": {
      "type": "string",
      "maxLength": 1024
    },
    "title": {
      "type": "string",
      "maxLength": 1024
    },
    "phoneNumber": {
      "type": "string",
      "maxLength": 1024
    },
    "location": {
      "type": "string",
      "maxLength": 1024
    },
    "url": {
      "type": "string",
      "maxLength": 1024
    },
    "tokenCutoff": {
      "type": "string",
      "format": "date-time"
    },
    "emailVerified": {
      "type": "boolean"
    },
    "twoFactorAuthEnabled": {
      "type": "boolean"
    },
    "fullName": {
      "type": "string"
    },
    "githubName": {
      "type": "string"
    },
    "twitterName": {
      "type": "string"
    },
    "avatarUrl": {
      "type": "string",
      "format": "url"
    },
    "limits": {
      "apitoken": {
        "type": "number"
      },
      "application": {
        "type": "number"
      },
      "applicationkey": {
        "type": "number"
      },
      "dashboard": {
        "type": "number"
      },
      "datatable": {
        "type": "number"
      },
      "device": {
        "type": "number"
      },
      "devicerecipe": {
        "type": "number"
      },
      "experiencedomain": {
        "type": "number"
      },
      "experienceendpoint": {
        "type": "number"
      },
      "experiencegroup": {
        "type": "number"
      },
      "experienceuser": {
        "type": "number"
      },
      "experienceview": {
        "type": "number"
      },
      "file": {
        "type": "number"
      },
      "flow": {
        "type": "number"
      },
      "integration": {
        "type": "number"
      },
      "webhook": {
        "type": "number"
      },
      "dataTTL": {
        "type": "number"
      },
      "payload": {
        "type": "number"
      }
    },
    "recentDashboards": {
      "title": "Recent Item List",
      "description": "Schema for an array of recent items",
      "type": "object",
      "properties": {
        "itemType": {
          "type": "string",
          "enum": [
            "application",
            "device",
            "flow",
            "dashboard",
            "organization"
          ]
        },
        "parentId": {
          "type": "string",
          "pattern": "^[A-Fa-f\\d]{24}$"
        },
        "items": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^[A-Fa-f\\d]{24}$"
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              }
            }
          }
        }
      }
    },
    "recentApplications": {
      "title": "Recent Item List",
      "description": "Schema for an array of recent items",
      "type": "object",
      "properties": {
        "itemType": {
          "type": "string",
          "enum": [
            "application",
            "device",
            "flow",
            "dashboard",
            "organization"
          ]
        },
        "parentId": {
          "type": "string",
          "pattern": "^[A-Fa-f\\d]{24}$"
        },
        "items": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^[A-Fa-f\\d]{24}$"
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              }
            }
          }
        }
      }
    },
    "recentOrganizations": {
      "title": "Recent Item List",
      "description": "Schema for an array of recent items",
      "type": "object",
      "properties": {
        "itemType": {
          "type": "string",
          "enum": [
            "application",
            "device",
            "flow",
            "dashboard",
            "organization"
          ]
        },
        "parentId": {
          "type": "string",
          "pattern": "^[A-Fa-f\\d]{24}$"
        },
        "items": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^[A-Fa-f\\d]{24}$"
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              }
            }
          }
        }
      }
    },
    "summary": {
      "type": "object",
      "properties": {
        "apiTokenCount": {
          "type": "number"
        },
        "appCount": {
          "type": "number"
        },
        "keyCount": {
          "type": "number"
        },
        "dashCount": {
          "type": "number"
        },
        "dataTableCount": {
          "type": "number"
        },
        "deviceCount": {
          "type": "number"
        },
        "deviceRecipeCount": {
          "type": "number"
        },
        "experienceDomainCount": {
          "type": "number"
        },
        "experienceEndpointCount": {
          "type": "number"
        },
        "experienceGroupCount": {
          "type": "number"
        },
        "experienceUserCount": {
          "type": "number"
        },
        "experienceViewCount": {
          "type": "number"
        },
        "fileCount": {
          "type": "number"
        },
        "flowCount": {
          "type": "number"
        },
        "orgCount": {
          "type": "number"
        },
        "payloadCount": {
          "title": "Payload Counts",
          "description": "Schema for the result of a payload count request",
          "type": "object",
          "properties": {
            "mqttOut": {
              "type": "object",
              "patternProperties": {
                ".*": {
                  "type": "number"
                }
              }
            },
            "mqttIn": {
              "type": "object",
              "patternProperties": {
                ".*": {
                  "type": "number"
                }
              }
            },
            "dataTable": {
              "type": "object",
              "patternProperties": {
                ".*": {
                  "type": "number"
                }
              }
            },
            "deviceState": {
              "type": "object",
              "patternProperties": {
                ".*": {
                  "type": "number"
                }
              }
            },
            "deviceCommand": {
              "type": "object",
              "patternProperties": {
                ".*": {
                  "type": "number"
                }
              }
            },
            "webhook": {
              "type": "object",
              "patternProperties": {
                ".*": {
                  "type": "number"
                }
              }
            },
            "timer": {
              "type": "object",
              "patternProperties": {
                ".*": {
                  "type": "number"
                }
              }
            },
            "event": {
              "type": "object",
              "patternProperties": {
                ".*": {
                  "type": "number"
                }
              }
            },
            "virtualButton": {
              "type": "object",
              "patternProperties": {
                ".*": {
                  "type": "number"
                }
              }
            },
            "deviceConnect": {
              "type": "object",
              "patternProperties": {
                ".*": {
                  "type": "number"
                }
              }
            },
            "deviceDisconnect": {
              "type": "object",
              "patternProperties": {
                ".*": {
                  "type": "number"
                }
              }
            },
            "endpoint": {
              "type": "object",
              "patternProperties": {
                ".*": {
                  "type": "number"
                }
              }
            },
            "integration": {
              "type": "object",
              "patternProperties": {
                ".*": {
                  "type": "number"
                }
              }
            }
          }
        },
        "integrationCount": {
          "type": "number"
        },
        "webhookCount": {
          "type": "number"
        }
      }
    },
    "currentPeriodStart": {
      "type": "string",
      "format": "date-time"
    },
    "currentPeriodEnd": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Example

{
  "id": "575ed70c7ae143cd83dc4aa9",
  "userId": "575ed70c7ae143cd83dc4aa9",
  "creationDate": "2016-06-13T04:00:00.000Z",
  "lastUpdated": "2016-06-13T04:00:00.000Z",
  "passwordLastUpdated": "2016-06-13T04:00:00.000Z",
  "email": "example@losant.com",
  "firstName": "Example",
  "lastName": "Name",
  "companyName": "Losant IoT, Inc.",
  "url": "https://www.losant.com",
  "emailVerified": true,
  "twoFactorAuthEnabled": false,
  "fullName": "Example Name",
  "summary": {
    "appCount": 8,
    "dashCount": 5,
    "orgCount": 2,
    "deviceCount": 12,
    "flowCount": 3,
    "webhookCount": 0,
    "keyCount": 2,
    "deviceRecipeCount": 0
  }
}


Me Patch

Schema for the body of request to modify the current user

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "format": "email",
      "maxLength": 1024
    },
    "firstName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1024
    },
    "lastName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1024
    },
    "companyName": {
      "type": "string",
      "maxLength": 1024
    },
    "title": {
      "type": "string",
      "maxLength": 1024
    },
    "phoneNumber": {
      "type": "string",
      "maxLength": 1024
    },
    "location": {
      "type": "string",
      "maxLength": 1024
    },
    "url": {
      "type": "string",
      "maxLength": 1024
    },
    "password": {
      "type": "string",
      "minLength": 8,
      "maxLength": 2048,
      "pattern": "^(?=.*[A-Z])(?=.*[^A-z0-9])(?=.*[0-9])(?=.*[a-z]).{8,}$"
    },
    "tokenCutoff": {
      "type": "string",
      "format": "date-time"
    }
  },
  "additionalProperties": false
}

Example

{
  "email": "example@losant.com",
  "firstName": "Example",
  "lastName": "Name",
  "companyName": "Losant IoT, Inc.",
  "url": "https://www.losant.com",
  "password": "my new password"
}


Multi Device Command

Schema for the body of a request to send a command to multiple Devices

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "time": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "number"
        },
        {
          "type": "object",
          "properties": {
            "$date": {
              "type": "string"
            }
          },
          "additionalProperties": false,
          "required": [
            "$date"
          ]
        }
      ]
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "payload": {},
    "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
    },
    "deviceIds": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[A-Fa-f\\d]{24}$"
      },
      "maxItems": 1000
    }
  },
  "required": [
    "name"
  ],
  "additionalProperties": false
}

Example

{
  "time": "2016-06-13T04:00:00.000Z",
  "name": "myCommand",
  "payload": [
    1,
    1,
    2,
    3,
    5
  ],
  "deviceTags": [
    {
      "key": "floor",
      "value": 8
    }
  ]
}


Organization

Schema for a single Organization

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "orgId": {
      "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
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "solutionsEnabled": {
      "type": "boolean"
    },
    "members": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "userId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "firstName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          },
          "lastName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          },
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 1024
          },
          "avatarUrl": {
            "type": "string",
            "format": "url"
          },
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "edit",
              "collaborate",
              "view",
              "none"
            ]
          },
          "applicationRoles": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "resourceId": {
                  "type": "string",
                  "pattern": "^[A-Fa-f\\d]{24}$"
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "collaborate",
                    "view",
                    "none"
                  ]
                }
              },
              "required": [
                "resourceId",
                "role"
              ],
              "additionalProperties": false
            },
            "maxItems": 1000
          },
          "dashboardRoles": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "resourceId": {
                  "type": "string",
                  "pattern": "^[A-Fa-f\\d]{24}$"
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "collaborate",
                    "view",
                    "none"
                  ]
                }
              },
              "required": [
                "resourceId",
                "role"
              ],
              "additionalProperties": false
            },
            "maxItems": 1000
          }
        }
      }
    },
    "limits": {
      "apitoken": {
        "type": "number"
      },
      "application": {
        "type": "number"
      },
      "applicationkey": {
        "type": "number"
      },
      "dashboard": {
        "type": "number"
      },
      "datatable": {
        "type": "number"
      },
      "device": {
        "type": "number"
      },
      "devicerecipe": {
        "type": "number"
      },
      "experiencedomain": {
        "type": "number"
      },
      "experienceendpoint": {
        "type": "number"
      },
      "experiencegroup": {
        "type": "number"
      },
      "experienceuser": {
        "type": "number"
      },
      "experienceview": {
        "type": "number"
      },
      "file": {
        "type": "number"
      },
      "flow": {
        "type": "number"
      },
      "solution": {
        "type": "number"
      },
      "integration": {
        "type": "number"
      },
      "webhook": {
        "type": "number"
      },
      "dataTTL": {
        "type": "number"
      },
      "member": {
        "type": "number"
      },
      "payload": {
        "type": "number"
      }
    },
    "summary": {
      "type": "object",
      "properties": {
        "apiTokenCount": {
          "type": "number"
        },
        "appCount": {
          "type": "number"
        },
        "keyCount": {
          "type": "number"
        },
        "dashCount": {
          "type": "number"
        },
        "dataTableCount": {
          "type": "number"
        },
        "deviceCount": {
          "type": "number"
        },
        "deviceRecipeCount": {
          "type": "number"
        },
        "experienceDomainCount": {
          "type": "number"
        },
        "experienceEndpointCount": {
          "type": "number"
        },
        "experienceGroupCount": {
          "type": "number"
        },
        "experienceUserCount": {
          "type": "number"
        },
        "experienceViewCount": {
          "type": "number"
        },
        "fileCount": {
          "type": "number"
        },
        "flowCount": {
          "type": "number"
        },
        "memberCount": {
          "type": "number"
        },
        "pendingInviteCount": {
          "type": "number"
        },
        "payloadCount": {
          "title": "Payload Counts",
          "description": "Schema for the result of a payload count request",
          "type": "object",
          "properties": {
            "mqttOut": {
              "type": "object",
              "patternProperties": {
                ".*": {
                  "type": "number"
                }
              }
            },
            "mqttIn": {
              "type": "object",
              "patternProperties": {
                ".*": {
                  "type": "number"
                }
              }
            },
            "dataTable": {
              "type": "object",
              "patternProperties": {
                ".*": {
                  "type": "number"
                }
              }
            },
            "deviceState": {
              "type": "object",
              "patternProperties": {
                ".*": {
                  "type": "number"
                }
              }
            },
            "deviceCommand": {
              "type": "object",
              "patternProperties": {
                ".*": {
                  "type": "number"
                }
              }
            },
            "webhook": {
              "type": "object",
              "patternProperties": {
                ".*": {
                  "type": "number"
                }
              }
            },
            "timer": {
              "type": "object",
              "patternProperties": {
                ".*": {
                  "type": "number"
                }
              }
            },
            "event": {
              "type": "object",
              "patternProperties": {
                ".*": {
                  "type": "number"
                }
              }
            },
            "virtualButton": {
              "type": "object",
              "patternProperties": {
                ".*": {
                  "type": "number"
                }
              }
            },
            "deviceConnect": {
              "type": "object",
              "patternProperties": {
                ".*": {
                  "type": "number"
                }
              }
            },
            "deviceDisconnect": {
              "type": "object",
              "patternProperties": {
                ".*": {
                  "type": "number"
                }
              }
            },
            "endpoint": {
              "type": "object",
              "patternProperties": {
                ".*": {
                  "type": "number"
                }
              }
            },
            "integration": {
              "type": "object",
              "patternProperties": {
                ".*": {
                  "type": "number"
                }
              }
            }
          }
        },
        "solutionCount": {
          "type": "number"
        },
        "integrationCount": {
          "type": "number"
        },
        "webhookCount": {
          "type": "number"
        }
      }
    },
    "planId": {
      "type": "string",
      "maxLength": 1024
    },
    "billingEmail": {
      "type": "string",
      "format": "email",
      "maxLength": 1024
    },
    "subscriptionStatus": {
      "type": "string",
      "enum": [
        "trialing",
        "active",
        "past_due",
        "canceled",
        "unpaid"
      ]
    },
    "currentPeriodStart": {
      "type": "string",
      "format": "date-time"
    },
    "currentPeriodEnd": {
      "type": "string",
      "format": "date-time"
    },
    "isEnterprise": {
      "type": "boolean"
    },
    "iconColor": {
      "type": "string"
    }
  }
}

Example

{
  "id": "575ed6e87ae143cd83dc4aa8",
  "orgId": "575ed6e87ae143cd83dc4aa8",
  "creationDate": "2016-06-13T04:00:00.000Z",
  "lastUpdated": "2016-06-13T04:00:00.000Z",
  "name": "My Organization",
  "description": "My organization description",
  "members": [
    {
      "userId": "575ed70c7ae143cd83dc4aa9",
      "firstName": "Example",
      "lastName": "Name",
      "email": "example@losant.com",
      "role": "admin"
    },
    {
      "userId": "575ef90f7ae143cd83dc4aad",
      "firstName": "Other View",
      "lastName": "Only User",
      "email": "viewer@losant.com",
      "role": "view"
    }
  ],
  "summary": {
    "appCount": 2,
    "dashCount": 1,
    "solutionCount": 0,
    "deviceCount": 12,
    "flowCount": 3,
    "webhookCount": 0,
    "keyCount": 2,
    "deviceRecipeCount": 0
  }
}


Organization Invitation Action

Schema for the body of a request to accept or reject an invitation

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "format": "email",
      "maxLength": 1024
    },
    "token": {
      "type": "string",
      "minLength": 1
    },
    "accept": {
      "type": "boolean"
    }
  },
  "additionalProperties": false,
  "required": [
    "email",
    "token",
    "accept"
  ]
}

Example

{
  "email": "invitedUser@losant.com",
  "token": "the_invitation_token",
  "accept": true
}


Organization Invitation Information

Schema for information about an invitation

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "orgName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "email": {
      "type": "string",
      "format": "email",
      "maxLength": 1024
    },
    "role": {
      "type": "string",
      "enum": [
        "admin",
        "edit",
        "collaborate",
        "view",
        "none"
      ]
    },
    "inviteDate": {
      "type": "string",
      "format": "date-time"
    },
    "ttl": {
      "type": "number"
    }
  }
}

Example

{
  "orgName": "My Organization",
  "email": "invitedUser@losant.com",
  "role": "edit",
  "inviteDate": "2016-05-13T04:00:00.000Z",
  "ttl": 4233600000
}


Organization Invitation Post

Schema for the body of a request to send an invitation

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "format": "email",
      "maxLength": 1024
    },
    "role": {
      "type": "string",
      "enum": [
        "admin",
        "edit",
        "collaborate",
        "view",
        "none"
      ]
    },
    "applicationRoles": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "resourceId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "role": {
            "type": "string",
            "enum": [
              "collaborate",
              "view",
              "none"
            ]
          }
        },
        "required": [
          "resourceId",
          "role"
        ],
        "additionalProperties": false
      },
      "maxItems": 1000
    },
    "dashboardRoles": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "resourceId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "role": {
            "type": "string",
            "enum": [
              "collaborate",
              "view",
              "none"
            ]
          }
        },
        "required": [
          "resourceId",
          "role"
        ],
        "additionalProperties": false
      },
      "maxItems": 1000
    }
  },
  "additionalProperties": false,
  "required": [
    "email",
    "role"
  ]
}

Example

{
  "email": "invitedUser@losant.com",
  "role": "edit"
}


Organization Invitation Result

Schema for the result of accepting/rejecting an invitation

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "accepted": {
      "type": "boolean"
    },
    "orgId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    }
  }
}

Example

{
  "accepted": true,
  "orgId": "575ed6e87ae143cd83dc4aa8"
}


Organization Invitations

Schema for an array of pending invitations to an Organization

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "pattern": "^[A-Fa-f\\d]{24}$"
      },
      "email": {
        "type": "string",
        "format": "email",
        "maxLength": 1024
      },
      "role": {
        "type": "string",
        "enum": [
          "admin",
          "edit",
          "collaborate",
          "view",
          "none"
        ]
      },
      "applicationRoles": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "resourceId": {
              "type": "string",
              "pattern": "^[A-Fa-f\\d]{24}$"
            },
            "role": {
              "type": "string",
              "enum": [
                "collaborate",
                "view",
                "none"
              ]
            }
          },
          "required": [
            "resourceId",
            "role"
          ],
          "additionalProperties": false
        },
        "maxItems": 1000
      },
      "dashboardRoles": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "resourceId": {
              "type": "string",
              "pattern": "^[A-Fa-f\\d]{24}$"
            },
            "role": {
              "type": "string",
              "enum": [
                "collaborate",
                "view",
                "none"
              ]
            }
          },
          "required": [
            "resourceId",
            "role"
          ],
          "additionalProperties": false
        },
        "maxItems": 1000
      },
      "inviteDate": {
        "type": "string",
        "format": "date-time"
      },
      "ttl": {
        "type": "number"
      },
      "hasExpired": {
        "type": "boolean"
      }
    }
  }
}

Example

[
  {
    "id": "575ed71e7ae143cd83dc4aaa",
    "email": "invitedUser@losant.com",
    "role": "edit",
    "inviteDate": "2016-05-13T04:00:00.000Z",
    "ttl": 4233600000,
    "hasExpired": true
  }
]


Organization Member Patch

Schema for the body of a request to modify an Organization member

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "userId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "role": {
      "type": "string",
      "enum": [
        "admin",
        "edit",
        "collaborate",
        "view",
        "none"
      ]
    },
    "applicationRoles": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "resourceId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "role": {
            "type": "string",
            "enum": [
              "collaborate",
              "view",
              "none"
            ]
          }
        },
        "required": [
          "resourceId",
          "role"
        ],
        "additionalProperties": false
      },
      "maxItems": 1000
    },
    "dashboardRoles": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "resourceId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "role": {
            "type": "string",
            "enum": [
              "collaborate",
              "view",
              "none"
            ]
          }
        },
        "required": [
          "resourceId",
          "role"
        ],
        "additionalProperties": false
      },
      "maxItems": 1000
    }
  },
  "additionalProperties": false,
  "required": [
    "userId"
  ]
}

Example

{
  "userId": "575ef90f7ae143cd83dc4aad",
  "role": "view"
}


Organization Patch

Schema for the body of an Organization modification request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "planId": {
      "type": "string",
      "maxLength": 1024
    },
    "billingEmail": {
      "type": "string",
      "format": "email",
      "maxLength": 1024
    },
    "cardToken": {
      "type": "string",
      "maxLength": 1024
    },
    "iconColor": {
      "type": "string"
    }
  },
  "additionalProperties": false
}

Example

{
  "name": "My Updated Organization",
  "description": "Description of my updated organization"
}


Organization Post

Schema for the body of an Organization creation request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "planId": {
      "type": "string",
      "maxLength": 1024
    },
    "billingEmail": {
      "type": "string",
      "format": "email",
      "maxLength": 1024
    },
    "cardToken": {
      "type": "string",
      "maxLength": 1024
    },
    "iconColor": {
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}

Example

{
  "name": "My New Organization",
  "description": "Description of my new organization"
}


Organizations

Schema for a collection of Organizations

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "title": "Organization",
        "description": "Schema for a single Organization",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "orgId": {
            "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
          },
          "description": {
            "type": "string",
            "maxLength": 32767
          },
          "solutionsEnabled": {
            "type": "boolean"
          },
          "members": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "userId": {
                  "type": "string",
                  "pattern": "^[A-Fa-f\\d]{24}$"
                },
                "firstName": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1024
                },
                "lastName": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1024
                },
                "email": {
                  "type": "string",
                  "format": "email",
                  "maxLength": 1024
                },
                "avatarUrl": {
                  "type": "string",
                  "format": "url"
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "admin",
                    "edit",
                    "collaborate",
                    "view",
                    "none"
                  ]
                },
                "applicationRoles": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "resourceId": {
                        "type": "string",
                        "pattern": "^[A-Fa-f\\d]{24}$"
                      },
                      "role": {
                        "type": "string",
                        "enum": [
                          "collaborate",
                          "view",
                          "none"
                        ]
                      }
                    },
                    "required": [
                      "resourceId",
                      "role"
                    ],
                    "additionalProperties": false
                  },
                  "maxItems": 1000
                },
                "dashboardRoles": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "resourceId": {
                        "type": "string",
                        "pattern": "^[A-Fa-f\\d]{24}$"
                      },
                      "role": {
                        "type": "string",
                        "enum": [
                          "collaborate",
                          "view",
                          "none"
                        ]
                      }
                    },
                    "required": [
                      "resourceId",
                      "role"
                    ],
                    "additionalProperties": false
                  },
                  "maxItems": 1000
                }
              }
            }
          },
          "limits": {
            "apitoken": {
              "type": "number"
            },
            "application": {
              "type": "number"
            },
            "applicationkey": {
              "type": "number"
            },
            "dashboard": {
              "type": "number"
            },
            "datatable": {
              "type": "number"
            },
            "device": {
              "type": "number"
            },
            "devicerecipe": {
              "type": "number"
            },
            "experiencedomain": {
              "type": "number"
            },
            "experienceendpoint": {
              "type": "number"
            },
            "experiencegroup": {
              "type": "number"
            },
            "experienceuser": {
              "type": "number"
            },
            "experienceview": {
              "type": "number"
            },
            "file": {
              "type": "number"
            },
            "flow": {
              "type": "number"
            },
            "solution": {
              "type": "number"
            },
            "integration": {
              "type": "number"
            },
            "webhook": {
              "type": "number"
            },
            "dataTTL": {
              "type": "number"
            },
            "member": {
              "type": "number"
            },
            "payload": {
              "type": "number"
            }
          },
          "summary": {
            "type": "object",
            "properties": {
              "apiTokenCount": {
                "type": "number"
              },
              "appCount": {
                "type": "number"
              },
              "keyCount": {
                "type": "number"
              },
              "dashCount": {
                "type": "number"
              },
              "dataTableCount": {
                "type": "number"
              },
              "deviceCount": {
                "type": "number"
              },
              "deviceRecipeCount": {
                "type": "number"
              },
              "experienceDomainCount": {
                "type": "number"
              },
              "experienceEndpointCount": {
                "type": "number"
              },
              "experienceGroupCount": {
                "type": "number"
              },
              "experienceUserCount": {
                "type": "number"
              },
              "experienceViewCount": {
                "type": "number"
              },
              "fileCount": {
                "type": "number"
              },
              "flowCount": {
                "type": "number"
              },
              "memberCount": {
                "type": "number"
              },
              "pendingInviteCount": {
                "type": "number"
              },
              "payloadCount": {
                "title": "Payload Counts",
                "description": "Schema for the result of a payload count request",
                "type": "object",
                "properties": {
                  "mqttOut": {
                    "type": "object",
                    "patternProperties": {
                      ".*": {
                        "type": "number"
                      }
                    }
                  },
                  "mqttIn": {
                    "type": "object",
                    "patternProperties": {
                      ".*": {
                        "type": "number"
                      }
                    }
                  },
                  "dataTable": {
                    "type": "object",
                    "patternProperties": {
                      ".*": {
                        "type": "number"
                      }
                    }
                  },
                  "deviceState": {
                    "type": "object",
                    "patternProperties": {
                      ".*": {
                        "type": "number"
                      }
                    }
                  },
                  "deviceCommand": {
                    "type": "object",
                    "patternProperties": {
                      ".*": {
                        "type": "number"
                      }
                    }
                  },
                  "webhook": {
                    "type": "object",
                    "patternProperties": {
                      ".*": {
                        "type": "number"
                      }
                    }
                  },
                  "timer": {
                    "type": "object",
                    "patternProperties": {
                      ".*": {
                        "type": "number"
                      }
                    }
                  },
                  "event": {
                    "type": "object",
                    "patternProperties": {
                      ".*": {
                        "type": "number"
                      }
                    }
                  },
                  "virtualButton": {
                    "type": "object",
                    "patternProperties": {
                      ".*": {
                        "type": "number"
                      }
                    }
                  },
                  "deviceConnect": {
                    "type": "object",
                    "patternProperties": {
                      ".*": {
                        "type": "number"
                      }
                    }
                  },
                  "deviceDisconnect": {
                    "type": "object",
                    "patternProperties": {
                      ".*": {
                        "type": "number"
                      }
                    }
                  },
                  "endpoint": {
                    "type": "object",
                    "patternProperties": {
                      ".*": {
                        "type": "number"
                      }
                    }
                  },
                  "integration": {
                    "type": "object",
                    "patternProperties": {
                      ".*": {
                        "type": "number"
                      }
                    }
                  }
                }
              },
              "solutionCount": {
                "type": "number"
              },
              "integrationCount": {
                "type": "number"
              },
              "webhookCount": {
                "type": "number"
              }
            }
          },
          "planId": {
            "type": "string",
            "maxLength": 1024
          },
          "billingEmail": {
            "type": "string",
            "format": "email",
            "maxLength": 1024
          },
          "subscriptionStatus": {
            "type": "string",
            "enum": [
              "trialing",
              "active",
              "past_due",
              "canceled",
              "unpaid"
            ]
          },
          "currentPeriodStart": {
            "type": "string",
            "format": "date-time"
          },
          "currentPeriodEnd": {
            "type": "string",
            "format": "date-time"
          },
          "isEnterprise": {
            "type": "boolean"
          },
          "iconColor": {
            "type": "string"
          }
        }
      }
    },
    "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"
      ]
    }
  }
}

Example

{
  "items": [
    {
      "id": "575ed6e87ae143cd83dc4aa8",
      "orgId": "575ed6e87ae143cd83dc4aa8",
      "creationDate": "2016-06-13T04:00:00.000Z",
      "lastUpdated": "2016-06-13T04:00:00.000Z",
      "name": "My Organization",
      "description": "My organization description",
      "members": [
        {
          "userId": "575ed70c7ae143cd83dc4aa9",
          "firstName": "Example",
          "lastName": "Name",
          "email": "example@losant.com",
          "role": "admin"
        },
        {
          "userId": "575ef90f7ae143cd83dc4aad",
          "firstName": "Other View",
          "lastName": "Only User",
          "email": "viewer@losant.com",
          "role": "view"
        }
      ],
      "summary": {
        "appCount": 2,
        "dashCount": 1,
        "solutionCount": 0,
        "deviceCount": 12,
        "flowCount": 3,
        "webhookCount": 0,
        "keyCount": 2,
        "deviceRecipeCount": 0
      }
    }
  ],
  "count": 1,
  "totalCount": 2,
  "perPage": 1,
  "page": 0,
  "sortField": "name",
  "sortDirection": "asc"
}


Payload Counts

Schema for the result of a payload count request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "mqttOut": {
      "type": "object",
      "patternProperties": {
        ".*": {
          "type": "number"
        }
      }
    },
    "mqttIn": {
      "type": "object",
      "patternProperties": {
        ".*": {
          "type": "number"
        }
      }
    },
    "dataTable": {
      "type": "object",
      "patternProperties": {
        ".*": {
          "type": "number"
        }
      }
    },
    "deviceState": {
      "type": "object",
      "patternProperties": {
        ".*": {
          "type": "number"
        }
      }
    },
    "deviceCommand": {
      "type": "object",
      "patternProperties": {
        ".*": {
          "type": "number"
        }
      }
    },
    "webhook": {
      "type": "object",
      "patternProperties": {
        ".*": {
          "type": "number"
        }
      }
    },
    "timer": {
      "type": "object",
      "patternProperties": {
        ".*": {
          "type": "number"
        }
      }
    },
    "event": {
      "type": "object",
      "patternProperties": {
        ".*": {
          "type": "number"
        }
      }
    },
    "virtualButton": {
      "type": "object",
      "patternProperties": {
        ".*": {
          "type": "number"
        }
      }
    },
    "deviceConnect": {
      "type": "object",
      "patternProperties": {
        ".*": {
          "type": "number"
        }
      }
    },
    "deviceDisconnect": {
      "type": "object",
      "patternProperties": {
        ".*": {
          "type": "number"
        }
      }
    },
    "endpoint": {
      "type": "object",
      "patternProperties": {
        ".*": {
          "type": "number"
        }
      }
    },
    "integration": {
      "type": "object",
      "patternProperties": {
        ".*": {
          "type": "number"
        }
      }
    }
  }
}

Example

{
  "timer": {
    "timer.flow": 19772
  },
  "deviceState": {
    "flow.flow": 5215,
    "device.mqtt": 1244049
  },
  "mqttOut": {
    "device.mqtt": 12
  },
  "webhook": {
    "public.rest": 1713284
  },
  "deviceConnect": {
    "device.mqtt": 1016
  },
  "deviceDisconnect": {
    "device.mqtt": 1016
  }
}


Recent Item

Schema for the body of a request to add a recent item

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "itemType": {
      "type": "string",
      "enum": [
        "application",
        "device",
        "flow",
        "dashboard",
        "organization"
      ]
    },
    "parentId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "itemId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    }
  },
  "required": [
    "itemType",
    "itemId"
  ]
}

Example

{
  "itemType": "device",
  "parentId": "575ec8687ae143cd83dc4a97",
  "itemId": "575ecf887ae143cd83dc4aa2"
}


Recent Item List

Schema for an array of recent items

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "itemType": {
      "type": "string",
      "enum": [
        "application",
        "device",
        "flow",
        "dashboard",
        "organization"
      ]
    },
    "parentId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          }
        }
      }
    }
  }
}

Example

{
  "itemType": "application",
  "items": [
    {
      "id": "575ec8687ae143cd83dc4a97",
      "name": "My Application"
    },
    {
      "id": "575efbcc7ae143cd83dc4aae",
      "name": "My Other Application"
    }
  ]
}


Resource Transfer

Schema for the body of a resource transfer request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "destinationId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "destinationType": {
      "type": "string",
      "enum": [
        "user",
        "organization"
      ]
    },
    "applicationIds": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[A-Fa-f\\d]{24}$"
      },
      "maxItems": 1000
    },
    "dashboardIds": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[A-Fa-f\\d]{24}$"
      },
      "maxItems": 1000
    },
    "solutionIds": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[A-Fa-f\\d]{24}$"
      },
      "maxItems": 1000
    },
    "strict": {
      "type": "boolean"
    }
  },
  "additionalProperties": false,
  "required": [
    "destinationId",
    "destinationType"
  ]
}

Example

{
  "destinationId": "575ed6e87ae143cd83dc4aa8",
  "destinationType": "organization",
  "applicationIds": [
    "575ec8687ae143cd83dc4a97"
  ]
}


Solution

Schema for a single Solution

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "solutionId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "orgId": {
      "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
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "slug": {
      "type": "string",
      "minLength": 4,
      "maxLength": 63,
      "pattern": "^[0-9a-z-]*$"
    },
    "allowSelfDeletion": {
      "type": "boolean"
    },
    "allowSelfEmailChange": {
      "type": "boolean"
    },
    "passwordReset": {
      "type": "object",
      "properties": {
        "allowPasswordReset": {
          "type": "boolean"
        },
        "emailSubject": {
          "type": "string",
          "maxLength": 255
        },
        "emailBody": {
          "type": "string",
          "maxLength": 32767
        },
        "emailFrom": {
          "type": "string",
          "format": "email",
          "maxLength": 1024
        }
      }
    },
    "summary": {
      "type": "object",
      "properties": {
        "solutionUserCount": {
          "type": "number"
        }
      }
    }
  }
}

Example

{
  "id": "57955788124b37010084c053",
  "solutionId": "57955788124b37010084c053",
  "orgId": "575ed6e87ae143cd83dc4aa8",
  "creationDate": "2016-06-13T04:00:00.000Z",
  "lastUpdated": "2016-06-13T04:00:00.000Z",
  "name": "My Solution",
  "slug": "my_solution",
  "allowSelfDeletion": false,
  "allowSelfEmailChange": false,
  "summary": {
    "solutionUserCount": 0
  }
}


Solution Patch

Schema for the body of a Solution modification request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "slug": {
      "type": "string",
      "pattern": "^[0-9a-z_-]{1,255}$"
    },
    "allowSelfDeletion": {
      "type": "boolean"
    },
    "allowSelfEmailChange": {
      "type": "boolean"
    },
    "passwordReset": {
      "type": "object",
      "properties": {
        "allowPasswordReset": {
          "type": "boolean"
        },
        "emailSubject": {
          "type": "string",
          "maxLength": 255
        },
        "emailBody": {
          "type": "string",
          "maxLength": 32767
        },
        "emailFrom": {
          "type": "string",
          "format": "email",
          "maxLength": 1024
        }
      },
      "additionalProperties": false
    },
    "additionalProperties": false
  }
}

Example

{
  "name": "My Updated Solution",
  "allowSelfDeletion": true
}


Solution Post

Schema for the body of a Solution creation request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "type": "string",
      "maxLength": 32767
    },
    "slug": {
      "type": "string",
      "pattern": "^[0-9a-z_-]{1,255}$"
    },
    "allowSelfDeletion": {
      "type": "boolean"
    },
    "allowSelfEmailChange": {
      "type": "boolean"
    },
    "passwordReset": {
      "type": "object",
      "properties": {
        "allowPasswordReset": {
          "type": "boolean"
        },
        "emailSubject": {
          "type": "string",
          "maxLength": 255
        },
        "emailBody": {
          "type": "string",
          "maxLength": 32767
        },
        "emailFrom": {
          "type": "string",
          "format": "email",
          "maxLength": 1024
        }
      },
      "additionalProperties": false
    },
    "required": [
      "name",
      "slug"
    ],
    "additionalProperties": false
  }
}

Example

{
  "name": "My New Solution",
  "slug": "my_new_solution"
}


Solution User

Schema for a single Solution User

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "solutionUserId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "solutionId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "orgId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "creationDate": {
      "type": "string",
      "format": "date-time"
    },
    "lastUpdated": {
      "type": "string",
      "format": "date-time"
    },
    "passwordLastUpdated": {
      "type": "string",
      "format": "date-time"
    },
    "lastLogin": {
      "type": "string",
      "format": "date-time"
    },
    "email": {
      "type": "string",
      "format": "email",
      "maxLength": 1024
    },
    "firstName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1024
    },
    "lastName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1024
    },
    "companyName": {
      "type": "string",
      "maxLength": 1024
    },
    "title": {
      "type": "string",
      "maxLength": 1024
    },
    "phoneNumber": {
      "type": "string",
      "maxLength": 1024
    },
    "location": {
      "type": "string",
      "maxLength": 1024
    },
    "url": {
      "type": "string",
      "maxLength": 1024
    },
    "forcePasswordResetOnNextLogin": {
      "type": "boolean"
    },
    "fullName": {
      "type": "string"
    },
    "twoFactorAuthEnabled": {
      "type": "boolean"
    },
    "avatarUrl": {
      "type": "string",
      "format": "url"
    },
    "tokenCutoff": {
      "type": "string",
      "format": "date-time"
    },
    "accessRestrictions": {
      "type": "object",
      "properties": {
        "dashboardIds": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "maxItems": 1000
        }
      }
    }
  }
}

Example

{
  "id": "566116085df4b701000258e3",
  "solutionUserId": "566116085df4b701000258e3",
  "solutionId": "57955788124b37010084c053",
  "orgId": "575ed6e87ae143cd83dc4aa8",
  "creationDate": "2016-06-13T04:00:00.000Z",
  "lastUpdated": "2016-06-13T04:00:00.000Z",
  "passwordLastUpdated": "2016-06-13T04:00:00.000Z",
  "lastLogin": "2016-06-13T04:00:00.000Z",
  "email": "example@solutionuser.com",
  "firstName": "Example",
  "lastName": "Name",
  "forcePasswordResetOnNextLogin": false,
  "fullName": "Example Name",
  "twoFactorAuthEnabled": false,
  "avatarUrl": "https://example.avatar.url/is_here.png",
  "accessRestrictions": {
    "dashboardIds": [
      "575ece2b7ae143cd83dc4a9b",
      "575ece2b7ae143cd83dc4a9c"
    ]
  }
}


Solution User Credentials

Schema for the body of a Solution User authentication request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "solutionId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "email": {
      "type": "string",
      "format": "email",
      "maxLength": 1024
    },
    "password": {
      "type": "string",
      "minLength": 8,
      "maxLength": 2048
    },
    "twoFactorCode": {
      "type": "string",
      "maxLength": 2048
    },
    "tokenTTL": {
      "type": "integer",
      "minimum": 0
    }
  },
  "required": [
    "solutionId",
    "email",
    "password"
  ],
  "additionalProperties": false
}

Example

{
  "solutionId": "57955788124b37010084c053",
  "email": "example@solutionuser.com",
  "password": "this is the password"
}


Solution User Patch

Schema for the body of a Solution User modification request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "format": "email",
      "maxLength": 1024
    },
    "firstName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1024
    },
    "lastName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1024
    },
    "companyName": {
      "type": "string",
      "maxLength": 1024
    },
    "title": {
      "type": "string",
      "maxLength": 1024
    },
    "phoneNumber": {
      "type": "string",
      "maxLength": 1024
    },
    "location": {
      "type": "string",
      "maxLength": 1024
    },
    "url": {
      "type": "string",
      "maxLength": 1024
    },
    "forcePasswordResetOnNextLogin": {
      "type": "boolean"
    },
    "password": {
      "type": "string",
      "minLength": 8,
      "maxLength": 2048,
      "pattern": "^(?=.*[A-Z])(?=.*[^A-z0-9])(?=.*[0-9])(?=.*[a-z]).{8,}$"
    },
    "twoFactorAuthKey": {
      "type": "string",
      "minLength": 52,
      "maxLength": 52
    },
    "tokenCutoff": {
      "type": "string",
      "format": "date-time"
    },
    "accessRestrictions": {
      "type": "object",
      "properties": {
        "dashboardIds": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "maxItems": 1000
        },
        "additionalProperties": false
      }
    }
  },
  "additionalProperties": false
}

Example

{
  "password": "aNewUserPassword",
  "forcePasswordResetOnNextLogin": true
}


Solution User Post

Schema for the body of a Solution User creation request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "format": "email",
      "maxLength": 1024
    },
    "firstName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1024
    },
    "lastName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1024
    },
    "companyName": {
      "type": "string",
      "maxLength": 1024
    },
    "title": {
      "type": "string",
      "maxLength": 1024
    },
    "phoneNumber": {
      "type": "string",
      "maxLength": 1024
    },
    "location": {
      "type": "string",
      "maxLength": 1024
    },
    "url": {
      "type": "string",
      "maxLength": 1024
    },
    "forcePasswordResetOnNextLogin": {
      "type": "boolean"
    },
    "password": {
      "type": "string",
      "minLength": 8,
      "maxLength": 2048,
      "pattern": "^(?=.*[A-Z])(?=.*[^A-z0-9])(?=.*[0-9])(?=.*[a-z]).{8,}$"
    },
    "twoFactorAuthKey": {
      "type": "string",
      "minLength": 52,
      "maxLength": 52
    },
    "tokenCutoff": {
      "type": "string",
      "format": "date-time"
    },
    "accessRestrictions": {
      "type": "object",
      "properties": {
        "dashboardIds": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "maxItems": 1000
        },
        "additionalProperties": false
      }
    }
  },
  "required": [
    "email",
    "firstName",
    "lastName",
    "password"
  ],
  "additionalProperties": false
}

Example

{
  "email": "example@solutionuser.com",
  "firstName": "Example",
  "lastName": "Name",
  "password": "aUserPassword",
  "accessRestrictions": {
    "dashboardIds": [
      "575ece2b7ae143cd83dc4a9b",
      "575ece2b7ae143cd83dc4a9c"
    ]
  }
}


Solution Users

Schema for a collection of Solution Users

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "title": "Solution User",
        "description": "Schema for a single Solution User",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "solutionUserId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "solutionId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "orgId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "creationDate": {
            "type": "string",
            "format": "date-time"
          },
          "lastUpdated": {
            "type": "string",
            "format": "date-time"
          },
          "passwordLastUpdated": {
            "type": "string",
            "format": "date-time"
          },
          "lastLogin": {
            "type": "string",
            "format": "date-time"
          },
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 1024
          },
          "firstName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          },
          "lastName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          },
          "companyName": {
            "type": "string",
            "maxLength": 1024
          },
          "title": {
            "type": "string",
            "maxLength": 1024
          },
          "phoneNumber": {
            "type": "string",
            "maxLength": 1024
          },
          "location": {
            "type": "string",
            "maxLength": 1024
          },
          "url": {
            "type": "string",
            "maxLength": 1024
          },
          "forcePasswordResetOnNextLogin": {
            "type": "boolean"
          },
          "fullName": {
            "type": "string"
          },
          "twoFactorAuthEnabled": {
            "type": "boolean"
          },
          "avatarUrl": {
            "type": "string",
            "format": "url"
          },
          "tokenCutoff": {
            "type": "string",
            "format": "date-time"
          },
          "accessRestrictions": {
            "type": "object",
            "properties": {
              "dashboardIds": {
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[A-Fa-f\\d]{24}$"
                },
                "maxItems": 1000
              }
            }
          }
        }
      }
    },
    "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"
      ]
    },
    "orgId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "solutionId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    }
  }
}

Example

{
  "items": [
    {
      "id": "566116085df4b701000258e3",
      "solutionUserId": "566116085df4b701000258e3",
      "solutionId": "57955788124b37010084c053",
      "orgId": "575ed6e87ae143cd83dc4aa8",
      "creationDate": "2016-06-13T04:00:00.000Z",
      "lastUpdated": "2016-06-13T04:00:00.000Z",
      "passwordLastUpdated": "2016-06-13T04:00:00.000Z",
      "lastLogin": "2016-06-13T04:00:00.000Z",
      "email": "example@solutionuser.com",
      "firstName": "Example",
      "lastName": "Name",
      "forcePasswordResetOnNextLogin": false,
      "fullName": "Example Name",
      "twoFactorAuthEnabled": false,
      "avatarUrl": "https://example.avatar.url/is_here.png",
      "accessRestrictions": {
        "dashboardIds": [
          "575ece2b7ae143cd83dc4a9b",
          "575ece2b7ae143cd83dc4a9c"
        ]
      }
    }
  ],
  "count": 1,
  "totalCount": 4,
  "perPage": 1,
  "page": 0,
  "sortField": "name",
  "sortDirection": "asc",
  "solutionId": "57955788124b37010084c053",
  "orgId": "575ed6e87ae143cd83dc4aa8"
}


Solutions

Schema for a collection of Solutions

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "title": "Solution",
        "description": "Schema for a single Solution",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "solutionId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "orgId": {
            "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
          },
          "description": {
            "type": "string",
            "maxLength": 32767
          },
          "slug": {
            "type": "string",
            "minLength": 4,
            "maxLength": 63,
            "pattern": "^[0-9a-z-]*$"
          },
          "allowSelfDeletion": {
            "type": "boolean"
          },
          "allowSelfEmailChange": {
            "type": "boolean"
          },
          "passwordReset": {
            "type": "object",
            "properties": {
              "allowPasswordReset": {
                "type": "boolean"
              },
              "emailSubject": {
                "type": "string",
                "maxLength": 255
              },
              "emailBody": {
                "type": "string",
                "maxLength": 32767
              },
              "emailFrom": {
                "type": "string",
                "format": "email",
                "maxLength": 1024
              }
            }
          },
          "summary": {
            "type": "object",
            "properties": {
              "solutionUserCount": {
                "type": "number"
              }
            }
          }
        }
      }
    },
    "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"
      ]
    },
    "orgId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    }
  }
}

Example

{
  "items": [
    {
      "id": "57955788124b37010084c053",
      "solutionId": "57955788124b37010084c053",
      "orgId": "575ed6e87ae143cd83dc4aa8",
      "creationDate": "2016-06-13T04:00:00.000Z",
      "lastUpdated": "2016-06-13T04:00:00.000Z",
      "name": "My Solution",
      "slug": "my_solution",
      "allowSelfDeletion": false,
      "allowSelfEmailChange": false,
      "summary": {
        "solutionUserCount": 0
      }
    }
  ],
  "count": 1,
  "totalCount": 4,
  "perPage": 1,
  "page": 0,
  "sortField": "name",
  "sortDirection": "asc",
  "orgId": "575ed6e87ae143cd83dc4aa8"
}


Success

Schema for reporting a successful operation

Schema

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

Example

{
  "success": true
}


Time Series Data

Schema for the result of a time series query

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "start": {
      "type": "string",
      "format": "date-time"
    },
    "end": {
      "type": "string",
      "format": "date-time"
    },
    "resolution": {
      "type": "number"
    },
    "aggregation": {
      "type": "string",
      "enum": [
        "FIRST",
        "LAST",
        "COUNT",
        "MAX",
        "MIN",
        "MEDIAN",
        "MEAN",
        "SUM",
        "NONE"
      ]
    },
    "devices": {
      "type": "object",
      "patternProperties": {
        "^[A-Fa-f\\d]{24}$": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            },
            "points": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "time": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "patternProperties": {
                      "^[0-9a-zA-Z_-]{1,255}$": {
                        "type": [
                          "number",
                          "string",
                          "boolean"
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false,
                "required": [
                  "data",
                  "time"
                ]
              }
            }
          },
          "additionalProperties": false,
          "required": [
            "name",
            "points"
          ]
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false,
  "required": [
    "start",
    "end",
    "resolution",
    "aggregation",
    "devices"
  ]
}

Example

{
  "start": "2016-06-15T03:50:00.000Z",
  "end": "2016-06-15T04:00:00.000Z",
  "resolution": 300000,
  "aggregation": "MEAN",
  "devices": {
    "575ecf887ae143cd83dc4aa2": {
      "name": "My Device",
      "points": [
        {
          "time": "2016-06-15T03:50:00.000Z",
          "data": {
            "voltage": 10.3
          }
        },
        {
          "time": "2016-06-15T03:55:00.000Z",
          "data": {
            "voltage": 12.7
          }
        }
      ]
    },
    "575ef5c97ae143cd83dc4aac": {
      "name": "My Other Device",
      "points": [
        {
          "time": "2016-06-15T03:50:00.000Z",
          "data": {
            "voltage": 10.3
          }
        },
        {
          "time": "2016-06-15T03:55:00.000Z",
          "data": {
            "voltage": 12.7
          }
        }
      ]
    }
  }
}


Time Series Query

Schema for the body of a time series query request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "start": {
      "type": "number"
    },
    "end": {
      "type": "number"
    },
    "duration": {
      "type": "number"
    },
    "resolution": {
      "type": "number"
    },
    "aggregation": {
      "type": "string",
      "enum": [
        "FIRST",
        "LAST",
        "COUNT",
        "MAX",
        "MIN",
        "MEDIAN",
        "MEAN",
        "SUM",
        "NONE"
      ]
    },
    "attributes": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[0-9a-zA-Z_-]{1,255}$"
      }
    },
    "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
    },
    "deviceIds": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[A-Fa-f\\d]{24}$"
      },
      "maxItems": 1000
    },
    "limit": {
      "type": "number"
    },
    "order": {
      "type": "string",
      "enum": [
        "asc",
        "desc"
      ],
      "default": "asc"
    }
  },
  "additionalProperties": false
}

Example

{
  "end": 0,
  "duration": 600000,
  "resolution": 300000,
  "aggregation": "MEAN",
  "attributes": [
    "voltage"
  ],
  "deviceTags": [
    {
      "key": "floor",
      "value": "8"
    }
  ]
}


User Credentials

Schema for the body of a User authentication request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "format": "email",
      "maxLength": 1024
    },
    "password": {
      "type": "string",
      "minLength": 8,
      "maxLength": 2048
    },
    "twoFactorCode": {
      "type": "string",
      "maxLength": 2048
    },
    "requestedScopes": {
      "type": "array",
      "uniqueItems": true,
      "items": {
        "oneOf": [
          {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "all.Application",
                  "all.Application.read",
                  "all.Device",
                  "all.Device.read",
                  "application.*",
                  "applicationApiToken.*",
                  "applicationApiTokens.*",
                  "applicationKey.*",
                  "applicationKeys.*",
                  "data.*",
                  "dataTable.*",
                  "dataTables.*",
                  "dataTableRow.*",
                  "dataTableRows.*",
                  "device.*",
                  "deviceRecipe.*",
                  "deviceRecipes.*",
                  "devices.*",
                  "edgeDeployments.*",
                  "event.*",
                  "events.*",
                  "experience.*",
                  "experienceDomain.*",
                  "experienceDomains.*",
                  "experienceEndpoint.*",
                  "experienceEndpoints.*",
                  "experienceGroup.*",
                  "experienceGroups.*",
                  "experienceUser.*",
                  "experienceUsers.*",
                  "experienceView.*",
                  "experienceViews.*",
                  "integration.*",
                  "integrations.*",
                  "file.*",
                  "files.*",
                  "flow.*",
                  "flows.*",
                  "flowVersion.*",
                  "flowVersions.*",
                  "webhook.*",
                  "webhooks.*",
                  "application.archiveData",
                  "application.backfillArchiveData",
                  "application.debug",
                  "application.delete",
                  "application.get",
                  "application.patch",
                  "application.payloadCounts",
                  "applicationApiToken.delete",
                  "applicationApiToken.get",
                  "applicationApiToken.patch",
                  "applicationApiTokens.get",
                  "applicationApiTokens.post",
                  "applicationKey.delete",
                  "applicationKey.get",
                  "applicationKey.patch",
                  "applicationKeys.get",
                  "applicationKeys.post",
                  "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.detailedSummary",
                  "devices.export",
                  "devices.get",
                  "devices.post",
                  "devices.sendCommand",
                  "edgeDeployments.get",
                  "edgeDeployments.release",
                  "edgeDeployments.remove",
                  "edgeDeployments.replace",
                  "event.delete",
                  "event.get",
                  "event.patch",
                  "events.get",
                  "events.mostRecentBySeverity",
                  "events.patch",
                  "events.post",
                  "experience.delete",
                  "experienceDomain.delete",
                  "experienceDomain.get",
                  "experienceDomain.patch",
                  "experienceDomains.get",
                  "experienceDomains.post",
                  "experienceEndpoint.delete",
                  "experienceEndpoint.get",
                  "experienceEndpoint.patch",
                  "experienceEndpoints.get",
                  "experienceEndpoints.post",
                  "experienceEndpoints.stats",
                  "experienceGroup.delete",
                  "experienceGroup.get",
                  "experienceGroup.patch",
                  "experienceGroups.detailedSummary",
                  "experienceGroups.get",
                  "experienceGroups.post",
                  "experienceUser.delete",
                  "experienceUser.get",
                  "experienceUser.patch",
                  "experienceUsers.detailedSummary",
                  "experienceUsers.get",
                  "experienceUsers.post",
                  "experienceView.debug",
                  "experienceView.delete",
                  "experienceView.get",
                  "experienceView.patch",
                  "experienceViews.debug",
                  "experienceViews.detailedSummary",
                  "experienceViews.get",
                  "experienceViews.post",
                  "file.get",
                  "file.patch",
                  "file.move",
                  "file.delete",
                  "files.get",
                  "files.post",
                  "flow.debug",
                  "flow.delete",
                  "flow.clearStorageEntries",
                  "flow.get",
                  "flow.getStorageEntries",
                  "flow.log",
                  "flow.patch",
                  "flow.pressVirtualButton",
                  "flow.setStorageEntry",
                  "flows.get",
                  "flows.import",
                  "flows.post",
                  "flowVersion.delete",
                  "flowVersion.get",
                  "flowVersion.log",
                  "flowVersion.patch",
                  "flowVersions.get",
                  "flowVersions.post",
                  "integration.delete",
                  "integration.get",
                  "integration.patch",
                  "integrations.get",
                  "integrations.post",
                  "webhook.delete",
                  "webhook.get",
                  "webhook.patch",
                  "webhooks.get",
                  "webhooks.post"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "all.Organization",
                  "all.Organization.read",
                  "applications.*",
                  "auditLog.*",
                  "auditLogs.*",
                  "dashboard.*",
                  "dashboards.*",
                  "org.*",
                  "solution.*",
                  "solutions.*",
                  "solutionUser.*",
                  "solutionUsers.*",
                  "applications.get",
                  "applications.post",
                  "auditLog.get",
                  "auditLogs.get",
                  "dashboard.patch",
                  "dashboard.delete",
                  "dashboards.get",
                  "dashboards.post",
                  "org.get",
                  "org.patch",
                  "org.delete",
                  "org.pendingInvites",
                  "org.inviteMember",
                  "org.revokeInvite",
                  "org.modifyMember",
                  "org.removeMember",
                  "org.payloadCounts",
                  "org.invoices",
                  "org.currentCard",
                  "org.chargeDetails",
                  "org.transferResources",
                  "solutionUser.get",
                  "solutionUser.patch",
                  "solutionUser.delete",
                  "solutionUsers.get",
                  "solutionUsers.post",
                  "solution.get",
                  "solution.patch",
                  "solution.delete",
                  "solutions.get",
                  "solutions.post"
                ]
              }
            ]
          },
          {
            "type": "string",
            "enum": [
              "all.User",
              "all.User.read",
              "me.*",
              "orgs.*",
              "me.get",
              "me.patch",
              "me.delete",
              "me.verifyEmail",
              "me.changePassword",
              "me.enableTwoFactorAuth",
              "me.disableTwoFactorAuth",
              "me.disconnectGithub",
              "me.connectGithub",
              "me.disconnectTwitter",
              "me.connectTwitter",
              "me.addRecentItem",
              "me.fetchRecentItems",
              "me.payloadCounts",
              "me.transferResources",
              "orgs.get",
              "orgs.post"
            ]
          }
        ]
      }
    },
    "tokenTTL": {
      "type": "integer",
      "minimum": 0
    }
  },
  "required": [
    "email",
    "password"
  ],
  "additionalProperties": false
}

Example

{
  "email": "example@losant.com",
  "password": "this is the password"
}


Virtual Button Press

Schema for the body of a request to press a Workflow virtual button

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "key": {
      "type": "string"
    },
    "payload": {},
    "meta": {},
    "flowVersion": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    }
  },
  "required": [
    "key"
  ],
  "additionalProperties": false
}

Example

{
  "key": "575ed18f7ae143cd83dc4aa6-SJaEw_dV",
  "payload": {
    "some": "data"
  }
}


Webhook

Schema for a single Webhook

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    },
    "webhookId": {
      "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"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "token": {
      "type": "string",
      "minLength": 1
    },
    "responseCode": {
      "type": "integer",
      "minimum": 100,
      "maximum": 599
    },
    "verificationType": {
      "type": "string",
      "enum": [
        "facebook",
        "fitbit",
        "none",
        "twilio",
        "alexa"
      ]
    },
    "verificationCode": {
      "type": "string",
      "maxLength": 32767
    },
    "waitForReply": {
      "type": "boolean"
    },
    "basicAuthUsername": {
      "type": "string",
      "maxLength": 255
    },
    "basicAuthPassword": {
      "type": "string",
      "maxLength": 255
    }
  }
}

Example

{
  "id": "575ed78e7ae143cd83dc4aab",
  "webhookId": "575ed78e7ae143cd83dc4aab",
  "applicationId": "575ec8687ae143cd83dc4a97",
  "creationDate": "2016-06-13T04:00:00.000Z",
  "lastUpdated": "2016-06-13T04:00:00.000Z",
  "name": "My Webhook",
  "token": "the_webhook_token",
  "responseCode": 200
}


Webhook Patch

Schema for the body of a Webhook modification request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "responseCode": {
      "type": "integer",
      "minimum": 100,
      "maximum": 599
    },
    "verificationType": {
      "type": "string",
      "enum": [
        "facebook",
        "fitbit",
        "none",
        "twilio",
        "alexa"
      ]
    },
    "verificationCode": {
      "type": "string",
      "maxLength": 32767
    },
    "waitForReply": {
      "type": "boolean"
    },
    "basicAuthUsername": {
      "type": "string",
      "maxLength": 255
    },
    "basicAuthPassword": {
      "type": "string",
      "maxLength": 255
    }
  },
  "additionalProperties": false
}

Example

{
  "name": "My Updated Webhook",
  "responseCode": 201
}


Webhook Post

Schema for the body of a Webhook creation request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "responseCode": {
      "type": "integer",
      "minimum": 100,
      "maximum": 599
    },
    "verificationType": {
      "type": "string",
      "enum": [
        "facebook",
        "fitbit",
        "none",
        "twilio",
        "alexa"
      ]
    },
    "verificationCode": {
      "type": "string",
      "maxLength": 32767
    },
    "waitForReply": {
      "type": "boolean"
    },
    "basicAuthUsername": {
      "type": "string",
      "maxLength": 255
    },
    "basicAuthPassword": {
      "type": "string",
      "maxLength": 255
    }
  },
  "required": [
    "name"
  ],
  "additionalProperties": false
}

Example

{
  "name": "My New Webhook"
}


Webhooks

Schema for a collection of Webhooks

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "title": "Webhook",
        "description": "Schema for a single Webhook",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
          },
          "webhookId": {
            "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"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "token": {
            "type": "string",
            "minLength": 1
          },
          "responseCode": {
            "type": "integer",
            "minimum": 100,
            "maximum": 599
          },
          "verificationType": {
            "type": "string",
            "enum": [
              "facebook",
              "fitbit",
              "none",
              "twilio",
              "alexa"
            ]
          },
          "verificationCode": {
            "type": "string",
            "maxLength": 32767
          },
          "waitForReply": {
            "type": "boolean"
          },
          "basicAuthUsername": {
            "type": "string",
            "maxLength": 255
          },
          "basicAuthPassword": {
            "type": "string",
            "maxLength": 255
          }
        }
      }
    },
    "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"
      ]
    },
    "applicationId": {
      "type": "string",
      "pattern": "^[A-Fa-f\\d]{24}$"
    }
  }
}

Example

{
  "items": [
    {
      "id": "575ed78e7ae143cd83dc4aab",
      "webhookId": "575ed78e7ae143cd83dc4aab",
      "applicationId": "575ec8687ae143cd83dc4a97",
      "creationDate": "2016-06-13T04:00:00.000Z",
      "lastUpdated": "2016-06-13T04:00:00.000Z",
      "name": "My Webhook",
      "token": "the_webhook_token",
      "responseCode": 200
    }
  ],
  "count": 1,
  "totalCount": 4,
  "perPage": 1,
  "page": 0,
  "sortField": "name",
  "sortDirection": "asc",
  "applicationId": "575ec8687ae143cd83dc4a97"
}