Skip to main content

Effective 10 September 2024, API Documentation can be found on our Equinix Product Documentation site.
The content on this page will not be updated after 1 Oct 2024 and will be inaccessible after 31st Dec 2024.


Create Role Assignment

Roles are like sets of permissions. They control who gets to access different resources in your organization. Assign roles to users at certain levels to let them access projects, organizations, and product stuff under a specific area. Create custom roles to help with specific access needs in your organization.

Crete Role Assignment


Step 1: Authenticate

Submit your user credentials, Client ID, and Client Secret for OAuth2 authentication.

 

Refer to Generate Client ID and Client Secret under Getting Access Token section for instructions on how to create client ID and client secret and refer to Request Access and Refresh tokens for instructions on how to call Oauth API to validate and authenticate your credentials.

 

If you don't know your user credentials for Equinix Customer Portal, contact your local Equinix Service Desk. 


Step 2: Get Role Assignments

Use the Get User Role Assignments API request to retrieve all user's roles in your root organization.


Step 3: Create User Role Assignments

 POST /roleAssignments/users/{userId}
MethodPOST
URL or End Point/am/v2/roleAssignments/users/{userId}
HeadersAuthorization, Content-Type
Path ParametersuserId
Query ParametersNot applicable
Body{assignments [{roleName, resource {refId, type}, constraints [{name, values [ ], operator}]}, {roleName, resource {refId, type}}]}

This method creates a new user's role within your organization. User is assigned one or more roles on the specified resources. Only an authenticated user with administrator privileges may create a new user's role. The authorization token and content-type are the only headers that are passed to this API and a response is received based on the values passed.

 

If you are unaware of how to obtain an authorization token, refer to Requesting Access and Refresh tokens under the Getting Access Token section.

Sample curl request

curl -X POST 'https://api.equinix.com/am/v2/roleAssignments/users/{userId}'
-H 'content-type: application/json'
-H 'authorization: Bearer qwErtY8zyW1abcdefGHI'
-d '{
"assignments": [
{
"roleName": "SmartHand Support Plan Notification",
"resource": {
"refId": "563d7790-8083-4af0-8df7-e115b768365b",
"type": "ORGANIZATION"
},
"constraints": [
{
"name": "BILLING_ACCOUNT",
"values": [
"570121",
"161094",
"156781"
],
"operator": "IN"
}
]
},
{
"roleName": "role/project.viewer",
"resource": {
"refId": "563d7790-8083-4af0-8df7-e115b768365b",
"type": "ORGANIZATION"
}
}
]
}'

A new user's role is successfully created when an HTTP code of 201 is returned.