Skip to content
Helementa Docs
Esc
↑↓navigate↵open⌘Jpreview

Authentication

Authenticate each request with an API key, sent as a bearer token in the Authorization header, and make a first call.

The Helementa API authenticates every request with an API key, sent as a bearer token in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Keep the key on your server: read it from an environment variable, and never ship it in a web page or a mobile app.

Make a first call

List the sensor types, the kinds of reading a device reports, each with its unit:

curl https://api.helementa.com/v1/sensor-types \
  -H "Authorization: Bearer $HELEMENTA_API_KEY"

The route in full, from the API reference:

GET/v1/sensor-types
Authorization
AuthorizationBearer token · headerrequired

An API key.

or
AuthorizationBearer token · headerrequired

The session of a signed-in user.

Query parameters
limitinteger
min 1 · max 100 · default: 20
cursorstring
min length 1
Responses
200

Response for status 200

dataobject[]required
Show properties
Array of object
idstring<uuid>required
tagstringrequired

Stable identifier devices report readings by.

namestringrequired
unitstringrequired
descriptionstring | nullrequired
next_cursorstring | nullrequired
401

Response for status 401

typestringrequired
codestringrequired
titlestringrequired
statusintegerrequired
detailstring
403

Response for status 403

typestringrequired
codestringrequired
titlestringrequired
statusintegerrequired
detailstring
422

Response for status 422

typestringrequired
codestringrequired
titlestringrequired
statusintegerrequired
detailstring
Request
curl -X GET 'https://api.helementa.com/v1/sensor-types' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json'
Response
{
  "data": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "tag": "string",
      "name": "string",
      "unit": "string",
      "description": "string"
    }
  ],
  "next_cursor": "string"
}

When the API refuses the key

  • 401 unauthenticated: the request carries no key, or one the API does not accept.
  • 403 forbidden: the key is valid, but it lacks the permission the route needs.

Both answers are problem documents. The API checks the key before it validates the request, so a refused call learns nothing about the route’s schema.