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

# List users

## Query

<ParamField query="role" type="enum" />

<ParamField query="workspace_id" type="string" />

<ParamField query="cohort_id" type="string">Restrict to users enrolled in a cohort.</ParamField>
<ParamField query="email" type="string">Exact-match lookup.</ParamField>

<ParamField query="limit" type="integer" default="20" />

<ParamField query="starting_after" type="string" />

## Examples

<CodeGroup>
  ```ts TypeScript theme={null}
  const teachers = await hk.users.list({ role: "teacher" });
  const cohort   = await hk.users.list({ cohort_id: "coh_123" });
  ```

  ```php PHP theme={null}
  $teachers = $hk->users->list(['role' => 'teacher']);
  $cohort   = $hk->users->list(['cohort_id' => 'coh_123']);
  ```
</CodeGroup>

## Returns

A paginated list of [User](/api-reference/users/object)s.
