To perform actions using the Harmony SASE API, a temporary authorization token must be generated using the workspace API Key.
How To Generate an Access Token
First, sign in to your Harmony SASE Admin Console with either the Admin or Manager role.
- Navigate to Settings -> API Support
- At the top right corner, click +Generate New Key
- Enter the following details:
- Key Name - Write a logical name to help you identify the Key later.
- Expiration Date - Select a date for the Access Token to expire. Any API requests done after this date will be denied.
- Key Permissions - Choose which Actions will be possible using this specific API Key.
- Once you have created your key, click the eye icon (👁) to reveal the Key.
- Once the key is revealed, copy it or use the clipboard icon ()
- This token can now be used to POST an authorization via the API.
POST /v1/auth/authorize
- Once you've successfully authorized the API key, you may use any API Calls permitted under Key Permissions for 60 minutes.
- After 60 minutes, you must go through authorization once more to continue interacting with the API.
Parameters: None
Request Body:
Property | Data Type | Description |
---|---|---|
grantType | String | Authorize request type: 'api_key'. |
apiKey | String | API key from Generate New Token in the web client. |
Request Example:
For US:
curl -X 'POST' -H 'Content-Type: application/json' \-d '{ "grantType": "api_key", "apiKey": "<API_KEY>"}' 'https://api.perimeter81.com/api/v1/auth/authorize'
For EU:
curl -X 'POST' -H 'Content-Type: application/json' \-d '{ "grantType": "api_key", "apiKey": "<API_KEY>"}' 'https://api.eu.sase.checkpoint.com/api/v1/auth/authorize'
Response:
Status Code | Message/JSON Response Body | Description |
---|---|---|
200 | See the Response Body table below. | Success. Access token and expiration time returned. |
Response Body:
Property | Data Type | Description |
---|---|---|
data | Object | Returns an object with the access token and its expiration timestamp. |
token | String | Type of token. Value is ‘bearer.’ |
accessToken | String | Access token. Expires according to accessTokenExpire. |
accessTokenExpire | Date | Timestamp of the Access Token’s expiration. |
Response Example:
Now you can use the APIs for external calls during the next 60 minutes.