Creating roles

A user with admin role can create a new role for a particular tenant.

Procedure

  1. In a REST client platform, add the authentication details of the tenant where you want to create a new role.
    
    //In case of Instance API key 
    Headers:
    {
    "x-instance-api-key": "instance_api_key"
    }
     
    // In case of MCSP or ISV token
    Headers:
    {
    "Authorization": "mcsp_or_isv_token"
    }
    Body: 
    	{
    	"name": "<role_name>*^",
    	"description": "<role_description>",
    	"projects": 
    	[{
    	"<project_name>": ["r", "w", "e"]  
    	}]
    }
    
    // A field with the asterisk (*) character in the body of the request is a required field. 
    // A field with the caret (^) character in the body of the request indicates that the field  can only have unique values.
  2. Make a POST request at the URL of the project.

    URL syntax - <domain>/apis/v1/rest/roles

    Method - POST

    If the request is successful, you receive the response code for success.

    {
    output : 
    {
    "name": <role_name>,
    "uid": <role_uid>,
    "tenant_uid": <project_tenant_uid>,
    "permissions": 
    		[
    			{
    			"project_uid": "<project_uid>",
    			"access_list": 
    			{
    			"read": true,
    			"write": true,
    			"execute":true                  
    			}
    			}
    		],
    "created_at": "<role_created_at>",
    "updated_at": "<role_updated_at>",
    }
    }