---
title: "Search Contacts in Directory"
method: POST
path: "/programs/{programCode}/directory/search"
tags: ["TokenManagement"]
---

# Search Contacts in Directory

`POST /programs/{programCode}/directory/search`

Searches for contacts in the P2P directory using the provided search criteria.

## Path parameters

- `programCode` string, required

## Headers

- `X-GD-RequestId` string, required

## Request body

- DirectorySearchRequest
  - `searchcriteria` string, nullable — The search criteria could be a name, token name, phone number or email.

## Response `200`

OK

- DirectorySearchResponse — Represents the response returned after performing a directory search. Contains an array of contacts with external resource and identifier details. Inherits standard response metadata from Gd.Bos.DataTransfer.Response.ResponseBase.
  - `contacts` DirectorySearchResponseDTO[], nullable — The array of contacts returned by the directory search. Each contact includes external resource and identifier details.
    - `externalresource` string, nullable — An external resource identifier or context related to the contact.
    - `identifier` IdentifierDirectorySearchResponse — Represents identifier details for a contact in a directory search response. Contains token name, user names, contact info, account and payment instrument identifiers, and additional metadata.
      - `tokenname` string, nullable — The token name associated with the contact.
      - `firstname` string, nullable — The first name of the contact.
      - `lastname` string, nullable — The last name of the contact.
      - `phone` string, nullable — The phone number of the contact.
      - `email` string, nullable — The email address of the contact.
      - `nickname` string, nullable — The nickname assigned to the contact.
      - `programCode` string, nullable — The program code associated with the contact.
      - `consumerProfileDirectoryKey` integer, nullable — The unique directory key for the consumer profile associated with the contact.
      - `paymentInstrumentIdentifier` string, uuid, nullable — The unique identifier for the payment instrument associated with the contact.
      - `accountIdentifier` string, uuid, nullable — The unique identifier for the account associated with the contact.
  - `responseDetails` ResponseDetail[], nullable — Required: A list of response details providing status codes, descriptions, and additional information about the result of the operation.
    - `code` integer — The primary status or error code for the response (e.g., 200 for success, 400 for validation error).
    - `subCode` integer, nullable — An optional subcode providing more granular detail about the response or error.
    - `description` string, nullable — A human-readable description of the response, error, or status.
    - `url` string, nullable — A URL linking to documentation or a web page with more information about the response code.

## Other responses

- `401` — Unauthorized
- `403` — Forbidden
- `500` — Internal Server Error
- `503` — Service Unavailable

---

[API](https://skmtc.net/greendot/apis/baas-apis.md) · [All operations](https://skmtc.net/greendot/apis/baas-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/greendot/baas-apis/versions/666553766b78/schema)
