---
title: "POST /v1/{+parent}/rules"
method: POST
path: "/v1/{+parent}/rules"
tags: ["projects"]
---

# POST /v1/{+parent}/rules

`POST /v1/{+parent}/rules`

Creates a new GatewaySecurityPolicy in a given project and location.

## Path parameters

- `parent` string, required

## Query parameters

- `gatewaySecurityPolicyRuleId` string

## Request body

- GatewaySecurityPolicyRule — The GatewaySecurityPolicyRule resource is in a nested collection within a GatewaySecurityPolicy and represents a traffic matching condition and associated action to perform.
  - `enabled` boolean — Required. Whether the rule is enforced.
  - `applicationMatcher` string — Optional. CEL expression for matching on L7/application level criteria.
  - `updateTime` string, google-datetime — Output only. Time when the rule was updated.
  - `priority` integer — Required. Priority of the rule. Lower number corresponds to higher precedence.
  - `name` string — Required. Immutable. Name of the resource. ame is the full resource name so projects/{project}/locations/{location}/gatewaySecurityPolicies/{gateway_security_policy}/rules/{rule} rule should match the pattern: (^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$).
  - `tlsInspectionEnabled` boolean — Optional. Flag to enable TLS inspection of traffic matching on , can only be true if the parent GatewaySecurityPolicy references a TLSInspectionConfig.
  - `description` string — Optional. Free-text description of the resource.
  - `createTime` string, google-datetime — Output only. Time when the rule was created.
  - `sessionMatcher` string — Required. CEL expression for matching on session criteria.
  - `basicProfile` 'BASIC_PROFILE_UNSPECIFIED' | 'ALLOW' | 'DENY' — Required. Profile which tells what the primitive action should be.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/networksecurity.md) · [All operations](https://skmtc.net/google/apis/networksecurity/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/networksecurity/versions/4afd54463fe6/schema)
