API Tokens Overview (v7.1.0+)
Introduced in v7.1.0, personal API Tokens are a new way of granting Metric Insights REST API access to users without sharing External Application credentials with them. The new interface allows generating personal API tokens for a selected user with a set expiration date. The API token has the exact same privileges as the assigned user and acts on their behalf. See the notes below on the token generation rules.
NOTES:
- Power Users can add a new token only for themselves.
- A Power User must be granted the Use API Tokens privilege to generate API Tokens.
- Admins can add a new token for themselves and for other non-admin users.
- Admins can't add a new token for another Admin.
- For v7.1.0: Personal API Tokens can be generated only via Metric Insights UI as described in this article, generating personal API Tokens via API calls is not supported.
1. Generate New Personal API Token
Access Admin > System > API Tokens
- [+ Token]
- Token Name: Enter a name for the Token
- Expiration: Set the Token's expiration date and time
-
Token will represent this user: Select a user on whose behalf the token will act.
- The token will have the permissions and privileges of the selected user.
- [Generate]
-
[Copy] the token value.
- Once the pop-up is closed, you will not be able to view it again.
- [Download] a text file with the token
2. Use Token in API Calls
NOTE: API Toolkit does not support personal API Tokens in v7.1.0.
This section provides examples of using the personal token in API calls via curl.
curl
Fetch data:
curl -X GET "https://<MI hostname>/api/user_group" \
-H "Accept: application/json" \
-H "Authorization: Bearer <API Token>"
Insert data:
curl -X POST "https://<MI hostname>/api/announcement" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API Token>" \
-d '{
"enabled": "enabled",
"show_on_viewer": "N",
"show_on_homepage": "Y",
"show_on_apps": "Y",
"time_window": "N",
"end_time": "2025-06-19 13:09:18",
"html_code": "<p style=\"text-align: center;\"><strong>API-created announcement</strong></p>",
"show_on_viewer_scope": "all_elements",
"border_color": "#CC0000",
"subject": "API-created announcement",
"visible_to": "Everyone",
"start_time": "2025-06-12 13:09:18",
"requires_approval": "N",
"allow_to_dismiss": "Y",
"rank": 1
}'