---
title: "List All Directories"
method: GET
path: "/api/v2/directories"
tags: ["Directories"]
---

# List All Directories

`GET /api/v2/directories`

## Request

- Base URL: `https://console.jumpcloud.com`
- URL: `https://console.jumpcloud.com/api/v2/directories`
- Auth: API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/jumpcloud/apis/jumpcloud-console-api/docs/api/v2/directories/get.ts> (a function with typed inputs; its response is checked against the schema)

This endpoint returns all active directories (LDAP, O365 Suite, G-Suite).

#### Sample Request
```
 curl -X GET https://console.jumpcloud.com/api/v2/directories \
  -H 'accept: application/json' \
  -H 'content-type: application/json' \
  -H 'x-api-key: {API_KEY}'
```

#### Filter by organizationId
Supported filter field: `organizationId`. Supported operators: `eq`, `in`.

```
 curl -X GET 'https://console.jumpcloud.com/api/v2/directories?filter=organizationId:eq:{ORG_ID}' \
  -H 'accept: application/json' \
  -H 'content-type: application/json' \
  -H 'x-api-key: {API_KEY}'
```

## Query parameters

- `fields` string[]
- `filter` string[]
- `limit` integer
- `sort` string[]
- `skip` integer

## Headers

- `x-org-id` string

## Response `200`

OK

- Directory[]
  - `id` string, required: The ObjectID of the directory.
  - `name` string, required: The name of the directory.
  - `type` 'active_directory' | 'g_suite' | 'ldap_server' | 'office_365' | 'workday', required: The type of directory.
  - `oAuthStatus` object, nullable: the expiry and error status of the bearer token
  - `defaultDomain` object, nullable: The default domain object if exists, contains id and name of the domain.
    - `id` string
    - `domain` string
  - `organizationId` string: ObjectID of the organization that owns this directory.
  - `associatedOrganizationIds` string[]: Organization object ids (hex) where this G Suite integration is associated among the caller's authorized organizations.

## Other responses

- `default`: Unexpected error

---

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