---
title: "Update API Key Policy"
method: PUT
path: "/api-users/policy/"
tags: ["API Users"]
---

# Update API Key Policy

`PUT /api-users/policy/`

## Request body

- APIKeyPolicy
  - `max_api_key_duration_days` integer — Sets the upper limit (in days) for how long an API key can be valid. This constraint is only active if 'enable_max_api_key_duration' is set to True.
  - `enable_max_api_key_duration` boolean — If enabled, the 'max_api_key_duration_days' setting will be enforced, limiting the validity period of created API keys.
  - `disable_keys_on_user_disabled` boolean — If enabled, all API keys created directly by a User (or by API users derived from them) will be automatically disabled when that user is disabled or deleted.

## Response `200`

- APIKeyPolicy
  - `max_api_key_duration_days` integer — Sets the upper limit (in days) for how long an API key can be valid. This constraint is only active if 'enable_max_api_key_duration' is set to True.
  - `enable_max_api_key_duration` boolean — If enabled, the 'max_api_key_duration_days' setting will be enforced, limiting the validity period of created API keys.
  - `disable_keys_on_user_disabled` boolean — If enabled, all API keys created directly by a User (or by API users derived from them) will be automatically disabled when that user is disabled or deleted.

## Other responses

- `400`
- `401`
- `500`

---

[API](https://skmtc.net/probely/apis/snyk-api-web-s-api-reference-documentation.md) · [All operations](https://skmtc.net/probely/apis/snyk-api-web-s-api-reference-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/probely/snyk-api-web-s-api-reference-documentation/versions/e29879bff01b/schema)
