# Get a list of master and investment accounts

Use the method described below to get a list of master and investment accounts created on the B2COPY investment platform.

<mark style="color:green;">`GET`</mark> `[host]/api/v2/b2copy/accounts`

## Request

**Headers**

`Authorization: Bearer <access_token>`

To get the access token, use the method to [authorize in the Back Office](https://docs.b2copy.b2broker.com/api-documentation/authorization-in-the-back-office).

**Body**

**‍**In the request body, specify the following parameters:

<table><thead><tr><th width="261">Name</th><th width="103">Type</th><th width="103">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>investmentPlatformId</code></td><td>integer</td><td>Yes</td><td><p>The identifier of the investment platform instance.</p><ul><li>If only one MT server is connected to your B2COPY investment platform, specify 1.</li><li>If you have more than one MT server connected to your B2COPY investment platform, contact the Support team for assistance.</li></ul></td></tr><tr><td><code>account_number</code></td><td>string</td><td>No</td><td>Specify the MT login (number) of a master or investment account to get data about a specific account.</td></tr><tr><td><code>email</code></td><td>string</td><td>No</td><td>Specify the client email address to get data about accounts of a specific client.</td></tr><tr><td><code>is_master</code></td><td>boolean</td><td>No</td><td>If <strong>true</strong>, only master accounts are returned.<br>If <strong>false</strong>, only investment accounts are returned.</td></tr><tr><td><code>limit</code></td><td>integer</td><td>No</td><td>Specify this parameter to define the maximum number of items that may be returned in a response.</td></tr><tr><td><code>offset</code></td><td>integer</td><td>No</td><td>Specify this parameter to exclude from a response the first N items of a resource collection.</td></tr><tr><td><code>sort_by</code></td><td>string</td><td>No</td><td>Sorts the items in the response by a specified parameter. Possible value:<br>- <strong>created_at</strong> – the date and time when a master or investment account was created.</td></tr><tr><td><code>sort_order</code></td><td>string</td><td>No</td><td>Sorts the items in the response in a specified order. Possible values:<br>- <strong>asc</strong> – the ascending order<br>- <strong>desc</strong> – the descending order</td></tr></tbody></table>

**Request example**

```sh
curl --location --request GET 'https://host.name/api/v2/b2copy/accounts' \
--header 'Authorization: Bearer <accesss_token>' \
--data-raw '{
    "investment_platform_id": 1,
    "account_number": "2121944013",
    "email": "username@bexample.com",
    "is_master": true,
    "limit": 100,
    "offset": 0,
    "sort_by": "created_at",
    "sort_order": "asc"
}'
```

## **Response**

The response includes an array of objects providing information about master and investment accounts matching the request parameters.

**Response example**

```json
{
    "firstName": "John",
    "lastName": "Smith",
    "email": "username@example.com",
    "account_id": "2121944013",
    "group": "demo_standalone",
    "account_type": "master",
    "createdAt": "2024-02-09T10:32:47.000000Z"
}
```
