openapi: 3.0.1
info:
  title: User Service
  description: The User Service provides a variety of APIs for creating, deleting, and retrieving users for a tenant.
  version: '2.0'
tags:
  - name: UserService
    description: User Service
    externalDocs:
      description: Confluence
      url: https://confluence.zebra.com/display/ZRPS/Phoenix+User+Service
security:
  - Authorization: []
paths:
  /users:
    get:
      summary: List all the users (Paginated and w/ Filter)
      description: 'Permission Level: Read'
      operationId: UserService_ListUsers
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2UsersCursorResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      parameters:
        - name: pageSize
          description: |-
            Requested size of the next page of data.
            If not set, the default page size is 10, Required: false.
          in: query
          required: false
          schema:
            type: integer
            format: int32
        - name: pageToken
          description: 'MongoDB Field, describes the encoded page token for page traversal, Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: tenantIds
          description: 'List of Tenants of the users, Required: false'
          in: query
          required: false
          explode: true
          schema:
            type: array
            items:
              type: string
        - name: scope
          description: 'scope of the users to list, Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: genericFilter
          description: |-
            Generic filter for user fields (userId, firstName, lastName, email, location, attributes.scope, attributes.name & attribute.value)
            If it contains a whitespace, it splits the text and filter by both words, Required: false
          in: query
          required: false
          schema:
            type: string
        - name: specificFilter.userId
          in: query
          required: false
          schema:
            type: string
        - name: specificFilter.firstName
          in: query
          required: false
          schema:
            type: string
        - name: specificFilter.lastName
          in: query
          required: false
          schema:
            type: string
        - name: specificFilter.email
          in: query
          required: false
          schema:
            type: string
        - name: specificFilter.location
          in: query
          required: false
          schema:
            type: string
        - name: specificFilter.workspaceType
          description: The workspace type of the Workspace entity
          in: query
          required: false
          schema:
            type: string
        - name: specificFilter.workspaceName
          description: The workspace name of the Workspace entity
          in: query
          required: false
          schema:
            type: string
        - name: specificFilter.licenseDomain
          description: The domain of the license
          in: query
          required: false
          schema:
            type: string
        - name: specificFilter.selectedDepartments
          description: The selected departments of the user
          in: query
          required: false
          explode: true
          schema:
            type: array
            items:
              type: string
        - name: sortField
          description: 'Sort field, valid values: userId, firstName, lastName, email, batchId, lastUpdated, licenses or creationTime Default: userId, Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: sortType
          description: 'Sort Type for the results, Default: ASC, Required: false'
          in: query
          required: false
          schema:
            type: string
            enum:
              - NONE
              - ASC
              - DESC
            default: NONE
        - name: domain
          description: 'domain of the users to list, Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: roleId
          description: 'role id. restrict results to users within this role, Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: fieldMask
          description: |-
            FieldMask to control what fields are to be returned, if empty assumes everything, Required: false
            Valid path names are names of each field in the UserResponse proto
          in: query
          required: false
          schema:
            type: string
        - name: includeDisabled
          description: |-
            Flag to include disabled scoped users, Default: false, Required: false
            if its set to true, all the scoped users will be fetched.
            This field is set for Deprecation, please switch to the new status_in_scope field.
            if the scope field above is null this field we be disregarded and no filter will be applied on any scope
          in: query
          required: false
          schema:
            type: boolean
        - name: startsWithSingleCharacter
          description: 'Ability to search for a single starts with character, only applicable to specific_filter: first_name, Required: false, Default: false'
          in: query
          required: false
          schema:
            type: boolean
        - name: excludeTenantIds
          description: 'List of tenant IDs to exclude. Required: false'
          in: query
          required: false
          explode: true
          schema:
            type: array
            items:
              type: string
        - name: specificFilterQueryType
          description: 'ENUM to switch the specific_filter.first_name and specific_filter.last_name params from AND to OR, Default: AND, Required: false.'
          in: query
          required: false
          schema:
            type: string
            enum:
              - AND
              - OR
            default: AND
        - name: searchMatchType
          description: |-
            ENUM to switch between the type of string matching you want on a query. Historically, we relied solely on a "contains" or "wild-card"
            based matching on all fields within specific_filter and and generic_filter. With this ENUM you can now select to do
            exact matches, Default = REGEX, Required = false
          in: query
          required: false
          schema:
            type: string
            enum:
              - REGEX
              - EXACT
            default: REGEX
        - name: statusInScope
          description: |-
            This enum works to retrieve either: ALL, only ENABLED, only DISABLED, users for a given scope
            if the scope field above is null this field we be disregarded and no filter will be applied on any scope
            Default: ENABLED, Required: false

             - ENABLED: gets only enabled users
             - DISABLED: gets only disabled users
             - ALL: gets all users
          in: query
          required: false
          schema:
            type: string
            enum:
              - ENABLED
              - DISABLED
              - ALL
            default: ENABLED
        - name: roleFilter
          description: |-
            This filter will only return users who have roles that meet a certain criteria

             - ALL_ROLES: All Roles
             - USER_ONLY: User Roles only
             - ADMIN_ONLY: Admin Roles only
          in: query
          required: false
          schema:
            type: string
            enum:
              - ALL_ROLES
              - USER_ONLY
              - ADMIN_ONLY
            default: ALL_ROLES
      tags:
        - UserService
    delete:
      summary: |-
        Deletes a list of users of a tenant.
        This method will try to delete all users in the list, even though an error happens.
      description: 'Permission Level: Read Write'
      operationId: UserService_DeleteUsers
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                type: object
                properties: {}
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      parameters:
        - name: tenantId
          description: 'tenant of the users to delete, Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: userIds
          description: 'list of user_ids of the users to delete, Required: true'
          in: query
          required: false
          explode: true
          schema:
            type: array
            items:
              type: string
        - name: scope
          description: |-
            User scope (ZPA, Reflexis, etc), Required : false
            Users will be disabled for the provided scope, if no scope given then users will be disabled for all scopes.
            Useful only when permanent delete is false.
          in: query
          required: false
          schema:
            type: string
        - name: permanentDelete
          description: 'Permanently delete users if set to true, Required : false, Default : false'
          in: query
          required: false
          schema:
            type: boolean
        - name: domain
          description: 'domain of the user to fetch, Required: false'
          in: query
          required: false
          schema:
            type: string
      tags:
        - UserService
    post:
      summary: Bulk create that creates all the valid users and return a list of errors.
      description: 'Permission Level: Read-Write'
      operationId: UserService_CreateUsers
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2UsersResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v2UsersRequest'
        required: true
      tags:
        - UserService
    put:
      summary: |-
        Bulk update that updates all the users with valid update field values and return a list of errors
        Updating user attributes with no user level scope provided will replace all user attributes.
        If a user level scope is specified, only attributes with that scope will be replaced.
      description: 'Permission Level: Read-Write'
      operationId: UserService_UpdateUsers
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2UsersResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v2UpdateUsersRequest'
        required: true
      tags:
        - UserService
  /users/admin:
    post:
      summary: Creates a user under the tenant as tenant admin
      description: 'Permission Level: Required admin grants.'
      operationId: UserService_CreateAdminUser
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2UserResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      parameters:
        - name: tenantId
          description: 'tenant_id of the admin user, Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: userId
          description: 'The user ID that will be created as tenant admin. Required: false. Default: adminuser'
          in: query
          required: false
          schema:
            type: string
        - name: email
          description: 'The email of user that is being created as a tenant admin, Required: false'
          in: query
          required: false
          schema:
            type: string
      tags:
        - UserService
  /users/batches/{batchId}/changelog:
    get:
      summary: Get change log info by batch_id for templated bulk uploaded users. batch_id and tenant required.
      description: 'Permission Level: Read'
      operationId: UserService_GetTemplatedChangeLog
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2GetTemplatedChangeLogResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      parameters:
        - name: batchId
          description: 'batch_id of the batch for change log, Required: true'
          in: path
          required: true
          schema:
            type: string
        - name: tenantId
          description: 'tenant_id of the users in batch, Required: false'
          in: query
          required: false
          schema:
            type: string
      tags:
        - UserService
  /users/batches/{batchId}/users:
    get:
      summary: List all the users by BatchId (Paginated)
      description: 'Permission Level: Read'
      operationId: UserService_ListTemplatedUsers
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2ListTemplatedUsersResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      parameters:
        - name: batchId
          description: 'batch_id of all the users, Required: true'
          in: path
          required: true
          schema:
            type: string
        - name: tenantId
          description: 'Tenant of the users, Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: pageSize
          description: 'Page Size, Default: 10, Required: false'
          in: query
          required: false
          schema:
            type: integer
            format: int32
        - name: pageToken
          description: 'MongoDB Field, describes the encoded page token for page traversal, Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: sortField
          description: 'sort field, valid values: userId, firstName, lastName, email, batchId, or lastUpdated Default: userId, Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: sortType
          description: 'Sort Type for the results, Default: ASC, Required: false'
          in: query
          required: false
          schema:
            type: string
            enum:
              - NONE
              - ASC
              - DESC
            default: NONE
      tags:
        - UserService
  /users/byid-tenant:
    post:
      summary: List all the users by userId and tenantId
      description: 'Permission Level: Read'
      operationId: UserService_GetUsersByIdAndTenant
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2UsersResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v2GetUsersByIdAndTenantRequest'
        required: true
      tags:
        - UserService
  /users/byresourcetype:
    get:
      summary: Returns users by permission ResourceType
      operationId: UserService_GetUsersByResourceType
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2UsersCursorResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      parameters:
        - name: type
          description: 'The type Required: true'
          in: query
          required: false
          schema:
            type: string
        - name: pageSize
          description: Requested size of the next page of data.
          in: query
          required: false
          schema:
            type: integer
            format: int32
        - name: pageToken
          description: 'MongoDB Field, describes the encoded page token for page traversal, Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: sortField
          description: 'sort field, valid values: userId, firstName, lastName, email, batchId, or lastUpdated Default: userId, Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: sortType
          description: 'Sort Type for the results, Default: ASC, Required: false'
          in: query
          required: false
          schema:
            type: string
            enum:
              - NONE
              - ASC
              - DESC
            default: NONE
        - name: includeNestedRoles
          description: 'Whether to include users who are assigned to the permission with the type via a nested role. Default: false, Required: false'
          in: query
          required: false
          schema:
            type: boolean
        - name: startsWithSingleCharacter
          description: 'Starts with a single character for the firstName field of the user, Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: tenantId
          description: 'The id of the tenant to which users belong, Required: false, Default: All tenants'
          in: query
          required: false
          schema:
            type: string
      tags:
        - UserService
  /users/inviteuser/{oldUserId}:
    put:
      summary: 'Note: this is only used by Identity Service and will work only once.'
      description: |-
        Updates a invited user to the Phoenix platform.

        Permission Level: Read-Write
      operationId: UserService_SetInvitedUserId
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2UserResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      parameters:
        - name: oldUserId
          description: 'old_user_id of the user, Required: true'
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserServiceSetInvitedUserIdBody'
        required: true
      tags:
        - UserService
  /users/license:
    post:
      summary: |-
        License all the users on the domains belonging to a specific tenant
        Permission Level: SuperAdmin
      operationId: UserService_LicenseUsers
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2LicenseUsersResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v2LicenseUsersRequest'
        required: true
      tags:
        - UserService
  /users/licenses:
    post:
      summary: |-
        Update license of the user
        Permission Level: SuperAdmin
      operationId: UserService_UpdateUserLicenses
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                type: object
                properties: {}
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v2UpdateLicensesRequest'
        required: true
      tags:
        - UserService
  /users/loggedincount:
    post:
      summary: Get the number of users that are logged in by tenant or by subset of face value level of workspaces
      description: 'Permission Level: Read'
      operationId: UserService_GetCountUsersLoggedIn
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2GetCountUsersLoggedInResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v2GetCountUsersLoggedInRequest'
        required: true
      tags:
        - UserService
  /users/permission-user/{identifier}:
    get:
      summary: Returns users related to permission and tenant (Does not return roles in response)
      description: 'Permission Level: Read'
      operationId: UserService_ListPermissionUsers
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2UsersCursorResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      parameters:
        - name: identifier
          description: 'The identifier value used for the Permission, Required: true'
          in: path
          required: true
          schema:
            type: string
        - name: tenantId
          description: 'The tenant of the permission, Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: identifierType
          description: |-
            The identifier type, Required: false, Default: Permission ID

             - PERMISSION_ID: By Permission ID. This is the default option.
             - FRIENDLY_ID: By friendly ID.
          in: query
          required: false
          schema:
            type: string
            enum:
              - PERMISSION_ID
              - FRIENDLY_ID
            default: PERMISSION_ID
      tags:
        - UserService
  /users/search:
    get:
      summary: Search all the users (Paginated and w/ Filter)
      description: 'Permission Level: Read'
      operationId: UserService_SearchUsers
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2SearchUsersResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      parameters:
        - name: pageSize
          description: |-
            Requested size of the next page of data.
            If not set, the default page size is 10, Required: false.
          in: query
          required: false
          schema:
            type: integer
            format: int32
        - name: pageToken
          description: 'MongoDB Field, describes the encoded page token for page traversal, Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: tenantIds
          description: 'List of Tenants of the users, Required: false'
          in: query
          required: false
          explode: true
          schema:
            type: array
            items:
              type: string
        - name: scope
          description: 'scope of the users to list, Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: workspace
          description: 'users workspace, Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: genericFilter
          description: |-
            Generic filter for user fields (userId, userFirstName, userLastName, email, location, workspace)
            If it contains a whitespace, it splits the text and filter by both words, Required: false
          in: query
          required: false
          schema:
            type: string
        - name: specificFilter.userId
          in: query
          required: false
          schema:
            type: string
        - name: specificFilter.firstName
          in: query
          required: false
          schema:
            type: string
        - name: specificFilter.lastName
          in: query
          required: false
          schema:
            type: string
        - name: specificFilter.email
          in: query
          required: false
          schema:
            type: string
        - name: specificFilter.location
          in: query
          required: false
          schema:
            type: string
        - name: specificFilter.workspaceType
          description: The workspace type of the Workspace entity
          in: query
          required: false
          schema:
            type: string
        - name: specificFilter.workspaceName
          description: The workspace name of the Workspace entity
          in: query
          required: false
          schema:
            type: string
        - name: specificFilter.licenseDomain
          description: The domain of the license
          in: query
          required: false
          schema:
            type: string
        - name: specificFilter.selectedDepartments
          description: The selected departments of the user
          in: query
          required: false
          explode: true
          schema:
            type: array
            items:
              type: string
        - name: userStatus
          description: User status in the selected scope
          in: query
          required: false
          schema:
            type: string
            enum:
              - NONE
              - DISABLE
              - ENABLE
            default: NONE
        - name: sortField
          description: 'List of sort fields, valid values: userId, firstName, lastName, email, batchId, or lastUpdated Default: userId, Required: false'
          in: query
          required: false
          explode: true
          schema:
            type: array
            items:
              type: string
        - name: sortType
          description: 'Sort Type for the results, Default: ASC, Required: false'
          in: query
          required: false
          schema:
            type: string
            enum:
              - NONE
              - ASC
              - DESC
            default: NONE
        - name: roleId
          description: 'role id. restrict results to users within this role, Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: fieldMask
          description: |-
            FieldMask to control what fields are to be returned, if empty assumes everything, Required: false
            Valid path names are names of each field in the SearchUserResponse proto
          in: query
          required: false
          schema:
            type: string
        - name: excludeTenantIds
          description: 'List of tenant IDs to exclude. Required: false'
          in: query
          required: false
          explode: true
          schema:
            type: array
            items:
              type: string
        - name: specificFilterQueryType
          description: 'ENUM to switch the specific_filter.first_name and specific_filter.last_name params from AND to OR, Default: AND, Required: false.'
          in: query
          required: false
          schema:
            type: string
            enum:
              - AND
              - OR
            default: AND
      tags:
        - UserService
    post:
      summary: List all the users with multiple filters
      description: 'Permission Level: Read'
      operationId: UserService_ListUsersWithFilters
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2UsersCursorResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v2ListUsersFilterRequest'
        required: true
      tags:
        - UserService
  /users/search/{userText}:
    get:
      summary: |-
        Search a user using atlas Search, that allows for relevance scoring, which is a ranking system that orders search results by relevance to the query.
        This helps ensure that the most relevant data is returned first, just like how search engines prioritize results based on relevance.
        So here you can search by a 'user_text' and get the 10 best matches for that search criteria
      description: 'Permission Level: Read'
      operationId: UserService_SearchUserByTextSearch
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2SearchUsersResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      parameters:
        - name: userText
          description: 'text for the user to search on this fields: firstName, lastName, email, userId. Required: true'
          in: path
          required: true
          schema:
            type: string
        - name: tenantId
          description: 'tenant of the user, Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: scope
          description: 'scope of the user to fetch, Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: sortField
          description: 'List of sort fields, valid values: userId, firstName, lastName, email, lastUpdated, licenses or creationTime Default: userId, Required: false'
          in: query
          required: false
          explode: true
          schema:
            type: array
            items:
              type: string
        - name: sortType
          description: 'Sort Type for the results, Default: ASC, Required: false'
          in: query
          required: false
          schema:
            type: string
            enum:
              - NONE
              - ASC
              - DESC
            default: NONE
        - name: pageSize
          description: 'The amount of data returned in a single response. Default: 10, Required: false'
          in: query
          required: false
          schema:
            type: integer
            format: int32
        - name: pageToken
          description: 'MongoDB Field, describes the encoded page token for page traversal, Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: resourceType
          description: |-
            the common ResourceType that all users have access to, Required: false
            note using this filter will decrease performance of the endpoint
          in: query
          required: false
          schema:
            type: string
        - name: partialSearch
          description: 'partial contains search on firstName, and lastName if entered in user_test, Default: false, Required: false'
          in: query
          required: false
          schema:
            type: boolean
        - name: roleFilter
          description: |-
            This filter will only return users who have roles that meet a certain criteria

             - ALL_ROLES: All Roles
             - USER_ONLY: User Roles only
             - ADMIN_ONLY: Admin Roles only
          in: query
          required: false
          schema:
            type: string
            enum:
              - ALL_ROLES
              - USER_ONLY
              - ADMIN_ONLY
            default: ALL_ROLES
      tags:
        - UserService
  /users/status:
    post:
      summary: Updates status for multiple users
      description: 'Permission Level: Read-Write'
      operationId: UserService_UpdateUsersStatus
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2UsersStatusResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v2UpdateUsersStatusRequest'
        required: true
      tags:
        - UserService
  /users/templated:
    post:
      summary: |-
        Bulk Upload users with a given template. Requires a template to be created beforehand.
        If the template has a column named `Action Flag`. the behavior changes and the input file is used to delete users.
      description: 'Permission Level: Read-Write'
      operationId: UserService_CreateTemplatedUsers
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2CreateTemplatedUsersResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v2CreateTemplatedUsersRequest'
        description: ' (streaming inputs)'
        required: true
      tags:
        - UserService
  /users/templates/{templateName}/users:
    get:
      summary: Creates a templated CSV download for users based on batchID
      description: 'Permission Level: Read'
      operationId: UserService_GetTemplatedUsersFile
      responses:
        '200':
          description: A successful response.(streaming responses)
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    $ref: '#/components/schemas/v2GetTemplatedUsersFileResponse'
                  error:
                    $ref: '#/components/schemas/googleRpcStatus'
                title: Stream result of v2GetTemplatedUsersFileResponse
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      parameters:
        - name: templateName
          description: 'Template name of the template to use for downloading batch users, Required: true'
          in: path
          required: true
          schema:
            type: string
        - name: tenantId
          description: 'tenant_id of the users, Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: batchId
          description: 'batch_id of the users to be downloaded. If missing, download all the tenant users. Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: scope
          description: 'Will only download users enabled for that particular scope. Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: includeClients
          description: |-
            Flag to include clients, Default: false, Required: false
            if its set to true, all the client users(is_client: true) will be fetched.
          in: query
          required: false
          schema:
            type: boolean
      tags:
        - UserService
  /users/tenant-lookup:
    post:
      summary: Returns the user's tenant and a link to the home operating set for that tenant
      description: 'Permission Level: Read'
      operationId: UserService_TenantLookup
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2TenantLookupResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v2TenantLookupRequest'
        required: true
      tags:
        - UserService
  /users/unlicense:
    post:
      summary: |-
        Unlicense all the users on the domains belonging to a specific tenant
        Permission Level: SuperAdmin
      operationId: UserService_UnlicenseUsers
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                type: object
                properties: {}
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v2UnlicenseUsersRequest'
        required: true
      tags:
        - UserService
  /users/user-domains:
    get:
      summary: Retrieves the list of domains the logged in user has roles and permission to access
      description: 'Permission Level: Read'
      operationId: UserService_GetUserDomains
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2GetUserDomainsResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      parameters:
        - name: userId
          description: 'user_id of the user to get details, Required: true'
          in: query
          required: false
          schema:
            type: string
        - name: tenantId
          description: 'tenant_id of the user, Required: false'
          in: query
          required: false
          schema:
            type: string
      tags:
        - UserService
  /users/user-tenants:
    get:
      summary: Retrieves the list of tenants the logged in user has permissions to access
      description: 'Permission Level: Read'
      operationId: UserService_GetUserTenants
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2GetUserTenantsResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      parameters:
        - name: domain
          description: Optional - restricts the list of tenants to permissions of a particular domain if present
          in: query
          required: false
          schema:
            type: string
        - name: scope
          description: Optional - restricts the list of tenants to permissions of a particular scope if present
          in: query
          required: false
          schema:
            type: string
        - name: permissionType
          description: Optional - restricts the list of tenants to permissions of a particular permission type if present
          in: query
          required: false
          schema:
            type: string
      tags:
        - UserService
  /users/validdepartments:
    get:
      summary: Retrieving list of all valid departments for a given user
      description: 'Permission Level: Read'
      operationId: UserService_GetValidDepartmentsByUser
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2GetValidDepartmentsByUserResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      parameters:
        - name: userId
          description: 'user_id of the user whose departments you wish to retrieve, Required: true'
          in: query
          required: false
          schema:
            type: string
        - name: tenantId
          description: 'tenant that the user belongs to, Default: tenant of the caller token, Required: false'
          in: query
          required: false
          schema:
            type: string
      tags:
        - UserService
  /users/{userId}:
    get:
      summary: Get a User by a user_id and tenant_id
      description: 'Permission Level: Read'
      operationId: UserService_GetUser
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2UserResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      parameters:
        - name: userId
          description: 'user_id of the user to get details, Required: true'
          in: path
          required: true
          schema:
            type: string
        - name: tenantId
          description: 'tenant of the user, Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: scope
          description: 'scope of the user to fetch, Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: domain
          description: 'domain of the user to fetch, Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: fieldMask
          description: |-
            FieldMask to control what fields are to be returned, if empty assumes everything, Required: false
            Valid path names are names of each field in the UserResponse proto
          in: query
          required: false
          schema:
            type: string
        - name: identifier
          description: 'DEPRECATED - Use userId for your identifier regardless of identifier type. The identifier value used to retrieve the User. Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: identifierType
          description: |-
            Specifies the types of identifiers available to retrieve an User. Default: USER_ID, Required: false

             - USER_ID: DEFAULT VALUE: Searches for user based on the user_id field.
             - PLATFORM_USER_ID: Searches for the user based on the phenixUserId field.
          in: query
          required: false
          schema:
            type: string
            enum:
              - USER_ID
              - PLATFORM_USER_ID
            default: USER_ID
      tags:
        - UserService
    delete:
      summary: Deletes a user from user_id and tenant
      description: '[Deprecated: Please use the Bulk Delete Users API.]  Deletes a user from user_id and tenant.'
      operationId: UserService_DeleteUser
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                type: object
                properties: {}
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      parameters:
        - name: userId
          description: 'user_id of the user to delete, Required: true'
          in: path
          required: true
          schema:
            type: string
        - name: tenantId
          description: 'tenant of the user to delete, Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: scope
          description: |-
            User scope (ZPA, Reflexis, etc), Required : false
            User will be disabled for the provided scope, if no scope given then user will be disabled for all scopes.
            Useful only when permanent delete is false.
          in: query
          required: false
          schema:
            type: string
        - name: permanentDelete
          description: 'Permanently delete user if set to true, Required : false, Default : false'
          in: query
          required: false
          schema:
            type: boolean
        - name: domain
          description: 'domain of the user to fetch, Required: false'
          in: query
          required: false
          schema:
            type: string
      tags:
        - UserService
      deprecated: true
    put:
      summary: Updates a user. user_id, tenant and user fields to update are required.
      description: '[Deprecated: Please use the Bulk Update Users API.]  Updates a user.'
      operationId: UserService_UpdateUser
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2UserResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      parameters:
        - name: userId
          description: 'user_id of the user to update, Required: true'
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserServiceUpdateUserBody'
        required: true
      tags:
        - UserService
      deprecated: true
  /users/{userId}/onboard/{applicationName}:
    post:
      summary: Onboard user in Phoenix auth with RFID/FSS support
      description: 'Permission Level: Read-Write'
      operationId: UserService_OnboardUser
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                type: object
                properties: {}
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      parameters:
        - name: userId
          description: 'user_id of the user to get details, Required: false'
          in: path
          required: true
          schema:
            type: string
        - name: applicationName
          description: 'The application name. Required: false'
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserServiceOnboardUserBody'
        required: true
      tags:
        - UserService
  /users/{userId}/status:
    post:
      summary: Updates the status for a user
      description: 'Permission Level: Read-Write'
      operationId: UserService_UpdateUserStatus
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2UserStatusResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      parameters:
        - name: userId
          description: 'user_id of the user to get details, Required: true'
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserServiceUpdateUserStatusBody'
        required: true
      tags:
        - UserService
servers:
  - url: https://prod-ui-zwseuprod01p.pp.zebra.com/api
    description: EU Server
  - url: https://prod-ui-zwsusprod01p.pp.zebra.com/api
    description: NA Server
components:
  schemas:
    UserServiceOnboardUserBody:
      type: object
      properties:
        tenantId:
          type: string
          title: 'tenant of the user, Required: false'
        firstName:
          type: string
          title: 'User''s first name. Required: false'
        lastName:
          type: string
          title: 'User''s last name. Required: false'
    UserServiceSetInvitedUserIdBody:
      type: object
      properties:
        tenantId:
          type: string
          title: 'tenant of the user to update, Required: true'
        newUserId:
          type: string
          title: 'new_user_id to update for the user invited, Required: true'
    UserServiceUpdateUserBody:
      type: object
      properties:
        tenantId:
          type: string
          title: 'tenant of the user to update, Required: false'
        user:
          $ref: '#/components/schemas/v2UpdateUserProto'
    UserServiceUpdateUserStatusBody:
      type: object
      properties:
        tenantId:
          type: string
          title: 'tenant of the user, Required: false'
        status:
          $ref: '#/components/schemas/v2UpdateUserStatusRequestStatus'
    commonsSortType:
      type: string
      enum:
        - NONE
        - ASC
        - DESC
      default: NONE
    googleRpcStatus:
      type: object
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string
        details:
          type: array
          items:
            $ref: '#/components/schemas/protobufAny'
    protobufAny:
      type: object
      properties:
        '@type':
          type: string
      additionalProperties: {}
    userV2Status:
      type: string
      enum:
        - PENDING
        - IN_PROGRESS
        - SUCCESS
        - FAILED
        - SUCCESS_WITH_ERRORS
      default: PENDING
      description: |-
        - PENDING: The file upload is pending. Default option.
         - IN_PROGRESS: The file is being uploaded.
         - SUCCESS: The file was successfully uploaded.
         - FAILED: The file upload failed.
         - SUCCESS_WITH_ERRORS: At least one user was successfully uploaded, but others had errors
      title: This enum represents the current status of a template bulk user upload
    v2AddressType:
      type: string
      enum:
        - UNRECOGNIZED_ADDRESS
        - HOME_ADDRESS
        - OFFICE_ADDRESS
      default: UNRECOGNIZED_ADDRESS
    v2AddressesProto:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/v2AddressType'
        address:
          type: string
    v2BulkCreateUserProto:
      type: object
      properties:
        userId:
          type: string
          title: 'user_id of the user to be created or updated, Required: true'
        firstName:
          type: string
          title: 'First Name of the user, Required: false'
        lastName:
          type: string
          title: 'Last Name of the user, Required: false'
        email:
          type: string
          title: 'Email id of the user, Required: false'
        location:
          type: string
          title: 'Location of the user, Required: false'
        site:
          type: string
          title: 'DEPRECATED FIELD DO NOT USE. Site of the user (Tied to location), Required: false'
        departments:
          type: string
          title: 'DEPRECATED FIELD DO NOT USE. Comma-separated list of user''s departments, Required: false'
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/v2UserAttributeProto'
          title: 'List of user specific attributes, Required: false'
        workspaces:
          type: array
          items:
            $ref: '#/components/schemas/v2UniqueWorkspaceProto'
          description: |-
            Workspaces this user is assigned to. Required: false
            Note: Any tenant_id setting is ignored. The tenant_id of the enclosing request will be used.
        scope:
          type: string
          title: 'User scope (ZPA, Reflexis, etc). Only set on creation as enable. It''s going to be change only on delete user event, Required: false'
        addresses:
          type: array
          items:
            $ref: '#/components/schemas/v2AddressesProto'
          title: 'Addresses including: HOME, and OFFICE, Required: false'
        contactNumbers:
          type: array
          items:
            $ref: '#/components/schemas/v2ContactNumbersProto'
          title: 'Personal Contact Number including: HOME, OFFICE, and MOBILE, Required: false'
        role:
          type: array
          items:
            $ref: '#/components/schemas/v2UniqueRoleProto'
          title: 'Unique Role(s) that can be added to a user upon creation, Required: False'
        isClient:
          type: boolean
          title: 'Identify user as client, Required: false, Default value: false'
        defaultLocale:
          type: string
          title: 'The user''s default locale, Required: false'
        notificationPreferences:
          type: array
          items:
            $ref: '#/components/schemas/v2UserNotificationPreferencesProto'
          description: User notification preferences for different subsystems and scopes. If not present for a given subsystem/scope, it is assumed all notifications modes are enabled.
        primarySite:
          type: string
          title: 'The primary site that the user is assigned to, the tenantId of the site is inferred to be the same as the user, Required: false'
        selectedDepartments:
          type: array
          items:
            type: string
          title: 'The selected department that the user is assigned to, the tenantId of the department is inferred to be the same as the user, Required: false'
        middleName:
          type: string
          title: 'Middle Name of the user, Required: false'
        preferredName:
          type: string
          title: 'Preferred Name of the user, Required: false'
        siteMapping:
          type: array
          items:
            $ref: '#/components/schemas/v2SiteMappingProto'
          title: 'Multi-Site mapping of the user, Required: false'
        claims:
          type: object
          additionalProperties:
            type: string
          title: |-
            JIT onboarding use case. The Identity Service will create the user with these claims, extracted from the first OIDC authentication. 
            This field should be not used in any other context. Required: false
        autoCreateDuringFirstLogin:
          type: boolean
          title: 'When true, this row is the automatic user create that happens during the subject''s first login (no pre-existing Phoenix user). User Service may apply create-only behavior (e.g. tenant auto-assign license domains). Not for routine bulk/admin creates. Required: false, default: false'
      title: Note that this message doesn't include a "tenant_id", as its use case is scenarios where many users in the same tenant are operated on
    v2ContactNumbersProto:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/v2ContactType'
        phoneNumber:
          type: string
    v2ContactType:
      type: string
      enum:
        - UNRECOGNIZED_PHONE
        - HOME_PHONE
        - OFFICE_PHONE
        - MOBILE_PHONE
      default: UNRECOGNIZED_PHONE
    v2CreateTemplatedUsersRequest:
      type: object
      properties:
        tenantId:
          type: string
          title: 'tenant_id of the bulk upload users, Required: false'
        templateName:
          type: string
          title: 'Name of the template to use for template bulk upload, Required: true'
        ignoreHeader:
          type: boolean
          description: Set if the header row of the CSV file I'm uploading can be ignored.
        replaceExisting:
          type: boolean
          title: |-
            A logical toggle to replace existing users. If false, existing users with no corresponding user in the new file
            remain as-is, and existing users with a corresponding user in the new file are upserted. If true, all existing users
            are deleted and replaced. Required: false, defaults to "false"
        file:
          $ref: '#/components/schemas/v2File'
        signedUrl:
          type: string
          title: 'URL to the CSV file, Required: false'
        sftpDetails:
          $ref: '#/components/schemas/v2SFTPDetails'
        fssId:
          type: string
          title: 'Unique identifier of file from FSS (File Store Service), Required: false'
        testConnection:
          type: boolean
          title: 'Flag to test the connection to the CSV file which does NOT actually create the users, Required: false'
        emails:
          type: array
          items:
            type: string
          title: 'List of emails to notify once the batch-job is complete, Required: false'
    v2CreateTemplatedUsersResponse:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/userV2Status'
        batchId:
          type: string
          description: batch_id for all the users in template bulk upload. Randomly generated string.
        created:
          type: integer
          format: int32
          title: number of users created
        updated:
          type: integer
          format: int32
          title: number of users updated
        deleted:
          type: integer
          format: int32
          title: number of users deleted
        errors:
          type: array
          items:
            $ref: '#/components/schemas/v2ErrorLineAndMessage'
          title: errors
      title: Response of templated bulk user upload
    v2ErrorLineAndMessage:
      type: object
      properties:
        line:
          type: integer
          format: int32
          title: line number of error
        message:
          type: string
          title: message describing the error
    v2ExclusionFilterMap:
      type: object
      properties:
        fieldName:
          type: string
          description: 'the entity field name. Required: true.'
        values:
          type: array
          items:
            type: string
          description: 'the values that should be excluded. Required: true.'
    v2File:
      type: object
      properties:
        content:
          type: string
          format: byte
      description: This protobuf message represents any file through an array of bytes.
    v2GetCountUsersLoggedInRequest:
      type: object
      properties:
        tenantId:
          type: string
          title: 'The id of the tenant to which user belongs, Required: false'
        workspaces:
          type: array
          items:
            $ref: '#/components/schemas/v2UniqueWorkspaceProto'
          title: 'The workspaces to which users belong, Required: false'
    v2GetCountUsersLoggedInResponse:
      type: object
      properties:
        loggedInCount:
          type: string
          format: int64
          title: Number of logged in users
    v2GetTemplatedChangeLogResponse:
      type: object
      properties:
        tenantId:
          type: string
          title: tenant_id of the users
        batchId:
          type: string
          title: batch_id of the users
        created:
          type: array
          items:
            type: string
          description: list of user_ids of the users created in the batch.
        updated:
          type: array
          items:
            type: string
          description: list of user_ids of the users updated in the batch.
        creationTime:
          type: string
          format: date-time
          title: Changelog creation time
    v2GetTemplatedUsersFileResponse:
      type: object
      properties:
        data:
          type: string
          format: byte
          title: Array of bytes representing csv file data of templated bulk upload users
    v2GetUserDomainsResponse:
      type: object
      properties:
        domains:
          type: array
          items:
            type: string
          title: List of domains user has roles and permissions on
    v2GetUserTenantsResponse:
      type: object
      properties:
        tenantId:
          type: array
          items:
            type: string
          title: List of tenants user has permissions on
    v2GetUsersByIdAndTenantRequest:
      type: object
      properties:
        tenantId:
          type: string
          title: 'Required: true'
        userId:
          type: array
          items:
            type: string
          title: 'Required: true'
    v2GetValidDepartmentsByUserResponse:
      type: object
      properties:
        validSelectedDepartments:
          type: array
          items:
            $ref: '#/components/schemas/v2SimpleDepartmentProto'
          title: the list of departments that are valid for the primary_site that is assigned to the user
        validDepartments:
          type: array
          items:
            $ref: '#/components/schemas/v2SimpleDepartmentProto'
          title: |-
            the list of all departments that are valid based on the secondary workspaces list on the user entity
            this field is being deprecated as we are getting rid of storing sites and departments in the workspaces list
    v2LicenseUsersRequest:
      type: object
      properties:
        tenantId:
          type: string
          title: 'The tenant to which all the users need to be licensed, Required: true'
        domains:
          type: array
          items:
            type: string
          title: |-
            The list of domains across the users which need to be licensed, Required: true
            When user_count is specified, exactly one domain must be provided
            When user_count is not specified, multiple domains are allowed
        userCount:
          type: integer
          format: int32
          title: |-
            Number of users to be licensed from the single specified domain, Required: false
            When provided, exactly one domain must be specified in the domains list
            When not provided, ALL users across all specified domains will be licensed
    v2LicenseUsersResponse:
      type: object
      properties:
        licensedUsersCount:
          type: integer
          format: int32
          title: The number of users that were actually licensed
    v2LicensesProto:
      type: object
      properties:
        domain:
          type: string
          title: 'Domain of the license, Required: false'
        value:
          type: boolean
          title: 'Value of the attribute Domain: Required: false'
        lastUpdated:
          type: string
          format: date-time
          title: 'Time of most recent licence update in user entity: Required: false'
    v2ListTemplatedUsersResponse:
      type: object
      properties:
        users:
          type: array
          items:
            $ref: '#/components/schemas/v2UserResponse'
          title: list of users for the given tenant
        nextPageToken:
          type: string
          title: next page token
    v2ListUsersFilterRequest:
      type: object
      properties:
        pageSize:
          type: integer
          format: int32
          description: |-
            Requested size of the next page of data.
            If not set, the default page size is 10, Required: false.
        pageToken:
          type: string
          title: 'MongoDB Field, describes the encoded page token for page traversal, Required: false'
        tenantIds:
          type: array
          items:
            type: string
          title: 'List of Tenants of the users, Required: false'
        scope:
          type: string
          title: 'scope of the users to list, Required: false'
        genericFilter:
          type: string
          title: |-
            Generic filter for user fields (userId, firstName, lastName, email, location, attributes.scope, attributes.name & attribute.value)
            If it contains a whitespace, it splits the text and filter by both words, Required: false
        specificSearchFilter:
          $ref: '#/components/schemas/v2SpecificSearchFilter'
        sortField:
          type: string
          title: 'Sort field, valid values: userId, firstName, lastName, email, batchId, or lastUpdated Default: userId, Required: false'
        sortType:
          $ref: '#/components/schemas/commonsSortType'
        domain:
          type: string
          title: 'domain of the users to list, Required: false'
        roleId:
          type: string
          title: 'role id. restrict results to users within this role, Required: false'
        fieldMask:
          type: string
          title: |-
            FieldMask to control what fields are to be returned, if empty assumes everything, Required: false
            Valid path names are names of each field in the UserResponse proto
        includeDisabled:
          type: boolean
          title: |-
            Flag to include disabled scoped users, Default: false, Required: false
            if its set to true, all the scoped users will be fetched.
            This field is set for Deprecation, please switch to the new status_in_scope field
            if the scope field above is null this field we be disregarded and no filter will be applied on any scope
        exclusionFilters:
          type: array
          items:
            $ref: '#/components/schemas/v2ExclusionFilterMap'
          title: |-
            Generic exclusion filter for user fields (tenantId). Required: false.
            valid field_name values: tenantId
        statusInScope:
          $ref: '#/components/schemas/v2StatusInScope'
        startsWithSingleCharacter:
          type: boolean
          title: 'Ability to search for a single starts with character, only applicable to specific_filter: first_name, Required: false, Default: false'
        specificFilterQueryType:
          $ref: '#/components/schemas/v2SpecificFilterQueryTypes'
    v2NotificationTypes:
      type: string
      enum:
        - EMAIL
        - SMS
        - DEVICE
      default: EMAIL
      description: Enum with all possible values for the notification type.
    v2PermissionIdentifierType:
      type: string
      enum:
        - PERMISSION_ID
        - FRIENDLY_ID
      default: PERMISSION_ID
      description: |-
        - PERMISSION_ID: By Permission ID. This is the default option.
         - FRIENDLY_ID: By friendly ID.
      title: Specifies the types of permission identifiers available to retrieve/update/delete a Permission
    v2RoleTypeFilter:
      type: string
      enum:
        - ALL_ROLES
        - USER_ONLY
        - ADMIN_ONLY
      default: ALL_ROLES
      title: |-
        - ALL_ROLES: All Roles
         - USER_ONLY: User Roles only
         - ADMIN_ONLY: Admin Roles only
    v2SFTPDetails:
      type: object
      properties:
        host:
          type: string
          title: 'SFTP Server host, Required: true'
        port:
          type: integer
          format: int32
          title: 'SFTP Server port, Default: 22, Required: false'
        directory:
          type: string
          title: 'Directory in SFTP Server of the file to fetch, Required: true'
        fileName:
          type: string
          title: 'Name of the file including file extension, Required: true (Example - userdata.csv)'
        username:
          type: string
          title: 'Username for SFTP authentication, Required: true'
        password:
          type: string
          title: 'Password for SFTP authentication, Required: true'
      title: Remote SFTP Server details to fetch file from
    v2SearchMatchType:
      type: string
      enum:
        - REGEX
        - EXACT
      default: REGEX
    v2SearchUserResponse:
      type: object
      properties:
        userId:
          type: string
          title: user_id of the user provided at the time of creation
        firstName:
          type: string
          title: First Name of the user
        lastName:
          type: string
          title: Last Name of the user
        email:
          type: string
          title: Email id of the user
        roles:
          type: array
          items:
            $ref: '#/components/schemas/v2UniqueRoleProto'
          description: The user's roles. Includes nested roles. Flat list. Read only.
        workspaces:
          type: array
          items:
            $ref: '#/components/schemas/v2UniqueWorkspaceProto'
          title: Workspaces this user is assigned to
        location:
          type: string
          title: Location of the user
        enabledScopes:
          type: object
          additionalProperties:
            type: boolean
          description: Scopes and status (enable, disable) for a user. Scope is optional. Typically applications will always pass their scope, but it is optional for admin purposes.
        primarySite:
          type: string
          title: The primary site that the user is assigned to, the tenant_id of the site is inferred to be the same as the user
        selectedDepartments:
          type: array
          items:
            type: string
          title: The selected department that the user is assigned to, the tenant_id of the department is inferred to be the same as the user
        middleName:
          type: string
          title: Middle name of the user
        platformId:
          type: string
          title: Platform id of the user
        status:
          type: string
          title: Status of the user
        licenses:
          type: array
          items:
            $ref: '#/components/schemas/v2LicensesProto'
          title: 'This is used to fetch, users license details. Required: false'
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/v2UserAttributeProto'
          title: List of user specific attributes
        creationTime:
          type: string
          format: date-time
          title: Time of creation of user entity
        siteMapping:
          type: array
          items:
            $ref: '#/components/schemas/v2SiteMappingProto'
          title: 'Multi-Site mapping of the user. Required: false'
    v2SearchUsersResponse:
      type: object
      properties:
        users:
          type: array
          items:
            $ref: '#/components/schemas/v2SearchUserResponse'
          title: list of users found
        nextPageToken:
          type: string
          title: next page token
    v2SimpleDepartmentProto:
      type: object
      properties:
        tenantId:
          type: string
        departmentName:
          type: string
      description: |-
        Protobuf created to represent a Department.
        Using this name because UniqueDepartmentProto is already used for another use case.
    v2SiteFilter:
      type: object
      properties:
        tenantId:
          type: string
        siteName:
          type: string
    v2SiteMappingProto:
      type: object
      properties:
        siteName:
          type: string
          title: 'Site name of the site, Required: true'
        isPrimary:
          type: boolean
          title: 'Whether the site is primary or not, Required: false'
        defaultDepartments:
          type: array
          items:
            type: string
          title: 'Default departments for the particular site mapping validated against the site template, Required: false'
        defaultRoles:
          type: array
          items:
            $ref: '#/components/schemas/v2SiteMappingRoleProto'
          title: 'Default roles for the particular site mapping validated against the site template, Required: false'
        availableDepartments:
          type: array
          items:
            type: string
          title: 'Available departments for the particular site mapping validated against the site template, Required: false'
        availableRoles:
          type: array
          items:
            $ref: '#/components/schemas/v2SiteMappingRoleProto'
          title: 'Available roles for the particular site mapping validated against the site template, Required: false'
        persistentDepartments:
          type: array
          items:
            type: string
          title: |-
            Persistent departments for the particular site mapping validated against the site template, a department can only be persistent if it
            is also a default_department, Required: false
        persistentRoles:
          type: array
          items:
            $ref: '#/components/schemas/v2SiteMappingRoleProto'
          title: |-
            Persistent roles for the particular site mapping validated against the site template, a role can only be persistent if it
            is also a default_role, Required: false
      title: Site templates are linked to a site per the reserved site attribute key SITE_TEMPLATE
    v2SiteMappingResponseProto:
      type: object
      properties:
        site:
          $ref: '#/components/schemas/v2UniqueSiteProto'
        isPrimary:
          type: boolean
          title: 'Whether the site is primary or not, Required: false'
        defaultDepartments:
          type: array
          items:
            $ref: '#/components/schemas/v2SimpleDepartmentProto'
          title: 'Default departments for the particular site mapping validated against the site template, Required: false'
        defaultRoles:
          type: array
          items:
            $ref: '#/components/schemas/v2UniqueRoleProto'
          title: 'Default roles for the particular site mapping validated against the site template, Required: false'
        availableDepartments:
          type: array
          items:
            $ref: '#/components/schemas/v2SimpleDepartmentProto'
          title: 'Available departments for the particular site mapping validated against the site template, Required: false'
        availableRoles:
          type: array
          items:
            $ref: '#/components/schemas/v2UniqueRoleProto'
          title: 'Available roles for the particular site mapping validated against the site template, Required: false'
        persistentDepartments:
          type: array
          items:
            $ref: '#/components/schemas/v2SimpleDepartmentProto'
          title: |-
            Persistent departments for the particular site mapping validated against the site template, a department can only be persistent if it
            is also a default_department, Required: false
        persistentRoles:
          type: array
          items:
            $ref: '#/components/schemas/v2UniqueRoleProto'
          title: |-
            Persistent roles for the particular site mapping validated against the site template, a role can only be persistent if it
            is also a default_role, Required: false
      title: |-
        Site templates are linked to a site per the reserved site attribute key SITE_TEMPLATE
        This message is used to return the site mapping information with additional details to support GraphQL queries
    v2SiteMappingRoleProto:
      type: object
      properties:
        roleId:
          type: string
          title: 'roleId of the role. Required: true'
        scope:
          type: string
          title: 'scope of the role Required: true'
        domain:
          type: string
          title: 'domain of the role Required: true'
    v2SpecificFilter:
      type: object
      properties:
        userId:
          type: string
        firstName:
          type: string
        lastName:
          type: string
        email:
          type: string
        location:
          type: string
        workspaceType:
          type: string
          title: The workspace type of the Workspace entity
        workspaceName:
          type: string
          title: The workspace name of the Workspace entity
        licenseDomain:
          type: string
          title: The domain of the license
        selectedDepartments:
          type: array
          items:
            type: string
          title: The selected departments of the user
      title: This will create and AND criteria on the specific fields for any of the non-blank values
    v2SpecificFilterQueryTypes:
      type: string
      enum:
        - AND
        - OR
      default: AND
    v2SpecificSearchFilter:
      type: object
      properties:
        userId:
          type: string
          title: Optional - userId of the user to search
        firstName:
          type: string
          title: Optional - firstName of the user to search
        lastName:
          type: string
          title: Optional - lastName of the user to search
        email:
          type: string
          title: Optional - email of the user to search
        location:
          type: string
          title: Optional - location of user to search
        workspaceType:
          type: string
          title: Optional - The workspace type of the Workspace entity
        workspaceName:
          type: string
          title: Optional - The workspace name of the Workspace entity
        userAttributes:
          type: array
          items:
            $ref: '#/components/schemas/v2UserAttributeProto'
          title: |-
            Optional - user-attributes of the user to search
            As per http, fields which are mapped to URL query parameters must have a primitive type or a repeated primitive type or a non-repeated message type.
            Sending repeated message as part of the GET API does not work. Thus used in the POST API
        licenseDomain:
          type: string
          title: The domain of the license
        sites:
          type: array
          items:
            $ref: '#/components/schemas/v2SiteFilter'
          title: The sites the users belong to
        platformId:
          type: string
          title: Optional - The platformId of user to search
        primarySite:
          type: string
          title: Optional - The primary site of the user
        selectedDepartment:
          type: string
          description: Optional - The Selected Department of the user.
    v2StatusInScope:
      type: string
      enum:
        - ENABLED
        - DISABLED
        - ALL
      default: ENABLED
      description: |-
        - ENABLED: gets only enabled users
         - DISABLED: gets only disabled users
         - ALL: gets all users
      title: Enum for filtering users on ListUsers and ListUsersWithFilters given a specific scope
    v2TenantLookupRequest:
      type: object
      properties:
        email:
          type: string
          title: 'Email to search on the Global Lookup table. Required: true'
        lookupKey:
          type: string
          title: 'DEPRECATED: this field is no longer required or used. The secret to authenticate and look up. Required: false'
    v2TenantLookupResponse:
      type: object
      properties:
        tenantId:
          type: string
          title: The user's tenant
        operatingSetUrl:
          type: string
          title: A link to the home operating set for that tenant
    v2UniqueRoleProto:
      type: object
      properties:
        tenantId:
          type: string
          description: 'The ID of the tenant. Required: false. Defaults to the tenant of the user making the call.'
        domain:
          type: string
          description: |-
            The platform domain. Required: true. (e.g. ZPA, Reflexis, WFC)
            Defaults to the domain in the request.
        scope:
          type: string
          description: 'Some more general scoping for the data (like a particular app in the domain). Required: false.'
        roleId:
          type: string
          description: 'The role ID. Required: true.'
        userIds:
          type: array
          items:
            type: string
          title: 'The User Ids for the Unique Role Proto, Required: false'
    v2UniqueSiteProto:
      type: object
      properties:
        tenantId:
          type: string
          title: 'TenantId of the Site. Required: false'
        siteName:
          type: string
          title: 'Name of the Site. Required: true'
    v2UniqueWorkspaceProto:
      type: object
      properties:
        tenantId:
          type: string
          description: 'The ID of the tenant. Required: false. Defaults to the tenant of the user making the call.'
        name:
          type: string
          title: 'Name of the workspace, Required: true'
        workspaceType:
          type: string
          title: 'Workspace Type of the workspace, Required: true'
        userIds:
          type: array
          items:
            type: string
          title: 'The User Ids for the Unique Workspace Proto, Required: false'
    v2UnlicenseUsersRequest:
      type: object
      properties:
        tenantId:
          type: string
          title: 'The tenant to which all the users need to be unlicensed, Required: true'
        domains:
          type: array
          items:
            type: string
          title: |-
            The list of domains across the users which need to be unlicensed, Required: true
            When user_count is specified, exactly one domain must be provided
            When user_count is not specified, multiple domains are allowed
        userCount:
          type: integer
          format: int32
          title: |-
            Number of users to be unlicensed from the single specified domain, Required: false
            When provided, exactly one domain must be specified in the domains list
            When not provided, ALL users across all specified domains will be unlicensed
    v2UpdateLicensesRequest:
      type: object
      properties:
        tenantId:
          type: string
          description: 'The tenant_id of the user, whose license is being updated. Required: true.'
        userId:
          type: string
          description: 'The user_id of the user, whose license is being updated. Required: true.'
        licensedApps:
          type: array
          items:
            type: string
          title: 'licenses requested for the user by the tenant. Required: false'
        licenses:
          type: array
          items:
            $ref: '#/components/schemas/v2LicensesProto'
          title: 'licenses assigned to the user. Required: true'
        lastUpdated:
          type: string
          format: date-time
          title: 'Time of most recent licence update in user entity: Required: false'
        updateType:
          $ref: '#/components/schemas/v2UpdateType'
    v2UpdateType:
      type: string
      enum:
        - MERGE
        - OVERRIDE
      default: MERGE
      description: |-
        - MERGE: Merge new objects of the entities specified in the RPC with existing ones
         - OVERRIDE: Override all existing objects of the entities specified in the RPC with new ones
      title: Enum to specify the type of update operation
    v2UpdateUserProto:
      type: object
      properties:
        firstName:
          type: string
          title: 'Updated first name of the user, Required: false'
        lastName:
          type: string
          title: 'Updated last name of the user, Required: false'
        email:
          type: string
          title: 'Updated user email id of the user, Required: false'
        location:
          type: string
          title: 'Location of the user, Required: false'
        site:
          type: string
          title: 'DEPRECATED FIELD DO NOT USE. Site of the user (Tied to location), Required: false'
        departments:
          type: string
          title: 'DEPRECATED FIELD DO NOT USE. Comma-separated list of user''s departments, Required: false'
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/v2UserAttributeProto'
          title: 'updated user specific attributes, Required: false'
        workspacesWrapper:
          $ref: '#/components/schemas/v2WorkspacesWrapper'
        claims:
          type: object
          additionalProperties:
            type: string
          title: |-
            IDP use case: Upon successful authentication, the user is updated with the claims retrieved from the customer IDP.
            No other use case known. Required: false
        scope:
          type: string
          title: 'User scope to be updated, Required: false'
        addresses:
          type: array
          items:
            $ref: '#/components/schemas/v2AddressesProto'
          title: 'Addresses including: HOME, and OFFICE, Required: false'
        contactNumbers:
          type: array
          items:
            $ref: '#/components/schemas/v2ContactNumbersProto'
          title: 'Personal Contact Number including: HOME, OFFICE, and MOBILE, Required: false'
        isClient:
          type: boolean
          title: 'Identify user as client, Required: false, Default value: false'
        updateFieldMask:
          type: string
          title: |-
            FieldMask to control what fields are to be updated, Required: false
            Valid path names (first_name, last_name, email, location, site, departments, attributes, workspaces, scopes, addresses, contact_numbers, is_client, default_locale)
        primarySite:
          type: string
          title: 'The primary site that the user is assigned to, the tenantId of the site is inferred to be the same as the user, Required: false'
        selectedDepartments:
          type: array
          items:
            type: string
          title: 'The selected department that the user is assigned to, the tenantId of the department is inferred to be the same as the user, Required: false'
        siteMapping:
          type: array
          items:
            $ref: '#/components/schemas/v2SiteMappingProto'
          title: Multi-Site mapping of the user
      title: Protobuf made for user fields to update (only those fields which needs to be updated should be provided)
    v2UpdateUserScope:
      type: object
      properties:
        scopes:
          type: object
          additionalProperties:
            type: boolean
          title: 'Option to set the status of scopes, Required: false'
        autoRemoveWorkspaces:
          type: boolean
          title: 'Option to remove the user from connected workspaces upon disabling, Required: false, Default: false'
    v2UpdateUserStatusRequestStatus:
      type: string
      enum:
        - ONLINE
        - DND
        - OFFLINE
      default: ONLINE
    v2UpdateUsersProto:
      type: object
      properties:
        userId:
          type: string
          title: 'user_id of the user to be updated, Required: true'
        firstName:
          type: string
          title: 'First Name of the user, Required: false'
        lastName:
          type: string
          title: 'Last Name of the user, Required: false'
        email:
          type: string
          title: 'Email id of the user, Required: false'
        location:
          type: string
          title: 'Location of the user, Required: false'
        site:
          type: string
          title: 'DEPRECATED FIELD DO NOT USE. Site of the user (Tied to location), Required: false'
        departments:
          type: string
          title: 'DEPRECATED FIELD DO NOT USE. Comma-separated list of user''s departments, Required: false'
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/v2UserAttributeProto'
          title: 'List of user specific attributes, Required: false'
        workspacesWrapper:
          $ref: '#/components/schemas/v2WorkspacesWrapper'
        scope:
          type: string
          title: 'User scope to be updated, Required: false'
        addresses:
          type: array
          items:
            $ref: '#/components/schemas/v2AddressesProto'
          title: 'Addresses including: HOME, and OFFICE, Required: false'
        contactNumbers:
          type: array
          items:
            $ref: '#/components/schemas/v2ContactNumbersProto'
          title: 'Personal Contact Number including: HOME, OFFICE, and MOBILE, Required: false'
        isClient:
          type: boolean
          title: 'DEPRECATED: IS_CLIENT IS NOW IMMUTABLE Identify user as client, Required: false, Default value: false'
        defaultLocale:
          type: string
          title: 'The user''s default locale, Required: false'
        scopeOption:
          $ref: '#/components/schemas/v2UpdateUserScope'
        notificationPreferences:
          type: array
          items:
            $ref: '#/components/schemas/v2UserNotificationPreferencesProto'
          description: User notification preferences for different subsystems and scopes. If not present for a given subsystem/scope, it is assumed all notifications modes are enabled.
        updateFieldMask:
          type: string
          title: |-
            FieldMask to control what fields are to be updated, Required: false
            Valid path names (first_name, last_name, email, location, site, departments, attributes, workspaces, scopes, enabled_scopes (Used for clearing scopes), addresses, contact_numbers, is_client, default_locale, role)
        primarySite:
          type: string
          title: 'The primary site that the user is assigned to, the tenantId of the site is inferred to be the same as the user, Required: false'
        selectedDepartments:
          type: array
          items:
            type: string
          title: 'The selected department that the user is assigned to, the tenantId of the department is inferred to be the same as the user, Required: false'
        claims:
          type: object
          additionalProperties:
            type: string
          title: |-
            IDP use case: Upon successful authentication, the user is updated with the claims retrieved from the customer IDP.
            No other use case known. Required: false
        licenses:
          type: array
          items:
            $ref: '#/components/schemas/v2LicensesProto'
          title: 'This is used to update, users licence details. Required: false'
        middleName:
          type: string
          title: 'Middle Name of the user, Required: false'
        preferredName:
          type: string
          title: 'Preferred Name of the user, Required: false'
        siteMapping:
          type: array
          items:
            $ref: '#/components/schemas/v2SiteMappingProto'
          title: 'Multi-Site mapping of the user. Required: false'
        role:
          type: array
          items:
            $ref: '#/components/schemas/v2UniqueRoleProto'
          title: 'Unique Role(s) that can be added to a user upon creation, Required: False'
      title: Protobuf made for user fields to update (only those fields which needs to be updated should be provided)
    v2UpdateUsersRequest:
      type: object
      properties:
        tenantId:
          type: string
          title: 'tenant of the users for bulk update, Required: false'
        users:
          type: array
          items:
            $ref: '#/components/schemas/v2UpdateUsersProto'
          title: 'list of users to update (fields except user_id will be updated if different), Required: true'
    v2UpdateUsersStatusRequest:
      type: object
      properties:
        tenantId:
          type: string
          title: 'tenant of the user, Required: false'
        usersAndStatuses:
          type: array
          items:
            $ref: '#/components/schemas/v2UserAndStatus'
          title: 'list of users and their new status. Required: true'
    v2UserAndStatus:
      type: object
      properties:
        userId:
          type: string
          title: 'user_id of the user to get details, Required: true'
        status:
          $ref: '#/components/schemas/v2UserAndStatusStatus'
    v2UserAndStatusStatus:
      type: string
      enum:
        - ONLINE
        - DND
        - OFFLINE
      default: ONLINE
    v2UserAttributeProto:
      type: object
      properties:
        scope:
          type: string
          title: 'General scoping for user attribute, Required: true'
        fieldName:
          type: string
          title: 'Name of the attribute, Required: true'
        value:
          type: string
          title: 'Value of the attribute, Required: false'
        domain:
          type: string
          title: 'Domain of the user attribute, Required: false'
    v2UserIdentifierType:
      type: string
      enum:
        - USER_ID
        - PLATFORM_USER_ID
      default: USER_ID
      description: |2-
         - USER_ID: DEFAULT VALUE: Searches for user based on the user_id field.
         - PLATFORM_USER_ID: Searches for the user based on the phenixUserId field.
    v2UserNotificationPreferencesProto:
      type: object
      properties:
        scope:
          type: string
          title: Some general scoping for the subsystem
        subSystem:
          type: string
          title: Particular sub_system for notification (like an application)
        allowedTypes:
          type: array
          items:
            $ref: '#/components/schemas/v2NotificationTypes'
          description: Notification Types allowed for given sub_system and scope.
      title: The absence of this for a particular scope means "No Preferences", which means "Try to send ALL notification types"
    v2UserResponse:
      type: object
      properties:
        userId:
          type: string
          title: user_id of the user provided at the time of creation
        tenantId:
          type: string
          title: The id of the tenant to which user belongs
        firstName:
          type: string
          title: First Name of the user
        lastName:
          type: string
          title: Last Name of the user
        email:
          type: string
          title: Email id of the user
        location:
          type: string
          title: 'Location of the user, Required: false'
        site:
          type: string
          title: 'DEPRECATED FIELD DO NOT USE. Site of the user (Tied to location), Required: false'
        departments:
          type: string
          title: 'DEPRECATED FIELD DO NOT USE. Comma-separated list of user''s departments, Required: false'
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/v2UserAttributeProto'
          title: List of user specific attributes
        workspaces:
          type: array
          items:
            $ref: '#/components/schemas/v2UniqueWorkspaceProto'
          title: Workspaces this user is assigned to
        userStatus:
          type: string
          title: 'Status of the user (example: OFFLINE, ONLINE, INVITED). Default value set as OFFLINE when a user is created'
        creationTime:
          type: string
          format: date-time
          title: Time of creation of user entity
        lastUpdated:
          type: string
          format: date-time
          title: Time of most recent update in user entity
        batchId:
          type: string
          title: id of the batch if the user was loaded in the system via templated bulk import. Randomly generated string
        notificationPreferences:
          type: array
          items:
            $ref: '#/components/schemas/v2UserNotificationPreferencesProto'
          description: User notification preferences for different subsystems and scopes. If not present for a given subsystem/scope, it is assumed all notifications modes are enabled.
        contactNumber:
          type: string
          title: Contact number of the user
        uniqueUserId:
          type: string
          description: Randomly generated string at the time of creation. Should be used to reference a unique user by other services as user_id may contain PII.
        claims:
          type: object
          additionalProperties:
            type: string
          title: Claims returned by customer IDP
        enabledScopes:
          type: object
          additionalProperties:
            type: boolean
          description: Scopes and status (enable, disable) for a user. Scope is optional. Typically applications will always pass their scope, but it is optional for admin purposes.
        addresses:
          type: array
          items:
            $ref: '#/components/schemas/v2AddressesProto'
          title: 'Addresses including: HOME, and WORK'
        contactNumbers:
          type: array
          items:
            $ref: '#/components/schemas/v2ContactNumbersProto'
          title: 'Personal Contact Number including: HOME, WORK, and MOBILE'
        roles:
          type: array
          items:
            $ref: '#/components/schemas/v2UniqueRoleProto'
          description: The user's roles. Includes nested roles. Flat list. Read only.
        defaultLocale:
          type: string
          title: 'The user''s default locale, Required: false'
        primarySite:
          type: string
          title: The primary site that the user is assigned to, the tenant_id of the site is inferred to be the same as the user
        selectedDepartments:
          type: array
          items:
            type: string
          title: The selected department that the user is assigned to, the tenant_id of the department is inferred to be the same as the user
        licenses:
          type: array
          items:
            $ref: '#/components/schemas/v2LicensesProto'
          title: 'This is used to fetch, users license details. Required: false'
        middleName:
          type: string
          description: Middle name of the user.
        preferredName:
          type: string
          description: Preferred Name of the user.
        isClient:
          type: boolean
          title: is User is Client
        assignedRoles:
          type: array
          items:
            $ref: '#/components/schemas/v2UniqueRoleProto'
          title: List of roles that are directly assigned to user
        inheritedRoles:
          type: array
          items:
            $ref: '#/components/schemas/v2UniqueRoleProto'
          title: List of roles that user has via inheritance from directly assigned roles/workspaces
        siteMapping:
          type: array
          items:
            $ref: '#/components/schemas/v2SiteMappingResponseProto'
          title: Multi-Site mapping of the user
        primarySelectedDepartments:
          type: array
          items:
            $ref: '#/components/schemas/v2SimpleDepartmentProto'
          description: |-
            The selected departments that the user is assigned to. This is to support UI for getting the details part of the graphQL query.
            In V3, we can remove the existing selected_departments field and use this one instead.
        userStatusLastUpdated:
          type: string
          format: date-time
          title: When the status of the user was last updated
      title: Main User data model
    v2UserStatus:
      type: string
      enum:
        - NONE
        - DISABLE
        - ENABLE
      default: NONE
    v2UserStatusResponse:
      type: object
      properties:
        userId:
          type: string
          title: the user id
        userStatus:
          type: string
          description: 'Status of the user (example: OFFLINE, ONLINE, INVITED).'
        lastUpdated:
          type: string
          format: date-time
          title: Time of most recent update
    v2UsersCursorResponse:
      type: object
      properties:
        users:
          type: array
          items:
            $ref: '#/components/schemas/v2UserResponse'
          title: list of users for the given tenant
        nextPageToken:
          type: string
          title: next page token
    v2UsersRequest:
      type: object
      properties:
        tenantId:
          type: string
          title: 'tenant of the users for bulk upload, Required: false'
        users:
          type: array
          items:
            $ref: '#/components/schemas/v2BulkCreateUserProto'
          title: 'list of users to upload, Required: true'
        rollback:
          type: boolean
          title: flag to check for rolling back DB transactions
    v2UsersResponse:
      type: object
      properties:
        users:
          type: array
          items:
            $ref: '#/components/schemas/v2UserResponse'
          title: list of users for the given tenant
    v2UsersStatusResponse:
      type: object
      properties:
        tenantId:
          type: string
          title: the tenant id
        statuses:
          type: array
          items:
            $ref: '#/components/schemas/v2UserStatusResponse'
          title: the current status values
    v2WorkspacesWrapper:
      type: object
      properties:
        workspaces:
          type: array
          items:
            $ref: '#/components/schemas/v2UniqueWorkspaceProto'
          description: |-
            Workspaces this user is assigned to. Required: false
            Note: The tenant_id of any item is ignored. The tenant_id from the enclosing request will be used.
  securitySchemes:
    Authorization:
      type: apiKey
      description: Bearer token
      name: Authorization
      in: header
