Skip to main content

Create or replace a Custom Device data source

PUT 

/api/v1/orgs/{orgId}/devices/{deviceId}/data-source

Create the device's data source if none exists yet, or fully replace it if one does (upsert). Every field in the request overwrites the corresponding stored field. Omitting description clears it, it is not preserved from the previous value.

Request Body

  • name (string, required): A descriptive name for the data source.
  • description (string, optional): A detailed description of the data source.
  • connectorType (string, optional): One of MQTT(v3.1), WEDA Data-Stream, HTTP-Server. Immutable once set: while the data source's current connectorType is unset, this may set it; once it has a value, sending the same value again is accepted as a no-op, but sending a different value returns 400.

Parameters

  • orgId (string, required, path): Organization identifier.
  • deviceId (UUID, required, path): Custom device identifier.

Responses

  • 201 Created: No data source existed yet for this device. A new one was created.
  • 200 OK: A data source already existed. It was replaced.
  • 400 Bad Request: connectorType was already set to a different value and this request tries to change it.
  • 417 Expectation Failed: The data source was saved, but applying it failed. The whole change was rolled back.

Request​

Responses​

OK