---
title: "Get accounts"
method: GET
path: "/v1/accounts"
tags: ["Accounts"]
---

# Get accounts

`GET /v1/accounts`

## Request

- Base URL: `https://app.aptrinsic.com`
- URL: `https://app.aptrinsic.com/v1/accounts`
- Auth: none declared
- TypeScript: <https://skmtc.dev/gainsight/apis/gainsight-px-rest-api/docs/v1/accounts/get.ts> (a function with typed inputs; its response is checked against the schema)

Retrieves accounts.  Supports filtering, sorting and paging.
### Filtering
The filter parameter accepts a list of semicolon-separated filters in the form: {fieldName}{operator}{fieldValue}
Filter terms within a single filter parameter are joined by a logical AND. 
Separate filter parameters are joined by a logical OR.
#### Operators
| Operator   | Meaning  |
| ----- | -------- |
| == | Exact match |
| != | Not equal |
| &lt;  | Less than |
| &lt;= | Less than or equal |
| &gt;  | Greater than |
| &gt;= | Greater than or equal |
| ~  | Matches string, supports wildcard characters * and ? |
| !~ | Not like, supports wildcard characters * and ? |

Examples: 

| URI   | Results  |
| ----- | -------- |
| GET /v1/accounts?filter=sicCode==64;numberOfEmployees>25 | Accounts with sicCode of 64 and more than 25 employees. |
| GET /v1/accounts?filter=sicCode==64;numberOfEmployees>25&filter=sicCode==63;numberOfEmployees>3000 | Accounts with: (sicCode of 64 AND more than 25 employees) OR (sicCode of 63 AND more than 3000 employees). |
| GET /v1/accounts?filter=location.cityName==Portland | Accounts with a city of 'Portland'. |
| GET /v1/accounts?filter=customAttributes.internalId==12345 | Accounts with a custom attribute of internalId equal to 12345'. |


### Sorting
The sort parameter accepts a list of semi-colon separated fields names, each with an optional dash to imply descending sort order.
Examples: 

| URI   | Results  |
| ----- | -------- |
| GET /v1/accounts?sort=name;location.stateCode | Accounts sorted by name and state code in ascending order. |
| GET /v1/accounts?sort=-createDate | Accounts sorted by createDate in descending order. |

## Query parameters

- `filter` string[]
- `pageSize` integer
- `scrollId` string
- `sort` string

## Response `200`

Success

- AccountsPage
  - `accounts` Account[]: Array of accounts
    - `id` string, required
    - `name` string, required
    - `trackedSubscriptionId` string
    - `sfdcId` string
    - `lastSeenDate` integer
    - `dunsNumber` string
    - `industry` string
    - `numberOfEmployees` integer
    - `sicCode` string
    - `website` string
    - `naicsCode` string
    - `plan` string
    - `location` Location: Location object
      - `countryName` string
      - `countryCode` string: See ISO 3166
      - `stateName` string
      - `stateCode` string: See ISO 3166
      - `city` string
      - `street` string
      - `postalCode` string
      - `continent` string: See ISO 3166
      - `regionName` string: See ISO 3166-2
      - `timeZone` string
      - `coordinates` Coordinates: Coordinates object
        - `latitude` number, double
        - `longitude` number, double
    - `numberOfUsers` integer: Number of users
    - `propertyKeys` string[], required: Aptrinsic Tag Key, at least one is required
    - `createDate` integer
    - `lastModifiedDate` integer
    - `customAttributes` object: Map of apiName to value
    - `parentGroupId` string: Id to group Accounts together
    - `renewalDate` integer
    - `healthScore` integer
    - `gsId` string
    - `nps` number, float
    - `csm` string
  - `totalHits` integer: Total number of records matching filters
  - `scrollId` string: If passed on subsequent requests as the scrollId parameter, will fetch the next page

## Other responses

- `400`: Bad request
- `401`: Unauthorized or bad API Key
- `429`: Rate limit exceeded

---

[API](https://skmtc.dev/gainsight/apis/gainsight-px-rest-api.md) - [All operations](https://skmtc.dev/gainsight/apis/gainsight-px-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/gainsight/apis/gainsight-px-rest-api/revisions/e7b197b373d8?raw)
