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

NameTypeRequiredConstraintsDescription
deviceIdintegerYesDevice ID
keystringYesA unique key for a key-value pair stored for a device.

Request body

Content type: application/json

PropertyTypeRequiredConstraintsDescription
valuestringYesThe 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

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

404 The specified device does not exist.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

500 An unexpected error has occurred.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

503 The service is temporarily unavailable.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.