jira.js
    Preparing search index...

    Function searchDirectoryUsers

    • Return a page of users in an organization that match the supplied parameters.

      Use searchTerm for free-text search across user display names and email addresses. Use emails for exact-match filtering by full email addresses. searchTerm and emails are mutually exclusive. Providing both in the same request returns 400 Bad Request. Use the expand field to include additional fields such as platformRoles, counts.resources, productAccess, and groups in the response.

      Parameters

      • client: Client
      • parameters: {
            accountIds?: string[];
            accountStatus?: ("active" | "inactive" | "closed" | string & {})[];
            claimStatus?: string & {} | "managed" | "unmanaged";
            cursor?: string;
            directoryId: string;
            directoryIds?: string[];
            emailDomains?: string[];
            emails?: string[];
            expand?: (
                | "groups"
                | string & {}
                | "platformRoles"
                | "productAccess"
                | "counts.resources"
            )[];
            groupIds?: string[];
            limit?: number;
            membershipStatus?: ("active" | "suspended" | string & {} | "no_membership")[];
            mfaEnabled?: boolean;
            orgId: string;
            resourceIds?: string[];
            roleIds?: (
                | string & {}
                | "atlassian/org-admin"
                | "atlassian/site-admin"
                | "atlassian/user-access-admin"
                | "atlassian/ai-access"
                | "atlassian/user"
                | "atlassian/admin"
                | "atlassian/guest"
                | "atlassian/customer"
                | "atlassian/contributor"
                | "atlassian/basic"
                | "atlassian/stakeholder"
            )[];
            searchTerm?: string;
            sortBy?: {
                direction: "desc"
                | string & {}
                | "asc";
                field: string & {} | "nick_name";
                [key: string]: unknown;
            }[];
            status?: (
                | "active"
                | "suspended"
                | string & {}
                | "not_invited"
                | "deactivated"
                | "for_deletion"
            )[];
        }
        • OptionalaccountIds?: string[]

          A list of user account IDs.

        • OptionalaccountStatus?: ("active" | "inactive" | "closed" | string & {})[]

          The lifecycle status of the account.

          • active - The account is active and can be used.
          • inactive - The account is inactive and doesn't have access to any resources.
          • closed - The account is closed and can't be used.
        • OptionalclaimStatus?: string & {} | "managed" | "unmanaged"

          The claim status for the user account. By default, both managed and unmanaged accounts are returned.

        • Optionalcursor?: string

          Sets the starting point for the page of results to return.

        • directoryId: string

          Unique ID associated with a directory. The - character can be used to increase the operation scope to all directories the requestor has permission to manage.

        • OptionaldirectoryIds?: string[]

          A list of directory IDs. The requestor must have permissions to administer resources linked to these directories.

        • OptionalemailDomains?: string[]

          The email domain to filter the results. The email domain will be used to search against the account email domain. For example, get all users with the @atlassian.com or @example.com email domain.

        • Optionalemails?: string[]

          List of full email addresses to filter by. Only exact matches are returned.

          Mutually exclusive with searchTerm — providing both returns a 400 Bad Request error.

        • Optionalexpand?: (
              | "groups"
              | string & {}
              | "platformRoles"
              | "productAccess"
              | "counts.resources"
          )[]

          List of additional fields to include in the response. Available values:

          • platformRoles – the user's organization-level admin role assignments (for example, org admin, site admin, or unit admin).
          • counts.resources – the number of resources the user has access to.
          • productAccess – the user's last active timestamp for each product in the given directory.
          • groups – the user's group memberships within the requested directory (id, name, description).
        • OptionalgroupIds?: string[]

          A list of group IDs.

        • Optionallimit?: number

          The number of results to return per page. Defaults to 50.

        • OptionalmembershipStatus?: ("active" | "suspended" | string & {} | "no_membership")[]

          A list of membership statuses. The membership status is the status of the user account in the organization.

          • active - the account has an active membership for one or more directories within the organization.
          • suspended - the account is suspended in ALL directories within the organization, to which the requestor has permission to access.
          • no_membership - the account is in NONE of the organization’s directories.
        • OptionalmfaEnabled?: boolean

          Whether or not a managed account has two-step verification enabled on their account. If true, they have two-step verification enabled. By default, all accounts are returned, regardless of two-step verification status.

        • orgId: string

          Your organization has a unique ID. Find this ID in your Atlassian Administration URL or when you create your API key.

        • OptionalresourceIds?: string[]

          A list of resource IDs. The resource IDs should be specified using the Atlassian Resource Identifier (ARI) format. Example ARI: ari:cloud:jira-core::site/1

        • OptionalroleIds?: (
              | string & {}
              | "atlassian/org-admin"
              | "atlassian/site-admin"
              | "atlassian/user-access-admin"
              | "atlassian/ai-access"
              | "atlassian/user"
              | "atlassian/admin"
              | "atlassian/guest"
              | "atlassian/customer"
              | "atlassian/contributor"
              | "atlassian/basic"
              | "atlassian/stakeholder"
          )[]

          A list of role IDs. The Atlassian canonical roles are used to determine the permissions of the user against resources within the organization. The allowed roles are:

          • atlassian/user - Can access the product, with no product admin permissions
          • atlassian/admin - Can access the product, with product admin permissions
          • atlassian/guest - Can only access one space you or space admins specify
          • atlassian/customer - (Jira Service Management) Can visit help center, submit help requests, and view articles (non-billable)
          • atlassian/user-access-admin - No product access. Can administer users and groups for this product in Atlassian Administration
          • atlassian/contributor - Can access the product to view, comment, and vote only (non-billable)
          • atlassian/basic - Can access basic product features, with no product admin permissions (non-billable)
          • atlassian/stakeholder - Can receive incident updates and has the same product access as Customer. Non-billable but available only on Premium and Enterprise plans
          • atlassian/org-admin - An organization admin is the highest level of admin and can complete any administrative task in Atlassian Administration
          • atlassian/site-admin - Site admins can access Atlassian Administration and complete tasks related to the specific site they are administering.
          • atlassian/ai-access - Can use AI features in AI-enabled apps they have access to.
        • OptionalsearchTerm?: string

          Free-text search term matched against display names and email addresses.

          Mutually exclusive with emails — providing both returns a 400 Bad Request error.

        • OptionalsortBy?: {
              direction: "desc" | string & {} | "asc";
              field: string & {} | "nick_name";
              [key: string]: unknown;
          }[]

          The field and direction to sort the results by. Currently, only a single field can be sorted by. If null, the default sorting will be used.

        • Optionalstatus?: (
              | "active"
              | "suspended"
              | string & {}
              | "not_invited"
              | "deactivated"
              | "for_deletion"
          )[]

          The status for the user account. This status is a composite of accountStatus and membershipStatus.

          • active - accountStatus is active and membershipStatus is active.
          • suspended - accountStatus is active and membershipStatus is suspended.
          • not_invited - accountStatus is active and membershipStatus is no_membership.
          • deactivated - accountStatus is inactive.
          • for_deletion - Indicates whether or not a managed account is scheduled for deletion.
      • Optionaloptions: RequestOptions

      Returns Promise<
          {
              data: {
                  accountId?: string;
                  accountStatus?: "active"
                  | "inactive"
                  | "closed"
                  | string & {};
                  accountType?: string & {} | "atlassian";
                  addedToOrg?: string;
                  avatar?: string;
                  claimStatus?: string & {} | "managed" | "unmanaged";
                  counts?: { resources?: number; [key: string]: unknown };
                  deactivatedOn?: string;
                  department?: string | null;
                  email?: string;
                  emailVerified?: boolean;
                  forDeletion?: boolean;
                  groups?: {
                      description?: string | null;
                      id?: string;
                      name?: string | null;
                      [key: string]: unknown;
                  }[];
                  jobTitle?: string;
                  links?: { self?: string
                  | null; [key: string]: unknown };
                  location?: string | null;
                  managementSource?: string & {} | "synced" | "invited" | null;
                  membershipStatus?: "active" | "suspended" | string & {} | "no_membership";
                  mfaEnabled?: boolean;
                  name?: string;
                  nickname?: string;
                  organization?: string | null;
                  picture?: string;
                  platformRoles?: (
                      | string & {}
                      | "atlassian/org-admin"
                      | "atlassian/site-admin"
                      | "atlassian/user-access-admin"
                      | "atlassian/ai-access"
                  )[];
                  productAccess?: {
                      id?: string;
                      key?: string;
                      lastActiveTimestamp?: Date;
                      [key: string]: unknown;
                  }[];
                  status?: | "active"
                  | "suspended"
                  | string & {}
                  | "not_invited"
                  | "deactivated"
                  | "for_deletion";
                  timeZone?: string
                  | null;
                  [key: string]: unknown;
              }[];
              links?: {
                  next?: string
                  | null;
                  prev?: string | null;
                  self?: string | null;
                  [key: string]: unknown;
              };
              [key: string]: unknown;
          },
      >