> ## Documentation Index
> Fetch the complete documentation index at: https://docs.metriport.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Search Destinations

> Find routable destinations for sending a message to another practitioner.

<Snippet file="in-construction.mdx" />

Returns a list of destinations you can pass to [Send Message](/medical-api/api-reference/message/send-message)
when addressing a message to another practitioner.

Metriport searches across available recipient data sources and returns only destinations your account
can use. Results are ordered by Metriport's recommended preference for your organization.

<Tip>
  This is the recommended endpoint for building the message
  body for Message Delivery. See the [Message Delivery
  guide](/medical-api/getting-started/message-delivery#finding-a-destination)
  for the full send flow.
</Tip>

## Body

#### Search by NPI

<ParamField body="npi" type="string">
  A 10-digit National Provider Identifier.
</ParamField>

#### Search by destination

<ParamField body="destination" type="string">
  Organization OID or Direct address.
</ParamField>

#### Search by organization details or provider demographics

<Warning>
  When searching by organization details or provider
  demographics, at least `lastName` and `address.state` or
  `organizationName` are required
</Warning>

<ParamField body="organizationName" type="string">
  The name of the organization or medical facility.
</ParamField>

<ParamField body="firstName" type="string">
  The provider's first name.
</ParamField>

<ParamField body="lastName" type="string">
  The provider's last name.
</ParamField>

<ParamField body="address" type="Address">
  An `Address` object, representing the practitioner's
  current and/or previous addresses.

  <Snippet file="address-optional.mdx" />
</ParamField>

## Response

<ResponseField name="destinations" type="Destination[]" required>
  Results for the potentially matching recipients, ordered by Metriport's recommended preference for your
  account.

  <Expandable title="Destination properties">
    <ResponseField name="organizationName" type="string" required>
      Display name for the recipient (for example, an organization or practitioner name).
    </ResponseField>

    <ResponseField name="address" type="Address" required>
      An address to help disambiguate matches.

      <Snippet file="address.mdx" />
    </ResponseField>

    <ResponseField name="destination" type="string" required>
      An OID or a Direct email address. Use this as `destination` on [Send Message](/medical-api/api-reference/message/send-message).
    </ResponseField>

    <ResponseField name="npi" type="string">
      The NPI associated with this destination, when available.
    </ResponseField>
  </Expandable>
</ResponseField>

```json theme={null}
{
  "destinations": [
    {
      "organizationName": "UCLA Cardiology",
      "address": {
        "addressLine1": "100 Medical Plaza",
        "addressLine2": "Suite 630",
        "city": "Los Angeles",
        "state": "CA",
        "zip": "90095",
        "country": "USA"
      },
      "destination": "1.2.840.114350.1.13.300.3.7.3.688884.100.1",
      "npi": "1234567890"
    },
    {
      "organizationName": "UCLA Cardiology",
      "address": {
        "addressLine1": "100 Medical Plaza",
        "addressLine2": "Suite 630",
        "city": "Los Angeles",
        "state": "CA",
        "zip": "90095",
        "country": "USA"
      },
      "destination": "intake@cardio.direct.partner.com",
      "npi": "1234567890"
    }
  ]
}
```

<ResponseExample>
  ```javascript Metriport SDK theme={null}
  import {
    MetriportMedicalApi,
    USState,
  } from "@metriport/api-sdk";

  const metriport = new MetriportMedicalApi("YOUR_API_KEY");

  const { destinations } = await metriport.searchDestinations(
    {
      firstName: "Jack",
      lastName: "Smith",
      address: {
        city: "Los Angeles",
        state: "CA",
        zip: "90095",
      },
    }
  );
  ```
</ResponseExample>

## Rate Limits

See [limits and throttling](/medical-api/more-info/limits#rate-limits)
