---
title: "Search Company Directory Entries"
method: POST
path: "/restapi/v1.0/account/{accountId}/directory/entries/search"
tags: ["Internal Contacts"]
---

# Search Company Directory Entries

`POST /restapi/v1.0/account/{accountId}/directory/entries/search`

## Request

- Base URL: `https://platform.ringcentral.com`
- URL: `https://platform.ringcentral.com/restapi/v1.0/account/{accountId}/directory/entries/search`
- Auth: OAuth 2
  - Authorization code: `https://platform.ringcentral.com/restapi/oauth/authorize`
  - Token URL: `https://platform.ringcentral.com/restapi/oauth/token`
- TypeScript: <https://skmtc.dev/ringcentral/apis/ringcentral-api/docs/restapi/v1.0/account/:accountId/directory/entries/search/post.ts> (a function with typed inputs; its response is checked against the schema)

Returns contact information on corporate users of federated accounts according to the specified filtering and ordering.

## Path parameters

- `accountId` string, required

## Query parameters

- `accountId` string
- `department` string
- `siteId` string
- `extensionStatus` string
- `extensionType` 'User' | 'Department' | 'Announcement' | 'Voicemail' | 'DigitalUser' | 'VirtualUser' | 'FaxUser' | 'PagingOnly' | 'SharedLinesGroup' | 'IvrMenu' | 'ApplicationExtension' | 'ParkLocation' | 'Limited' | 'Bot' | 'Site' | 'Room' | 'ProxyAdmin' | 'DelegatedLinesGroup' | 'FlexibleUser' | 'GroupCallPickup' | 'RoomConnector': Type of extension to filter the contacts

## Request body

- SearchDirectoryEntriesRequest
  - `searchString` string: String value to filter the contacts. The value specified is searched through the following fields: `firstName`, `lastName`, `extensionNumber`, `phoneNumber`, `email`, `jobTitle`, `department`, `customFieldValue`
  - `searchFields` string[]: The list of field to be searched for
  - `showFederated` boolean: If `true` then contacts of all accounts in federation are returned, if it is in federation, account section will be returned. If `false` then only contacts of the current account are returned, and account section is eliminated in this case
  - `showAdminOnlyContacts` boolean: Should show AdminOnly Contacts
  - `extensionType` 'User' | 'Department' | 'Announcement' | 'Voicemail' | 'SharedLinesGroup' | 'PagingOnly' | 'ParkLocation' | 'IvrMenu' | 'Limited' | 'ApplicationExtension' | 'Site' | 'Bot' | 'Room' | 'DelegatedLinesGroup' | 'GroupCallPickup' | 'External': Type of directory contact to filter
  - `siteId` string: Internal identifier of the business site to which extensions belong
  - `showExternalContacts` boolean: Allows to control whether External (Hybrid) contacts should be returned in the response or not
  - `accountIds` string[]: The list of Internal identifiers of an accounts
  - `department` string: Department
  - `siteIds` string[]: The list of Internal identifiers of the business sites to which extensions belong
  - `extensionStatuses` string[]: Extension current state.
  - `extensionTypes` SearchDirectoryExtensionType[]: Types of extension to filter the contacts
  - `orderBy` OrderBy[]: Sorting settings
    - `index` integer: Sorting priority index, starting from '1'. Optional if only one element in `orderBy` array is specified
    - `fieldName` 'firstName' | 'lastName' | 'extensionNumber' | 'phoneNumber' | 'email' | 'jobTitle' | 'department': Field name by which to sort the contacts
    - `direction` 'Asc' | 'Desc': Sorting direction
  - `page` integer
  - `perPage` integer

## Response `200`

Paged collection of all contacts information for a given account according to filtering and ordering. Records can be empty if no data found

- DirectoryResource
  - `paging` EnumeratedPagingModel, required
    - `perPage` integer, required: Current page size, describes how many items are in each page. Matches "perPage" parameter from the request.
    - `page` integer: The current page number. 1-indexed, so the first page is 1 by default. May be omitted if result is empty (because non-existent page was specified or perPage=0 was requested)
    - `pageStart` integer: The zero-based number of the first element on the current page. Omitted if the page is omitted or result is empty
    - `pageEnd` integer: The zero-based index of the last element on the current page. Omitted if the page is omitted or result is empty
    - `totalPages` integer: The total number of pages in a dataset. May be omitted for some resources due to performance reasons
    - `totalElements` integer: The total number of elements in a dataset. May be omitted for some resource due to performance reasons
  - `records` ContactResource[], required
    - `id` string, required: Contact extension identifier
    - `type` 'User' | 'Department' | 'Announcement' | 'Voicemail' | 'SharedLinesGroup' | 'PagingOnly' | 'ParkLocation' | 'IvrMenu' | 'Limited' | 'ApplicationExtension' | 'Site' | 'Bot' | 'Room' | 'ProxyAdmin' | 'DelegatedLinesGroup' | 'GroupCallPickup' | 'External' | 'RoomConnector' | 'Unknown': Contact type
    - `status` 'Enabled' | 'Disabled' | 'Frozen' | 'NotActivated' | 'Unassigned' | 'Unknown': Contact status
    - `account` AccountResource
      - `companyName` string
      - `federatedName` string
      - `id` string, required
      - `mainNumber` PhoneNumberResource
        - `formattedPhoneNumber` string
        - `phoneNumber` string
        - `type` string
        - `label` string: Custom user name of a phone number, if any
        - `usageType` 'MobileNumber' | 'ContactNumber' | 'DirectNumber' | 'ForwardedNumber': Usage type of phone number
        - `hidden` boolean: Specifies if a phone number should be hidden or not
        - `primary` boolean: Specifies if the number is primary, i.e. displayed as 'main number' and called by default
    - `department` string
    - `email` string, email
    - `extensionNumber` string
    - `firstName` string: First name of a contact, for user extensions only
    - `lastName` string: Last name of a contact, for user extensions only
    - `name` string: Name of a contact, for non-user extensions
    - `jobTitle` string
    - `phoneNumbers` PhoneNumberResource[]
      - `formattedPhoneNumber` string
      - `phoneNumber` string
      - `type` string
      - `label` string: Custom user name of a phone number, if any
      - `usageType` 'MobileNumber' | 'ContactNumber' | 'DirectNumber' | 'ForwardedNumber': Usage type of phone number
      - `hidden` boolean: Specifies if a phone number should be hidden or not
      - `primary` boolean: Specifies if the number is primary, i.e. displayed as 'main number' and called by default
    - `profileImage` AccountDirectoryProfileImageResource
      - `etag` string
      - `uri` string, uri
    - `site` BusinessSiteResource
      - `id` string
      - `name` string
      - `code` string
    - `hidden` boolean
    - `role` DirectoryRoleResource
      - `id` string, required
      - `name` string
      - `domain` string
      - `displayName` string
    - `callQueues` CallQueueResource[]
      - `id` string
      - `name` string
    - `customFields` CustomFieldResource[]
      - `id` string
      - `name` string
      - `value` string
    - `groups` GroupResource[]
      - `id` string
      - `name` string
    - `costCenter` CostCenterResource
      - `id` string
      - `code` string
      - `name` string
    - `integration` ExternalIntegrationResource
      - `id` string
      - `typeId` string
      - `type` string
      - `displayName` string
      - `routingType` string
      - `outboundEdgeId` string
    - `subType` 'Unknown' | 'VideoPro' | 'VideoProPlus' | 'DigitalSignage' | 'Emergency': Extension subtype

## Other responses

- `400`: Current request cannot be processed due to error in its body and/or url
- `500`: Some unexpected error during current request processing.
- `503`: Network error during request

---

[API](https://skmtc.dev/ringcentral/apis/ringcentral-api.md) - [All operations](https://skmtc.dev/ringcentral/apis/ringcentral-api/llms.txt) - [OpenAPI document](https://skmtc.dev/ringcentral/apis/ringcentral-api/revisions/8d602198ec97?raw)
