
# Get a directory

`GET /v1/directories/{directory_id}` · permission `directories:read`

Returns one SCIM directory with its open mass deprovision hold (`null` when none). A hold opens when one sync would deprovision too many users at once; approve or reject it with the `deprovision-holds` endpoints. The tokens' metadata is listed by `GET /v1/directories/{directory_id}/tokens`.

## Request

| Field | Type | Required | Description |
|---|---|---|---|
| `directory_id` | path | yes | SCIM directory ID (`dir_…`). |

There is no request body.

## Response

`200 OK` with the directory and its `ETag` (the `If-Match` value for `PATCH /v1/directories/{directory_id}`).

```json
{
  "id": "dir_01j9xm2n4p6q8r0s2t4v6w8y0z",
  "organization_id": "org_01j9xk3m7q8r2s4t6v8w0y2z4a",
  "type": "scim",
  "name": "Okta",
  "state": "inactive",
  "base_url": "https://acme.eu.keenauth.app/scim/v2/dir_01j9xm2n4p6q8r0s2t4v6w8y0z",
  "created_at": "2026-10-19T09:31:00.123456Z",
  "last_request_at": null,
  "provisioning_mode": "user_store",
  "attribute_allowlist": [],
  "unverified_domain_action": "invite",
  "delete_action": "remove_membership",
  "on_delete_memberships": "keep",
  "mass_deprovision_guard": {"enabled": true, "percent": 10, "absolute_min": 25},
  "send_welcome_email": false,
  "open_deprovision_hold": {
    "id": "0192a3c0-1d2e-7f3a-8b4c-5d6e7f8a9b0c",
    "opened_at": "2026-10-19T10:02:00Z",
    "pending_count": 42
  }
}
```

## Errors

| HTTP | code | When |
|---|---|---|
| 404 | `not_found` | The directory does not exist in this environment. |
| 401 | `unauthenticated` | The credential is missing, invalid or revoked. |
| 403 | `insufficient_permissions` | The credential lacks the required permission. |
| 429 | `rate_limited` | The rate limit was exceeded; retry after the `Retry-After` period. |
| 503 | `service_unavailable` | Directory sync is temporarily unavailable or not configured in this deployment; retry after the `Retry-After` period. |

## Example

```bash
curl -i "https://api.eu.keenauth.com/v1/directories/dir_01j9xm2n4p6q8r0s2t4v6w8y0z" \
  -H "Authorization: Bearer $KEENAUTH_SECRET_KEY"
```
