Identity Access Management API
Overview
The Identity Access Management (IAM) API lets you:
-
Create and manage users under their CPaaS account, as well as define a permission set for each user.
-
Create up to two API keys and rotate them according to security best practices
User Management
You can create, update, retrieve and delete users.
Resource Properties
Property | Description |
---|---|
AccountSid |
A string that uniquely identifies the account the user belongs to. |
Name |
The name of the user. |
The email address associated with the user. |
|
PhoneNumber |
Optional. The phone number associated with the user. |
Role |
The role assigned to the user. Possible values for users created under your account include: |
Sid |
A string that uniquely identifies the user. |
Status |
The status of the user. Possible values are: unconfirmed, active, inactive. By default, users have |
DateCreated |
The date and time when the user was created. |
DateUpdated |
The date and time when the user was last updated. |
Uri |
The uri for this user, relative to |
Password |
The password for this user. This field is only available after a create operation. Get and update operations won’t display this field. |
User Roles and Permissions
The following table specifies the user permissions to the Platform and Turnkey Applications resources based on their role.
Capability Availability at that Account Hierarchy Level |
Administrator |
Developer |
Turnkey Applications Administrator |
Turnkey Applications Developer |
|
Platform Resources |
|||||
Account Settings |
Yes |
read only |
read only |
no access |
no access |
API Credentials |
Yes |
read/write |
read/write |
no access |
no access |
Audit API |
No |
no access |
no access |
no access |
no access |
Feature Access Control Management |
No |
no access |
no access |
no access |
no access |
User Management |
Yes |
read/write |
no access |
read/write |
no access |
Role Access |
Yes |
- Business Customer Administrator |
no access |
- Business Customer Turnkey Applications Administrator |
no access |
Whitelabeling Settings |
No |
no access |
no access |
no access |
no access |
BYOC Settings |
No |
no access |
no access |
no access |
no access |
Manage Enterprise Accounts |
No |
no access |
no access |
no access |
no access |
Communications Partner Organization/Account Management |
No |
no access |
no access |
no access |
no access |
Turnkey Applications Enablement Management |
No |
no access |
no access |
no access |
no access |
Manage Applications |
Yes |
read/write |
read/write |
no access |
no access |
Manage Numbers |
Yes |
read/write |
read/write |
no access |
no access |
Manage SIP/WebRTC Clients |
Yes |
read/write |
read/write |
no access |
no access |
P. SMS |
Yes |
read/write |
read/write |
no access |
no access |
P. Voice |
Yes |
read/write |
read/write |
no access |
no access |
Call Logs |
Yes |
read only |
read only |
no access |
no access |
SMS Logs |
Yes |
read only |
read only |
no access |
no access |
SMS Logs Content |
Yes |
read only |
read only |
no access |
no access |
Recordings |
Yes |
read/write |
read/write |
no access |
no access |
Recordings Content |
Yes |
read only |
read only |
no access |
no access |
Usage |
Yes |
read only |
read only |
no access |
no access |
Notifications |
Yes |
read only |
read only |
no access |
no access |
OutgoingCallerIDs |
No |
no access |
no access |
no access |
no access |
Visual Designer |
Yes |
read/write |
read/write |
no access |
no access |
Turnkey Applications |
|||||
Auto Attendant |
|||||
AA-Provisioning (GET, POST, PUT, DELETE) |
read/write |
no access |
no access |
read/write |
read/write |
AA-System(CSP_ADMIN or SUPER_ADMIN) AA-Phone Number AA-Single Sign On |
read only |
no access |
no access |
read only |
read only |
AA- Usage Records |
read only |
no access |
no access |
read only |
read only |
AA-Enterprise And User |
read only |
no access |
no access |
read only |
read only |
AA-Search and Usage record all endpoints all levels |
no access |
no access |
no access |
no access |
no access |
Number Masking |
|||||
NM-Provisioning(GET, POST, PUT, DELETE) |
read/write |
no access |
no access |
read/write |
no access |
NM-Usage records |
read only |
no access |
no access |
read only |
no access |
NM-Enterprise And User |
read only |
no access |
no access |
read only |
no access |
NM- Search and Usage record all endpoints all levels |
no access |
no access |
no access |
no access |
no access |
Task Router |
|||||
TR-Provisioning (GET, POST, PUT, DELETE) |
read/write |
no access |
no access |
read/write |
no access |
TR-Usage Records |
read only |
no access |
no access |
read only |
no access |
TR-Enterprise And User |
no access |
no access |
no access |
no access |
no access |
TR- Search and Usage record all endpoints all levels |
no access |
no access |
no access |
no access |
no access |
Smart 2FA |
|||||
2FA-Traffic |
read/write |
no access |
no access |
read/write |
no access |
2FA-Limit Provision |
read/write |
no access |
no access |
read/write |
no access |
2FA-Usage Records |
read only |
no access |
no access |
read only |
no access |
2FA-Search and Usage record all endpoints all levels |
no access |
no access |
no access |
no access |
no access |
Campaign Manager |
|||||
Campaign Manager-Provisioning (GET, POST, PUT, DELETE) |
no access |
no access |
no access |
no access |
no access |
Campaigns (GET, POST, PUT, DELETE) |
read/write |
no access |
no access |
read/write |
no access |
Usage records |
read only |
no access |
no access |
read only |
no access |
Search and Usage Records |
no access |
no access |
no access |
no access |
no access |
Create a User
HTTP POST Creates a new user under the specified CPaaS account.
Example Request
curl -X POST https://mycompany.restcomm.com/restcomm/2012-04-24/Accounts/ACCOUNT_SID/Users \
-d 'Name=Jane Doe' \
-d 'Email=jane.doe@company.com' \
-d 'Role=BC/Administrator' \
-u 'YourAccountSid:YourAuthToken'
Example Response
{
"sid": "USaff6a6dec30047d58d0f08edf5f46f0f",
"name": "Jane Doe",
"email": "jane.doe@company.com",
"phone_number": null,
"role": "BC/Administrator",
"account_sid": "AC25b6ea2f04ca57c75e6e0e6aef9b69c9",
"status": "unconfirmed",
"date_created": "Tue, 8 Jun 2021 07:31:23 +0000",
"date_updated": "Tue, 8 Jun 2021 07:31:23 +0000",
"uri": "/2012-04-24/Accounts/AC25b6ea2f04ca57c75e6e0e6aef9b69c9/Users/USaff6a6dec30047d58d0f08edf5f46f0f.json"
}
Create a User
HTTP POST Creates a new user under the specified account.
Request Parameters
Property | Description |
---|---|
Name |
The name of the user. |
The email address associated with the user. |
|
PhoneNumber |
Optional. The phone number associated with the user. |
Role |
The role assigned to the user. |
curl --location --request POST 'https://yourcompany.com/api/2012-04-24/Accounts/AC25b6ea2f04ca57c75e6e0e6aef9b69c9/Users/USaff6a6dec30047d58d0f08edf5f46f0f' \ --header 'Accept: application/json' \ --header 'Authorization: Basic YourAPIKeyValue:YourAPIKeySecret' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'Name=Jane Doe' \ --data-urlencode 'Email=jane.doe@company.com' \ --data-urlencode 'Role=CP/Administrator'
Example Response
{
"sid": "USaff6a6dec30047d58d0f08edf5f46f0f",
"name": "Jane Doe",
"email": "jane.doe@company.com",
"phone_number": null,
"role": "CP/Administrator",
"account_sid": "AC25b6ea2f04ca57c75e6e0e6aef9b69c9",
"status": "unconfirmed",
"date_created": "Tue, 8 Jun 2021 07:31:23 +0000",
"date_updated": "Tue, 8 Jun 2021 07:31:23 +0000",
"uri": "/2012-04-24/Accounts/AC25b6ea2f04ca57c75e6e0e6aef9b69c9/Users/USaff6a6dec30047d58d0f08edf5f46f0f.json"
}
Update a User
HTTP PUT Updates a user under the specified account.
Request Parameters
Property | Description |
---|---|
Name |
The name of the user. |
Status |
The status of the user. |
PhoneNumber |
The phone number associated with the user. |
Role |
The role assigned to the user. |
Password |
The password associated with the user. |
Example Request
curl --location --request PUT 'https://yourcompany.com/api/2012-04-24/Accounts/AC25b6ea2f04ca57c75e6e0e6aef9b69c9/Users/USaff6a6dec30047d58d0f08edf5f46f0f' \ --header 'Accept: application/json' \ --header 'Authorization: Basic YourAPIKeyValue:YourAPIKeySecret' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'PhoneNumber=+12223334444'
Example Response
{
"sid": "USaff6a6dec30047d58d0f08edf5f46f0f",
"name": "Jane Doe",
"email": "jane.doe@company.com",
"phone_number": "+12223334444",
"role": "CP/Administrator",
"account_sid": "AC25b6ea2f04ca57c75e6e0e6aef9b69c9",
"status": "unconfirmed",
"date_created": "Tue, 8 Jun 2021 07:31:23 +0000",
"date_updated": "Tue, 8 Jun 2021 07:31:23 +0000",
"uri": "/2012-04-24/Accounts/AC25b6ea2f04ca57c75e6e0e6aef9b69c9/Users/USaff6a6dec30047d58d0f08edf5f46f0f.json"
}
Retrieve a User List
HTTP GET Retrieves information about the list of Users belonging to an Account.
Example Request
curl --location --request GET 'https://yourcompany.com/api/2012-04-24/Accounts/AC9deec0905f5c5aa8f9e40ca03b54e071/Users' \ --header 'Accept: application/json' \ --header 'Authorization: Basic YourAPIKeyValue:YourAPIKeySecret'
Example Response
{
"page": 0,
"num_pages": 1,
"page_size": 50,
"total": 2,
"start": "0",
"end": "1",
"uri": "/2012-04-24/Accounts/AC9deec0905f5c5aa8f9e40ca03b54e071/Users",
"first_page_uri": "/2012-04-24/Accounts/AC9deec0905f5c5aa8f9e40ca03b54e071/Users?Page=0&PageSize=50",
"previous_page_uri": "null",
"next_page_uri": "null",
"last_page_uri": "/2012-04-24/Accounts/AC9deec0905f5c5aa8f9e40ca03b54e071/Users?Page=0&PageSize=50",
"users": [
{
"sid": "US58cc28c66d7633d2fc7dbb301999c722",
"name": "Jane Doe",
"email": "jane.doe@acme.com",
"phone_number": "+127312837225",
"role": "CP/Administrator",
"account_sid": "AC9deec0905f5c5aa8f9e40ca03b54e071",
"status": "active",
"date_created": "Tue, 20 Jul 2021 08:14:35 +0000",
"date_updated": "Tue, 20 Jul 2021 08:14:36 +0000",
"uri": "/2012-04-24/Accounts/AC9deec0905f5c5aa8f9e40ca03b54e071/Users/US58cc28c66d7633d2fc7dbb301999c722.json"
},
{
"sid": "UScaa05ee9fbbe4bcfbbaafd8686dc4606",
"name": "John Doe",
"email": "john.doe@acme.com",
"phone_number": "+127312837226",
"role": "CP/Developer",
"account_sid": "AC9deec0905f5c5aa8f9e40ca03b54e071",
"status": "active",
"date_created": "Fri, 23 Jul 2021 14:25:34 +0000",
"date_updated": "Fri, 23 Jul 2021 14:25:54 +0000",
"uri": "/2012-04-24/Accounts/AC9deec0905f5c5aa8f9e40ca03b54e071/Users/UScaa05ee9fbbe4bcfbbaafd8686dc4606.json"
}
]
}
Retrieve User Information
HTTP GET Retrieves information about a specific user.
Example Request
curl --location --request GET 'https://yourcompany.com/api/2012-04-24/Accounts/AC25b6ea2f04ca57c75e6e0e6aef9b69c9/Users/USb0b76d2f398348cfa9b18022f81d26d3' \ --header 'Accept: application/json' \ --header 'Authorization: Basic YourAPIKeyValue:YourAPIKeySecret'
Example Response
{
"sid": "USaff6a6dec30047d58d0f08edf5f46f0f",
"name": "Jane Doe",
"email": "jane.doe@company.com",
"phone_number": "+12223334444",
"role": "CP/Administrator",
"account_sid": "AC25b6ea2f04ca57c75e6e0e6aef9b69c9",
"status": "unconfirmed",
"date_created": "Tue, 8 Jun 2021 07:31:23 +0000",
"date_updated": "Tue, 8 Jun 2021 07:31:23 +0000",
"uri": "/2012-04-24/Accounts/AC25b6ea2f04ca57c75e6e0e6aef9b69c9/Users/USaff6a6dec30047d58d0f08edf5f46f0f.json"
}
API Keys Management
You can create, update, retrieve, and delete API keys for a given user.Every user can have up to two API keys generated and rotate them according to their needs
Resource Properties
Property | Description |
---|---|
UserSid |
A string that uniquely identifies the user with whom the API key is associated. |
Sid |
The API Key unique identifier. |
Value |
The value of the API Key used as the username during authentication.For regular API Keys it matches the |
Status |
The status of the API Key: |
DateCreated |
The date representation of when the API key was created. |
DateUpdated |
The date representation of when the API key was last updated. |
Uri |
The uri for this API key, relative to |
Secret |
The API Key secret used to sign requests.This field is only available after a create operation.Get and update operations won’t display this field. |
Create an API Key
HTTP POST Creates API key for a specific user.
Accounts and Users that have been migrated from the legacy to the new Identity Access Management functionality do not have to perform this step.Their API keys are automatically generated during the migration process. |
Example Request
curl --location --request POST 'https://yourcompany.com/api/2012-04-24/Accounts/AC25b6ea2f04ca57c75e6e0e6aef9b69c9/Users/USaff6a6dec30047d58d0f08edf5f46f0f/APIKeys' \ --header 'Accept: application/json' \ --header 'Authorization: Basic YourUsername:YourPassword'
The first API Key creation requires basic authorization utilizing the user’s email address and password |
Example Response
{
"sid": "AK2f8f4d0d36324c1a84a58bffdd4897ef",
"value": "AK2f8f4d0d36324c1a84a58bffdd4897ef",
"user_sid": "USaff6a6dec30047d58d0f08edf5f46f0f",
"status": "active",
"date_created": "Fri, 11 Jun 2021 09:37:19 +0000",
"date_updated": "Fri, 11 Jun 2021 09:37:19 +0000",
"uri": "/2012-04-24/Accounts/AC25b6ea2f04ca57c75e6e0e6aef9b69c9/Users/USaff6a6dec30047d58d0f08edf5f46f0f/APIKeys/AK2f8f4d0d36324c1a84a58bffdd4897ef.json",
"secret": "ZTfQoDcvaJsp9i50zHG43FZd37NRIJ8l"
}
Update an API Key
HTTP PUT Updates the status of an existing API key for a specific user.The status of the key can either be active
or inactive
.
Example Request
curl --location --request PUT 'https://yourcompany.com/api/2012-04-24/Accounts/AC25b6ea2f04ca57c75e6e0e6aef9b69c9/Users/USaff6a6dec30047d58d0f08edf5f46f0f/APIKeys/AK2f8f4d0d36324c1a84a58bffdd4897ef' \ --header 'Accept: application/json' \ --header 'Authorization: Basic YourUsername:YourPassword' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'Status=inactive'
This request requires basic authorization utilizing the user’s email address and password. |
Example Response
{
"sid": "AK2f8f4d0d36324c1a84a58bffdd4897ef",
"value": "AK2f8f4d0d36324c1a84a58bffdd4897ef",
"user_sid": "USaff6a6dec30047d58d0f08edf5f46f0f",
"status": "inactive",
"date_created": "Fri, 11 Jun 2021 09:37:19 +0000",
"date_updated": "Fri, 11 Jun 2021 11:14:50 +0000",
"uri": "/2012-04-24/Accounts/AC25b6ea2f04ca57c75e6e0e6aef9b69c9/Users/USaff6a6dec30047d58d0f08edf5f46f0f/APIKeys/AK2f8f4d0d36324c1a84a58bffdd4897ef.json"
}
Retrieve a list of API Keys
HTTP GET Retrieves a list of API Keys for a specific user.
Example Request
curl --location --request GET 'https://yourcompany.com/api/2012-04-24/Accounts/ACbf4e39a26964a12972da1d31c3b07f7a/Users/USbd2e168c5cca4ea6857bba36e187ff09/APIKeys' \ --header 'Accept: application/json' \ --header 'Authorization: Basic YourUsername:YourPassword'
This request requires basic authorization utilizing the user’s email address and password. |
Example Response
{
"api_keys": [
{
"sid": "AK5bed0521de024bf588e010d79aca33dc",
"value": "AK5bed0521de024bf588e010d79aca33dc",
"user_sid": "USbd2e168c5cca4ea6857bba36e187ff09",
"status": "active",
"date_created": "Wed, 26 May 2021 13:06:44 +0000",
"date_updated": "Fri, 23 Jul 2021 08:39:09 +0000",
"uri": "/2012-04-24/Accounts/ACbf4e39a26964a12972da1d31c3b07f7a/Users/USbd2e168c5cca4ea6857bba36e187ff09/APIKeys/AK5bed0521de024bf588e010d79aca33dc.json"
},
{
"sid": "AKb3f6257341b54f60a741162f177d1aa4",
"value": "AKb3f6257341b54f60a741162f177d1aa4",
"user_sid": "US90ec08939663ff0e97a310643c62db18",
"status": "inactive",
"date_created": "Wed, 26 May 2021 13:06:44 +0000",
"date_updated": "Fri, 23 Jul 2021 08:39:09 +0000",
"uri": "/2012-04-24/Accounts/ACbf4e39a26964a12972da1d31c3b07f7a/Users/USbd2e168c5cca4ea6857bba36e187ff09/APIKeys/AKb3f6257341b54f60a741162f177d1aa4.json"
}
]
}
Retrieve an API Key
HTTP GET Retrieves an existing API key for a specific user.
Example Request
curl --location --request GET 'https://yourcompany.com/api/2012-04-24/Accounts/AC25b6ea2f04ca57c75e6e0e6aef9b69c9/Users/USaff6a6dec30047d58d0f08edf5f46f0f/APIKeys/AK2f8f4d0d36324c1a84a58bffdd4897ef' \ --header 'Accept: application/json' \ --header 'Authorization: Basic YourUsername:YourPassword'
This request requires basic authorization utilizing the user’s email address and password. |
Example Response
{
"sid": "AK2f8f4d0d36324c1a84a58bffdd4897ef",
"value": "AK2f8f4d0d36324c1a84a58bffdd4897ef",
"user_sid": "USaff6a6dec30047d58d0f08edf5f46f0f",
"status": "inactive",
"date_created": "Fri, 11 Jun 2021 09:37:19 +0000",
"date_updated": "Fri, 11 Jun 2021 11:14:50 +0000",
"uri": "/2012-04-24/Accounts/AC25b6ea2f04ca57c75e6e0e6aef9b69c9/Users/USaff6a6dec30047d58d0f08edf5f46f0f/APIKeys/AK2f8f4d0d36324c1a84a58bffdd4897ef.json"
}
Delete an API Key
HTTP DELETE Deletes an API key for a given user.
Example Request
curl --location --request DELETE 'https://yourcompany.com/api/2012-04-24/Accounts/AC25b6ea2f04ca57c75e6e0e6aef9b69c9/Users/USaff6a6dec30047d58d0f08edf5f46f0f/APIKeys/AK763360e88c0048a594f6bde046804698' \ --header 'Accept: application/json' \ --header 'Authorization: Basic YourUsername:YourPassword'