Create entity instance
POST/projects/{projectId}/entities
Base URL: https://api.tinkermode.com
Create a new entity instance.
Authentication
Send an Authorization header of the form ModeCloud <AUTH_CODE>.
Must contain a user API key of a user with permission to create child entities on the parent entity, a service account token with the same permission, or a project API key with admin permission.
Path parameters
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
projectId | integer | Yes | The unique ID for a specified project. |
Request body
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
attributes | object | No | The attributes that belong to the entity instance, separated as key-value pairs. | |
displaySettings | object | Yes | Various user interface settings used for display of the entity class. This object must contain at least the name field. | |
entityClass | string | Yes | The entity class that the entity will be instantiated from. | |
entityId | string | Yes | Unique entity ID. | |
homeId | number | Yes | Home that this entity belongs to. | |
parentId | string | No | The ID of the entity instance that is a parent of the instance. | |
timeZone | string | Yes | The time zone that the entity exists in. This should be a time zone name defined in the IANA TZ Database. | |
uiSettings | object | No | An opaque object used by UI applications to store any additional settings. These will override the entity class uiSettings. |
Responses
201 Successful creation of entity instance.
Content type: application/json
| Property | Type | Required | Constraints | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
attributes | object | No | The attributes that belong to the entity instance, separated as key-value pairs. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
createdAt | string | No | read-only (server-generated); format: date-time | Timestamp of entity creation. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
displaySettings | object | No | Various user interface settings used for display of the entity instance. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
entityClass | string | Yes | read-only (server-generated) | The entity class that the entity was instantiated from. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
entityId | string | Yes | read-only (server-generated) | Unique entity ID. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
homeId | integer | Yes | read-only (server-generated) | Home that this entity belongs to. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
metrics | array<object> | No | read-only (server-generated) | Meta data of the metrics associated with this entity instance. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
parentId | string | No | The ID of the entity instance that is a parent of the instance. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
projectId | integer | Yes | read-only (server-generated) | Project that this entity belongs to. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
suspendAlertRuleEvaluationConditions | array<object> | No | An array of condition for suspending alerts, which are evaluated as if they are concatenated with OR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
timeZone | string | Yes | read-only (server-generated) | The time zone that the entity exists in. This should be a time zone name defined in the IANA TZ Database. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
uiSettings | object | No | An opaque object used by UI applications to store any additional settings. These will override the entity class uiSettings. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
updatedAt | string | No | read-only (server-generated); format: date-time | Timestamp of the last update on the entity. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Response example
{
"attributes": {
"group": "samsung_freezer_model_4",
"minTemperatureCelsius": -40.2
},
"createdAt": "2021-09-02T22:19:39Z",
"displaySettings": {
"description": "A warehouse freezer in warehouse room #003.",
"iconData": {
"fileName": "freezer_icon.png",
"url": "https://example.com/icons/freezer_icon.png"
},
"imageData": {
"fileName": "freezer.png",
"url": "https://example.com/images/freezer.png"
},
"name": "Warehouse Freezer 001"
},
"entityClass": "warehouse_freezer",
"entityId": "warehouse_freezer_001",
"homeId": 5,
"parentId": "warehouse_room_003",
"projectId": 1,
"timeZone": "Europe/Berlin",
"updatedAt": "2021-09-02T22:19:39Z"
}401 Authorization is required to access this resource.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
403 Request failed because of invalid data or denied permission.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
429 Request failed because of rate limit.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
500 An unexpected error has occurred.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
503 The service is temporarily unavailable.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |