createRole

post

/ccstore/v1/roles

Creates a new organizational role. Optionally takes the X-CCOrganization header to specify current Organization context of logged in user. Optionally takes the x-ccasset-language header to create role content in another language.

Request

Supported Media Types
Header Parameters
Body ()
Root Schema : createRole_request
Type: object
Show Source
Example:
{
    "function":"custom",
    "relativeTo":{
        "id":"or-100001"
    },
    "name":"Custom Organizational Role",
    "repositoryId":"customOrganizationalRole",
    "description":"Custom Organizational Role",
    "accessRights":[
        {
            "repositoryId":"customAccessRight"
        }
    ],
    "type":"organizationalRole",
    "category":{
        "displayName":"Custom Roles",
        "repositoryId":"customRoleCategory",
        "id":"customRoleCategory"
    }
}
Nested Schema : accessRights
Type: array
Access rights to assign to role
Show Source
Nested Schema : category
Type: object
Category of the role to be created.
Show Source
Nested Schema : relativeTo
Type: object
Organization for which the organizational role must be created. Users can only create organizational roles for the organization they are currently working in.
Show Source
Nested Schema : items
Type: object
Show Source
Back to Top

Response

Supported Media Types

200 Response

Following model is returned when operation succeeds.
Body ()
Root Schema : getRole_response
Type: object
Show Source
Nested Schema : accessRights
Type: array
Access rights assigned to role
Show Source
Nested Schema : category
Type: object
Category of the role to be created.
Show Source
Nested Schema : relativeTo
Type: object
Related organization for organizationRole
Show Source
Nested Schema : items
Type: object
Show Source
Example Response (application/json)
{
    "function":"custom",
    "relativeTo":{
        "id":"or-100001",
        "externalOrganizationId":null
    },
    "name":"Custom Organizational Role",
    "repositoryId":"customOrganizationalRole",
    "description":"Custom Organizational Role",
    "id":"customOrganizationalRole",
    "accessRights":[
        {
            "displayName":"Custom Access Right",
            "name":"Custom Access Right",
            "repositoryId":"customAccessRight",
            "description":"Custom Access Right",
            "id":"customAccessRight",
            "type":"generic"
        }
    ],
    "type":"organizationalRole",
    "category":{
        "displayName":"Custom Roles",
        "repositoryId":"customRoleCategory",
        "id":"customRoleCategory"
    }
}

Default Response

The error response. The following are the internal error codes thrown by this API when the request processing fails in Oracle Commerce Cloud: |Error Code|Description| |------------------|------------------| |22047|If input passed is invalid|| |22055|If type, relativeTo or function passed are invalid| |22102|If a restricted privilege is being added to an organizationalRole|
Body ()
Root Schema : errorModel
Type: object
Show Source
Nested Schema : errors
Type: array
An optional list of errors if multiple errors were encountered
Show Source
Nested Schema : items
Type: object
Show Source
Back to Top