---
title: "Update Active Directory"
method: PATCH
path: "/activedirectories/{id}"
tags: ["Active Directory"]
---

# Update Active Directory

`PATCH /activedirectories/{id}`

## Request

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

This endpoint allows you to update Active Directory.
Here use case can be one of:
- AD as Authority - password in AD - 2-way sync use case is selected.
- JC as Authority - one-way sync from AD.
- Two way sync -  2-way sync use case is selected


#### Sample Request
```
curl -X PATCH https://console.jumpcloud.com/api/v2/activedirectories/{Domain_ID} \
  -H 'accept: application/json' \
  -H 'content-type: application/json' \
  -H 'x-api-key: {API_KEY}' \
  -d '{
        "domain": "{DC=DOMAIN;DC=COM}",
        "use_case": "{ADASAUTHORITY}",
        "delegation_state": "{ENABLED}"
    }' \
```

## Headers

- `x-org-id` string

## Request body

- ActiveDirectory
  - `domain` string: Domain name for this Active Directory instance.
  - `id` string: ObjectID of this Active Directory instance.
  - `useCase` 'UNSET' | 'TWOWAYSYNC' | 'JCASAUTHORITY' | 'ADASAUTHORITY'
  - `groupsEnabled` boolean
  - `delegationState` 'ENABLED' | 'PENDING' | 'DISABLED': Delegation state of the Active Directory instance
  - `primaryAgent` string: ObjectID of the primary sync agent of domain.
  - `primaryImportAgent` string: ObjectID of the primary import agent of domain.
  - `updatedAt` string, date-time, nullable
  - `permission` 'PERMISSION_UNSPECIFIED' | 'PERMISSION_OWNER' | 'PERMISSION_READ_ONLY': Permission level for the Active Directory domain.
  - `organizationId` string: ObjectID of the organization that owns this Active Directory instance.
  - `associatedOrganizationIds` string[]: Organization object ids (hex) where this Active Directory integration is associated among the caller's authorized organizations.

## Response `200`

- ActiveDirectory
  - `domain` string: Domain name for this Active Directory instance.
  - `id` string: ObjectID of this Active Directory instance.
  - `useCase` 'UNSET' | 'TWOWAYSYNC' | 'JCASAUTHORITY' | 'ADASAUTHORITY'
  - `groupsEnabled` boolean
  - `delegationState` 'ENABLED' | 'PENDING' | 'DISABLED': Delegation state of the Active Directory instance
  - `primaryAgent` string: ObjectID of the primary sync agent of domain.
  - `primaryImportAgent` string: ObjectID of the primary import agent of domain.
  - `updatedAt` string, date-time, nullable
  - `permission` 'PERMISSION_UNSPECIFIED' | 'PERMISSION_OWNER' | 'PERMISSION_READ_ONLY': Permission level for the Active Directory domain.
  - `organizationId` string: ObjectID of the organization that owns this Active Directory instance.
  - `associatedOrganizationIds` string[]: Organization object ids (hex) where this Active Directory integration is associated among the caller's authorized organizations.

---

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