Create or update a key-value pair
PUT/devices/{deviceId}/kv/{key}
Base URL: https://api.tinkermode.com
Set the value for the specified key. If the key-value pair does not already exist, it is created.
Authentication
Send an Authorization header of the form ModeCloud <AUTH_CODE>.
Must contain a user key, service account token, project API key, or API key of the matching device.
Path parameters
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
deviceId | integer | Yes | Device ID | |
key | string | Yes | A unique key for a key-value pair stored for a device. |
Request body
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
value | string | Yes | The value set to the key. |
Responses
204 Key-value pair has been successfully stored. There is no response body.
401 Authorization is required to access this resource.
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. |
404 The specified device does not exist.
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. |