---
title: "Update an Unwanted Access Rule"
method: PATCH
path: "/v1/unwanted_access_rules/{id}"
tags: ["Unwanted Access Rules"]
---

# Update an Unwanted Access Rule

`PATCH /v1/unwanted_access_rules/{id}`

Updates the schedule and notes on an existing Unwanted Access Rule. The rule's category, value, scope, logic, and type cannot be changed.

Standard, catchall, and catchall exception rules can all be updated, but catchall and catchall exception rules must keep `starts_at` and `expires_at` nil. Passing a value for those fields on those rules will return a 422.

## Path parameters

- `id` integer, required

## Request body

- UnwantedAccessRuleUpdateParameters — Update an Unwanted Access Rule
  - `starts_at` string, date — UTC date (YYYY-MM-DD) when the rule becomes active. Pass an empty string or null to clear.
  - `expires_at` string, date — UTC date (YYYY-MM-DD) when the rule expires. Pass an empty string or null to clear.
  - `notes` string — Free-text note attached to the rule. Pass an empty string or null to clear.

## Response `200`

Update an Unwanted Access Rule

- object
  - `unwanted_access_rule` UnwantedAccessRule — UnwantedAccessRule model
    - `id` integer — A Huntress-unique identifier for the rule.
    - `applied_to` unknown
    - `category` 'country' | 'vpn' | 'ip_address' — The category of attribute this rule governs.
    - `country_code` string — ISO 3166-1 alpha-2 country code this rule matches. Null unless `category` is `country`.
    - `vpn` string — Tunnel operator name this rule matches. Null unless `category` is `vpn`.
    - `ip_address` string — IP Address this rule matches. Null unless `category` is `ip_address`.
    - `type` 'expected' | 'unauthorized' — Whether matching access is expected or unauthorized.
    - `status` 'active' | 'scheduled' | 'expired' | 'not_applicable' — The current status of the rule.
    - `logic` 'catchall_exception' | 'catchall' | 'standard' — How the rule matches: `standard` matches a specific value within the `country`, `vpn`, or `ip_address` category, `catchall` matches all values in the category, and `catchall_exception` opts the resource out of an inherited catchall.
    - `note` string — Optional free-text note the rule author attached to the rule.
    - `starts_at` string, date-time — ISO-8601 formatted timestamp for when this rule becomes active. Null for unscheduled rules.
    - `expires_at` string, date-time — ISO-8601 formatted timestamp for when this rule expires. Null if the rule does not expire.
    - `created_by` string — The name of the user who created this rule, or "Deleted" if the user has been removed.
    - `created_at` string, date-time — ISO-8601 formatted timestamp for when this rule was created.
    - `updated_at` string, date-time — ISO-8601 formatted timestamp for when this rule was last updated.

## Other responses

- `400` — Invalid request parameters.
- `403` — There was an issue with your API credential or permissions.
- `404` — Unwanted Access Rule not found.
- `422` — Invalid update parameters.

---

[API](https://skmtc.net/huntress/apis/huntress-api-reference.md) · [All operations](https://skmtc.net/huntress/apis/huntress-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/huntress/huntress-api-reference/revisions/94acb422c07d/schema)
