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

# POST /v1/{+parent}/policyBasedRoutes

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

Creates a new policy-based route in a given project and location.

## Path parameters

- `parent` string, required

## Query parameters

- `policyBasedRouteId` string
- `requestId` string

## Request body

- PolicyBasedRoute — Policy-based routes route L4 network traffic based on not just destination IP address, but also source IP address, protocol, and more. If a policy-based route conflicts with other types of routes, the policy-based route always takes precedence.
  - `name` string — Immutable. Identifier. A unique name of the resource in the form of `projects/{project_number}/locations/global/PolicyBasedRoutes/{policy_based_route_id}`
  - `network` string — Required. Fully-qualified URL of the network that this route applies to, for example: projects/my-project/global/networks/my-network.
  - `filter` Filter — Filter matches L4 traffic.
    - `ipProtocol` string — Optional. The IP protocol that this policy-based route applies to. Valid values are 'TCP', 'UDP', and 'ALL'. Default is 'ALL'.
    - `destRange` string — Optional. The destination IP range of outgoing packets that this policy-based route applies to. Default is "0.0.0.0/0" if protocol version is IPv4 and "::/0" if protocol version is IPv6.
    - `protocolVersion` 'PROTOCOL_VERSION_UNSPECIFIED' | 'IPV4' | 'IPV6' — Required. Internet protocol versions this policy-based route applies to. IPV4 and IPV6 is supported.
    - `srcRange` string — Optional. The source IP range of outgoing packets that this policy-based route applies to. Default is "0.0.0.0/0" if protocol version is IPv4 and "::/0" if protocol version is IPv6.
  - `nextHopOtherRoutes` 'OTHER_ROUTES_UNSPECIFIED' | 'DEFAULT_ROUTING' — Optional. Other routes that will be referenced to determine the next hop of the packet.
  - `priority` integer — Optional. The priority of this policy-based route. Priority is used to break ties in cases where there are more than one matching policy-based routes found. In cases where multiple policy-based routes are matched, the one with the lowest-numbered priority value wins. The default value is 1000. The priority value must be from 1 to 65535, inclusive.
  - `warnings` Warnings[] — Output only. If potential misconfigurations are detected for this route, this field will be populated with warning messages.
    - `data` object — Output only. Metadata about this warning in key: value format. The key should provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement.
    - `warningMessage` string — Output only. A human-readable description of the warning code.
    - `code` 'WARNING_UNSPECIFIED' | 'RESOURCE_NOT_ACTIVE' | 'RESOURCE_BEING_MODIFIED' — Output only. A warning code, if applicable.
  - `updateTime` string, google-datetime — Output only. Time when the policy-based route was updated.
  - `selfLink` string — Output only. Server-defined fully-qualified URL for this resource.
  - `interconnectAttachment` InterconnectAttachment — InterconnectAttachment that this route applies to.
    - `region` string — Optional. Cloud region to install this policy-based route on interconnect attachment. Use `all` to install it on all interconnect attachments.
  - `nextHopIlbIp` string — Optional. The IP address of a global-access-enabled L4 ILB that is the next hop for matching packets. For this version, only nextHopIlbIp is supported.
  - `labels` object — User-defined labels.
  - `virtualMachine` VirtualMachine — VM instances that this policy-based route applies to.
    - `tags` string[] — Optional. A list of VM instance tags that this policy-based route applies to. VM instances that have ANY of tags specified here installs this PBR.
  - `description` string — Optional. An optional description of this resource. Provide this field when you create the resource.
  - `createTime` string, google-datetime — Output only. Time when the policy-based route was created.
  - `kind` string — Output only. Type of this resource. Always networkconnectivity#policyBasedRoute for policy-based Route resources.

## Response `200`

Successful response

---

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