Create API key Early access
This method allows you to create an API key. Only users with certain roles can create api keys; for example, Account Manager and Integrations Manager roles.
Authorizations:
Scopes:
Request rate limit:
Request Body schema:
application/jsonaccountId | string Unique identifier for account this API key will belong to. If not provided accountId of the user making the API request will be set. CPaaSX Applications and Entities can be set only on api keys that belong to the account of the user making the request and only if that account is main account. | ||||||
name required | string Name of this API Key. | ||||||
allowedIPs | Array of strings List of IP addresses or IP ranges from which this API key will be used. Authentication will fail from any other IP not specified in this list. | ||||||
validFrom | string <date-time> Date from which this API key will be valid. Time is in UTC. Should not be earlier than creation date. If not provided default is date of creation. | ||||||
validTo | string <date-time> Date until this API key will be valid. Time is in UTC. Should not be earlier than validFrom or creation time. If not provided default is 1 year from creation. | ||||||
permissions | Array of strings Items Enum: "PUBLIC_API" "2FA_CLIENT" "WEB_SDK" List of permissions this API key has granted. Default permission is 'PUBLIC_API'. API key cannot be created with both 'PUBLIC_API' and 'WEB_SDK' permissions. API key cannot be created with both permissions and a collection of Applications and/or Entities in | ||||||
platform | Array of objects A collection of CPaaS X Applications and Entities that will be linked to the API Key. API key cannot be created with both permissions and a collection of Applications and/or Entities. | ||||||
Array
| |||||||
scopeGuids | Array of strings List of Scopes that will be assigned to API Key. |
Responses
OK
Bad Request
Unauthorized
Forbidden
Too Many Requests
Internal Server Error
Request samples
- Payload
- cURL
- Java
- C#
- Go
- Python
- PHP
- JavaScript
- NodeJs
- Ruby
{- "accountId": "8F0792F86035A9F4290821F1EE6BC06A",
- "name": "First ApiKey on my account",
- "allowedIPs": [
- "127.0.0.1",
- "168.158.10.122"
], - "validFrom": "2023-09-01T10:00:00",
- "validTo": "2024-09-01T10:00:00",
- "permissions": [
- "PUBLIC_API"
], - "scopeGuids": [
- "2fa:manage",
- "account-management:manage"
]
}
Response samples
- 200
- 400
- 401
- 403
- 429
- 500
{ "id": "573711510E1C002E29679B12C7CB48AE", "apiKeySecret": "<secret api key>", "accountId": "8F0792F86035A9F4290821F1EE6BC06A", "name": "First ApiKey on my account", "allowedIPs": [ "127.0.0.1", "168.158.10.122" ], "validFrom": "2024-09-01T10:00:00", "validTo": "2023-09-01T10:00:00", "enabled": true, "permissions": [ "PUBLIC_API" ], "scopeGuids": [ "2fa:manage", "account-management:manage" ] }
Need assistance
Encountering issues
What's new? Check out
Unsure about a term? See