Create Custom Role Using POST

Create Custom Role Using POST

Create custom role.

Access Policy

Role User Accounts Service Accounts (Client Credentials Applications)
Organization Admin ✔️ ✔️
Organization Owner ✔️ ✔️
Request
URI
POST
https://{api_host}/csp/gateway/iam-roles-mgmt/api/orgs/{orgId}/custom-roles
COPY
Path Parameters
string
orgId
Required

Organization Id


Request Body
CreateCustomRoleRequest of type(s) application/json
Required
"CreateCustomRoleRequest Object"
array of string
permissions
Optional
Constraints: minItems: 1 maxItems: 100

Permissions of the role

string As ^[a-zA-Z0-9_-]{2,30}$
name
Required

Custom role name

string
displayName
Required
Constraints: minLength: 1 maxLength: 100

Custom role display name

string
description
Optional
Constraints: minLength: 1 maxLength: 256

Custom role description

Authentication
This operation uses the following authentication methods.
Responses
200

OK

Returns CustomRoleDto of type(s) application/json
{
    "permissions": [
        "string"
    ],
    "name": "string",
    "description": "string",
    "createdBy": "string",
    "displayName": "string",
    "lastModifiedBy": "string"
}
array of string
permissions
Optional

Permissions of the custom role

string
name
Optional

Name of the custom role

string
description
Optional

Description of the custom role

string
createdBy
Optional

createdBy

string
displayName
Optional

Display name of the custom role

string
lastModifiedBy
Optional

lastModifiedBy


201

Created

Returns CustomRoleDto of type(s) application/json
"CustomRoleDto Object"
array of string
permissions
Optional

Permissions of the custom role

string
name
Optional

Name of the custom role

string
description
Optional

Description of the custom role

string
createdBy
Optional

createdBy

string
displayName
Optional

Display name of the custom role

string
lastModifiedBy
Optional

lastModifiedBy


400

Invalid request body

Returns CspErrorResponse of type(s) application/json
"CspErrorResponse Object"
string
message
Optional

message

integer As int32 As int32
moduleCode
Optional

moduleCode

string
errorCode
Optional

errorCode

string
cspErrorCode
Optional

cspErrorCode

integer As int32 As int32
statusCode
Optional

statusCode

string
requestId
Optional

requestId


401

Unauthorized

Returns CspErrorResponse of type(s) application/json
"CspErrorResponse Object"
string
message
Optional

message

integer As int32 As int32
moduleCode
Optional

moduleCode

string
errorCode
Optional

errorCode

string
cspErrorCode
Optional

cspErrorCode

integer As int32 As int32
statusCode
Optional

statusCode

string
requestId
Optional

requestId


403

Forbidden

Returns CspErrorResponse of type(s) application/json
"CspErrorResponse Object"
string
message
Optional

message

integer As int32 As int32
moduleCode
Optional

moduleCode

string
errorCode
Optional

errorCode

string
cspErrorCode
Optional

cspErrorCode

integer As int32 As int32
statusCode
Optional

statusCode

string
requestId
Optional

requestId


404

The requested resource could not be found

Returns CspErrorResponse of type(s) application/json
"CspErrorResponse Object"
string
message
Optional

message

integer As int32 As int32
moduleCode
Optional

moduleCode

string
errorCode
Optional

errorCode

string
cspErrorCode
Optional

cspErrorCode

integer As int32 As int32
statusCode
Optional

statusCode

string
requestId
Optional

requestId


409

The request could not be processed due to a conflict

Returns CspErrorResponse of type(s) application/json
"CspErrorResponse Object"
string
message
Optional

message

integer As int32 As int32
moduleCode
Optional

moduleCode

string
errorCode
Optional

errorCode

string
cspErrorCode
Optional

cspErrorCode

integer As int32 As int32
statusCode
Optional

statusCode

string
requestId
Optional

requestId


429

The user has sent too many requests

Returns CspErrorResponse of type(s) application/json
"CspErrorResponse Object"
string
message
Optional

message

integer As int32 As int32
moduleCode
Optional

moduleCode

string
errorCode
Optional

errorCode

string
cspErrorCode
Optional

cspErrorCode

integer As int32 As int32
statusCode
Optional

statusCode

string
requestId
Optional

requestId


500

An unexpected error has occurred while processing the request

Returns CspErrorResponse of type(s) application/json
"CspErrorResponse Object"
string
message
Optional

message

integer As int32 As int32
moduleCode
Optional

moduleCode

string
errorCode
Optional

errorCode

string
cspErrorCode
Optional

cspErrorCode

integer As int32 As int32
statusCode
Optional

statusCode

string
requestId
Optional

requestId


Code Samples
COPY
                    curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '[{}]' https://{api_host}/csp/gateway/iam-roles-mgmt/api/orgs/{orgId}/custom-roles