# tenants

Audience: Developer

**Served by:** [management](https://docs.pyck.cloud/api/services/management.md)

## Arguments

| Name | Type | Description |
| --- | --- | --- |
| `after` | [Cursor](https://docs.pyck.cloud/api/scalars/cursor.md) | Returns the elements in the list that come after the specified cursor. |
| `first` | Int | Returns the first _n_ elements from the list. |
| `before` | [Cursor](https://docs.pyck.cloud/api/scalars/cursor.md) | Returns the elements in the list that come before the specified cursor. |
| `last` | Int | Returns the last _n_ elements from the list. |
| `orderBy` | [TenantOrder](https://docs.pyck.cloud/api/inputs/tenantorder.md) | Ordering options for Tenants returned from the connection. |
| `where` | [TenantWhereInput](https://docs.pyck.cloud/api/inputs/tenantwhereinput.md) | Filtering options for Tenants returned from the connection. |

## Returns

[TenantConnection](https://docs.pyck.cloud/api/types/tenantconnection.md)!

## Example

Lists tenants with pagination. Requires admin privileges.

```graphql
query GetTenants($after: Cursor, $first: Int, $before: Cursor, $last: Int, $orderBy: TenantOrder, $where: TenantWhereInput) {
  tenants(after: $after, first: $first, before: $before, last: $last, orderBy: $orderBy, where: $where) {
    totalCount
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
    edges {
      cursor
      node {
        createdAt
        createdBy
        data
        dataTypeID
        dataTypeSlug
        deletedAt
        deletedBy
        expiresAt
        id
        idpOrgRef
        name
        status
        updatedAt
        updatedBy
      }
    }
  }
}
```

**Variables**

```json
{
  "first": 10
}
```
