Access token for an API integration (e.g. a factory station) with the client_credentials grant. Valid for 5 minutes, no refresh token.
For software that calls the API without a person: factory stations, server-to-server integrations. An organization administrator creates an API integration (Administration → API integrations), gives it a role on the machine groups it needs, and copies its client_id and secret; the secret is shown only once and can be rotated or revoked at any time. Personal credentials (username and password, Get access token) must not be used by such systems. See Provisioning from a factory station.
POST https://auth.things5.digital/auth/realms/{realm-id}/protocol/openid-connect/token
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials&client_id={client_id}&client_secret={secret}
| Parameter | Description |
|---|---|
realm-id | Your realm, see General parameters. If your organization logs in on its own domain (for example auth.yourcompany.com), use that domain instead of auth.things5.digital: the dialog of the integration shows the exact address. |
grant_type | Always client_credentials. |
client_id, client_secret | Of the API integration. |
Responses
200: send access_token as Authorization: Bearer <access_token>. It is valid for 5 minutes and there is no refresh token: request a new one when it expires.
{ "access_token": "eyJhbGciOi…", "expires_in": 300, "token_type": "Bearer", "scope": "profile email" }
Then call the API with it:
curl 'https://api.things5.digital/v1/organizations' \
-H 'Authorization: Bearer {access_token}'
401: wrong or rotated secret (unauthorized_client), or unknown or revoked integration (invalid_client).
{ "error": "unauthorized_client", "error_description": "Invalid client or Invalid client credentials" }
