> For the complete documentation index, see [llms.txt](https://docs.xyb.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xyb.co/xyb-platform-1/accounts/account-operations-apis/retrieve-all-accounts.md).

# Retrieve all Accounts

Use this endpoint to query accounts with structured filters such as ID, reference, name, or status. Ideal for paginated listings or dashboards where precise field-based querying is required.

## GET /api/v2.0/account

> Query accounts

```json
{"openapi":"3.0.3","info":{"title":"Account Service","version":"0.18.1-bb9ff03"},"paths":{"/api/v2.0/account":{"get":{"tags":["AccountController"],"description":"Query accounts","operationId":"AccountController::queryAccounts","parameters":[{"name":"filter","in":"query","required":false,"schema":{"type":"string"}},{"name":"page[size]","in":"query","required":false,"schema":{"type":"string"}},{"name":"page[number]","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response to /api/v2.0/account","content":{"application/json":{"schema":{"type":"object","properties":{"record_count":{"type":"integer","description":"The total number of records in the dataset. The record count may return zero if there are no records in the dataset."},"page_number":{"type":"integer","description":"The number of the page within the complete dataset. This is indexed from 1."},"page":{"type":"array","items":{"$ref":"#/components/schemas/cac_account_schema_account_lite"},"description":"A list of the records included in the page. The length of the list may be zero; it SHOULD NOT exceed the quoted page size."},"continuation":{"type":"string"},"page_count":{"type":"integer","description":"The largest page number that yield an empty page. The page count may return zero if there are no records in the dataset."},"page_size":{"type":"integer","description":"The size of page that was requested (or defaulted). This is the maximum number of records that will be returned in the page."}},"required":["page_number","page_size","page"]}}}}}}}},"components":{"schemas":{"cac_account_schema_account_lite":{"type":"object","properties":{"attributes":{"type":"object","additionalProperties":{"type":"string"},"description":"A collection of account attributes."},"created_at":{"type":"string","format":"date-time","description":"The time at which the account was created in the XYB system."},"id":{"type":"string","format":"uuid","description":"A globally unique identifier for the account, generated on creation."},"name":{"type":"string","description":"Customer defined name of the account."},"product_uuid":{"type":"string","format":"uuid","description":"Product UUID of the account"},"product_version":{"type":"string","description":"Product Version of the account"},"reference":{"type":"string","description":"A globally unique identifier for the account."},"status":{"type":"string","enum":["PENDING","OPEN","SUSPENDED","SUSPENDED_OUT","SUSPENDED_IN","CLOSED","TERMINATED","BLOCKED"],"description":"Account status"},"updated_at":{"type":"string","format":"date-time","description":"The time at which the account was created in the XYB system."}},"required":["id","reference","product_uuid","product_version","name","status","created_at","updated_at"],"title":"AccountLite"}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.xyb.co/xyb-platform-1/accounts/account-operations-apis/retrieve-all-accounts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
