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

# Update NTLM Settings

> Updates NTLM (NT LAN Manager) authentication settings for an API proxy. NTLM settings configure Windows authentication for backend connections.

## Endpoint

```
PATCH /apiops/projects/{projectName}/apiProxies/{apiProxyName}/settings/ntlm/
```

## Authentication

Requires a Personal API Access Token.

### Header

```
Authorization: Bearer YOUR_TOKEN
```

## Request

### Headers

| Header        | Value            | Required |
| ------------- | ---------------- | -------- |
| Authorization | Bearer {token}   | Yes      |
| Content-Type  | application/json | Yes      |

### Path Parameters

| Parameter    | Type   | Required | Description    |
| ------------ | ------ | -------- | -------------- |
| projectName  | string | Yes      | Project name   |
| apiProxyName | string | Yes      | API Proxy name |

### Request Body

#### Full JSON Body Example

```json theme={null}
{
  "ntlmSettings": {
    "enabled": true,
    "domain": "EXAMPLE",
    "username": "user",
    "password": "password",
    "workstation": "WORKSTATION01"
  },
  "deploy": false,
  "deployTargetEnvironmentNameList": []
}
```

#### Request Body Fields

| Field                           | Type           | Required | Default | Description                                                        |
| ------------------------------- | -------------- | -------- | ------- | ------------------------------------------------------------------ |
| ntlmSettings                    | object         | Yes      | -       | NTLM settings object (see fields below)                            |
| deploy                          | boolean        | No       | false   | If true, deploy the API proxy after saving changes                 |
| deployTargetEnvironmentNameList | array\[string] | No       | \[]     | List of environment names to deploy to (required when deploy=true) |

#### ntlmSettings Fields

| Field       | Type    | Required | Default | Description                                    |
| ----------- | ------- | -------- | ------- | ---------------------------------------------- |
| enabled     | boolean | No       | false   | Enable/disable NTLM authentication             |
| domain      | string  | No\*     | -       | Windows domain name (required if enabled=true) |
| username    | string  | No\*     | -       | Windows username (required if enabled=true)    |
| password    | string  | No\*     | -       | Windows password (required if enabled=true)    |
| workstation | string  | No       | -       | Workstation name (optional)                    |

**Note:** All fields are optional. Only provided fields are updated.

**Password Security:** Password is encrypted when stored.

## Response

### Success Response (200 OK)

```json theme={null}
{
  "success": true
}
```

When `deploy=true` is specified:

```json theme={null}
{
  "success": true,
  "deploymentResult": {
    "deploymentResults": [
      {
        "environmentName": "prod-env",
        "success": true
      }
    ]
  }
}
```

#### Response Fields

| Field                                                 | Type    | Description                                               |
| ----------------------------------------------------- | ------- | --------------------------------------------------------- |
| success                                               | boolean | Indicates if the request was successful                   |
| deploymentResult                                      | object  | Deployment result details (only present when deploy=true) |
| deploymentResult.deploymentResults                    | array   | List of deployment results per environment                |
| deploymentResult.deploymentResults\[].environmentName | string  | Name of the target environment                            |
| deploymentResult.deploymentResults\[].success         | boolean | Whether deployment to this environment succeeded          |

### Error Response (400 Bad Request)

```json theme={null}
{
  "error": "bad_request",
  "error_description": "Domain, username, and password are required when NTLM is enabled"
}
```

### Error Response (401 Unauthorized)

```json theme={null}
{
  "error": "unauthorized_client",
  "error_description": "Invalid token"
}
```

### Error Response (404 Not Found)

```json theme={null}
{
  "error": "not_found",
  "error_description": "ApiProxy (name: MyAPI) was not found!"
}
```

## cURL Example

### Example 1: Enable NTLM Authentication

```bash theme={null}
curl -X PATCH \
  "https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyAPI/settings/ntlm/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "ntlmSettings": {
      "enabled": true,
      "domain": "EXAMPLE",
      "username": "user",
      "password": "password",
      "workstation": "WORKSTATION01"
    }
  }'
```

### Example 2: Enable NTLM without Workstation

```bash theme={null}
curl -X PATCH \
  "https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyAPI/settings/ntlm/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "ntlmSettings": {
      "enabled": true,
      "domain": "EXAMPLE",
      "username": "user",
      "password": "password"
    }
  }'
```

### Example 3: Save and Deploy

```bash theme={null}
curl -X PATCH \
  "https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyAPI/settings/ntlm/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "ntlmSettings": {
      "enabled": true,
      "domain": "EXAMPLE",
      "username": "user",
      "password": "password",
      "workstation": "WORKSTATION01"
    },
    "deploy": true,
    "deployTargetEnvironmentNameList": ["prod-env"]
  }'
```

## Notes and Warnings

* **Domain**: Windows domain name (required when enabled=true)
* **Username**: Windows username (required when enabled=true)
* **Password**: Windows password (required when enabled=true, encrypted when stored)
* **Workstation**: Optional workstation name
* **NTLM Protocol**: Uses NTLM v1/v2 authentication
* **Security**: Password is encrypted using default encryption algorithm
* **Deploy**: When `deploy=true`, the API proxy is automatically deployed to the specified environments after saving

## Permissions

User must have **`API_MANAGEMENT` + `MANAGE`** permission in the project.

## Related Documentation

* [Update mTLS Settings](/api-reference/api-proxies/settings/update-mtls-settings) - Update mTLS settings
* [Update Connection Settings](/api-reference/api-proxies/settings/update-connection-settings) - Update connection settings
* [Get API Proxy](/api-reference/api-proxies/crud/get-api-proxy) - Get API proxy details
