Only users with the ADMINISTRATOR scope in the current context can assign user contexts to hierarchy levels. Make sure your API token grants administrator privileges. See Understanding Scopes for more information.
To assign a user context to a specific hierarchy level, use the assignUserContextToLevel mutation. Access policy:
  • The API user context must have permission to manage user assignments.
  • The specified userContextId must exist and be accessible.
  • The specified hierarchyLevelId must exist and be accessible.
The mutation accepts the following arguments:
ArgumentTypeDescriptionDefault
userContextIdIDRequired. The unique identifier of the user context to assign.
hierarchyLevelIdIDRequired. The unique identifier of the hierarchy level to assign the user context to.
This operation creates a relationship between a user context and a hierarchy level, which affects the user’s access permissions and organizational structure visibility.
mutation assignUserContextToLevel {
  assignUserContextToLevel(
    userContextId: "5acfc440-88e0-4286-b089-c0f03575ed9a"
    hierarchyLevelId: 1
  ) {
    errors
    response
  }
}