{
"swagger" : "2.0",
"info" : {
"version" : "2.0",
"title" : "ZENSIE API"
},
"host" : "api.30mhz.com",
"basePath" : "/api",
"tags" : [ {
"name" : "admin"
}, {
"name" : "agent"
}, {
"name" : "integrate"
}, {
"name" : "robocrops"
}, {
"name" : "assembly"
}, {
"name" : "assembly-update"
}, {
"name" : "authorization"
}, {
"name" : "billing-history-details"
}, {
"name" : "billing-history-details-update"
}, {
"name" : "billing-history"
}, {
"name" : "billing-history-update"
}, {
"name" : "chart"
}, {
"name" : "check"
}, {
"name" : "check-update"
}, {
"name" : "comment"
}, {
"name" : "comment-update"
}, {
"name" : "company-details"
}, {
"name" : "company-details-update"
}, {
"name" : "crop"
}, {
"name" : "currency-rates"
}, {
"name" : "currency"
}, {
"name" : "customer-registration"
}, {
"name" : "dashboard"
}, {
"name" : "dashboard-theme"
}, {
"name" : "dashboard-theme-update"
}, {
"name" : "dashboard-update"
}, {
"name" : "data-export"
}, {
"name" : "data"
}, {
"name" : "data-source-coordinates"
}, {
"name" : "data-source"
}, {
"name" : "data-upload"
}, {
"name" : "device"
}, {
"name" : "export-partner-job"
}, {
"name" : "export-partner-job-update"
}, {
"name" : "export-partner"
}, {
"name" : "export-partner-update"
}, {
"name" : "gateway-cluster"
}, {
"name" : "gateway"
}, {
"name" : "gateway-update"
}, {
"name" : "util"
}, {
"name" : "group"
}, {
"name" : "group-update"
}, {
"name" : "health"
}, {
"name" : "highlight"
}, {
"name" : "import-check"
}, {
"name" : "import-check-update"
}, {
"name" : "ingest"
}, {
"name" : "ingest-update"
}, {
"name" : "integration"
}, {
"name" : "integrity-check"
}, {
"name" : "license"
}, {
"name" : "location"
}, {
"name" : "location-update"
}, {
"name" : "map"
}, {
"name" : "metric"
}, {
"name" : "metric-update"
}, {
"name" : "mother"
}, {
"name" : "mother-template"
}, {
"name" : "mother-template-update"
}, {
"name" : "mother-update"
}, {
"name" : "news"
}, {
"name" : "notes"
}, {
"name" : "notification-follow"
}, {
"name" : "notification-follow-update"
}, {
"name" : "notification"
}, {
"name" : "notification-settings"
}, {
"name" : "notification-settings-update"
}, {
"name" : "notification-topic-follow"
}, {
"name" : "notification-topic-follow-update"
}, {
"name" : "notification-topic"
}, {
"name" : "notification-topic-update"
}, {
"name" : "notification-update"
}, {
"name" : "offer"
}, {
"name" : "organization"
}, {
"name" : "organization-update"
}, {
"name" : "partner"
}, {
"name" : "pricing"
}, {
"name" : "pricing-update"
}, {
"name" : "product"
}, {
"name" : "product-update"
}, {
"name" : "sensor"
}, {
"name" : "sensor-type"
}, {
"name" : "sensor-type-update"
}, {
"name" : "shared-check"
}, {
"name" : "shared-dashboard"
}, {
"name" : "shared-dashboard-update"
}, {
"name" : "share-sensor-type"
}, {
"name" : "site"
}, {
"name" : "soil"
}, {
"name" : "subscription-assignment"
}, {
"name" : "subscription"
}, {
"name" : "swagger"
}, {
"name" : "timezone"
}, {
"name" : "userconfig"
}, {
"name" : "user"
}, {
"name" : "user-update"
}, {
"name" : "widget"
}, {
"name" : "widget-update"
}, {
"name" : "zone"
}, {
"name" : "app-installation"
}, {
"name" : "app-installation-update"
}, {
"name" : "app"
}, {
"name" : "app-update"
}, {
"name" : "calculation"
}, {
"name" : "calculation-update"
}, {
"name" : "app-cultiwatch"
}, {
"name" : "app-irrigation"
}, {
"name" : "customer-request-item"
}, {
"name" : "customer-request-item-update"
}, {
"name" : "customer-request"
}, {
"name" : "customer-request-update"
}, {
"name" : "dealer"
}, {
"name" : "dealer-update"
}, {
"name" : "invoice"
}, {
"name" : "invoice-update"
}, {
"name" : "order"
}, {
"name" : "order-update"
}, {
"name" : "quote"
}, {
"name" : "quote-update"
}, {
"name" : "cultivation"
}, {
"name" : "cultivation-target"
}, {
"name" : "downtime"
}, {
"name" : "stats"
}, {
"name" : "uptime"
}, {
"name" : "status"
}, {
"name" : "xbee-factory"
}, {
"name" : "xbee-factory-update"
} ],
"schemes" : [ "https" ],
"paths" : {
"/admin/health/api-build-version" : {
"get" : {
"tags" : [ "admin" ],
"summary" : "Returns the API build version.",
"description" : "The authenticated user must be an administrator.",
"operationId" : "getApiBuildVersion",
"consumes" : [ "application/json" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "Returns the API build version.",
"schema" : {
"$ref" : "#/definitions/Result"
}
},
"403" : {
"description" : "Unauthorized to perform the operation. User has to be admin."
}
},
"x-admin-only" : true
}
},
"/admin/health/auth0" : {
"get" : {
"tags" : [ "admin" ],
"summary" : "Returns the Auth0 health.",
"description" : "The authenticated user must be an administrator.",
"operationId" : "getAuth0Health",
"consumes" : [ "application/json" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "Return the health of Auth0",
"schema" : {
"$ref" : "#/definitions/Result"
}
},
"403" : {
"description" : "Unauthorized to perform the operation. User has to be admin."
}
},
"x-admin-only" : true
}
},
"/admin/health/dynamodb" : {
"get" : {
"tags" : [ "admin" ],
"summary" : "Returns the DynamoDB health.",
"description" : "The authenticated user must be an administrator.",
"operationId" : "getDynamoDbHealth",
"consumes" : [ "application/json" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "Return the list of sales statistics",
"schema" : {
"$ref" : "#/definitions/Result"
}
},
"403" : {
"description" : "Unauthorized to perform the operation. User has to be admin."
}
},
"x-admin-only" : true
}
},
"/admin/health/elasticsearch" : {
"get" : {
"tags" : [ "admin" ],
"summary" : "Returns the Elasticsearch health.",
"description" : "The authenticated user must be an administrator.",
"operationId" : "getElasticsearchHealth",
"consumes" : [ "application/json" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "Returns the Elasticsearch health.",
"schema" : {
"$ref" : "#/definitions/Result"
}
},
"403" : {
"description" : "Unauthorized to perform the operation."
}
},
"x-admin-only" : true
}
},
"/admin/health/scheduler" : {
"get" : {
"tags" : [ "admin" ],
"summary" : "Returns the Scheduler health.",
"description" : "The authenticated user must be an administrator.",
"operationId" : "getSchedulerHealth",
"consumes" : [ "application/json" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "",
"schema" : {
"$ref" : "#/definitions/Result"
}
},
"403" : {
"description" : "Unauthorized to perform the operation. User has to be admin."
}
},
"x-admin-only" : true
}
},
"/admin/notification-follow/user/{email}" : {
"delete" : {
"tags" : [ "admin" ],
"summary" : "Delete all notification follows of a user (i.e. Follow, NotificationFollow and NotificationTopicFollow objects).",
"description" : "",
"operationId" : "deleteAllNotificationFollowsOfUser",
"consumes" : [ "application/json" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "email",
"in" : "path",
"required" : true,
"type" : "string"
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "Notifications have been deleted"
},
"403" : {
"description" : "User not allowed to perform the operation"
}
},
"x-admin-only" : true
}
},
"/agent/conversation/{conversationId}/message" : {
"get" : {
"tags" : [ "agent", "integrate", "robocrops" ],
"summary" : "Return all messages of the provided conversation.",
"description" : "Authentication required for this operation.",
"operationId" : "getConversationMessages",
"consumes" : [ "application/json" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "conversationId",
"in" : "path",
"required" : true,
"type" : "string"
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "All messages returned.",
"schema" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/AgentMessage"
}
}
},
"403" : {
"description" : "Not enough permissions to perform the operation."
}
}
}
},
"/agent/message-stream" : {
"post" : {
"tags" : [ "agent", "integrate", "robocrops" ],
"summary" : "Send a message to the provided conversation and start a run.",
"description" : "Authentication required for this operation.",
"operationId" : "sendMessageStream",
"consumes" : [ "application/json" ],
"produces" : [ "text/event-stream" ],
"parameters" : [ {
"in" : "body",
"name" : "body",
"required" : false,
"schema" : {
"$ref" : "#/definitions/AgentMessageNew"
}
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "Stream with updates to the run.",
"schema" : {
"$ref" : "#/definitions/ChunkedOutput"
}
},
"403" : {
"description" : "Not enough permissions to perform the operation."
}
}
}
},
"/assembly" : {
"post" : {
"tags" : [ "assembly" ],
"summary" : "Create a new assembly.",
"description" : "Authentication required for this operation, authenticated user must have admin role.",
"operationId" : "createAssembly",
"consumes" : [ "application/json" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"in" : "body",
"name" : "body",
"required" : false,
"schema" : {
"$ref" : "#/definitions/NewAssembly"
}
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"201" : {
"description" : "New assembly created",
"schema" : {
"$ref" : "#/definitions/Assembly"
}
},
"400" : {
"description" : "Invalid data in the properties."
},
"403" : {
"description" : "User must be an admin."
},
"500" : {
"description" : "There was a problem creating the assembly."
}
},
"x-admin-only" : true
}
},
"/assembly/{serialNumber}" : {
"get" : {
"tags" : [ "assembly" ],
"summary" : "Get an assembly by its serial number.",
"description" : "Authentication required for this operation, authenticated user must have admin role.",
"operationId" : "getAssembly",
"consumes" : [ "application/json" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "serialNumber",
"in" : "path",
"required" : true,
"type" : "string"
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "Assembly returned successfully",
"schema" : {
"$ref" : "#/definitions/Assembly"
}
},
"400" : {
"description" : "There was a problem getting the assembly."
},
"403" : {
"description" : "User must be an admin."
},
"404" : {
"description" : "Assembly not found."
},
"500" : {
"description" : "There was a problem getting the assembly."
}
},
"x-admin-only" : true
},
"delete" : {
"tags" : [ "assembly" ],
"summary" : "Delete an assembly.",
"description" : "Authentication required for this operation, authenticated user must have admin role.",
"operationId" : "deleteAssembly",
"consumes" : [ "application/json" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "serialNumber",
"in" : "path",
"required" : true,
"type" : "string"
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"204" : {
"description" : "Assembly deleted successfully"
},
"403" : {
"description" : "User must be an admin."
},
"404" : {
"description" : "Assembly not found."
},
"500" : {
"description" : "There was a problem deleting the assembly."
}
},
"x-admin-only" : true
}
},
"/assembly/xbee/{xbee}" : {
"get" : {
"tags" : [ "assembly" ],
"summary" : "Get an assembly by its xbee.",
"description" : "Authentication required for this operation, authenticated user must have admin role.",
"operationId" : "getAssemblyByXbee",
"consumes" : [ "application/json" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "xbee",
"in" : "path",
"required" : true,
"type" : "string"
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "Assembly returned successfully",
"schema" : {
"$ref" : "#/definitions/Assembly"
}
},
"400" : {
"description" : "There was a problem getting the assembly."
},
"403" : {
"description" : "User must be an admin."
},
"404" : {
"description" : "Assembly not found."
},
"500" : {
"description" : "There was a problem getting the assembly."
}
},
"x-admin-only" : true
}
},
"/assembly/{serialNumber}/history" : {
"get" : {
"tags" : [ "assembly" ],
"summary" : "Get the update history of an assembly as a map, where keys denote the date of change and values denote the changed assembly.",
"description" : "Authentication required for this operation, authenticated user must have admin role.",
"operationId" : "getAssemblyHistory",
"consumes" : [ "application/json" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "serialNumber",
"in" : "path",
"required" : true,
"type" : "string"
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "Assembly history returned successfully",
"schema" : {
"type" : "object",
"additionalProperties" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/Assembly"
}
}
}
},
"403" : {
"description" : "User must be an admin."
},
"404" : {
"description" : "Assembly not found."
},
"500" : {
"description" : "There was a problem getting the assembly."
}
},
"x-admin-only" : true
}
},
"/assembly/xbee/{xbee}/history" : {
"get" : {
"tags" : [ "assembly" ],
"summary" : "Get the update history of an assembly as a map, by its xbee, where keys denote the date of change and values denote the changed assembly.",
"description" : "Authentication required for this operation, authenticated user must have admin role.",
"operationId" : "getAssemblyHistoryByXbee",
"consumes" : [ "application/json" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "xbee",
"in" : "path",
"required" : true,
"type" : "string"
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "Assembly history returned successfully",
"schema" : {
"type" : "object",
"additionalProperties" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/Assembly"
}
}
}
},
"403" : {
"description" : "User must be an admin."
},
"404" : {
"description" : "Assembly not found."
},
"500" : {
"description" : "There was a problem getting the assembly."
}
},
"x-admin-only" : true
}
},
"/assembly-update/{serialNumber}" : {
"post" : {
"tags" : [ "assembly-update" ],
"summary" : "Update an assembly.",
"description" : "Authentication required for this operation, authenticated user must have admin role.",
"operationId" : "updateAssembly",
"consumes" : [ "application/json" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "serialNumber",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"in" : "body",
"name" : "body",
"required" : false,
"schema" : {
"$ref" : "#/definitions/AssemblyEditable"
}
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "Assembly updated successfully",
"schema" : {
"$ref" : "#/definitions/Assembly"
}
},
"400" : {
"description" : "Invalid data in the properties to be updated"
},
"403" : {
"description" : "User must be an admin."
},
"404" : {
"description" : "Assembly not found."
},
"500" : {
"description" : "There was a problem updating the assembly."
}
}
}
},
"/authorization/device/jwks" : {
"get" : {
"tags" : [ "authorization" ],
"summary" : "Get public key for a device access token validation.",
"description" : "",
"operationId" : "getDevicePublicKey",
"consumes" : [ "application/json" ],
"produces" : [ "application/json", "application/zensie-v2+json", "application/jwk-set+json; charset=UTF-8" ],
"parameters" : [ ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "Device access token public key",
"schema" : {
"type" : "object",
"additionalProperties" : {
"type" : "object"
}
}
},
"401" : {
"description" : "Unauthenticated request"
},
"500" : {
"description" : "Error when retrieving device access token public key"
}
}
}
},
"/authorization/license/oauth/token" : {
"post" : {
"tags" : [ "authorization" ],
"summary" : "Provides an access token for a license service",
"description" : "",
"operationId" : "getAccessToken",
"consumes" : [ "application/json" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"in" : "body",
"name" : "body",
"required" : false,
"schema" : {
"$ref" : "#/definitions/LicenseAccessTokenRequest"
}
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "Returns the access token",
"schema" : {
"$ref" : "#/definitions/AccessToken"
}
},
"401" : {
"description" : "Unauthenticated request"
},
"500" : {
"description" : "Failed to assign the role"
}
}
}
},
"/authorization/role-assignment/assignee/{assignee}/role/{role}/license/{licenseId}" : {
"post" : {
"tags" : [ "authorization" ],
"summary" : "Assign a role on a license to a user, if the role already exists it will be a no-op",
"description" : "",
"operationId" : "assignRoleOnLicense",
"consumes" : [ "application/json" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "assignee",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "role",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "licenseId",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"in" : "body",
"name" : "body",
"required" : false,
"schema" : {
"type" : "object"
}
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "Created role assignment",
"schema" : {
"$ref" : "#/definitions/Assignment of a role on a resource for a user"
}
},
"401" : {
"description" : "Unauthenticated request"
},
"500" : {
"description" : "Failed to assign the role"
}
}
},
"delete" : {
"tags" : [ "authorization" ],
"summary" : "Unassign a role on an license from a user.",
"description" : "",
"operationId" : "unassignRoleOnLicense",
"consumes" : [ "application/json" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "assignee",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "role",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "licenseId",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"in" : "body",
"name" : "body",
"required" : false,
"schema" : {
"type" : "object"
}
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"204" : {
"description" : "Deleted role assignment"
},
"401" : {
"description" : "Unauthenticated request"
},
"500" : {
"description" : "Failed to unassign the role"
}
}
}
},
"/authorization/role-assignment/assignee/{assignee}/role/{role}/organization/{organizationId}" : {
"post" : {
"tags" : [ "authorization" ],
"summary" : "Assign a role on an organization to a user, if the role already exists it will be a no-op",
"description" : "",
"operationId" : "assignRoleOnOrganization",
"consumes" : [ "application/json" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "assignee",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "role",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "organizationId",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"in" : "body",
"name" : "body",
"required" : false,
"schema" : {
"type" : "object"
}
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "Created role assignment",
"schema" : {
"$ref" : "#/definitions/Assignment of a role on a resource for a user"
}
},
"401" : {
"description" : "Unauthenticated request"
},
"500" : {
"description" : "Failed to assign the role"
}
}
},
"delete" : {
"tags" : [ "authorization" ],
"summary" : "Unassign a role on an organization from a user.",
"description" : "",
"operationId" : "unassignRoleOnOrganization",
"consumes" : [ "application/json" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "assignee",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "role",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "organizationId",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"in" : "body",
"name" : "body",
"required" : false,
"schema" : {
"type" : "object"
}
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"204" : {
"description" : "Deleted role assignment"
},
"401" : {
"description" : "Unauthenticated request"
},
"500" : {
"description" : "Failed to unassign the role"
}
}
}
},
"/authorization/role-assignment/assignee/{assignee}/role/{role}/device/{deviceId}" : {
"post" : {
"tags" : [ "authorization" ],
"summary" : "Assign a role on a device to a user, if the role already exists it will be a no-op",
"description" : "",
"operationId" : "assignRoleOnDevice",
"consumes" : [ "application/json" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "assignee",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "role",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "deviceId",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"in" : "body",
"name" : "body",
"required" : false,
"schema" : {
"type" : "object"
}
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "Created role assignment",
"schema" : {
"$ref" : "#/definitions/Assignment of a role on a resource for a user"
}
},
"401" : {
"description" : "Unauthenticated request"
},
"500" : {
"description" : "Failed to assign the role"
}
}
},
"delete" : {
"tags" : [ "authorization" ],
"summary" : "Unassign a role on a device from a user.",
"description" : "",
"operationId" : "unassignRoleOnDevice",
"consumes" : [ "application/json" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "assignee",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "role",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "deviceId",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"in" : "body",
"name" : "body",
"required" : false,
"schema" : {
"type" : "object"
}
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"204" : {
"description" : "Deleted role assignment"
},
"401" : {
"description" : "Unauthenticated request"
},
"500" : {
"description" : "Failed to unassign the role"
}
}
}
},
"/authorization/role-assignment/assignee/{assignee}/role/{role}/organization/{organizationId}/site/{siteId}" : {
"post" : {
"tags" : [ "authorization" ],
"summary" : "Assign a role on a site to a user, if the role already exists it will be a no-op",
"description" : "",
"operationId" : "assignRoleOnSite",
"consumes" : [ "application/json" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "assignee",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "role",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "organizationId",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "siteId",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"in" : "body",
"name" : "body",
"required" : false,
"schema" : {
"type" : "object"
}
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "Created role assignment",
"schema" : {
"$ref" : "#/definitions/Assignment of a role on a resource for a user"
}
},
"401" : {
"description" : "Unauthenticated request"
},
"500" : {
"description" : "Failed to assign the role"
}
}
},
"delete" : {
"tags" : [ "authorization" ],
"summary" : "Unassign a role on a site from a user.",
"description" : "",
"operationId" : "unassignRoleOnSite",
"consumes" : [ "application/json" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "assignee",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "role",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "organizationId",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "siteId",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"in" : "body",
"name" : "body",
"required" : false,
"schema" : {
"type" : "object"
}
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"204" : {
"description" : "Deleted role assignment"
},
"401" : {
"description" : "Unauthenticated request"
},
"500" : {
"description" : "Failed to unassign the role"
}
}
}
},
"/authorization/check/device/{deviceId}" : {
"get" : {
"tags" : [ "authorization" ],
"summary" : "Check whether the user is authorized to perform a certain action on a device.",
"description" : "",
"operationId" : "checkUserAuthorizationOnDevice",
"consumes" : [ "application/json" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "deviceId",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "action",
"in" : "query",
"required" : false,
"type" : "string"
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "True if the user is authorized, otherwise false",
"schema" : {
"type" : "boolean"
}
},
"401" : {
"description" : "Unauthenticated request"
},
"500" : {
"description" : "Error when verifying the users permissions"
}
}
}
},
"/authorization/check/organization/{organizationId}" : {
"get" : {
"tags" : [ "authorization" ],
"summary" : "Check whether the user is authorized to perform a certain action on an organization.",
"description" : "",
"operationId" : "checkUserAuthorizationOnOrganization",
"consumes" : [ "application/json" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "organizationId",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "action",
"in" : "query",
"required" : false,
"type" : "string"
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "True if the user is authorized, otherwise false",
"schema" : {
"type" : "boolean"
}
},
"401" : {
"description" : "Unauthenticated request"
},
"500" : {
"description" : "Error when verifying the users permissions"
}
}
}
},
"/authorization/check/organization/{organizationId}/site/{siteId}" : {
"get" : {
"tags" : [ "authorization" ],
"summary" : "Check whether the user is authorized to perform a certain action on a site.",
"description" : "",
"operationId" : "checkUserAuthorizationOnSite",
"consumes" : [ "application/json" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "organizationId",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "siteId",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "action",
"in" : "query",
"required" : false,
"type" : "string"
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "True if the user is authorized, otherwise false",
"schema" : {
"type" : "boolean"
}
},
"401" : {
"description" : "Unauthenticated request"
},
"500" : {
"description" : "Error when verifying the users permissions"
}
}
}
},
"/authorization/device/{deviceId}/access-token" : {
"get" : {
"tags" : [ "authorization" ],
"summary" : "Get access token for a specific device.",
"description" : "",
"operationId" : "getDeviceAccessToken",
"consumes" : [ "application/json" ],
"produces" : [ "application/json", "application/zensie-v2+json", "application/jwt" ],
"parameters" : [ {
"name" : "deviceId",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "expirationDuration",
"in" : "query",
"required" : false,
"type" : "integer",
"default" : 604800,
"maximum" : 2678400,
"minimum" : 0,
"format" : "int32"
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "Device access token",
"schema" : {
"$ref" : "#/definitions/AccessToken"
}
},
"401" : {
"description" : "Unauthenticated request"
},
"500" : {
"description" : "Error when retrieving device access token"
}
}
}
},
"/authorization/role-assignment" : {
"get" : {
"tags" : [ "authorization" ],
"summary" : "Get all the role assignments of the current user",
"description" : "",
"operationId" : "getRoleAssignments",
"consumes" : [ "application/json" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "List of role assignments",
"schema" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/Assignment of a role on a resource for a user"
}
}
},
"401" : {
"description" : "Unauthenticated request"
},
"500" : {
"description" : "Error when reading the role assignments"
}
}
}
},
"/authorization/role-assignment/assignee/{assignee}/organization/{organizationId}" : {
"get" : {
"tags" : [ "authorization" ],
"summary" : "Get role assignments of a user on an organization.",
"description" : "",
"operationId" : "getRoleAssignmentsOfUserOnOrganization",
"consumes" : [ "application/json" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "assignee",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "organizationId",
"in" : "path",
"required" : true,
"type" : "string"
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "List of role assignments",
"schema" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/Assignment of a role on a resource for a user"
}
}
},
"401" : {
"description" : "Unauthenticated request"
},
"403" : {
"description" : "Forbidden to read role assignments on this organization"
},
"500" : {
"description" : "Error when reading the role assignments"
}
}
}
},
"/authorization/role-assignment/assignee/{assignee}/license/{licenseId}" : {
"get" : {
"tags" : [ "authorization" ],
"summary" : "Get role assignments of a user under a license.",
"description" : "",
"operationId" : "getRoleAssignmentsOfUserUnderLicense",
"consumes" : [ "application/json" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "assignee",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "licenseId",
"in" : "path",
"required" : true,
"type" : "string"
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "List of role assignments",
"schema" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/Assignment of a role on a resource for a user"
}
}
},
"401" : {
"description" : "Unauthenticated request"
},
"403" : {
"description" : "Forbidden to read role assignments under this license"
},
"500" : {
"description" : "Error when reading the role assignments"
}
}
}
},
"/authorization/role-assignment/organization/{organizationId}" : {
"get" : {
"tags" : [ "authorization" ],
"summary" : "Get role assignments on an organization.",
"description" : "",
"operationId" : "getRoleAssignmentsOnOrganization",
"consumes" : [ "application/json" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "organizationId",
"in" : "path",
"required" : true,
"type" : "string"
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "List of role assignments",
"schema" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/Assignment of a role on a resource for a user"
}
}
},
"401" : {
"description" : "Unauthenticated request"
},
"403" : {
"description" : "Forbidden to read role assignments on this organization"
},
"500" : {
"description" : "Error when reading the role assignments"
}
}
}
},
"/authorization/scopes" : {
"get" : {
"tags" : [ "authorization" ],
"summary" : "Get scopes for a specific user.",
"description" : "",
"operationId" : "getScopesAndClaims",
"consumes" : [ "application/json" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "userEmail",
"in" : "query",
"required" : true,
"type" : "string"
}, {
"name" : "requiredScopes",
"in" : "query",
"required" : false,
"type" : "string"
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "List of scopes for the user",
"schema" : {
"$ref" : "#/definitions/ScopesAndClaims"
}
},
"401" : {
"description" : "Unauthenticated request"
},
"500" : {
"description" : "Error when retrieving user scopes"
}
}
}
},
"/billing-history-details/{billingHistoryDetailsId}" : {
"get" : {
"tags" : [ "billing-history-details" ],
"summary" : "Return billing history detail",
"description" : "Authentication required for this operation.",
"operationId" : "getBillingHistoryDetailsById",
"consumes" : [ "application/json", "application/xml" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "billingHistoryDetailsId",
"in" : "path",
"required" : true,
"type" : "string"
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "Billing history detail record returned",
"schema" : {
"$ref" : "#/definitions/BillingHistoryDetailsResponse"
}
},
"403" : {
"description" : "Not enough permissions to perform the operation"
}
}
}
},
"/billing-history-details/organization/{organizationId}/year/{year}/month/{month}" : {
"get" : {
"tags" : [ "billing-history-details" ],
"summary" : "Return billing history details",
"description" : "Authentication required for this operation.",
"operationId" : "getBillingHistoryDetailsByOrganizationIdAndMonth",
"consumes" : [ "application/json", "application/xml" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "organizationId",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "year",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "month",
"in" : "path",
"required" : true,
"type" : "string"
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "Billing history details record returned"
},
"403" : {
"description" : "Not enough permissions to perform the operation"
}
}
}
},
"/billing-history-details/organization/{organizationId}/year/{year}/month/{month}/json/{jsonCheck}" : {
"get" : {
"tags" : [ "billing-history-details" ],
"summary" : "Return billing history details json / regular checks summary",
"description" : "Authentication required for this operation.",
"operationId" : "getBillingHistoryDetailsChecksJson",
"consumes" : [ "application/json", "application/xml" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "organizationId",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "year",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "month",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "jsonCheck",
"in" : "path",
"required" : true,
"type" : "boolean"
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "Billing history details json / regular checks summary record returned"
},
"403" : {
"description" : "Not enough permissions to perform the operation"
}
}
}
},
"/billing-history-details/organization/{organizationId}/year/{year}/month/{month}/mother" : {
"get" : {
"tags" : [ "billing-history-details" ],
"summary" : "Return billing history details mother summary",
"description" : "Authentication required for this operation.",
"operationId" : "getBillingHistoryDetailsMothersByOrgIdAndMonth",
"consumes" : [ "application/json", "application/xml" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "organizationId",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "year",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "month",
"in" : "path",
"required" : true,
"type" : "string"
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "Billing history details mother summary record returned"
},
"403" : {
"description" : "Not enough permissions to perform the operation"
}
}
}
},
"/billing-history-details-update/organization/{organizationId}/year/{year}/month/{month}/mother/{motherId}" : {
"post" : {
"tags" : [ "billing-history-details-update" ],
"summary" : "Update a billing history details record for a given organization, mother, and a specific date",
"description" : "Authentication required for this operation.
Preconditions:
Authenticated user has to be an admin in the platform.",
"operationId" : "updateBillingHistoryByMother",
"consumes" : [ "application/json" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "year",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "month",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "organizationId",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "motherId",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"in" : "body",
"name" : "body",
"required" : false,
"schema" : {
"$ref" : "#/definitions/BillingHistoryDetailsUpdate"
}
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "Billing history details record updated",
"schema" : {
"$ref" : "#/definitions/BillingHistoryDetails"
}
},
"400" : {
"description" : "Invalid data in the properties to be updated"
},
"403" : {
"description" : "Not enough permissions to perform the operation"
},
"404" : {
"description" : "A billing history details record for that id doesn't exist"
}
}
}
},
"/billing-history-details-update/{billingHistoryDetailsId}" : {
"post" : {
"tags" : [ "billing-history-details-update" ],
"summary" : "Update a billing history details record for a given organization and a specific date",
"description" : "Authentication required for this operation.
Preconditions:
Authenticated user has to be an admin in the platform.",
"operationId" : "updateBillingHistoryDetails",
"consumes" : [ "application/json" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "billingHistoryDetailsId",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"in" : "body",
"name" : "body",
"required" : false,
"schema" : {
"$ref" : "#/definitions/BillingHistoryDetailsUpdate"
}
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "Billing history details record updated",
"schema" : {
"$ref" : "#/definitions/BillingHistoryDetails"
}
},
"400" : {
"description" : "Invalid data in the properties to be updated"
},
"403" : {
"description" : "Not enough permissions to perform the operation"
},
"404" : {
"description" : "A billing history details record for that id doesn't exist"
}
}
}
},
"/billing-history/organization/{organizationId}/year/{year}/month/{month}" : {
"get" : {
"tags" : [ "billing-history" ],
"summary" : "Return billing history",
"description" : "Authentication required for this operation.",
"operationId" : "getBillingHistoryByOrganizationIdAndMonth",
"consumes" : [ "application/json", "application/xml" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "organizationId",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "year",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "month",
"in" : "path",
"required" : true,
"type" : "string"
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "Billing history record returned"
},
"403" : {
"description" : "Not enough permissions to perform the operation"
}
},
"x-admin-only" : true
},
"delete" : {
"tags" : [ "billing-history" ],
"summary" : "Remove billing history for a specific organization and month, including the billing history details.",
"description" : "Operation reserved to administrators.",
"operationId" : "deleteBillingHistoryByOrganizationAndMonth",
"consumes" : [ "application/json", "application/xml" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "organizationId",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "year",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "month",
"in" : "path",
"required" : true,
"type" : "string"
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "Billing history records removed"
},
"403" : {
"description" : "User not allowed to perform this operation. Should be admin."
},
"404" : {
"description" : "No billing history for the organization in that month."
}
},
"x-admin-only" : true
}
},
"/billing-history/organization/{organizationId}" : {
"get" : {
"tags" : [ "billing-history" ],
"summary" : "Return billing history",
"description" : "Authentication required for this operation.",
"operationId" : "getBillingHistoryByOrganizationId",
"consumes" : [ "application/json", "application/xml" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "organizationId",
"in" : "path",
"required" : true,
"type" : "string"
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "List of billing history records returned"
},
"403" : {
"description" : "Not enough permissions to perform the operation"
}
},
"x-admin-only" : true
}
},
"/billing-history/organization/{organizationId}/forecast" : {
"post" : {
"tags" : [ "billing-history" ],
"summary" : "Return billing history forecast for current month",
"description" : "Authentication required for this operation.",
"operationId" : "getBillingHistoryForecastForCurrentMonth",
"consumes" : [ "application/json", "application/xml" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "organizationId",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"in" : "body",
"name" : "body",
"required" : false,
"schema" : {
"$ref" : "#/definitions/BillingHistoryForecastRequest"
}
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "Billing history record returned"
},
"403" : {
"description" : "Not enough permissions to perform the operation"
}
},
"x-admin-only" : true
}
},
"/billing-history/all-organizations/year/{year}/month/{month}" : {
"get" : {
"tags" : [ "billing-history" ],
"summary" : "Return billing history for a specific month for all organisations that are billable",
"description" : "Operation reserved to administrators.",
"operationId" : "getBillingHistoryOrganisationsByMonth",
"consumes" : [ "application/json", "application/xml" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "year",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "month",
"in" : "path",
"required" : true,
"type" : "string"
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "Billing history records returned"
},
"403" : {
"description" : "Not enough permissions to perform the operation"
}
}
}
},
"/billing-history/all-organizations" : {
"get" : {
"tags" : [ "billing-history" ],
"summary" : "Return billing history for all organisations that are billable",
"description" : "Operation reserved to administrators.",
"operationId" : "getBillingHistoryOrganisationsCurrentMonth",
"consumes" : [ "application/json", "application/xml" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "Billing history records returned"
},
"403" : {
"description" : "Not enough permissions to perform the operation"
}
}
},
"post" : {
"tags" : [ "billing-history" ],
"summary" : "Generate billing history records for every billable organization for the past month (current - 1).",
"description" : "Authentication required for this operation.",
"operationId" : "createSqsBillingHistoryRequest",
"consumes" : [ "application/json", "application/xml" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"in" : "body",
"name" : "body",
"required" : false,
"schema" : {
"type" : "object"
}
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "Billing History requests created for all the billable organizations."
},
"403" : {
"description" : "Not enough permissions to perform the operation. User must be admin."
}
},
"x-admin-only" : true
}
},
"/billing-history" : {
"post" : {
"tags" : [ "billing-history" ],
"summary" : "Create billing history entry for an organization",
"description" : "Authentication required for this operation.",
"operationId" : "createSqsBillingHistoryRequestForOrganization",
"consumes" : [ "application/json", "application/xml" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"in" : "body",
"name" : "body",
"required" : false,
"schema" : {
"$ref" : "#/definitions/BillingHistoryRequest"
}
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "Billing History request created"
},
"403" : {
"description" : "Not enough permissions to perform the operation"
},
"404" : {
"description" : "Organization does not exist"
},
"400" : {
"description" : "The organization is not billable"
}
}
}
},
"/billing-history-update/organization/{organizationId}/year/{year}/month/{month}" : {
"post" : {
"tags" : [ "billing-history-update" ],
"summary" : "Update a billing history record for a given organization and a specific date",
"description" : "Authentication required for this operation.
Preconditions:
Authenticated user has to be an admin in the platform.",
"operationId" : "updateBillingHistory",
"consumes" : [ "application/json" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "organizationId",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "year",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "month",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"in" : "body",
"name" : "body",
"required" : false,
"schema" : {
"$ref" : "#/definitions/BillingHistoryUpdate"
}
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "Billing history record updated",
"schema" : {
"$ref" : "#/definitions/BillingHistory"
}
},
"400" : {
"description" : "Invalid data in the properties to be updated"
},
"403" : {
"description" : "Not enough permissions to perform the operation"
},
"404" : {
"description" : "A billing history record for that organization doesn't exist"
}
}
}
},
"/chart/scatterplot" : {
"post" : {
"tags" : [ "chart" ],
"summary" : "Get a series data",
"description" : "",
"operationId" : "getScatterplot",
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"in" : "body",
"name" : "body",
"required" : false,
"schema" : {
"$ref" : "#/definitions/ScatterplotRequest"
}
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "Returns series data.",
"schema" : {
"$ref" : "#/definitions/Chart"
}
},
"400" : {
"description" : "The provided date must be a valid date: ISO 8601 date. E.g.: '2016-03-03T00:00:00Z'"
},
"403" : {
"description" : "Unauthorized access to the check id."
},
"404" : {
"description" : "CheckId is not found."
}
}
}
},
"/chart/cultivation-target" : {
"post" : {
"tags" : [ "chart" ],
"summary" : "Return the cultivation target setpoints with given date range and interval.",
"description" : "Authentication required for this operation.",
"operationId" : "getCultivationTargetSeriesById",
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "cultivationTargetId",
"in" : "path",
"description" : "Universally unique identifier of a cultivation target.",
"required" : true,
"type" : "string"
}, {
"in" : "body",
"name" : "body",
"required" : false,
"schema" : {
"$ref" : "#/definitions/CultivationTargetSeriesRequest"
}
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "Cultivation target series returned.",
"schema" : {
"$ref" : "#/definitions/CultivationTargetSeriesResponse"
}
},
"403" : {
"description" : "Not enough permissions to perform the operation."
},
"500" : {
"description" : "Error while retrieving the cultivation targets."
}
}
}
},
"/check/{checkId}" : {
"get" : {
"tags" : [ "check" ],
"summary" : "Returns the check with given check id",
"description" : "Authentication required.
The authenticated user has to be a user in the organization of the given check
or have role admin within the system.
",
"operationId" : "getCheck",
"consumes" : [ "application/json", "application/xml" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "checkId",
"in" : "path",
"required" : true,
"type" : "string"
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "Check returned successfully",
"schema" : {
"$ref" : "#/definitions/Check"
}
},
"403" : {
"description" : "Authenticated user is not allowed to access this check"
},
"404" : {
"description" : "Check with given id doesn't exist"
}
}
},
"delete" : {
"tags" : [ "check" ],
"summary" : "Removes the persisted check data, and the authorization information associated to this (followers and the notification settings).",
"description" : "",
"operationId" : "removeCheck",
"consumes" : [ "application/json", "application/xml" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "checkId",
"in" : "path",
"required" : true,
"type" : "string"
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"204" : {
"description" : "Check removed"
},
"403" : {
"description" : "Unauthorized access to the check id"
},
"500" : {
"description" : "Error DELETING the follows related to the check"
}
}
}
},
"/check/sensor/default" : {
"get" : {
"tags" : [ "check" ],
"summary" : "Returns a sensor check with default values for most fields",
"description" : "Authentication required.",
"operationId" : "getDefaultSensorCheck",
"consumes" : [ "application/json", "application/xml" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "Defaults for sensor check returned successfully",
"schema" : {
"$ref" : "#/definitions/CheckProperties"
}
}
}
}
},
"/check/organization/{organizationId}/clone/check/{checkId}" : {
"post" : {
"tags" : [ "check" ],
"summary" : "Clone a check in the organization given, based on another existing check",
"description" : "Authentication required and user is at least an editor in the organization, or is an admin in the system.
.
",
"operationId" : "cloneCheck",
"consumes" : [ "application/json", "application/xml" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "organizationId",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "checkId",
"in" : "path",
"required" : true,
"type" : "string"
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"201" : {
"description" : "Check created",
"schema" : {
"$ref" : "#/definitions/Check"
}
},
"403" : {
"description" : "User is not authorized to perform this operation."
}
}
}
},
"/check/organization/{organizationId}" : {
"get" : {
"tags" : [ "check" ],
"summary" : "Return all the checks of the given organization",
"description" : "Authentication required and user is at least a follower in the organization, or is an admin in the system.
If not empty, the call filters the list of checks to return only those with checkName in their name.
",
"operationId" : "getOrganizationChecks",
"consumes" : [ "application/json", "application/xml" ],
"produces" : [ "application/json", "application/zensie-v2+json" ],
"parameters" : [ {
"name" : "organizationId",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "search",
"in" : "query",
"description" : "Search for checks by name, url or check id",
"required" : false,
"type" : "string"
}, {
"name" : "tags",
"in" : "query",
"description" : "Filter checks by tags (separate with comma)",
"required" : false,
"type" : "string"
}, {
"name" : "tagsoperator",
"in" : "query",
"description" : "How should checks by filtered by tags (or / and)?",
"required" : false,
"type" : "string"
}, {
"name" : "sensortype",
"in" : "query",
"description" : "Filter checks by sensortype",
"required" : false,
"type" : "string"
}, {
"name" : "expandCoordinates",
"in" : "query",
"description" : "Include data source coordinates information",
"required" : false,
"type" : "boolean"
}, {
"name" : "expandCoordinateHistory",
"in" : "query",
"description" : "Include coordinate history for each data source (may increase response size)",
"required" : false,
"type" : "boolean"
} ],
"security" : [ {
"Bearer" : [ ]
} ],
"responses" : {
"200" : {
"description" : "List of checks returned",
"schema" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/Check"
}
}
},
"403" : {
"description" : "User is not authorized to perform this operation."
}
}
},
"post" : {
"tags" : [ "check" ],
"summary" : "Create a new web check in the organization",
"description" : "Authentication required for this operation.
Preconditions:
1: Import check does not exist.
2: Import check is currently disabled. The import check must be enabled in order to receive data.
3: Sensor type for import check does not exist.
4: Status field should contain one of the values: \"ok\" or \"fail\" .
5: Timestamp field should contain a valid ISO 8601 DateTime format value with an explicitly set timezone value (e.g. 2017-01-17T19:23:02+06:45, 2017-01-17T19:23:02Z).
6: Timestamp must be after 2015-01-01.
8: The import check does not belong to the organization.
9: Sensor type is not external.
10: Sensor fields or the data types of the event are invalid (not matching the ones defined in sensor type table).
11: Event could not be added to database.
12: Event could not be added to notification system (notifications will not run for this event).
14: Imported string value is too long.
15: Sensor field defined in unit override is invalid.
16: Unit defined for a sensor field is invalid.
17: Collection not found
18: Failed to create new manual input event.
", "operationId" : "ingestImportChecks", "consumes" : [ "application/json", "application/xml" ], "produces" : [ "application/json", "application/zensie-v2+json" ], "parameters" : [ { "name" : "organizationId", "in" : "path", "required" : true, "type" : "string" }, { "in" : "body", "name" : "body", "required" : false, "schema" : { "type" : "array", "items" : { "$ref" : "#/definitions/ImportCheckEvent" } } } ], "security" : [ { "Bearer" : [ ] } ], "responses" : { "200" : { "description" : "Import checks events processed.", "schema" : { "$ref" : "#/definitions/ImportCheckEventsResponse" } }, "403" : { "description" : "Not enough permissions to perform the operation. User must be editor or owner in the organization." }, "413" : { "description" : "Too many events sent. A maximum of 100 events are allowed per call" } } } }, "/ingest/manual-input-update" : { "post" : { "tags" : [ "ingest" ], "summary" : "Update manual data.", "description" : "Authentication required for this operation.", "operationId" : "updateManualImportChecks", "consumes" : [ "application/json", "application/xml" ], "produces" : [ "application/json", "application/zensie-v2+json" ], "parameters" : [ { "in" : "body", "name" : "body", "required" : false, "schema" : { "$ref" : "#/definitions/ManualImportCheckEventUpdate" } } ], "security" : [ { "Bearer" : [ ] } ], "responses" : { "201" : { "description" : "Import check event processed.", "schema" : { "$ref" : "#/definitions/ManualImportCheckEventUpdateResponse" } }, "400" : { "description" : "Bad request while ingesting manual data" }, "403" : { "description" : "Not enough permissions to perform the operation. User must be editor or owner in the organization." }, "404" : { "description" : "Event not found" } } } }, "/ingest/manual-input-update/{id}" : { "post" : { "tags" : [ "ingest" ], "summary" : "Update manual data by event id.", "description" : "Authentication required for this operation.", "operationId" : "updateManualImportChecksWithId", "consumes" : [ "application/json", "application/xml" ], "produces" : [ "application/json", "application/zensie-v2+json" ], "parameters" : [ { "name" : "id", "in" : "path", "required" : true, "type" : "string" }, { "in" : "body", "name" : "body", "required" : false, "schema" : { "$ref" : "#/definitions/ManualImportCheckEventUpdate" } } ], "security" : [ { "Bearer" : [ ] } ], "responses" : { "201" : { "description" : "Import check event processed.", "schema" : { "$ref" : "#/definitions/ManualImportCheckEventUpdateResponse" } }, "400" : { "description" : "Bad request while ingesting manual data" }, "403" : { "description" : "Not enough permissions to perform the operation. User must be editor or owner in the organization." } } } }, "/ingest-update/import-check/{importCheckId}/timestamp/{timestamp}" : { "post" : { "tags" : [ "ingest-update" ], "summary" : "Update ingested external sensor data.", "description" : "", "operationId" : "updateImportCheckEvent", "consumes" : [ "application/json", "application/xml" ], "produces" : [ "application/json", "application/zensie-v2+json" ], "parameters" : [ { "name" : "importCheckId", "in" : "path", "required" : true, "type" : "string" }, { "name" : "timestamp", "in" : "path", "required" : true, "type" : "string" }, { "in" : "body", "name" : "body", "required" : false, "schema" : { "$ref" : "#/definitions/ImportCheckEventUpdateRequest" } } ], "security" : [ { "Bearer" : [ ] } ], "responses" : { "200" : { "description" : "Import check event processed." }, "403" : { "description" : "Not enough permissions to perform the operation. User must be editor or owner in the organization." } } } }, "/integration/activate/{integrationId}" : { "post" : { "tags" : [ "integration" ], "operationId" : "activateIntegration", "consumes" : [ "application/json" ], "produces" : [ "application/json", "application/zensie-v2+json" ], "parameters" : [ { "name" : "integrationId", "in" : "path", "required" : true, "type" : "string" }, { "in" : "body", "name" : "body", "required" : false, "schema" : { "type" : "object" } } ], "security" : [ { "Bearer" : [ ] } ], "responses" : { "default" : { "description" : "successful operation" } } } }, "/integration/deactivate/{integrationId}/installation/{installationId}" : { "post" : { "tags" : [ "integration" ], "operationId" : "deactivateIntegration", "consumes" : [ "application/json" ], "produces" : [ "application/json", "application/zensie-v2+json" ], "parameters" : [ { "name" : "integrationId", "in" : "path", "required" : true, "type" : "string" }, { "name" : "installationId", "in" : "path", "required" : true, "type" : "string" }, { "in" : "body", "name" : "body", "required" : false, "schema" : { "type" : "object" } } ], "security" : [ { "Bearer" : [ ] } ], "responses" : { "default" : { "description" : "successful operation" } } } }, "/integrity-check/unique-mother-assignment" : { "get" : { "tags" : [ "integrity-check" ], "summary" : "The mothers in the mothers table are referenced in ONE (not less, not more) location of the locations table.", "description" : "Authentication required for this operation.", "operationId" : "uniqueMother", "consumes" : [ "application/json", "application/xml" ], "produces" : [ "application/json", "application/zensie-v2+json" ], "parameters" : [ ], "security" : [ { "Bearer" : [ ] } ], "responses" : { "200" : { "description" : "The mothers in the mothers table are referenced in ONE (not less, not more) location of the locations table." }, "403" : { "description" : "Not enough permissions to perform the operation. User must be admin." } } } }, "/integrity-check/location-mothers-exist" : { "get" : { "tags" : [ "integrity-check" ], "summary" : "The mother ids mentioned in the locations table exist in the mothers table.", "description" : "Authentication required for this operation.", "operationId" : "motherIdsInLocationsExist", "consumes" : [ "application/json", "application/xml" ], "produces" : [ "application/json", "application/zensie-v2+json" ], "parameters" : [ ], "security" : [ { "Bearer" : [ ] } ], "responses" : { "200" : { "description" : "The mother ids mentioned in the locations table exist in the mothers table." }, "403" : { "description" : "Not enough permissions to perform the operation. User must be admin." } } } }, "/integrity-check/sensor-location-mother" : { "get" : { "tags" : [ "integrity-check" ], "summary" : "Checks if a location has sensor checks but no mother assigned to it.", "description" : "Authentication required for this operation.", "operationId" : "sensorLocationHasMother", "consumes" : [ "application/json", "application/xml" ], "produces" : [ "application/json", "application/zensie-v2+json" ], "parameters" : [ ], "security" : [ { "Bearer" : [ ] } ], "responses" : { "200" : { "description" : "There are no locations with sensor checks which do not have a mother assigned." }, "403" : { "description" : "Not enough permissions to perform the operation. User must be admin." } } } }, "/license/{licenseId}/{organizationId}" : { "post" : { "tags" : [ "license" ], "summary" : "Assign a license to an existing organization.", "description" : "Admin credentials required for this operation.", "operationId" : "createOrganizationLicense", "consumes" : [ "application/json" ], "produces" : [ "application/json", "application/zensie-v2+json" ], "parameters" : [ { "name" : "licenseId", "in" : "path", "required" : true, "type" : "string" }, { "name" : "organizationId", "in" : "path", "required" : true, "type" : "string" }, { "in" : "body", "name" : "body", "required" : false, "schema" : { "type" : "object" } } ], "security" : [ { "Bearer" : [ ] } ], "responses" : { "201" : { "description" : "License assigned to organization.", "schema" : { "$ref" : "#/definitions/OrganizationLicense" } }, "403" : { "description" : "User not authorized." } } }, "delete" : { "tags" : [ "license" ], "summary" : "Remove license from an organization.", "description" : "Admin credentials required for this operation.", "operationId" : "deleteOrganizationLicense", "consumes" : [ "application/json" ], "produces" : [ "application/json", "application/zensie-v2+json" ], "parameters" : [ { "name" : "licenseId", "in" : "path", "required" : true, "type" : "string" }, { "name" : "organizationId", "in" : "path", "required" : true, "type" : "string" } ], "security" : [ { "Bearer" : [ ] } ], "responses" : { "204" : { "description" : "License has been removed from organization." }, "403" : { "description" : "User not authorized." }, "404" : { "description" : "License not found." } } } }, "/license/{licenseId}" : { "get" : { "tags" : [ "license" ], "summary" : "Return the license with the given id.", "description" : "Authentication required for this operation.", "operationId" : "getLicenseById", "consumes" : [ "application/json" ], "produces" : [ "application/json", "application/zensie-v2+json" ], "parameters" : [ { "name" : "licenseId", "in" : "path", "required" : true, "type" : "string" } ], "security" : [ { "Bearer" : [ ] } ], "responses" : { "200" : { "description" : "The license.", "schema" : { "$ref" : "#/definitions/License" } }, "403" : { "description" : "Not enough permissions to perform the operation." } } }, "put" : { "tags" : [ "license" ], "summary" : "Update a license.", "description" : "Authentication required for this operation.", "operationId" : "putLicense", "consumes" : [ "application/json" ], "produces" : [ "application/json", "application/zensie-v2+json" ], "parameters" : [ { "name" : "licenseId", "in" : "path", "required" : true, "type" : "string" }, { "in" : "body", "name" : "body", "required" : false, "schema" : { "$ref" : "#/definitions/LicenseEditable" } } ], "security" : [ { "Bearer" : [ ] } ], "responses" : { "200" : { "description" : "License updated", "schema" : { "$ref" : "#/definitions/License" } }, "400" : { "description" : "Invalid data in the properties to be updated." }, "403" : { "description" : "User not authorized." }, "500" : { "description" : "Error while updating the license." } } }, "delete" : { "tags" : [ "license" ], "summary" : "Delete a license.", "description" : "Authentication required for this operation.", "operationId" : "deleteLicense", "consumes" : [ "application/json" ], "produces" : [ "application/json", "application/zensie-v2+json" ], "parameters" : [ { "name" : "licenseId", "in" : "path", "required" : true, "type" : "string" } ], "security" : [ { "Bearer" : [ ] } ], "responses" : { "204" : { "description" : "License has been deleted." }, "403" : { "description" : "User not authorized." }, "404" : { "description" : "License not found." } } }, "patch" : { "tags" : [ "license" ], "summary" : "Patch a license.", "description" : "Authentication required for this operation.", "operationId" : "patchLicense", "consumes" : [ "application/json" ], "produces" : [ "application/json", "application/zensie-v2+json" ], "parameters" : [ { "name" : "licenseId", "in" : "path", "required" : true, "type" : "string" }, { "in" : "body", "name" : "body", "required" : false, "schema" : { "$ref" : "#/definitions/LicenseEditable" } } ], "security" : [ { "Bearer" : [ ] } ], "responses" : { "200" : { "description" : "License patched", "schema" : { "$ref" : "#/definitions/License" } }, "400" : { "description" : "Invalid data in the properties to be patched." }, "403" : { "description" : "User must be authenticated." }, "500" : { "description" : "Error while patching the license." } } } }, "/license" : { "get" : { "tags" : [ "license" ], "summary" : "Return all licenses.", "description" : "Authentication required for this operation.", "operationId" : "getAllLicenses", "consumes" : [ "application/json" ], "produces" : [ "application/json", "application/zensie-v2+json" ], "parameters" : [ ], "security" : [ { "Bearer" : [ ] } ], "responses" : { "200" : { "description" : "Returns all licenses.", "schema" : { "type" : "array", "items" : { "$ref" : "#/definitions/License" } } }, "403" : { "description" : "User not authorized." } } }, "post" : { "tags" : [ "license" ], "summary" : "Create a new license.", "description" : "Authentication required for this operation.", "operationId" : "createLicense", "consumes" : [ "application/json" ], "produces" : [ "application/json", "application/zensie-v2+json" ], "parameters" : [ { "in" : "body", "name" : "body", "required" : false, "schema" : { "$ref" : "#/definitions/License" } } ], "security" : [ { "Bearer" : [ ] } ], "responses" : { "201" : { "description" : "New license created.", "schema" : { "$ref" : "#/definitions/License" } }, "403" : { "description" : "User not authorized." } } } }, "/license/{licenseId}/organizations" : { "get" : { "tags" : [ "license" ], "summary" : "Return the list of organizations with the given license.", "description" : "Authentication required for this operation.", "operationId" : "getOrganizationsByLicenseId", "consumes" : [ "application/json" ], "produces" : [ "application/json", "application/zensie-v2+json" ], "parameters" : [ { "name" : "licenseId", "in" : "path", "required" : true, "type" : "string" } ], "security" : [ { "Bearer" : [ ] } ], "responses" : { "200" : { "description" : "The list of organizations.", "schema" : { "type" : "array", "items" : { "$ref" : "#/definitions/Organization" } } }, "403" : { "description" : "Not enough permissions to perform the operation." } } } }, "/location/{locationName}" : { "get" : { "tags" : [ "location" ], "summary" : "Return the location with the given location name.", "description" : "Default oauth authentication mechanism required for this operation. ", "operationId" : "getLocation", "consumes" : [ "application/json" ], "produces" : [ "application/json", "application/zensie-v2+json" ], "parameters" : [ { "name" : "locationName", "in" : "path", "required" : true, "type" : "string" } ], "security" : [ { "Bearer" : [ ] } ], "deprecated" : true, "responses" : { "200" : { "description" : "Return the location with the given name", "schema" : { "$ref" : "#/definitions/Location" } }, "403" : { "description" : "Unauthorized to perform operation, not enough permissions." }, "404" : { "description" : "There is no location with the given name" } } }, "delete" : { "tags" : [ "location" ], "summary" : "Removes the location, the queue associated to it, and IAM user.", "description" : "", "operationId" : "deleteLocation", "consumes" : [ "application/json" ], "produces" : [ "application/json", "application/zensie-v2+json" ], "parameters" : [ { "name" : "locationName", "in" : "path", "required" : true, "type" : "string" }, { "name" : "removeChecks", "in" : "query", "description" : "True if you want to remove the checks that use this location (and no other locations)", "required" : false, "type" : "boolean", "default" : true } ], "security" : [ { "Bearer" : [ ] } ], "deprecated" : true, "responses" : { "204" : { "description" : "Location removed" }, "403" : { "description" : "Unauthorized to perform this operation." }, "510" : { "description" : "Error - location partially deleted." } } } }, "/location" : { "post" : { "tags" : [ "location" ], "summary" : "Create a new location.", "description" : "Default oauth authentication mechanism required for this operation./stats/check/9cca5615-b654-4e6e-96d2-f5db89805a83/1d /stats/check/9cca5615-b654-4e6e-96d2-f5db89805a83/from/2016-03-04T00:00:00Z/until/2016-03-14T00:00:00Z