Register external applications and scripts to access Cloudmon APIs with OAuth 2.0 client credentials securely.
OAuth Apps let external applications and scripts, such as a CMDB, ITSM, or reporting tool, access Cloudmon APIs securely.
Authorization: Bearer with the token| Section | Description |
| Setup Guide | A reference panel for the integration team. |
| Enable App | On by default. When it is off, the app can't get or use tokens. |
| Details | Name (required): a name that identifies the integration, such as ServiceNow CMDB. Description: an optional note on what the integration does. |
| Permissions | Role (required): the app gets exactly this role's permissions. |
| Access Scope | Limits the customers and groups the app can see. Customers: All Customers, or Select Customers to choose one or more. Available in the MSP edition. Groups: All Groups, or Select Groups to choose one or more. |
| Credential | Description |
| Client ID | Starts with cmc_. Identifies the integration. It stays the same until the app is deleted. |
| Client secret | Starts with cms_. The password of the integration. It is shown only once and stays valid until it is rotated. |
| Access token | Starts with cma_. Sent with every API call. It is valid for 15 minutes. |
In the examples in this article, replace <cloudmon-address> with your Cloudmon address, and CLIENT_ID and CLIENT_SECRET with your credentials.
Send a POST request to the Token URL with grant_type=client_credentials.
curl -s -u "CLIENT_ID:CLIENT_SECRET" \
-d "grant_type=client_credentials" \
https://<cloudmon-address>/api/oauth/token
A successful response looks like this:
{ "access_token": "cma_...", "token_type": "Bearer", "expires_in": 900 }Send the credentials as HTTP Basic authentication, as in the example, which is recommended, or as the form fields client_id and client_secret. Don't send both.
Send the access token in the Authorization header of each call.
curl -s -H "Authorization: Bearer ACCESS_TOKEN" \
"https://<cloudmon-address>/api/<your-api>"
Every API that the app's role allows works the same way.
An access token is valid for 15 minutes, the expires_in value. To renew it, repeat Step 1 with the same Client ID and Client secret.
expires_in runs out, so that a call never fails in the middle of a job.401 with the header WWW-Authenticate: Bearer error="invalid_token", request a new token and retry the call once.Click the app count on the OAuth Apps card to open the OAuth Apps Integration window. It lists every registered app with its status, and its Add button opens the Register App form. Use the action icons on an app's row as described in the following table.
| Action | Description |
| Copy Client ID | Copies the app's Client ID. |
| Edit | Opens the app to change its name, description, role, access scope, or status. Changing only the name or description has no effect on the integration. Changing the role, access scope, or status cancels all of the app's tokens, and the integration must request a new token. |
| Rotate secret | Issues a new Client secret, shown once. The old secret and all of the app's tokens stop working immediately. Use it if the secret may have leaked, or as routine hygiene. |
| Revoke tokens | Cancels all of the app's current tokens. The same Client ID and Client secret can request new ones. Use it if a token may have leaked. |
| Delete | Removes the app and all its tokens permanently. To confirm, type the app's name. Use it when the integration is retired. |
To pause an integration temporarily, edit the app and switch Enable App off. Switch it on again to let the integration request tokens.