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

# POST /v1/{+parent}/tlsRoutes

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

Creates a new TlsRoute in a given project and location.

## Path parameters

- `parent` string, required

## Query parameters

- `tlsRouteId` string

## Request body

- TlsRoute — TlsRoute defines how traffic should be routed based on SNI and other matching L3 attributes.
  - `name` string — Identifier. Name of the TlsRoute resource. It matches pattern `projects/*/locations/*/tlsRoutes/tls_route_name>`.
  - `selfLink` string — Output only. Server-defined URL of this resource
  - `createTime` string, google-datetime — Output only. The timestamp when the resource was created.
  - `updateTime` string, google-datetime — Output only. The timestamp when the resource was updated.
  - `description` string — Optional. A free-text description of the resource. Max length 1024 characters.
  - `rules` TlsRouteRouteRule[] — Required. Rules that define how traffic is routed and handled. At least one RouteRule must be supplied. If there are multiple rules then the action taken will be the first rule to match.
    - `matches` TlsRouteRouteMatch[] — Required. RouteMatch defines the predicate used to match requests to a given action. Multiple match types are "OR"ed for evaluation. Atleast one RouteMatch must be supplied.
      - `sniHost` string[] — Optional. SNI (server name indicator) to match against. SNI will be matched against all wildcard domains, i.e. `www.example.com` will be first matched against `www.example.com`, then `*.example.com`, then `*.com.` Partial wildcards are not supported, and values like *w.example.com are invalid. At least one of sni_host and alpn is required. Up to 100 sni hosts across all matches can be set.
      - `alpn` string[] — Optional. ALPN (Application-Layer Protocol Negotiation) to match against. Examples: "http/1.1", "h2". At least one of sni_host and alpn is required. Up to 5 alpns across all matches can be set.
    - `action` TlsRouteRouteAction — The specifications for routing traffic and applying associated policies.
      - `destinations` TlsRouteRouteDestination[] — Required. The destination services to which traffic should be forwarded. At least one destination service is required.
        - `serviceName` string — Required. The URL of a BackendService to route traffic to.
        - `weight` integer — Optional. Specifies the proportion of requests forwarded to the backend referenced by the service_name field. This is computed as: - weight/Sum(weights in destinations) Weights in all destinations does not need to sum up to 100.
      - `idleTimeout` string, google-duration — Optional. Specifies the idle timeout for the selected route. The idle timeout is defined as the period in which there are no bytes sent or received on either the upstream or downstream connection. If not set, the default idle timeout is 1 hour. If set to 0s, the timeout will be disabled.
  - `meshes` string[] — Optional. Meshes defines a list of meshes this TlsRoute is attached to, as one of the routing rules to route the requests served by the mesh. Each mesh reference should match the pattern: `projects/*/locations/*/meshes/` The attached Mesh should be of a type SIDECAR
  - `gateways` string[] — Optional. Gateways defines a list of gateways this TlsRoute is attached to, as one of the routing rules to route the requests served by the gateway. Each gateway reference should match the pattern: `projects/*/locations/*/gateways/`
  - `targetProxies` string[] — Optional. TargetProxies defines a list of TargetTcpProxies this TlsRoute is attached to, as one of the routing rules to route the requests served by the TargetTcpProxy. Each TargetTcpProxy reference should match the pattern: `projects/*/locations/*/targetTcpProxies/`
  - `labels` object — Optional. Set of label tags associated with the TlsRoute resource.

## Response `200`

Successful response

---

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