CorefinityCorefinityDocs
Open the Control PanelControl Panel
Team · 10 of 17

Update a custom role

Renames a custom role of your company and replaces its permissions with the list you send. Everybody who holds the role gets the new set. Standard roles cannot be changed.

POST/api/roles/{id}/update

Path parameters

idintegerRequired

The id of a custom role of your company, as GET /team/roles lists it. Digits only; anything else answers 404. At least 1.

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 as saved.

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.
404noneCheck the id. You see only what your account can reach.
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/3107/update \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Release leads",
    "permissions": [
      "viewUsers",
      "viewWebsites"
    ]
  }'
{
  "data": {
    "id": 3107,
    "name": "Release leads",
    "permissions": [
      "viewUsers",
      "viewWebsites"
    ],
    "slug": "release-managers-0b9c7a52-3f7e-4c1d-9a55-2f6f1f0e8d11"
  },
  "message": "Role updated.",
  "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