Skip to main content
Browse Documentation
HTTP - Management

Create a role

Created by Contensis product team, last modified by zengenti on 03 Nov 2020

Creates a new role.

POST/api/management/projects/{projectId}/security/roles

Parameter

NameParameter typeTypeDescriptionExampleRequired
projectIdpathstringThe project identifier found in the project overview screen of the management consolemovieDbtrue

Example

POST: /api/management/projects/movieDb/security/roles/

{
    "name": {
        "en-GB": "Movie Editors"
    },
    "description": {
        "en-GB": "Movie editors can edit movies, but not submit or approve them"
    },
    "enabled": true,
    "permissions": {
        "entries": [
            {
                "id": "movie",
                "languages": ["en-GB"],
                "actions": ["sys.update", "awaitingApproval.revoke"]
            }
        ],
        "assets": [{
                "id": "*",
                "languages": ["*"],
                "actions": ["contensisEntryBasic.*"]
            }
        ],
        "webhookSubscription": {
            "actions": [ "create", "view" ]
        }
    },
    "assignments": {
        "users": [ "a.user" ],
        "groups": [ "Movie Editors" ],
        "apiKeys": [ "Movie Import" ]
    }
}

Remarks

In order to create a role you must be a member of the "System Administrators" user group. If you do not have permission to create a role you will get a 403 Forbidden responses.

Responses

HTTP status codeReasonModel
201CreatedRole
401UnauthorizedError
403ForbiddenError
404Project not foundError
409Resource already existsError
422Validation errorError
500Internal server errorError