---
title: "Update Firewall Configuration"
method: PATCH
path: "/v1/security/firewall/config"
tags: ["security"]
---

# Update Firewall Configuration

`PATCH /v1/security/firewall/config`

Process updates to modify the existing firewall config for a project

## Query parameters

- `projectId` string, required
- `teamId` string
- `slug` string

## Request body

- union
  - object — Add a ruleset
    - `action` 'firewallEnabled', required
    - `id` unknown
    - `value` object, required
      - `name` string, required
      - `description` string
      - `active` boolean, required
      - `conditionGroup` object[], required
        - `conditions` object[], required
          - `type` 'host' | 'path' | 'method' | 'header' | 'query' | 'cookie' | 'target_path' | 'route' | 'raw_path' | 'ip_address' | 'region' | 'protocol' | 'scheme' | 'environment' | 'domain_environment' | 'user_agent' | 'geo_continent' | 'geo_country' | 'geo_country_region' | 'geo_city' | 'geo_as_number' | 'ja4_digest' | 'ja3_digest' | 'rate_limit_api_id' | 'server_action' | 'bot_name' | 'bot_category' | 'bot_status' | 'bot_protection' | 'ruleset', required
          - `op` 're' | 'eq' | 'neq' | 'ex' | 'nex' | 'inc' | 'ninc' | 'pre' | 'suf' | 'sub' | 'gt' | 'gte' | 'lt' | 'lte' | 'list', required
          - `neg` boolean
          - `key` string
          - `value` union
            - string
            - string[]
            - number
      - `action` object
        - `mitigate` object
          - `action` 'deny' | 'challenge' | 'log', required
      - `valid` boolean
      - `validationErrors` union
        - string[]
        - string
  - object — Update a ruleset
    - `action` 'rules.insert', required
    - `id` unknown, required
    - `value` object, required
      - `name` string, required
      - `description` string
      - `active` boolean, required
      - `conditionGroup` object[], required
        - `conditions` object[], required
          - `type` 'host' | 'path' | 'method' | 'header' | 'query' | 'cookie' | 'target_path' | 'route' | 'raw_path' | 'ip_address' | 'region' | 'protocol' | 'scheme' | 'environment' | 'domain_environment' | 'user_agent' | 'geo_continent' | 'geo_country' | 'geo_country_region' | 'geo_city' | 'geo_as_number' | 'ja4_digest' | 'ja3_digest' | 'rate_limit_api_id' | 'server_action' | 'bot_name' | 'bot_category' | 'bot_status' | 'bot_protection' | 'ruleset', required
          - `op` 're' | 'eq' | 'neq' | 'ex' | 'nex' | 'inc' | 'ninc' | 'pre' | 'suf' | 'sub' | 'gt' | 'gte' | 'lt' | 'lte' | 'list', required
          - `neg` boolean
          - `key` string
          - `value` union
            - string
            - string[]
            - number
      - `action` object
        - `mitigate` object
          - `action` 'deny' | 'challenge' | 'log', required
      - `valid` boolean
      - `validationErrors` union
        - string[]
        - string
  - object — Remove a ruleset
    - `action` 'rules.update', required
    - `id` string, required
    - `value` string
  - object — Set the action for a consumed ruleset (project scope)
    - `action` 'rules.remove', required
    - `id` string, required
    - `value` object, nullable, required
      - `action` 'deny' | 'challenge' | 'log' | 'allow', required
  - object — Remove the action for a consumed ruleset (project scope)
    - `action` 'rules.priority', required
    - `id` string, required
    - `value` string
  - object — Enable Firewall
    - `action` 'crs.update', required
    - `id` string
    - `value` boolean, required
  - object — Add a custom rule
    - `action` 'crs.disable', required
    - `id` unknown
    - `value` object, nullable, required
      - `name` string, required
      - `description` string
      - `active` boolean, required
      - `conditionGroup` object[], required
        - `conditions` object[], required
          - `type` 'host' | 'path' | 'method' | 'header' | 'query' | 'cookie' | 'target_path' | 'route' | 'raw_path' | 'ip_address' | 'region' | 'protocol' | 'scheme' | 'environment' | 'domain_environment' | 'user_agent' | 'geo_continent' | 'geo_country' | 'geo_country_region' | 'geo_city' | 'geo_as_number' | 'ja4_digest' | 'ja3_digest' | 'rate_limit_api_id' | 'server_action' | 'bot_name' | 'bot_category' | 'bot_status' | 'bot_protection' | 'ruleset', required
          - `op` 're' | 'eq' | 'neq' | 'ex' | 'nex' | 'inc' | 'ninc' | 'pre' | 'suf' | 'sub' | 'gt' | 'gte' | 'lt' | 'lte' | 'list', required
          - `neg` boolean
          - `key` string
          - `value` union
            - string
            - string[]
            - number
      - `action` object, required
        - `mitigate` object
          - `action` 'log' | 'challenge' | 'deny' | 'bypass' | 'rate_limit' | 'redirect', required
          - `rateLimit` union
            - object
              - …
            - string
          - `redirect` union
            - object
              - …
            - string
          - `actionDuration` string, nullable
          - `bypassSystem` boolean, nullable
          - `logHeaders` union
            - string
            - string[]
      - `valid` boolean
      - `validationErrors` union
        - string[]
        - string
  - object — Update a custom rule
    - `action` 'ip.insert', required
    - `id` unknown, required
    - `value` object, required
      - `name` string, required
      - `description` string
      - `active` boolean, required
      - `conditionGroup` object[], required
        - `conditions` object[], required
          - `type` 'host' | 'path' | 'method' | 'header' | 'query' | 'cookie' | 'target_path' | 'route' | 'raw_path' | 'ip_address' | 'region' | 'protocol' | 'scheme' | 'environment' | 'domain_environment' | 'user_agent' | 'geo_continent' | 'geo_country' | 'geo_country_region' | 'geo_city' | 'geo_as_number' | 'ja4_digest' | 'ja3_digest' | 'rate_limit_api_id' | 'server_action' | 'bot_name' | 'bot_category' | 'bot_status' | 'bot_protection' | 'ruleset', required
          - `op` 're' | 'eq' | 'neq' | 'ex' | 'nex' | 'inc' | 'ninc' | 'pre' | 'suf' | 'sub' | 'gt' | 'gte' | 'lt' | 'lte' | 'list', required
          - `neg` boolean
          - `key` string
          - `value` union
            - string
            - string[]
            - number
      - `action` object, required
        - `mitigate` object
          - `action` 'log' | 'challenge' | 'deny' | 'bypass' | 'rate_limit' | 'redirect', required
          - `rateLimit` union
            - object
              - …
            - string
          - `redirect` union
            - object
              - …
            - string
          - `actionDuration` string, nullable
          - `bypassSystem` boolean, nullable
          - `logHeaders` union
            - string
            - string[]
      - `valid` boolean
      - `validationErrors` union
        - string[]
        - string
  - object — Remove a custom rule
    - `action` 'ip.update', required
    - `id` string, required
    - `value` string
  - object — Reorder a custom rule
    - `action` 'ip.remove', required
    - `id` string, required
    - `value` unknown, required
  - object — Enable a managed rule
    - `action` 'managedRules.update', required
    - `id` 'sd' | 'ma' | 'lfi' | 'rfi' | 'rce' | 'php' | 'gen' | 'xss' | 'sqli' | 'sf' | 'java', required
    - `value` object, required
      - `active` boolean, required
      - `action` 'deny' | 'log', required
  - object — Disable a managed rule
    - `action` string, required
    - `id` string
    - `value` string
  - object — Add an IP Blocking rule
    - `action` string, required
    - `id` string
    - `value` object, required
      - `hostname` string, required
      - `ip` string, required
      - `notes` string
      - `action` 'deny' | 'challenge' | 'log' | 'bypass', required
  - object — Update an IP Blocking rule
    - `action` string, required
    - `id` string, required
    - `value` object, required
      - `hostname` string, required
      - `ip` string, required
      - `notes` string
      - `action` 'deny' | 'challenge' | 'log' | 'bypass', required
  - object — Remove an IP Blocking rule
    - `action` string, required
    - `id` string, required
    - `value` string
  - object — Update a managed ruleset
    - `action` string, required
    - `id` 'ai_bots' | 'bot_filter' | 'bot_protection' | 'traffic_sources' | 'vercel_ruleset' | 'owasp', required
    - `value` object, required
      - `action` 'log' | 'challenge' | 'deny'
      - `active` boolean, required
  - object — Update a managed rule group
    - `action` string, required
    - `id` 'ai_bots' | 'bot_filter' | 'bot_protection' | 'traffic_sources' | 'vercel_ruleset' | 'owasp', required
    - `value` object, required
  - object — Toggle bot ID
    - `action` string, required
    - `id` string
    - `value` boolean, required
  - object — Update log headers configuration
    - `action` string, required
    - `id` string
    - `value` union, required
      - string
      - string[]
      - string

## Response `200`

- object

## Other responses

- `400` — One of the provided values in the request body is invalid. One of the provided values in the request query is invalid.
- `401` — The request is not authorized.
- `402`
- `403` — You do not have permission to access this resource.
- `404`
- `410`
- `500`

---

[API](https://skmtc.net/vercel/apis/api.md) · [All operations](https://skmtc.net/vercel/apis/api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/vercel/api/versions/61d1ba3f6dac/schema)
