Skip to main content

Scopes

Cloudonix offers advanced security by implementing a detailed access control policy. This approach ensures that developers, voice applications, and external resources can only access the specific resources they are permitted to use, without exposing other data. Unlike other CPaaS platforms where an API key grants unrestricted access, Cloudonix provides the ability to generate API keys tailored to different data models and access permissions. This ensures a more secure and controlled environment.

Bearer Tokens

All Cloudonix API keys are implemented as Bearer Token keys, in accordance with the specifications outlined in RFC 6750, Section 2.1. This means that authentication is handled through a token that is included in the HTTP headers of requests, ensuring a secure and standardized method for accessing API resources.

Request Example:

$ curl 'https://api.cloudonix.io/customers/self' \
--header 'Authorization: Bearer XI•••••••••••••••' -s

Access Scopes

Platform Scopes

Key TypeDescriptionCustomerDomain
Voice Application
Subscriber
CustomerA Customer key (AKA: Tenant key) has access to all customer owned resources.
DomainA Domain key has access to all domain owned resources, such as voice trunks, subscribers, etc.
SubscriberA Subscriber key has access to its own resources only, eg. the subscriber profile.
Voice ApplicationA Voice Application key has access to its own resources only, eg. the voice application profile.

User Scope

When a user is provisioned to access the Cloudonix Cockpit, they are automatically assigned a User token. This token provides access to all resources available through the Cockpit. Users can be created with access at either the Customer scope (eg. the first administrative user) or the Domain scope (eg. a domain administrator). Once created, the User inherits the same access privileges as the scope it was created at.

User Tokens

As a developer, the User token is provided as a personal means of communicating with the Cloudonix API. Using a User token in your applications is highly discouraged, as the User token has elevated access rights and may be abused by a remote application and/or user, without proper control.

API Key Endpoints

The following are the releant API key endpoints, depending on the scope being used.

warning

When using a higher scope API key to access an resource owned data model, YOU MUST access the resource via the API key parent scope endpoint. For example, assuming the following API keys:

Customer API-Key: XI1
Domain API-Key: XI2

If using the Customer API-Key, to access domain resources, we must use the following endpoint: /customers/{customer-id/domains/{domain-name}/keys{/key-id}. If we were using the Domain API-Key, the endpoint would be as following: /domains/{domain-name}/keys{/key-id}. Each API-Key automatically defined the highest scope to be used.

Get API Keys

With Customer API Key
GET /customers/{identifier|"self"}/keys[/{key-id}]

With Domain API Key
GET /domains/{identifier}/keys[/{key-id}]

With Voice Application API Key
GET /applications/{identifier}/keys[/{key-id}]

With Subscriber API Key
GET /subscribers/{identifier}/keys[/{key-id}]

info

This request will return ALL customer API keys - may be a large JSON array of objects.

Example

[
{
"id": •••••••••••••••,
"tenantId": •••••••••••••••,
"domainId": •••••••••••••••,
"applicationId": •••••••••••••••,
"subscriberId": null,
"userId": null,
"active": true,
"name": "API Key Description",
"keyId": "API Key Text",
"secret": null,
"type": "application",
"createdAt": "2024-08-11T11:13:35Z",
"modifiedAt": "2024-08-19T10:11:22Z",
"deletedAt": null,
"activeAt": "2024-08-19T10:11:22Z",
"tenant-id": •••••••••••••••,
"tenant": {
•••••••••••••••,
},
"domain-id": •••••••••••••••,
"domain": {
•••••••••••••••
},
"subscriber-id": •••••••••••••••,
"subscriber": {
•••••••••••••••
},
"application-id": •••••••••••••••,
"application": {
•••••••••••••••
}
}
]

Immutable Properties

PropertyTypeDescription
tenantIdIntegerCustomer numerical ID.
domainIdIntegerDomain numerical ID, available for domain and lower scope resources only.
applicationIdIntegerVoice application numerical ID, available for voice application scope resources only.
subscriberIdIntegerSubscriber numerical ID, available for subscribers cope resources only.
nameStringAPI Key name.
keyIdObjectA customer settings object, describing optional customer configurations.
typeStringAPI Key type. See: Voice API Overview.
tenantObjectCustomer object. See: Customer Data Model
domainObjectDomain object. See: Domain Data Model
subscriberObjectSubscriber object. See: Subscriber Data Model
applicationObjectVoice Application object. See: Voice Application Data Model
createdAtISO-8601 TimestampAPI Key creation timestamp, in ISO-8601 format.
modifiedAtISO-8601 TimestampAPI Key modification timestamp, in ISO-8601 format.
deletedAtISO-8601 TimestampAPI Key deletion timestamp, in ISO-8601 format.
activeAtISO-8601 TimestampAPI Key activation timestamp, in ISO-8601 format.

API Key Types

Key TypeDescription
customerA customer backend applicationassociatd API key, normally a remote server application backend.
userA Cloudonix cockpit user account associatd API key.
applicationA voice application associatd API key.
subscriberA subscriber associated API key.

Create API Key

With Customer API Key
POST /customers/{identifier|"self"}/keys

With Domain API Key
POST /domains/{identifier}/keys

With Voice Application API Key
POST /applications/{identifier}/keys

With Subscriber API Key
POST /subscribers/{identifier}/keys

Create customer API Key Example

$ curl 'https://api.cloudonix.io/customers/self' \
--header 'Authorization: Bearer XI•••••••••••••••' -s
--data '{
"name": "Customer API Key Name"
}'

Delete API Key

With Customer API Key
DELETE /customers/{identifier|"self"}/keys/{key-id}

With Domain API Key
DELETE /domains/{identifier}/keys/{key-id}

With Voice Application API Key
DELETE /applications/{identifier}/keys/{key-id}

With Subscriber API Key
DELETE /subscribers/{identifier}/keys/{key-id}

Delete customer API Key Example

$ curl 'https://api.cloudonix.io/customers/self/XI1234567890' \
--request DELETE
--header 'Authorization: Bearer XI•••••••••••••••' -s