# List accounts

Retrieves a paginated list of accounts in the organization associated with the authenticated user.

Endpoint: GET /v2/accounts
Version: v2
Security: x-api-key

## Security:

  - `x-api-key` (unknown)
    apiKey in header x-api-key

## Query parameters:

  - `search` (string)

  - `sortBy` (string)

  - `sortOrder` (string)

  - `page` (integer)

  - `pageSize` (integer)

## Response 200:

  - `200` (unknown)
    Successful response containing a paginated list of accounts.

## Response 200 fields (application/json):

  - `requestId` (string)
    Unique identifier for the request.
    Example: b0eac937-c25c-47a5-bb7e-552f6b860458

  - `status` (string)
    Indicates the status of the request.
    Example: success

  - `data` (object)
    The paginated list of accounts.

  - `data.items` (array)
    Accounts returned for the current page.

  - `data.items.id` (integer)
    Unique identifier for the account.
    Example: 123456

  - `data.items.name` (string)
    Display name of the account.
    Example: ACME, Inc.

  - `data.items.isSelfManaged` (boolean)
    Whether the account manages usage and billing independently of the organization.
    Example: false

  - `data.items.managedBy` (object)
    User responsible for managing the resource.

  - `data.items.managedBy.id` (integer)
    Unique identifier for the user.
    Example: 123456

  - `data.items.managedBy.name` (string)
    Full name of the user.
    Example: Anna Lytics

  - `data.pagination` (object)
    Pagination details for the response.

  - `data.pagination.page` (integer)
    The zero-based page number returned.
    Example: 0

  - `data.pagination.pageSize` (integer)
    The maximum number of items included per page.
    Example: 100

  - `data.pagination.totalItems` (integer)
    The total number of items across all pages.
    Example: 1000

## Response 400:

  - `400` (unknown)
    Error response indicating one or more request parameters are invalid.

## Response 400 fields (application/json):

  - `requestId` (string)
    Unique identifier for the request.
    Example: b0eac937-c25c-47a5-bb7e-552f6b860458

  - `status` (string)
    Indicates the status of the request.
    Example: error

  - `errors` (array)
    Errors that occurred while processing the request.

  - `errors.code` (string)
    Machine-readable error code that identifies the type of error.
    Example: invalid_input

  - `errors.message` (string)
    Human-readable description of the error, including the underlying validation message when available.
    Example: The provided parameter is invalid.

  - `errors.field` (string)
    Name of the request field associated with the error, if applicable.
    Example: name

  - `errors.type` (string)
    Category or context of the error, such as validation or permission.
    Example: validation

## Response 401:

  - `401` (unknown)
    Error response indicating that the API key is missing or invalid.

## Response 401 fields (application/json):

  - `requestId` (string)
    Unique identifier for the request.
    Example: b0eac937-c25c-47a5-bb7e-552f6b860458

  - `status` (string)
    Indicates the status of the request.
    Example: error

  - `errors` (array)
    Errors that occurred while processing the request.

  - `errors.code` (string)
    Machine-readable error code that identifies the type of error.
    Example: invalid_input

  - `errors.message` (string)
    Human-readable description of the error, including the underlying validation message when available.
    Example: The provided parameter is invalid.

  - `errors.field` (string)
    Name of the request field associated with the error, if applicable.
    Example: name

  - `errors.type` (string)
    Category or context of the error, such as validation or permission.
    Example: validation

