API Stability Long-Term

The changeUserAndGroupRolesForSearchDomain() GraphQL mutation field is used to change the user and group roles for a search domain.

For more information on roles in LogScale, see the Manage users & permissions documentation page. You may also want to look at Manage users & permissions for related information.

Syntax

Below is the syntax for the changeUserAndGroupRolesForSearchDomain() mutation field:

graphql
changeUserAndGroupRolesForSearchDomain(
      searchDomainId: string!
      groups: [GroupRoleAssignment!]!
      users: [UserRoleAssignment!]!
   ): [UserOrGroup!]!

Below is an example of how this mutation field might be used:

Show:
graphql
mutation {
  changeUserAndGroupRolesForSearchDomain(
      searchDomainId: "aK9GKAsTnMXfRxT8Fpecx3fX",
      groups: [ {groupId: "Kj3SzghhYxdjz8X6XIxZ2EhaVTrMuSpo", 
                 roleId: "8TKAG5afPxvPcqGJ8De8ccMeJSFiBckE"} ],
      users:  [ {userId: "DScDf7IpfDeykSYW1B7AU48p", 
                 roleId: "wZ5KEIUY7kRFYDxlQZCHB72VZnFGsmIB"} ] )
  {... on Group {displayName, userCount}
   ... on User {username} }
}

Given Datatypes

For GroupRoleAssignment, there a couple of parameters that may be given. Below is a list of them along with a description of each:

Table: GroupRoleAssignment

ParameterTypeRequiredDefaultStabilityDescription
Some arguments may be required, as indicated in the Required column. For some fields, this column indicates that a result will always be returned for this column.
Table last updated: Sep 18, 2024
groupIdstringyes Long-TermThe unique identifier for the group related to the role.
roleIdstringyes Long-TermThe unique identifier of the role.

UserRoleAssignment has only a couple of parameters. Below is a list of them and a description of each:

Table: UserRoleAssignment

ParameterTypeRequiredDefaultStabilityDescription
Some arguments may be required, as indicated in the Required column. For some fields, this column indicates that a result will always be returned for this column.
Table last updated: Sep 23, 2024
userIdstringyes Long-TermThe unique identifier of the user for which to assign the role.
roleIdstringyes Long-TermThe unique identifier for the role to assign.

Returned Datatypes

The returned results are sets of users and groups. This is a union between two other datatypes: Group and User. The parameters for them are listed in the tables below:

Table: Group

ParameterTypeRequiredDefaultStabilityDescription
Some arguments may be required, as indicated in the Required column. For some fields, this column indicates that a result will always be returned for this column.
Table last updated: Apr 3, 2025
allowedAssetActionsBySourcemultipleyes PreviewGet allowed asset actions for the group on a specific asset and explain how it has gotten this access The multiple datatype consists of (assetId: string!, assetType: AssetPermissionsAssetType!, searchDomainId: string): GroupAssetActionsBySource!. See AssetPermissionsAssetType GroupAssetActionsBySource.
defaultQueryPrefixstring  Long-TermThe default prefix for queries.
defaultRolerole  Long-TermThe default role associated with the group. See role.
defaultSearchDomainCountintegeryes Long-TermThe default search domain count.
displayNamestringyes Long-TermThe display name of the group.
idstringyes Long-TermThe identifier of the group.
lookupNamestring  Long-TermThe look-up name for the group.
organizationRoles[GroupOrganizationRole]yes Long-TermThe roles of the organization associated with the group. See GroupOrganizationRole.
permissionTypePermissionType  Long-TermIndicates which level of permissions the group contains. See PermissionType.
queryPrefixesmultiple  Long-TermThe query prefixes for the group. The multiple datatype consists of queryPrefixes(onlyIncludeRestrictiveQueryPrefixes: boolean, onlyForRoleWithId: string): [QueryPrefixes]. See queryPrefixes.
roles[SearchDomainRole]yes Long-TermThe roles for the group See SearchDomainRole.
searchAssetPermissionsmultipleyes PreviewSearch for asset permissions for the group. This is a preview and subject to change. The datatype consists of (searchFilter: string, skip: integer, limit: integer, orderBy: OrderBy, sortBy: SortBy, assetTypes: [AssetPermissionsAssetType], searchDomainIds: [string], permissions: [AssetAction], includeUnassignedAssets: boolean): AssetPermissionSearchResultSet!. See AssetPermissionsAssetType AssetAction, and AssetPermissionSearchResultSet.
searchDomainCountintegeryes Long-TermThe number of search domains for the group.
searchDomainRolesmultipleyes Long-TermThe search domain roles assigned to the group. The multiple datatype consists of (searchDomainId: string): [SearchDomainRole]. (seeSearchDomainRole).
searchDomainRolesByNamemultipleyes DeprecatedThe search domain roles assigned to the group, by name. The multiple datatype consists of (searchDomainName: string): SearchDomainRole. See SearchDomainRole. When multiple roles per view is enabled, this field will return only the first of possibly multiple roles matching the name for the view. Use roles, searchDomainRoles, or searchDomainRolesBySearchDomainName fields instead. Will be removed at the earliest in version 1.195.
searchDomainRolesBySearchDomainNamestringyes Long-TermThe domain roles by search domain name. The datatype consists of (searchDomainName: string!): [SearchDomainRole!]. See SearchDomainRole.
searchUsersmultiple  Long-TermUsed to search the list of users in the group. The datatype consists of (searchFilter: string, skip: integer, limit: integer, sortBy: OrderByUserField, orderBy: OrderBy): UserResultSetType. See OrderByUserField, OrderBy, UserResultSetType.
systemRoles[GroupSystemRole]yes Long-TermThe system roles of the group (see GroupSystemRole Table).
userCountintegeryes Long-TermThe number of users that are part of the group.
users[User]yes Long-TermThe list of users in the group. See User.

Table: User

ParameterTypeRequiredDefaultStabilityDescription
Some arguments may be required, as indicated in the Required column. For some fields, this column indicates that a result will always be returned for this column.
Table last updated: Mar 25, 2025
allowedAssetActionsBySourcemultipleyes Preview

Get allowed asset actions for the user on a specific asset and explain how these actions have been granted.

The multiple datatype consists of (assetId: string!, assetType: AssetPermissionsAssetType!, searchDomainId: string): [AssetActionsBySource]!.

See AssetPermissionsAssetType, and AssetActionsBySource.

allowedOrganizationActions[OrganizationAction]yes Long-TermReturns the actions the user is allowed to perform in the organization. See OrganizationAction.
allowedSystemActions[SystemAction]yes Long-TermReturns the actions the user is allowed to perform in the system. See SystemAction Table.
companystring  Long-TermThe name of the company for the user account.
countryCodestring  Long-TermThe two-letter ISO 3166-1 Alpha-2 code for the country of residence (e.g., us).
createdAtdatetimeyes Long-TermThe data and time the account was created.
displayNamestringyes Long-TermThe value of the fullName if used, otherwise the username.
emailstring  Long-TermThe user account's email address for communications from LogScale.
firstNamestring  Long-TermThe user's actual first name (e.g., Bob). Don't use with fullName.
fullNamestring  Long-TermThe user's full name (e.g., Bob Smith). Don't use if using other name parameters.
groups[group]yes Long-TermThe groups of which the user is a member. See group.
groupSearchDomainRoles[GroupSearchDomainRole]yes Long-TermThe group search domain roles. See GroupSearchDomainRole.
groupsV2multiple  Preview

The groups of which the user is a member. This is a preview and subject to change.

The multiple datatype consists of (search: string, typeFilter: [PermissionType], limit: integer, skip: integer, searchInRoles: boolean): GroupResultSetType.

See PermissionType, and GroupResultSetType.

idstringyes Long-TermThe identifier or token for the user.
isOrgRootbooleanyes Long-TermWhether the organization is granted root access.
isRootbooleanyes Long-TermWhether the user account is granted root access.
lastNamestring  Long-TermThe user's actual last name or family name (e.g., Smith). Don't use with fullName.
permissionsmultipleyes Long-TermPermissions of the user. The multiple datatype consists of (viewName: string): [UserPermissions]. See UserPermissions.
permissionsPagemultipleyes DeprecatedA page of user permissions. The multiple datatype consists of (search: string, pageNumber: integer, pageSize: integer): UserPermissionsPage. See UserPermissionsPage. This field is no longer used. It will be removed at the earliest in version 1.208.
phoneNumberstring  Long-TermThe telephone number for LogScale to use for telephone text messages.
picturestring  Long-TermFile name of an image file for the account.
searchAssetPermissionsmultiple  Preview

Search for asset permissions for the user. This is a preview and subject to change.

The multiple datatype consists of (searchFilter: string, skip: integer, limit: integer, orderBy: OrderBy, sortBy: SortBy, assetTypes: [AssetPermissionsAssetType], searchDomainIds: [string], permissions: [AssetAction], searchDomainIds: [string], permissions: [AssetAction!]): AssetPermissionSearchResultSet.

See AssetPermissionsAssetType, AssetPermissionInputEnum, and AssetPermissionSearchResultSet.

searchDomainRolesmultiple  Long-TermThe search domain roles assigned to the user. The multiple datatype consists of (searchDomainId: string): [SearchDomainRole]. See SearchDomainRole.
searchDomainRolesByNamemultipleyes Deprecated

The search domain roles for the user, by name. The multiple datatype consists of (searchDomainName: string): SearchDomainRole. See SearchDomainRole.

This is deprecated because when multiple roles per view is enabled, this field will return only the first of possibly multiple roles matching the name for the view. Therefore, use instead searchDomainRoles or searchDomainRolesBySearchDomainName.

searchDomainRolesBySearchDomainNamemultiple  Long-TermThe search domain roles assigned to the user by search domain name. The multiple datatype consists of (searchDomainName: string): [SearchDomainRole]. See SearchDomainRole.
stateCodestring  Long-TermThe two-letter, ISO 3166-2 country sub-division code for the state of residence (e.g., ny).
rolesV2multiple  Preview

The roles assigned to the user through a group. This is a preview and subject to change.

The multiple datatype consists of (search: string, typeFilter: [PermissionType], limit: integer, skip: integer, searchInGroups: boolean): RolesResultSetType.

See PermissionType, and RolesResultSetType.

usernamestringyes Long-TermThe user name for the account.
userOrGroupSearchDomainRolesmultipleyes Long-TermThe user or group search domain roles. The multiple datatype consists of (search: string, skip: integer, limit: integer, totalSearchDomains: integer): UserOrGroupSearchDomainRoleResultSet. See UserOrGroupSearchDomainRoleResultSet.