---
title: Azure Active Directory
slug: connectors/azure-active-directory
docTags: 
createdAt: 2026-06-09T16:30:10.799Z
---

Azure Active Directory is a cloud-based identity and access management service that helps organizations secure access to applications and resources.

Azure Active Directory (Azure AD) is a comprehensive identity and access management cloud solution that provides a robust set of capabilities to manage users and groups. This connector allows Swimlane Turbine users to automate identity workflows, manage user accounts, and enforce Conditional Access policies seamlessly. By integrating Azure AD with Swimlane Turbine, security teams can enhance their identity management processes, streamline user provisioning and deprovisioning, and ensure compliance with organizational security policies.

## Prerequisites

Before you can use the Azure Active Directory connector for Turbine, you'll need access to the Azure AD API. This requires the following:

- OAuth 2.0 Client Credentials authentication using the following parameters:
  - URL: The endpoint for accessing Azure AD services.
  - Client ID: The unique identifier for your application registered in Azure AD.
  - Client Secret: A secret key used to authenticate your application.
  - Token URL: The URL to obtain an access token for Azure AD.
  - Scope: The permissions required for accessing Azure AD resources.

## Asset Setup

### Client Credential Flow Authentication

Authentication uses Azure application OAuth2.  You will need an admin account in Azure to create the application.

Recommended Application Permissions (feel free use custom permissions if you only use
certain actions):

- User.ReadWrite.All
- Directory.ReadWrite.All
- Directory.AccessAsUser.All
- User.ReadBasic.All
- Directory.Read.All
- User.ManageIdentities.All
- User.EnableDisableAccount.All

For Conditional Access actions (List CA Policies, Update CA Policy State, Create Named Location), the following Microsoft Graph application permissions are required:

- Policy.Read.All (required for List Conditional Access Policies)
- Policy.ReadWrite.ConditionalAccess (required for Update Conditional Access Policy State and Create Named Location)
- Application.Read.All (required when policies reference applications by ID)

In order to set up the asset, you need the following:

- Azure Application Client ID
- Azure Application Client Secret
- Azure Tenant ID

Steps to create the Azure app:

1. Go to the [App Registration page](https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade)
   in the Azure portal.
2. Click **New Registration**.
3. Enter a name for your new application and choose **Accounts in this organizational directory only**,
   then click **Register** at the bottom.
4. Navigate to the **API permissions** tab on the left navigation menu.
5. Select **Add a permission**.
6. Select **Microsoft Graph**.
7. Select **Application permissions**, then mark all the permissions you need for the
   actions you are using (See suggested permissions at the top of the asset setup section).
8. Click the **Add permissions** button at the bottom of the page.
9. Select **Grant admin consent** for your organization, then your permissions should look as below.
10. Navigate to the **Certificates & secrets** tab and select **New client secret**.
11. Fill out the description and expiration, then click the **Add** button at the bottom.
12. The **Value** of the secret you just created is the **Client Secret** needed for the Swimlane asset.
13. Navigate to the **Overview** tab on the left menu.
14. The **Client ID** and **Tenant ID** needed in the asset are shown on this page.

The **Client ID**, **Tenant ID**, and **Client Secret** described in the steps above are the credentials you
need for the asset.

## Notes:

- For more information refer to API documentation - [API Document](https://learn.microsoft.com/en-us/graph/api/resources/user?view=graph-rest-1.0)
- [Query Parameters Documentation - OData V4](https://docs.microsoft.com/en-us/graph/query-parameters)
- For more information about the use of ConsistencyLevel and $count, see [Advanced query capabilities on directory objects](https://learn.microsoft.com/en-us/graph/aad-advanced-queries?tabs=http)

### Conditional Access References

- [List Conditional Access policies](https://learn.microsoft.com/en-us/graph/api/conditionalaccessroot-list-policies?view=graph-rest-1.0)
- [Update conditionalAccessPolicy](https://learn.microsoft.com/en-us/graph/api/conditionalaccesspolicy-update?view=graph-rest-1.0)
- [Create namedLocation](https://learn.microsoft.com/en-us/graph/api/conditionalaccessroot-post-namedlocations?view=graph-rest-1.0)

# Configurations

## Oauth 2.0 Client Credentials

Authenticates using oauth 2.0 client credentials

### Configuration Parameters

| **Parameter**  | **Description**                                                                                                                                                               | **Type** | **Required** |
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------------ |
| url            | A URL to the target host.                                                                                                                                                     | string   | Required     |
| token\_url     | Must start with [https://login.microsoftonline.com/](https://login.microsoftonline.com/) and then continue with the tenant\_id, and then be prepended with /oauth2/v2.0/token | string   | Required     |
| client\_id     | The client ID                                                                                                                                                                 | string   | Required     |
| client\_secret | The client secret.                                                                                                                                                            | string   | Required     |
| scope          | List of permission scopes for this action.                                                                                                                                    | array    | Required     |
| verify\_ssl    | Verify SSL certificate                                                                                                                                                        | boolean  | Optional     |
| http\_proxy    | A proxy to route requests through.                                                                                                                                            | string   | Optional     |

# Actions

## Create Named Location

Create an IP or country-based named location in Azure Active Directory for Conditional Access policies, requiring @odata.type and displayName.

### Endpoint

- **URL:** `/v1.0/identity/conditionalAccess/namedLocations`
- **Method:** `POST`

### Input

| **Argument Name**                   | **Type** | **Required** | **Description**                                                                                                                                                                                                                                                         |
| ----------------------------------- | -------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `@odata.type`                       | string   | Optional     | The named location type. Use `#microsoft.graph.ipNamedLocation` for an IP-based location or `#microsoft.graph.countryNamedLocation` for a country-based location.                                                                                                       |
| `displayName`                       | string   | Optional     | Human-readable name of the named location.                                                                                                                                                                                                                              |
| `isTrusted`                         | boolean  | Optional     | For IP named locations, indicates whether the location is trusted. Only applicable when `@odata.type` is `#microsoft.graph.ipNamedLocation`.                                                                                                                            |
| `ipRanges`                          | array    | Optional     | List of IP address ranges in IPv4 or IPv6 CIDR format. Only applicable when `@odata.type` is `#microsoft.graph.ipNamedLocation`. Each range must include `@odata.type` (e.g. `#microsoft.graph.iPv4CidrRange` or `#microsoft.graph.iPv6CidrRange`) and a `cidrAddress`. |
| `ipRanges.@odata.type`              | string   | Optional     | Response data                                                                                                                                                                                                                                                           |
| `ipRanges.cidrAddress`              | string   | Optional     | Unique identifier                                                                                                                                                                                                                                                       |
| `countriesAndRegions`               | array    | Optional     | List of two-letter country codes (ISO 3166-1 alpha-2). Only applicable when `@odata.type` is `#microsoft.graph.countryNamedLocation`.                                                                                                                                   |
| `includeUnknownCountriesAndRegions` | boolean  | Optional     | Whether IP addresses that don't map to a country or region should be included in the named location. Only applicable when `@odata.type` is `#microsoft.graph.countryNamedLocation`.                                                                                     |
| `countryLookupMethod`               | string   | Optional     | Determines what method is used to decide which country the user is located in. Possible values are `clientIpAddress` and `authenticatorAppGps`. Only applicable when `@odata.type` is `#microsoft.graph.countryNamedLocation`.                                          |

### Input Example

`{"json_body":{"@odata.type":"#microsoft.graph.ipNamedLocation","displayName":"Untrusted Named Location","isTrusted":false,"ipRanges":[{"@odata.type":"#microsoft.graph.iPv4CidrRange","cidrAddress":"192.168.1.1/32"},{"@odata.type":"#microsoft.graph.iPv6CidrRange","cidrAddress":"2001:0:0:0:0:0:0:0/128"}]}}`

### Output

| **Parameter**                        | **Type** | **Description**                        |
| ------------------------------------ | -------- | -------------------------------------- |
| `status_code`                        | number   | HTTP status code of the response       |
| `reason`                             | string   | Response reason phrase                 |
| `response_text`                      | object   | Output field: response\_text           |
| `response_text.@odata.context`       | string   | Response data                          |
| `response_text.@odata.type`          | string   | Response data                          |
| `response_text.id`                   | string   | Unique identifier                      |
| `response_text.displayName`          | string   | Name of the resource                   |
| `response_text.createdDateTime`      | string   | Time value                             |
| `response_text.modifiedDateTime`     | string   | Time value                             |
| `response_text.isTrusted`            | boolean  | Output field: response\_text.isTrusted |
| `response_text.ipRanges`             | array    | Output field: response\_text.ipRanges  |
| `response_text.ipRanges.@odata.type` | string   | Response data                          |
| `response_text.ipRanges.cidrAddress` | string   | Unique identifier                      |

### Output Example

`{"status_code":201,"response_headers":{"Date":"Wed, 23 Aug 2023 14:02:55 GMT","Content-Type":"application/json; charset=utf-8","Cache-Control":"private","Strict-Transport-Security":"max-age=31536000"},"reason":"Created","response_text":{"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#identity/conditionalAccess/namedLocat...","@odata.type":"#microsoft.graph.ipNamedLocation","id":"7ba6a2b3-1d3a-4d6f-8a91-9b2bd9f1c6e8","displayName":"Untrusted Named Location","modifiedDateTime":"2024-0...`

## Create User

Create a new user object in Azure Active Directory with all necessary attributes.

### Endpoint

- **URL:** `/v1.0/users`
- **Method:** `POST`

### Input

| **Argument Name**                                      | **Type** | **Required** | **Description**           |
| ------------------------------------------------------ | -------- | ------------ | ------------------------- |
| `accountEnabled`                                       | boolean  | Optional     | Parameter for Create User |
| `displayName`                                          | string   | Optional     | Name of the resource      |
| `onPremisesImmutableId`                                | string   | Optional     | Unique identifier         |
| `mailNickname`                                         | string   | Optional     | Name of the resource      |
| `userPrincipalName`                                    | string   | Optional     | Name of the resource      |
| `passwordProfile`                                      | object   | Optional     | Parameter for Create User |
| `passwordProfile.forceChangePasswordNextSignIn`        | boolean  | Optional     | Parameter for Create User |
| `passwordProfile.forceChangePasswordNextSignInWithMfa` | boolean  | Optional     | Parameter for Create User |
| `passwordProfile.password`                             | string   | Optional     | Parameter for Create User |

### Input Example

`{"json_body":{"accountEnabled":false,"displayName":"Adele Vance","onPremisesImmutableId":"Adele","mailNickname":"AdeleV","userPrincipalName":"AdeleV@contoso.onmicrosoft.com","passwordProfile":{"forceChangePasswordNextSignIn":false,"forceChangePasswordNextSignInWithMfa":false,"password":"xWwvJ]6NMw+bWH-d"}}}`

### Output

| **Parameter**   | **Type** | **Description**                  |
| --------------- | -------- | -------------------------------- |
| `status_code`   | number   | HTTP status code of the response |
| `reason`        | string   | Response reason phrase           |
| `response_text` | string   | Output field: response\_text     |

### Output Example

`{"status_code":200,"response_headers":{"Date":"Fri, 18 Aug 2023 11:21:47 GMT","Content-Type":"text/html; charset=utf-8","Content-Length":"16586","Connection":"keep-alive","Cache-Control":"public, stale-while-revalidate=900, max-age=900","Content-Encoding":"gzip","Expires":"Fri, 18 Aug 2023 11:13:00 GMT","Last-Modified":"Fri, 18 Aug 2023 10:55:00 GMT","ETag":"\"Q5cbyW9tOsWs\"","Vary":"Accept-Encoding, host","x-content-type-options":"nosniff","X-XSS-Protection":"1; mode=block","x-ms-version":"12.4...`

## Delete User

Remove a user from Azure Active Directory using their unique ID. Requires the user's ID as a path parameter.

### Endpoint

- **URL:** `/v1.0/users/{{id}}`
- **Method:** `DELETE`

### Input

| **Argument Name**    | **Type** | **Required** | **Description**                       |
| -------------------- | -------- | ------------ | ------------------------------------- |
| `path_parameters.id` | string   | Required     | Parameters for the Delete User action |

### Input Example

`{"path_parameters":{"id":"abc123"}}`

### Output

| **Parameter**   | **Type** | **Description**                  |
| --------------- | -------- | -------------------------------- |
| `status_code`   | number   | HTTP status code of the response |
| `reason`        | string   | Response reason phrase           |
| `response_text` | string   | Output field: response\_text     |

### Output Example

`{"status_code":200,"response_headers":{"Date":"Wed, 23 Aug 2023 14:02:55 GMT","Content-Type":"text/html; charset=UTF-8","Content-Length":"999","Connection":"keep-alive","Cache-Control":"private","Content-Encoding":"gzip","Vary":"Accept-Encoding","x-content-type-options":"nosniff","X-XSS-Protection":"1; mode=block","x-ms-version":"12.43.4.1 (v12.42.0.1#162d343f82.230814-2250) Signed","Strict-Transport-Security":"max-age=31536000; includeSubDomains","X-UA-Compatible":"IE=edge","X-Frame-Options":"S...`

## Get User

Retrieve detailed properties and relationships of a user in Azure Active Directory using their unique ID.

### Endpoint

- **URL:** `/v1.0/users/{{id}}`
- **Method:** `GET`

### Input

| **Argument Name**    | **Type** | **Required** | **Description**                    |
| -------------------- | -------- | ------------ | ---------------------------------- |
| `path_parameters.id` | string   | Required     | Parameters for the Get User action |
| `parameters.$select` | string   | Optional     | Filters properties (columns).      |

### Input Example

`{"parameters":{"$select":"displayName,givenName,postalCode"},"path_parameters":{"id":"87d349ed-44d7-43e1-9a83-5f2406dee5bd"}}`

### Output

| **Parameter**                     | **Type** | **Description**                                |
| --------------------------------- | -------- | ---------------------------------------------- |
| `status_code`                     | number   | HTTP status code of the response               |
| `reason`                          | string   | Response reason phrase                         |
| `response_text`                   | object   | Output field: response\_text                   |
| `response_text.businessPhones`    | array    | Output field: response\_text.businessPhones    |
| `response_text.displayName`       | string   | Name of the resource                           |
| `response_text.givenName`         | string   | Name of the resource                           |
| `response_text.jobTitle`          | string   | Output field: response\_text.jobTitle          |
| `response_text.mail`              | string   | Output field: response\_text.mail              |
| `response_text.mobilePhone`       | string   | Output field: response\_text.mobilePhone       |
| `response_text.officeLocation`    | string   | Output field: response\_text.officeLocation    |
| `response_text.preferredLanguage` | string   | Output field: response\_text.preferredLanguage |
| `response_text.surname`           | string   | Name of the resource                           |
| `response_text.userPrincipalName` | string   | Name of the resource                           |
| `response_text.id`                | string   | Unique identifier                              |

### Output Example

`{"status_code":200,"response_headers":{"Date":"Wed, 23 Aug 2023 13:20:02 GMT","Content-Type":"text/html; charset=utf-8","Content-Length":"16595","Connection":"keep-alive","Cache-Control":"public, stale-while-revalidate=900, max-age=900","Content-Encoding":"gzip","Expires":"Wed, 23 Aug 2023 13:26:00 GMT","Last-Modified":"Wed, 23 Aug 2023 13:08:00 GMT","ETag":"\"WHuRpQeAYNiY\"","Vary":"Accept-Encoding, host","x-content-type-options":"nosniff","X-XSS-Protection":"1; mode=block","x-ms-version":"12.4...`

## List Conditional Access Policies

Retrieve a list of Conditional Access policies configured in the Azure Active Directory tenant via the Microsoft Graph API. Useful for auditing existing policies before enabling, disabling, or updating them.

### Endpoint

- **URL:** `/v1.0/identity/conditionalAccess/policies`
- **Method:** `GET`

### Input

| **Argument Name**          | **Type** | **Required** | **Description**                                                                                                                                                                                                                                   |
| -------------------------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `parameters.$count`        | string   | Optional     | Retrieves the total count of matching resources.                                                                                                                                                                                                  |
| `parameters.$filter`       | string   | Optional     | Use the `filter` query parameter to retrieve just a subset of a collection. For guidance on using `filter`, see [https://learn.microsoft.com/en-us/graph/filter-query-parameter](https://learn.microsoft.com/en-us/graph/filter-query-parameter). |
| `parameters.$orderby`      | string   | Optional     | Orders results.                                                                                                                                                                                                                                   |
| `parameters.$select`       | string   | Optional     | Filters properties (columns).                                                                                                                                                                                                                     |
| `parameters.$top`          | number   | Optional     | Sets the page size of results.                                                                                                                                                                                                                    |
| `headers`                  | object   | Optional     | HTTP headers for the request                                                                                                                                                                                                                      |
| `headers.ConsistencyLevel` | string   | Optional     | This header and $count are required when using $search, or in specific usage of $filter.                                                                                                                                                          |

### Input Example

`{"parameters":{"$count":"true","$filter":"startswith(displayName,'Lockdown')","$orderby":"displayName desc","$select":"id,displayName,state","$top":10},"headers":{"ConsistencyLevel":"eventual"}}`

### Output

| **Parameter**                          | **Type** | **Description**                                                                                                  |
| -------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------- |
| `status_code`                          | number   | HTTP status code of the response                                                                                 |
| `reason`                               | string   | Response reason phrase                                                                                           |
| `response_text`                        | object   | Output field: response\_text                                                                                     |
| `response_text.@odata.context`         | string   | Response data                                                                                                    |
| `response_text.value`                  | array    | Value for the parameter                                                                                          |
| `response_text.value.id`               | string   | Unique identifier                                                                                                |
| `response_text.value.displayName`      | string   | Name of the resource                                                                                             |
| `response_text.value.createdDateTime`  | string   | Value for the parameter                                                                                          |
| `response_text.value.modifiedDateTime` | string   | Value for the parameter                                                                                          |
| `response_text.value.state`            | string   | Specifies the state of the policy. Possible values are enabled, disabled, and enabledForReportingButNotEnforced. |
| `response_text.value.conditions`       | object   | Value for the parameter                                                                                          |
| `response_text.value.grantControls`    | object   | Value for the parameter                                                                                          |
| `response_text.value.sessionControls`  | object   | Value for the parameter                                                                                          |

### Output Example

`{"status_code":200,"response_headers":{"Date":"Wed, 23 Aug 2023 13:46:59 GMT","Content-Type":"application/json; charset=utf-8","Cache-Control":"private","Strict-Transport-Security":"max-age=31536000"},"reason":"OK","response_text":{"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#identity/conditionalAccess/policies","value":[{}]}}`

## List User

Retrieve a comprehensive list of user objects from Azure Active Directory, including names and roles.

### Endpoint

- **URL:** `/v1.0/users`
- **Method:** `GET`

### Input

| **Argument Name**          | **Type** | **Required** | **Description**                                                                                                                                                                                                                                   |
| -------------------------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `parameters.$count`        | string   | Optional     | Retrieves the total count of matching resources.                                                                                                                                                                                                  |
| `parameters.$expand`       | string   | Optional     | Retrieves related resources.                                                                                                                                                                                                                      |
| `parameters.$filter`       | string   | Optional     | Use the `filter` query parameter to retrieve just a subset of a collection. For guidance on using `filter`, see [https://learn.microsoft.com/en-us/graph/filter-query-parameter](https://learn.microsoft.com/en-us/graph/filter-query-parameter). |
| `parameters.$orderby`      | string   | Optional     | Orders results.                                                                                                                                                                                                                                   |
| `parameters.$search`       | string   | Optional     | Returns results based on search criteria.                                                                                                                                                                                                         |
| `parameters.$select`       | string   | Optional     | Filters properties (columns).                                                                                                                                                                                                                     |
| `parameters.$top`          | number   | Optional     | Sets the page size of results.                                                                                                                                                                                                                    |
| `headers`                  | object   | Optional     | HTTP headers for the request                                                                                                                                                                                                                      |
| `headers.ConsistencyLevel` | string   | Optional     | This header and $count are required when using $search, or in specific usage of $filter.                                                                                                                                                          |

### Input Example

`{"parameters":{"$count":"true","$expand":"manager($select=id,displayName)","$filter":"startswith(givenName,'J')","$orderby":"displayName desc","$search":"\"displayName:Janne Nyman\"","$select":"givenName,surname","$top":2},"headers":{"ConsistencyLevel":"eventual"}}`

### Output

| **Parameter**                     | **Type** | **Description**                                |
| --------------------------------- | -------- | ---------------------------------------------- |
| `status_code`                     | number   | HTTP status code of the response               |
| `reason`                          | string   | Response reason phrase                         |
| `response_text`                   | array    | Output field: response\_text                   |
| `response_text.businessPhones`    | array    | Output field: response\_text.businessPhones    |
| `response_text.displayName`       | string   | Name of the resource                           |
| `response_text.givenName`         | string   | Name of the resource                           |
| `response_text.jobTitle`          | object   | Output field: response\_text.jobTitle          |
| `response_text.mail`              | object   | Output field: response\_text.mail              |
| `response_text.mobilePhone`       | string   | Output field: response\_text.mobilePhone       |
| `response_text.officeLocation`    | object   | Output field: response\_text.officeLocation    |
| `response_text.preferredLanguage` | string   | Output field: response\_text.preferredLanguage |
| `response_text.surname`           | string   | Name of the resource                           |
| `response_text.userPrincipalName` | string   | Name of the resource                           |
| `response_text.id`                | string   | Unique identifier                              |

### Output Example

`{"status_code":200,"response_headers":{"Date":"Wed, 23 Aug 2023 13:46:59 GMT","Content-Type":"text/html; charset=utf-8","Content-Length":"16609","Connection":"keep-alive","Cache-Control":"public, stale-while-revalidate=900, max-age=900","Content-Encoding":"gzip","Expires":"Wed, 23 Aug 2023 13:41:00 GMT","Last-Modified":"Wed, 23 Aug 2023 13:23:00 GMT","ETag":"\"SovJwPdQDurP\"","Vary":"Accept-Encoding, host","x-content-type-options":"nosniff","X-XSS-Protection":"1; mode=block","x-ms-version":"12.4...`

## Update Conditional Access Policy State

Enable or disable a Conditional Access policy in Azure Active Directory by updating its state via the Microsoft Graph API. Requires policy ID and state.

### Endpoint

- **URL:** `/v1.0/identity/conditionalAccess/policies/{{id}}`
- **Method:** `PATCH`

### Input

| **Argument Name**    | **Type** | **Required** | **Description**                                                                                                                                                                                                                                                                                                                                         |
| -------------------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `path_parameters.id` | string   | Required     | The unique identifier of the Conditional Access policy.                                                                                                                                                                                                                                                                                                 |
| `state`              | string   | Optional     | Specifies the state of the Conditional Access policy. Allowed values are `enabled`, `disabled`, and `enabledForReportingButNotEnforced`.                                                                                                                                                                                                                |
| `displayName`        | string   | Optional     | Specifies a display name for the Conditional Access policy.                                                                                                                                                                                                                                                                                             |
| `conditions`         | object   | Optional     | Specifies the rules that must be met for the policy to apply. Includes signInRiskLevels, clientAppTypes, applications, users, platforms, and locations. See [https://learn.microsoft.com/en-us/graph/api/resources/conditionalaccessconditionset](https://learn.microsoft.com/en-us/graph/api/resources/conditionalaccessconditionset) for full schema. |
| `grantControls`      | object   | Optional     | Specifies the grant controls that must be fulfilled to pass the policy.                                                                                                                                                                                                                                                                                 |
| `sessionControls`    | object   | Optional     | Specifies the session controls that are enforced after sign-in.                                                                                                                                                                                                                                                                                         |

### Input Example

`{"json_body":{"state":"enabled"},"path_parameters":{"id":"6b5e9c5e-1f4d-4f9d-9f7a-3e7d6f1f5b2a"}}`

### Output

| **Parameter**   | **Type** | **Description**                  |
| --------------- | -------- | -------------------------------- |
| `status_code`   | number   | HTTP status code of the response |
| `reason`        | string   | Response reason phrase           |
| `response_text` | string   | Output field: response\_text     |

### Output Example

`{"status_code":204,"response_headers":{"Date":"Wed, 23 Aug 2023 14:02:55 GMT","Cache-Control":"private","Strict-Transport-Security":"max-age=31536000"},"reason":"No Content","response_text":""}`

## Update User

Update a user's account status in Azure Active Directory using their unique ID and the 'accountEnabled' parameter.

### Endpoint

- **URL:** `/v1.0/users/{{id}}`
- **Method:** `PATCH`

### Input

| **Argument Name**         | **Type** | **Required** | **Description**                                                                                                                                                                                                                                                                                                                                                              |
| ------------------------- | -------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `path_parameters.id`      | string   | Required     | Parameters for the Update User action                                                                                                                                                                                                                                                                                                                                        |
| `aboutMe`                 | string   | Optional     | A freeform text entry field for the user to describe themselves.                                                                                                                                                                                                                                                                                                             |
| `accountEnabled`          | string   | Optional     | true if the account is enabled; otherwise, false. This property is required when a user is created. A global administrator assigned the Directory.AccessAsUser.All delegated permission can update the accountEnabled status of all administrators in the tenant.                                                                                                            |
| `ageGroup`                | string   | Optional     | Sets the age group of the user. Allowed values\:null, Minor, NotAdult and Adult. Refer to the legal age group property definitions for further information.                                                                                                                                                                                                                  |
| `birthday`                | string   | Optional     | The birthday of the user. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z                                                                                                                                                                          |
| `businessPhones`          | string   | Optional     | The telephone numbers for the user. NOTE\:Although this is a string collection, only one number can be set for this property.                                                                                                                                                                                                                                                |
| `city`                    | string   | Optional     | The city in which the user is located.                                                                                                                                                                                                                                                                                                                                       |
| `companyName`             | string   | Optional     | The company name which the user is associated. This property can be useful for describing the company that an external user comes from. The maximum length is 64 characters.                                                                                                                                                                                                 |
| `consentProvidedForMinor` | string   | Optional     | Sets whether consent has been obtained for minors. Allowed values\:null, Granted, Denied and NotRequired. Refer to the legal age group property definitions for further information.                                                                                                                                                                                         |
| `country`                 | string   | Optional     | The country/region in which the user is located; for example, US or UK.                                                                                                                                                                                                                                                                                                      |
| `department`              | string   | Optional     | The name for the department in which the user works.                                                                                                                                                                                                                                                                                                                         |
| `displayName`             | string   | Optional     | The name displayed in the address book for the user. This is usually the combination of the user's first name, middle initial and last name. This property is required when a user is created and it cannot be cleared during updates.                                                                                                                                       |
| `employeeId`              | string   | Optional     | The employee identifier assigned to the user by the organization. The maximum length is 16 characters.                                                                                                                                                                                                                                                                       |
| `employeeType`            | string   | Optional     | Captures enterprise worker type. For example, Employee, Contractor, Consultant, or Vendor. Returned only on $select.                                                                                                                                                                                                                                                         |
| `givenName`               | string   | Optional     | The given name (first name) of the user.                                                                                                                                                                                                                                                                                                                                     |
| `employeeHireDate`        | string   | Optional     | The hire date of the user. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z                                                                                                                                                                         |
| `employeeLeaveDateTime`   | string   | Optional     | The date and time when the user left or will leave the organization. The timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z.                                                                                                                              |
| `employeeOrgData`         | string   | Optional     | Represents organization data (e.g. division and costCenter) associated with a user.                                                                                                                                                                                                                                                                                          |
| `interests`               | string   | Optional     | A list for the user to describe their interests.                                                                                                                                                                                                                                                                                                                             |
| `jobTitle`                | string   | Optional     | The user's job title.                                                                                                                                                                                                                                                                                                                                                        |
| `mail`                    | string   | Optional     | The SMTP address for the user, for example, [jeff@contoso.onmicrosoft.com](mailto\:jeff@contoso.onmicrosoft.com). Changes to this property will also update the user's proxyAddresses collection to include the value as a SMTP address. For Azure AD B2C accounts, this property can be updated up to only ten times with unique SMTP addresses. Cannot be updated to null. |
| `mailNickname`            | string   | Optional     | The mail alias for the user. This property must be specified when a user is created.                                                                                                                                                                                                                                                                                         |
| `mobilePhone`             | string   | Optional     | The primary cellular telephone number for the user.                                                                                                                                                                                                                                                                                                                          |
| `mySite`                  | string   | Optional     | The URL for the user's personal site.                                                                                                                                                                                                                                                                                                                                        |
| `officeLocation`          | string   | Optional     | The office location in the user's place of business.                                                                                                                                                                                                                                                                                                                         |

### Input Example

`{"json_body":{"aboutMe":"example","accountEnabled":"false","ageGroup":"minor","birthday":"2014-01-01T00:00:00Z","businessPhones":"9876543210","city":"US","companyName":"Swimlane","consentProvidedForMinor":"Granted","country":"USA","department":"IT","displayName":"John","employeeId":"Robertfabrikamjo","employeeType":"vendor","givenName":"Jon","employeeHireDate":"2014-01-01T00:00:00Z","employeeLeaveDateTime":"2014-01-01T00:00:00Z","employeeOrgData":"string","interests":"yes","jobTitle":"DE","mail":"jeff@contoso.onmicrosoft.com","mailNickname":"Example","mobilePhone":"08963287493","mySite":"US","officeLocation":"US","onPremisesExtensionAttributes":"onPremisesSyncEnabled","onPremisesImmutableId":"userPrincipalName","otherMails":"Robert@fabrikam.com","passwordPolicies":"DisableStrongPassword","passwordProfile":"false","pastProjects":"example","postalCode":"372798","preferredLanguage":"en-US","responsibilities":"job","schools":"Us","skills":"Data engineer","state":"Us","streetAddress":"US","surname":"NIck","usageLocation":"US","userPrincipalName":"Example","userType":"Member"},"path_parameters":{"id":"abc123"}}`

### Output

| **Parameter**   | **Type** | **Description**                  |
| --------------- | -------- | -------------------------------- |
| `status_code`   | number   | HTTP status code of the response |
| `reason`        | string   | Response reason phrase           |
| `response_text` | string   | Output field: response\_text     |

### Output Example

`{"status_code":200,"response_headers":{"Date":"Fri, 18 Aug 2023 11:47:19 GMT","Content-Type":"text/html; charset=UTF-8","Content-Length":"1000","Connection":"keep-alive","Cache-Control":"private","Content-Encoding":"gzip","Vary":"Accept-Encoding","x-content-type-options":"nosniff","X-XSS-Protection":"1; mode=block","x-ms-version":"12.43.2.1 (v12.42.0.1#6c4023fb99.230803-0127) Signed","Strict-Transport-Security":"max-age=31536000; includeSubDomains","X-UA-Compatible":"IE=edge","X-Frame-Options":"...`

# Response Headers

| **Header**                  | **Description**                                                                      | **Example**                                                                                                                                                                     |
| --------------------------- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Accept-Ranges               | HTTP response header: Accept-Ranges                                                  | bytes                                                                                                                                                                           |
| Access-Control-Allow-Origin | HTTP response header: Access-Control-Allow-Origin                                    | \*                                                                                                                                                                              |
| Cache-Control               | Directives for caching mechanisms                                                    | public, stale-while-revalidate=900, max-age=900                                                                                                                                 |
| Connection                  | HTTP response header: Connection                                                     | keep-alive                                                                                                                                                                      |
| Content-Encoding            | HTTP response header: Content-Encoding                                               | gzip                                                                                                                                                                            |
| Content-Length              | The length of the response body in bytes                                             | 16595                                                                                                                                                                           |
| Content-Security-Policy     | HTTP response header: Content-Security-Policy                                        | frame-ancestors 'self'                                                                                                                                                          |
| Content-Type                | The media type of the resource                                                       | text/html; charset=UTF-8                                                                                                                                                        |
| Date                        | The date and time at which the message was originated                                | Fri, 18 Aug 2023 11:21:47 GMT                                                                                                                                                   |
| ETag                        | An identifier for a specific version of a resource                                   | "Q5cbyW9tOsWs"                                                                                                                                                                  |
| Expires                     | The date/time after which the response is considered stale                           | Fri, 18 Aug 2023 11:13:00 GMT                                                                                                                                                   |
| Last-Modified               | The date and time at which the origin server believes the resource was last modified | Wed, 23 Aug 2023 13:08:00 GMT                                                                                                                                                   |
| nel                         | HTTP response header: nel                                                            | \{"report\_to":"network-errors","max\_age":86400,"success\_fraction":0.001,"failure\_fraction":1.0}                                                                             |
| Permissions-Policy          | HTTP response header: Permissions-Policy                                             | accelerometer=(), ambient-light-sensor=(), battery=(), camera=(), gyroscope=(), magnetometer=(), screen-wake-lock=()                                                            |
| Referrer-Policy             | HTTP response header: Referrer-Policy                                                | strict-origin-when-cross-origin                                                                                                                                                 |
| report-to                   | HTTP response header: report-to                                                      | \{"group":"network-errors","max\_age":86400,"endpoints":\[\{"url":"[https://eafc.nelreports.net/api/report?cat=aportal](https://eafc.nelreports.net/api/report?cat=aportal)"}]} |
| Strict-Transport-Security   | HTTP response header: Strict-Transport-Security                                      | max-age=31536000; includeSubDomains                                                                                                                                             |
| Timing-Allow-Origin         | HTTP response header: Timing-Allow-Origin                                            | \*                                                                                                                                                                              |
| Vary                        | HTTP response header: Vary                                                           | Accept-Encoding, host                                                                                                                                                           |
| x-azure-ref                 | HTTP response header: x-azure-ref                                                    | 20230818T114719Z-v7556zx97h4335ppu1mubfv65s000000021g00000000yd3z                                                                                                               |
| X-Cache                     | HTTP response header: X-Cache                                                        | TCP\_HIT                                                                                                                                                                        |
| x-content-type-options      | HTTP response header: x-content-type-options                                         | nosniff                                                                                                                                                                         |
| X-Frame-Options             | HTTP response header: X-Frame-Options                                                | SAMEORIGIN                                                                                                                                                                      |
| x-ms-content-source         | HTTP response header: x-ms-content-source                                            | DiskPersistentContentCache                                                                                                                                                      |
| x-ms-version                | HTTP response header: x-ms-version                                                   | 12.43.4.1 (v12.42.0.1#162d343f82.230814-2250) Signed                                                                                                                            |
| X-UA-Compatible             | HTTP response header: X-UA-Compatible                                                | IE=edge                                                                                                                                                                         |
| X-XSS-Protection            | HTTP response header: X-XSS-Protection                                               | 1; mode=block                                                                                                                                                                   |
