Skip to content
Release: Australia · Updated: 2026-03-12 · Official documentation · View source

Role API - ServiceNow Fluent

The Role API defines roles [sys_user_role] that grant specific permissions to users of an application.

Note: For the latest ServiceNow Fluent API documentation and examples, see the ServiceNow Fluent API reference and ServiceNow SDK examples repository on GitHub.

For general information about user roles, see Managing roles.

Parent Topic:ServiceNow Fluent API reference

Related topics

ServiceNow Fluent

Role object

Create a role [sys_user_role] to control access to applications and their features.

import { Role } from "@servicenow/sdk/core";

const managerRole = Role({ 
   $id: Now.ID['manager_role'], 
   name: 'x_snc_example.manager' 
})

const adminRole = Role({ 
   $id: Now.ID['admin_role'], 
   name: 'x_snc_example.admin', 
   containsRoles: [managerRole] 
})

sndocs is an independent community mirror and is not affiliated with or endorsed by ServiceNow.

ServiceNow, the ServiceNow logo, Now, and other ServiceNow marks are trademarks and/or registered trademarks of ServiceNow, Inc., in the United States and/or other countries. Other company and product names may be trademarks of the respective companies with which they are associated.

© 2026 ServiceNow, Inc. All rights reserved.

Documentation content is redistributed under the Apache License 2.0 from the ServiceNowDocs repository.

NameTypeDescription
nameStringA name for the role beginning with the application scope in the following format: `.`.
assignableByStringOther roles that can assign this role to users.
canDelegateBooleanFlag that indicates if the role can be delegated to other users. For more information, see Delegating roles.Valid values: - true: The role can be delegated to other users. - false: The role can't be delegated to other users. Default: true
descriptionStringA description of what the role can access.
elevatedPrivilegeBooleanFlag that indicates whether manually accepting the responsibility of using the role before you can access the features of the role is required. For more information about elevated privileges, see Elevated privilege roles.Valid values: - true: You must manually accept the responsibility of using the role before you can access its features. - false: You don't need to manually accept the responsibility of using the role to access its features. Default: false
grantableBooleanFlag that indicates whether the role can be granted independently.Valid values: - true: The role can be granted independently. - false: The role can't be granted independently. Default: true
containsRolesArrayThe variable identifiers of other Role objects that this role contains.
scopedAdminBooleanFlag that indicates whether the role is an Application Administrator role. For general information about application administration roles, see Application administration.Valid values: - true: The role is an Application Administrator. - false: The role isn't an Application Administrator. Default: false
$metaObject

Metadata for the application metadata.With the installMethod property, you can map the application metadata to an output directory that loads only in specific circumstances.

$meta: {
      installMethod: 'String'
}

Valid values for installMethod:

  • demo: Outputs the application metadata to the metadata/unload.demo directory to be installed with the application when the Load demo data option is selected.
  • first install: Outputs the application metadata to the metadata/unload directory to be installed only the first time an application is installed on an instance.