CorefinityCorefinityDocs
Open the Control PanelControl Panel
Team · 7 of 17

Create a custom role

Makes a custom role for your company. It may give only permissions you hold yourself, which GET /permissions lists. The role's slug is made from its name and a unique suffix.

POST/api/roles/create

Body

namestringRequired

Up to 255 characters.

permissionsarray of stringsRequired

The slugs of the permissions the role gives, each one you hold yourself. The whole set, not a change to it.

Returns

200 The role that was made.

Fields of the 200 answer
dataobjectRequired
Fields
idintegerRequired

At least 1.

namestringRequired
permissionsarray of stringsRequired
slugstringRequired

The name as a slug, then a unique suffix. The slug does not change when the role is renamed.

messagestringRequired
statusstringRequired

If it is refused

StatusReasonWhat to do
401noneSend a valid token as Authorization: Bearer <token>.
403forbiddenThe person is not allowed to do this.
403scope_requiredUse a token with the scope named in scope.
422invalidFix the field named in field; errors says why.
429rate_limitedWait for the seconds in Retry-After.

Reasons are listed by name in Errors and refusals.

The same task elsewhere

curl -X POST https://manage.corefinity.com/api/roles/create \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Release managers",
    "permissions": [
      "viewUsers"
    ]
  }'
{
  "data": {
    "id": 3107,
    "name": "Release managers",
    "permissions": [
      "viewUsers"
    ],
    "slug": "release-managers-0b9c7a52-3f7e-4c1d-9a55-2f6f1f0e8d11"
  },
  "message": "Role was created.",
  "status": "success"
}
Try it

Try it is off for this endpointIt has not been cleared for the console. Copy the request and run it yourself when you are sure.

Was this helpful?
Open in ClaudeOpen in ChatGPT