> ## Documentation Index
> Fetch the complete documentation index at: https://plain-docs-orca-916-agent-docs-restructure.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get tenants

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

There are three ways to fetch tenants:

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

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

These operations require the following permissions:

* `tenant:read`

## Get tenants

Our API allows you to fetch tenants as a collection using the `tenants` query in GraphQL. This endpoint supports [Pagination](/graphql/pagination).

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

## Get tenant by ID

If you know the tenant's ID in Plain you can use this method to fetch the tenant. Prefer [upsert](./upsert) when you have the full details of the tenant.

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

## Search for tenants

The `searchTenants` query lets you do a case-insensitive partial match on a tenant'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-tenants.mdx" />
