Skip to content

Authentication

Every Revolution API call — REST, SignalR, MQTT — needs a bearer token tied to a real user in a real tenant. We use OAuth 2.0 with PKCE; there are no API keys.

  1. Register your client in the Revolution admin → API clients.

  2. Send the user to the authorization endpoint with a PKCE challenge.

  3. Exchange the returned code for an access token.

  4. Send the token as a bearer header on every subsequent request.

Once the user has authorized, your callback receives ?code=…&state=…. Exchange the code:

Terminal window
curl -X POST https://api.revolution.io/v1/auth/token \
-H "Content-Type: application/json" \
-d '{
"code": "<auth-code>",
"code_verifier": "<pkce-verifier>",
"client_id": "<your-client-id>",
"redirect_uri": "https://your.app/callback"
}'

Pass the token in the Authorization header.

Terminal window
curl https://api.revolution.io/v1/devices \
-H "Authorization: Bearer $TOKEN"

Access tokens are short-lived (1 hour by default). Use the refresh_token returned by the exchange to mint a new one without re-prompting the user.

For machine-to-machine integrations (CI bots, scheduled jobs, internal services), use the client-credentials flow instead of PKCE.

Terminal window
curl -X POST https://api.revolution.io/v1/auth/token \
-H "Content-Type: application/json" \
-d '{
"grant_type": "client_credentials",
"client_id": "<service-client-id>",
"client_secret": "<service-client-secret>"
}'

The returned token is scoped to the service account’s role in your tenant. Create a service account with least-privilege roles in Revolution admin → Service accounts.