Skip to content

Mandates

A mandate is the main structure for all information. Mandates isolate and encapsulate organizational data (users, user groups, folders, API keys) and logical data (devices, parsers, interfaces, packets, readings).

All API requests are bound to one specific mandate which is being retrieved from the API key that is being used to initiate the request.

Mandates can only be created/updated/deleted using the Administration-UI.

Websocket

The packets and readings of all devices in a mandate can be pushed using a websocket.

List all mandates

Method: GET, Endpoint: /mandates

!!! A Superadmin-API-Key will have access to all mandates. Common Admin-API-Keys will only see their own mandate.

Example Request

GET https://element-iot.com/api/v1/mandates?auth=46cb688e2c0b468e26e914235d4b73ea

Example Response

{
  "status": 200,
  "retrieve_after_id": "50e032fb-964f-440d-9b9a-47870667373c",
  "ok": true,
  "body": [
    // Contains an array of mandates
  ]
}

This endpoint returns a paginated list of mandates. The inserted_at or name property may be used for sorting.

If you want to configure the sort order or restrict the results to a specific time interval, please refer to the Pagination section of this documentation.

Show a single mandate

Method: GET, Endpoint: /mandates/:mandate_id

!!! A Superadmin-API-Key will have access to all mandates. Common Admin-API-Keys will only see their own mandate.

Example Request

GET https://element-iot.com/api/v1/mandates/50e032fb-964f-440d-9b9a-47870667373c?auth=46cb688e2c0b468e26e914235d4b73ea

Example Response

{
  "status": 200,
  "ok": true,
  "body": {
    "slug": "example",
    "name": "Example Mandate",
    "id": "50e032fb-964f-440d-9b9a-47870667373c"
  }
}