Get inspired at ContentCon. Learn more and register today
Get inspired at ContentCon. Learn more and register today
Contentstack.comAcademyLogin
CS-log-dark.svgCS-log-dark.svg
  • Changelog
  • APIs
  • SDKs

Platform

  • Solution Center
  • Marketplace
  • Changelog
  • Developers & IT
  • Business users
  • Digital leaders
  • Developer Fast Track
  • Plans & Pricing

Solutions

  • Retail
  • Travel and tourism
  • Financial services
  • Technology
  • Manufacturing
  • E-commerce
  • Localization
  • Personalization
  • Portals and knowledge bases

Resources

  • Academy
  • Docs
  • Product updates
  • Contentstack on Contentstack
  • Blog
  • Insights and analyst reports
  • Webinars
  • Podcasts
  • Glossary
  • Content generative library
  • Community
  • Headless CMS
  • Composable AXP
  • Personalization
  • CDP

Customers

  • Case Studies
  • Customer Care
  • Contentstack Experience Awards
  • Customer support

Partners

  • Overview
  • Find a partner
  • Login

Company

  • About us
  • News
  • Customer support portal
  • Contact

Social

  • Facebook
  • LinkedIn
  • Instagram
  • GitHub
  • YouTube
  • Discord
  • X
LegalTermsPrivacyTrust Center

Cookie settings

Copyright © 2026 Contentstack Inc. All rights reserved.
/
  1. Home
  2. APIs
  3. Administration API
  4. Roles

Roles

markdownView as Markdown

Roles define the permissions and privileges that a user or team receives within an organization. Assigning a role grants a consistent set of access rights across a domain, such as the organization, the CMS, or Asset Manager. Every endpoint below enforces an organization-level permission check, so a caller without the required access receives a 403 Forbidden response.

NoteBefore executing any calls, retrieve the authtoken by authenticating yourself via the Log in call of User Session. The authtoken is returned in the 'Response' body of the Log in call and is mandatory in all of the calls.

Get all roles

GEThttps://api.contentstack.io/v4/organizations/{organization_uid}/roles

The Get all roles request returns all roles defined in your organization, so you can review the permissions and privileges granted within each domain.

Contentstack takes the organization from the organization_uid path parameter and enforces an organization-level permission check; a caller without the required access receives a 403 response. By default, the response is a flat roles array. Add include_count to return a count, and use skip, limit, asc, desc, and typeahead to page, sort, and search the results.

Filter the results by domain with domain, and enrich each role with include_user_details, include_stack_roles, or include_privilege_permissions. Set group_by_domain to “true” to receive a domain-keyed object instead of the flat list.

Sample Response
Status|200 OK
12345678910111213141516171819202122232425262728
{
    "roles": [
        {
            "_id": "665ff127a2dc68f3c31d96c4",
            "name": "access_manager",
            "uid": "blt**************rl",
            "description": "Access Manager role.",
            "org_uid": "blt**************b5",
            "domain": "organization",
            "default": false,
            "permissions": ["org.info:read", "org.users:read", "org.users:write"],
            "privileges": ["blt**************p1"],
            "global_permissions": [],
            "required_roles": null,
            "can_invite": true,
            "admin": false,
            "owner_uid": "blt**************f0",
            "tags": [],
            "created_at": "2024-06-05T05:01:27.165Z",
            "updated_at": "2024-06-05T05:01:27.165Z",
            "deleted_at": false,
            "created_by": "blt**************f0",
            "updated_by": "blt**************f0",
            "__v": 0
        }
    ],
    "count": 20
}

Get a single role

GEThttps://api.contentstack.io/v4/organizations/{organization_uid}/roles/{role_uid}

The Get a single role request returns the full definition of one role in your organization, including its permissions, privileges, domain, and assignment metadata.

Pass the organization UID as organization_uid and the role UID as role_uid in the request path. The endpoint enforces an organization-level permission check; a caller without the required access receives a 403 response.

Sample Response
Status|200 OK
12345678910111213141516171819202122232425
{
  "role": {
      "_id": "665ff127a2dc68f3c31d96c4",
      "name": "access_manager",
      "uid": "blt**************rl",
      "description": "Access Manager role.",
      "org_uid": "blt**************b5",
      "domain": "organization",
      "default": false,
      "permissions": ["org.info:read", "org.users:read", "org.users:write"],
      "privileges": ["blt**************p1"],
      "global_permissions": [],
      "required_roles": null,
      "can_invite": true,
      "admin": false,
      "owner_uid": "blt**************f0",
      "tags": [],
      "created_at": "2024-06-05T05:01:27.165Z",
      "updated_at": "2024-06-05T05:01:27.165Z",
      "deleted_at": false,
      "created_by": "blt**************f0",
      "updated_by": "blt**************f0",
      "__v": 0
  }
}

Create a role

POSThttps://api.contentstack.io/v4/organizations/{organization_uid}/roles

The Create a role request creates a role in the specified organization and grants it a set of permissions or privileges within a domain.

Provide the role name, a description, and the domain the role belongs to. Supply either a permissions array or a privileges array (at least one is required, and each must contain a minimum of one entry). You can optionally assign users at creation through a users array.

A role in the organization domain must include org.info:read in its permissions. On success, the request returns a 201 response with the created role. A duplicate name returns 409, and invalid permissions or users return 400.

Sample Request
123456789101112
{
    "name": "config_admin",
    "description": "The role allows a user to manage app config.",
    "domain": "developerhub",
    "permissions": [
        "developerhub.config:write",
        "developerhub.config:read"
    ],
    "users": [
        "blt**************a0"
    ]
}
Sample Response
Status|201 Created
12345678910111213141516171819202122232425
{
  "role": {
      "_id": "665ff127a2dc68f3c31d96c4",
      "name": "access_manager",
      "uid": "blt**************rl",
      "description": "Access Manager role.",
      "org_uid": "blt**************b5",
      "domain": "organization",
      "default": false,
      "permissions": ["org.info:read", "org.users:read", "org.users:write"],
      "privileges": ["blt**************p1"],
      "global_permissions": [],
      "required_roles": null,
      "can_invite": true,
      "admin": false,
      "owner_uid": "blt**************f0",
      "tags": [],
      "created_at": "2024-06-05T05:01:27.165Z",
      "updated_at": "2024-06-05T05:01:27.165Z",
      "deleted_at": false,
      "created_by": "blt**************f0",
      "updated_by": "blt**************f0",
      "__v": 0
  }
}

Update a role

PATCHhttps://api.contentstack.io/v4/organizations/{organization_uid}/roles/{role_uid}

The Update a role request modifies an existing role in your organization. All fields are optional except domain, and you must send at least one field to change.

The permissions you send replace the role’s existing permissions, so include every permission you want the role to retain. A role in the organization domain must retain org.info:read.

You cannot change role membership through this request. Sending a users field returns a 400 response with the error code role.ROLE_USERS_NOT_PATCHABLE. To assign a role to users, invite or share them into the organization with that role through the Add users or Update user permissions request, assign the role to a team, or pass a users array when you create the role.

Default roles, such as Admin and Member, cannot be updated and return a 400 response with the error code DefaultRoleUpdateError. On success, the request returns a 200 response with the updated role, and the change applies to every user who holds it.

Sample Request
123456789
{
    "name": "admin",
    "description": "Access Manager role.",
    "domain": "organization",
    "permissions": [
        "org.info:read",
        "org.analytics:read"
    ]
}
Sample Response
Status|200 OK
12345678910111213141516171819202122232425
{
  "role": {
      "_id": "665ff127a2dc68f3c31d96c4",
      "name": "access_manager",
      "uid": "blt**************rl",
      "description": "Access Manager role.",
      "org_uid": "blt**************b5",
      "domain": "organization",
      "default": false,
      "permissions": ["org.info:read", "org.users:read", "org.users:write"],
      "privileges": ["blt**************p1"],
      "global_permissions": [],
      "required_roles": null,
      "can_invite": true,
      "admin": false,
      "owner_uid": "blt**************f0",
      "tags": [],
      "created_at": "2024-06-05T05:01:27.165Z",
      "updated_at": "2024-06-05T05:01:27.165Z",
      "deleted_at": false,
      "created_by": "blt**************f0",
      "updated_by": "blt**************f0",
      "__v": 0
  }
}

Delete roles

DELETEhttps://api.contentstack.io/v4/organizations/{organization_uid}/roles

The Delete roles request removes one or more roles from your organization in a single call. Pass the role UIDs to delete in a role_uids array in the request body.

Deleting a role removes it from the org_roles of every user who had it. A user left with no organization roles is automatically assigned the built-in Member role, and references to the deleted roles in team assignments are cleaned up. Roles are soft-deleted rather than removed permanently, and the permissions of all affected users are re-synced.

Sample Request
123456
{
    "role_uids": [
        "blt**************r1",
        "blt**************r2"
    ]
}
Sample Response
Status|200 OK
123
{
    "deleted": true
}

Get role permissions

GEThttps://api.contentstack.io/v4/organizations/{organization_uid}/roles/{role_uid}/permissions

The Get role permissions request returns the permissions currently assigned to a role, so you can review its access without fetching the full role object.

Pass the organization UID as organization_uid and the role UID as role_uid in the request path. This endpoint requires the caller to hold the data.organization.roles.write permission, not read.

Sample Response
Status|200 OK
123456
{
    "permissions": [
        "org.info:read",
        "org.users:read"
    ]
}

Update role permissions

PATCHhttps://api.contentstack.io/v4/organizations/{organization_uid}/roles/{role_uid}/permissions

The Update role permissions request replaces the permission set of a role with the permissions you send. Include every permission the role should hold, because the request replaces rather than merges.

Send at least one permission. A role in the organization domain must retain org.info:read. On success, the request returns a 200 response with the full updated role.

Sample Request
12345
{
    "permissions": [
        "org.info:read"
    ]
}
Sample Response
Status|200 OK
12345678910111213141516171819202122232425
{
  "role": {
      "_id": "665ff127a2dc68f3c31d96c4",
      "name": "access_manager",
      "uid": "blt**************rl",
      "description": "Access Manager role.",
      "org_uid": "blt**************b5",
      "domain": "organization",
      "default": false,
      "permissions": ["org.info:read", "org.users:read", "org.users:write"],
      "privileges": ["blt**************p1"],
      "global_permissions": [],
      "required_roles": null,
      "can_invite": true,
      "admin": false,
      "owner_uid": "blt**************f0",
      "tags": [],
      "created_at": "2024-06-05T05:01:27.165Z",
      "updated_at": "2024-06-05T05:01:27.165Z",
      "deleted_at": false,
      "created_by": "blt**************f0",
      "updated_by": "blt**************f0",
      "__v": 0
  }
}

Get role users

GEThttps://api.contentstack.io/v4/organizations/{organization_uid}/roles/{role_uid}/users

The Get role users request returns the users assigned to a role in your organization.

Pass the organization UID as organization_uid and the role UID as role_uid in the request path.

This request is read-only for role membership, and there is no request that adds or removes a single user from a role. To change who holds a role, invite or share users into the organization with that role through the Add users or Update user permissions request, assign the role to a team, or pass a users array when you create the role. The Update a role request rejects a users field.

Sample Response
Status|200 OK
12345678
[
    {
        "uid": "blt**************a0",
        "first_name": "John",
        "last_name": "Doe",
        "email": "[email protected]"
    }
]
Hide Parameters

URL Parameters

organization_uidrequiredstring

Enter the UID of your Organization.

Example:

your_organization_uid

Query Parameters

include_countoptionalstring

Set this parameter to “true” to include the total count of roles in the response.

Example:

true
group_by_domainoptionalstring

Set this parameter to “true” to group the roles by domain instead of returning a flat list. The cms domain returns stacks in place of roles.

Example:

false
domainoptionalstring

Enter one or more domains in string format, separated by commas, to filter the roles.

Example:

organization,cms
include_user_detailsoptionalstring

Set this parameter to “true” to include the users assigned to each role.

Example:

false
include_stack_rolesoptionalstring

Set this parameter to “true” to include CMS stack roles in the response.

Example:

false
include_privilege_permissionsoptionalstring

Set this parameter to “true” to add a permissionsFromPrivileges array to each role.

Example:

false
skipoptionalstring

Enter the number of roles to skip from the response.

Example:

0
limitoptionalstring

Enter the maximum number of roles to return.

Example:

100
ascoptionalstring

Sort the response in ascending order by the given field name.

Example:

name
descoptionalstring

Sort the response in descending order by the given field name.

Example:

name
typeaheadoptionalstring

Retrieves roles whose name matches the provided string.

Example:

sample

Headers

authtokenrequiredstring

Enter your authtoken.

Example:

your_authtoken
Hide Parameters

URL Parameters

organization_uidrequiredstring

Enter the UID of your Organization.

Example:

your_organization_uid
role_uidrequiredstring

Enter the UID of the role. Execute the Get all roles request to retrieve the UID of a role.

Example:

role_uid

Headers

authtokenrequiredstring

Enter your authtoken.

Example:

your_authtoken
Hide Parameters

URL Parameters

organization_uidrequiredstring

Enter the UID of your Organization.

Example:

your_organization_uid

Headers

authtokenrequiredstring

Enter your authtoken.

Example:

your_authtoken
Content-Typerequiredstring

Enter "application/json" to pass a request body.

Example:

application/json
Hide Parameters

URL Parameters

organization_uidrequiredstring

Enter the UID of your Organization.

Example:

your_organization_uid
role_uidrequiredstring

Enter the UID of the role. Execute the Get all roles request to retrieve the UID of a role.

Example:

role_uid

Headers

authtokenrequiredstring

Enter your authtoken.

Example:

your_authtoken
Content-Typerequiredstring

Enter "application/json" to pass a request body.

Example:

application/json
Hide Parameters

URL Parameters

organization_uidrequiredstring

Enter the UID of your Organization.

Example:

your_organization_uid

Headers

authtokenrequiredstring

Enter your authtoken.

Example:

your_authtoken
Content-Typerequiredstring

Enter "application/json" to pass a request body.

Example:

application/json
Hide Parameters

URL Parameters

organization_uidrequiredstring

Enter the UID of your Organization.

Example:

your_organization_uid
role_uidrequiredstring

Enter the UID of the role. Execute the Get all roles request to retrieve the UID of a role.

Example:

role_uid

Query Parameters

typeaheadoptionalstring

Retrieves permissions that match the provided string.

Example:

sample
ascoptionalstring

Sort the response in ascending order by the given field name.

Example:

uid
descoptionalstring

Sort the response in descending order by the given field name.

Example:

uid

Headers

authtokenrequiredstring

Enter your authtoken.

Example:

your_authtoken
Hide Parameters

URL Parameters

organization_uidrequiredstring

Enter the UID of your Organization.

Example:

your_organization_uid
role_uidrequiredstring

Enter the UID of the role. Execute the Get all roles request to retrieve the UID of a role.

Example:

role_uid

Headers

authtokenrequiredstring

Enter your authtoken.

Example:

your_authtoken
Content-Typerequiredstring

Enter "application/json" to pass a request body.

Example:

application/json
Hide Parameters

URL Parameters

organization_uidrequiredstring

Enter the UID of your Organization.

Example:

your_organization_uid
role_uidrequiredstring

Enter the UID of the role. Execute the Get all roles request to retrieve the UID of a role.

Example:

role_uid

Query Parameters

skipoptionalstring

Enter the number of users to skip from the response.

Example:

0
limitoptionalstring

Enter the maximum number of users to return.

Example:

100
typeaheadoptionalstring

Retrieves users whose name or email matches the provided string.

Example:

sample
ascoptionalstring

Sort the response in ascending order by the given field name.

Example:

first_name
descoptionalstring

Sort the response in descending order by the given field name.

Example:

first_name

Headers

authtokenrequiredstring

Enter your authtoken.

Example:

your_authtoken