---
title: "List teams as admin"
method: POST
path: "/unstable/admin/teams/query"
tags: ["admin"]
---

# List teams as admin

`POST /unstable/admin/teams/query`

## Request

- Base URL: `https://api.e2b.app`
- URL: `https://api.e2b.app/unstable/admin/teams/query`
- Auth: one of:
  - API key in header `X-Admin-Token`
  - HTTP bearer

Lists teams matching the filters in the request body, with each team's
member count, and its running sandbox count when sorted by running
sandboxes. A read despite the POST: the body carries a project ID list
too long for a query string.

## Request body

- AdminTeamListRequest
  - `projectIds` string[]: Only list these teams. An empty list matches no team; omit it to list every team.
  - `search` string: A team ID, as a UUID or public project ID, matches that team exactly. Any other text matches a substring of the email, name or slug, ignoring case.
  - `hideBanned` boolean: Leave out banned teams
  - `hideBlocked` boolean: Leave out blocked teams
  - `createdAfter` string, date-time: Only list teams created at or after this time
  - `createdBefore` string, date-time: Only list teams created at or before this time
  - `sortBy` 'name' | 'email' | 'createdAt' | 'runningSandboxes': Column to order by, with newer teams first among equal values. Omit it to list the newest teams first.
  - `sortOrder` 'asc' | 'desc': Sort direction
  - `limit` integer: Maximum number of teams to return
  - `offset` integer: Number of matching teams to skip

## Response `200`

The page of matching teams and the number of all matching teams

- AdminTeamList
  - `items` AdminTeamListItem[], required
    - `id` string, uuid, required
    - `email` string, required
    - `name` string, required
    - `isBanned` boolean, required
    - `isBlocked` boolean, required
    - `createdAt` string, date-time, required
    - `memberCount` integer, required: Number of users in the team
    - `runningSandboxCount` integer: Running sandboxes from the same cached snapshot as `GET /admin/sandboxes/running-counts`. Present only when the list is sorted by `runningSandboxes`.
  - `total` integer, required: Number of teams matching the filters, ignoring limit and offset

## Other responses

- `400`: Bad request
- `401`: Authentication error
- `429`: Too many requests
- `500`: Server error

## Changes

- **2026-10-26** `99fccbc60e6d`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/e2b-dev/apis/e2b-api/changes/unstable/admin/teams/query/post.md)

---

[API](https://skmtc.dev/e2b-dev/apis/e2b-api.md) - [All operations](https://skmtc.dev/e2b-dev/apis/e2b-api/llms.txt) - [OpenAPI document](https://skmtc.dev/e2b-dev/apis/e2b-api/revisions/99fccbc60e6d?raw)
