> For the complete documentation index, see [llms.txt](https://docs.udara360.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.udara360.io/udara360-docs-1/account/editor/get-accounts-by-phonenumber.md).

# Get Accounts By PhoneNumber

To retrieve accounts linked to a phone number, make a GET request to this endpoint, passing the phone number as the `PhoneNumber` query parameter.

A successful request returns a list of accounts under `data`, each including the `accountNumber`, `accountName`, `accountType`, and the account holder's `firstName` and `lastName`, along with a `recordCount` showing how many accounts were found.

This process allows you to look up every account tied to a customer's phone number in a single call.

<mark style="color:blue;">`GET`</mark> `/api/account/v1/GetAccountsByPhoneNumber`

**Headers**

| Name                                                | Value                |
| --------------------------------------------------- | -------------------- |
| Content-Type<mark style="color:red;">\*</mark>      | `application/json`   |
| Authorization<mark style="color:red;">\*</mark>     | `bearer <token>`     |
| Request-reference<mark style="color:red;">\*</mark> | `{unique_reference}` |

**Params**

| Name          | Data Type (Length) | Required | Description                            |
| ------------- | ------------------ | -------- | -------------------------------------- |
| `PhoneNumber` | string             | Required | The phone number to search accounts by |

**Body**

| Name            | Data Type | Description                      |
| --------------- | --------- | -------------------------------- |
| `accountNumber` | string    | The account number               |
| `customerID`    | string    | Unique ID of the customer        |
| `accountName`   | string    | Name on the account              |
| `accountType`   | string    | Type of account                  |
| `accountStatus` | string    | Current status of the account    |
| `firstName`     | string    | Customer's first name            |
| `lastName`      | string    | Customer's last name             |
| `otherNames`    | string    | Customer's other names           |
| `address`       | string    | Customer's residential address   |
| `email`         | string    | Customer's email address         |
| `recordCount`   | number    | Total number of accounts matched |

**Sample API Request**

{% tabs %}
{% tab title="Curl" %}

```javascript
curl --location -g '{{baseurl}}/api/account/v1/GetAccountsByPhoneNumber?PhoneNumber={{PhoneNumber}}' \
--header 'Authorization: bearer {token}' \
--header 'request-reference: {unique_reference}' \
--header 'Content-Type: application/json' \
--data ''
```

{% endtab %}
{% endtabs %}

**Response**

{% tabs %}
{% tab title="json" %}
{% code overflow="wrap" expandable="true" %}

```javascript
{
  "status": true,
  "message": "string",
  "data": {
    "data": [
      {
        "accountNumber": "string",
        "customerID": "string",
        "accountName": "string",
        "accountType": "string",
        "accountStatus": "string",
        "firstName": "Adebayo",
        "lastName": "Olufemi",
        "otherNames": "Emmanuel",
        "address": "XYZ Acme road",
        "email": "xyz@gmail.com"
      }
    ],
    "recordCount": 0
  }
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% hint style="info" %}
&#x20;`data.data` is an array, it returns one entry per account linked to the phone number. `recordCount` shows the total number of accounts matched.
{% endhint %}
