> ## Documentation Index
> Fetch the complete documentation index at: https://www.plain.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Get accounts

> Fetch accounts by ID or external ID, or as a paginated collection.

There are three ways to fetch accounts:

* [Get accounts](#get-accounts) to fetch more than one account at a time.
* [Get account by ID](#get-account-by-id)
* [Search for accounts](#search-for-accounts)

<Snippet file="graphql/sdk-note.mdx" />

These operations require the following permissions:

* `tenant:read`

## Get accounts

Our API allows you to fetch accounts as a collection using the `accounts` query in GraphQL. This endpoint supports [Pagination](https://www.plain.com/docs/graphql/pagination.md).

<Snippet file="graphql/get-accounts.mdx" />

## Get account by ID

If you know the account's ID in Plain you can use this method to fetch the account. Prefer [upsert](https://www.plain.com/docs/graphql/accounts/upsert.md) when you have the full details of the account.

<Snippet file="graphql/get-account-by-id.mdx" />

## Search for accounts

The `searchAccounts` query lets you do a case-insensitive partial match on an account's name as well as an exact match on its external ID. The search term must be at least 2 characters long.

<Snippet file="graphql/search-accounts.mdx" />


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.