---
title: "create route"
method: POST
path: "/route"
tags: ["Route"]
---

# create route

`POST /route`

Create a new route

## Request body

- RouteCreate
  - `route_key` string
  - `domain_key` string, required
  - `zone_key` string, required
  - `shared_rules_key` string, required
  - `path` string, required
  - `checksum` string
  - `rules` Rule[]
    - `rule_key` string
    - `methods` string[]
    - `matches` Match[]
      - `kind` string — Defines the attribute by which a request should be matched on. Valid values are * cookie * header * query (for query parameter)
      - `behavior` string — Defines how a request attribute should be matched. If not specified, defaults to `exact`. Valid values are * exact * regex * range * prefix * suffix
      - `from` Metadatum
        - `key` string
        - `value` string
      - `to` Metadatum
        - `key` string
        - `value` string
    - `constraints` AllConstraints
      - `light` ClusterConstraint[], required
        - `constraint_key` string
        - `cluster_key` string
        - `metadata` Metadatum[]
          - `key` string
          - `value` string
        - `properties` Metadatum[]
          - `key` string
          - `value` string
        - `response_data` ResponseData
          - `headers` HeaderDatum[]
            - `name` string — The name of the header that will be attached to the response sent. This is case insensitive.
            - `value` string — A literal value to send as the header value or a reference to some metadatum value set on the Cluster Intsance that handles a specific request. If this value is empty after looking up an Instance metadatum value no header will be sent.
            - `value_is_literal` boolean — If true then the value attribute is treated as a literal and no attempt to resolve instance metadatum to find a value.
          - `cookies` CookieDatum[]
            - `name` string — The name of the cookie that will be attached to the response sent.
            - `value` string — A literal value to send as the cookie value or a reference to some metadatum value set on the Cluster Intsance that handles a specific request.
            - `value_is_literal` boolean — If true then the value attribute is treated as a literal and no attempt to resolve to a server metadatum.
            - `expires_in_sec` integer — This indicates how long a cookie will be valid, in seconds. If not set the default is to provide no expiration information. If set to 0 the cookie will have an 'Expires' attribute set to 'Mon, 1 Jan 0001 12:00:00 UTC'. For values greater than 0 the cookie's 'Max-Age' attribute will be set to that value.
            - `domain` string — Specifies the hosts to hich a cookie will be sent. Maps directly to a cookie's 'Domain' attribute.
            - `path` string — Specifies the path a cookie will be associated with. Maps directly to the 'Path' attribute.
            - `secure` boolean — If set the cookie will only be sent on subsequent requests when accessing a server via HTTPS. Maps directly to 'Secure' attribute.
            - `http_only` boolean — If set the cookie value will not be accessible via Document.cookie. Maps directly to 'HttpOnly' attribute.
            - `same_site` 'Strict' | 'Lax' — Allows assertions how a cookie should behave wend making cross-site requests. Maps directly to 'SameSite' attribute. If unset no guidance will be included in the cookie.
        - `weight` integer
      - `dark` ClusterConstraint[]
        - `constraint_key` string
        - `cluster_key` string
        - `metadata` Metadatum[]
          - `key` string
          - `value` string
        - `properties` Metadatum[]
          - `key` string
          - `value` string
        - `response_data` ResponseData
          - `headers` HeaderDatum[]
            - `name` string — The name of the header that will be attached to the response sent. This is case insensitive.
            - `value` string — A literal value to send as the header value or a reference to some metadatum value set on the Cluster Intsance that handles a specific request. If this value is empty after looking up an Instance metadatum value no header will be sent.
            - `value_is_literal` boolean — If true then the value attribute is treated as a literal and no attempt to resolve instance metadatum to find a value.
          - `cookies` CookieDatum[]
            - `name` string — The name of the cookie that will be attached to the response sent.
            - `value` string — A literal value to send as the cookie value or a reference to some metadatum value set on the Cluster Intsance that handles a specific request.
            - `value_is_literal` boolean — If true then the value attribute is treated as a literal and no attempt to resolve to a server metadatum.
            - `expires_in_sec` integer — This indicates how long a cookie will be valid, in seconds. If not set the default is to provide no expiration information. If set to 0 the cookie will have an 'Expires' attribute set to 'Mon, 1 Jan 0001 12:00:00 UTC'. For values greater than 0 the cookie's 'Max-Age' attribute will be set to that value.
            - `domain` string — Specifies the hosts to hich a cookie will be sent. Maps directly to a cookie's 'Domain' attribute.
            - `path` string — Specifies the path a cookie will be associated with. Maps directly to the 'Path' attribute.
            - `secure` boolean — If set the cookie will only be sent on subsequent requests when accessing a server via HTTPS. Maps directly to 'Secure' attribute.
            - `http_only` boolean — If set the cookie value will not be accessible via Document.cookie. Maps directly to 'HttpOnly' attribute.
            - `same_site` 'Strict' | 'Lax' — Allows assertions how a cookie should behave wend making cross-site requests. Maps directly to 'SameSite' attribute. If unset no guidance will be included in the cookie.
        - `weight` integer
      - `tap` ClusterConstraint[]
        - `constraint_key` string
        - `cluster_key` string
        - `metadata` Metadatum[]
          - `key` string
          - `value` string
        - `properties` Metadatum[]
          - `key` string
          - `value` string
        - `response_data` ResponseData
          - `headers` HeaderDatum[]
            - `name` string — The name of the header that will be attached to the response sent. This is case insensitive.
            - `value` string — A literal value to send as the header value or a reference to some metadatum value set on the Cluster Intsance that handles a specific request. If this value is empty after looking up an Instance metadatum value no header will be sent.
            - `value_is_literal` boolean — If true then the value attribute is treated as a literal and no attempt to resolve instance metadatum to find a value.
          - `cookies` CookieDatum[]
            - `name` string — The name of the cookie that will be attached to the response sent.
            - `value` string — A literal value to send as the cookie value or a reference to some metadatum value set on the Cluster Intsance that handles a specific request.
            - `value_is_literal` boolean — If true then the value attribute is treated as a literal and no attempt to resolve to a server metadatum.
            - `expires_in_sec` integer — This indicates how long a cookie will be valid, in seconds. If not set the default is to provide no expiration information. If set to 0 the cookie will have an 'Expires' attribute set to 'Mon, 1 Jan 0001 12:00:00 UTC'. For values greater than 0 the cookie's 'Max-Age' attribute will be set to that value.
            - `domain` string — Specifies the hosts to hich a cookie will be sent. Maps directly to a cookie's 'Domain' attribute.
            - `path` string — Specifies the path a cookie will be associated with. Maps directly to the 'Path' attribute.
            - `secure` boolean — If set the cookie will only be sent on subsequent requests when accessing a server via HTTPS. Maps directly to 'Secure' attribute.
            - `http_only` boolean — If set the cookie value will not be accessible via Document.cookie. Maps directly to 'HttpOnly' attribute.
            - `same_site` 'Strict' | 'Lax' — Allows assertions how a cookie should behave wend making cross-site requests. Maps directly to 'SameSite' attribute. If unset no guidance will be included in the cookie.
        - `weight` integer
    - `cohort_seed` CohortSeed
      - `type` 'header' | 'cookie' | 'query' — Where a request's cohort seed will be drawn from.
      - `name` string — The name of the cookie, the header field, or the query argument to be checked for a cohort seed value.
      - `use_zero_value_seed` boolean — If true, requests with a seed source which resolves to an empty value will still be grouped and routed consistently. This means a misspelled or missing seed source on a request will sort all such traffic into a single backend. This could result in all traffic being assigned to a backend intended for only a small percentage of traffic. Use with caution.
  - `response_data` ResponseData
    - `headers` HeaderDatum[]
      - `name` string — The name of the header that will be attached to the response sent. This is case insensitive.
      - `value` string — A literal value to send as the header value or a reference to some metadatum value set on the Cluster Intsance that handles a specific request. If this value is empty after looking up an Instance metadatum value no header will be sent.
      - `value_is_literal` boolean — If true then the value attribute is treated as a literal and no attempt to resolve instance metadatum to find a value.
    - `cookies` CookieDatum[]
      - `name` string — The name of the cookie that will be attached to the response sent.
      - `value` string — A literal value to send as the cookie value or a reference to some metadatum value set on the Cluster Intsance that handles a specific request.
      - `value_is_literal` boolean — If true then the value attribute is treated as a literal and no attempt to resolve to a server metadatum.
      - `expires_in_sec` integer — This indicates how long a cookie will be valid, in seconds. If not set the default is to provide no expiration information. If set to 0 the cookie will have an 'Expires' attribute set to 'Mon, 1 Jan 0001 12:00:00 UTC'. For values greater than 0 the cookie's 'Max-Age' attribute will be set to that value.
      - `domain` string — Specifies the hosts to hich a cookie will be sent. Maps directly to a cookie's 'Domain' attribute.
      - `path` string — Specifies the path a cookie will be associated with. Maps directly to the 'Path' attribute.
      - `secure` boolean — If set the cookie will only be sent on subsequent requests when accessing a server via HTTPS. Maps directly to 'Secure' attribute.
      - `http_only` boolean — If set the cookie value will not be accessible via Document.cookie. Maps directly to 'HttpOnly' attribute.
      - `same_site` 'Strict' | 'Lax' — Allows assertions how a cookie should behave wend making cross-site requests. Maps directly to 'SameSite' attribute. If unset no guidance will be included in the cookie.
  - `cohort_seed` CohortSeed
    - `type` 'header' | 'cookie' | 'query' — Where a request's cohort seed will be drawn from.
    - `name` string — The name of the cookie, the header field, or the query argument to be checked for a cohort seed value.
    - `use_zero_value_seed` boolean — If true, requests with a seed source which resolves to an empty value will still be grouped and routed consistently. This means a misspelled or missing seed source on a request will sort all such traffic into a single backend. This could result in all traffic being assigned to a backend intended for only a small percentage of traffic. Use with caution.
  - `retry_policy` RetryPolicy — Number of times to retry a request and how long to wait before timing out.
    - `num_retries` integer — Number of times to retry an upstream request. Note that the initial connection attempt is not included in this number, hence 0 means initial attempt and no retries, and 1 means initial attempt plus one retry.
    - `per_try_timeout_msec` integer — Time limit in milliseconds for a single attempt.
    - `timeout_msec` integer — Total time limit in milliseconds for all attempts (including the initial attempt)

## Response `200`

the newly created route

- RouteResult
  - `result` Route
    - `route_key` string, required
    - `domain_key` string, required
    - `zone_key` string, required
    - `shared_rules_key` string, required
    - `path` string, required
    - `checksum` string, required
    - `rules` Rule[]
      - `rule_key` string
      - `methods` string[]
      - `matches` Match[]
        - `kind` string — Defines the attribute by which a request should be matched on. Valid values are * cookie * header * query (for query parameter)
        - `behavior` string — Defines how a request attribute should be matched. If not specified, defaults to `exact`. Valid values are * exact * regex * range * prefix * suffix
        - `from` Metadatum
          - `key` string
          - `value` string
        - `to` Metadatum
          - `key` string
          - `value` string
      - `constraints` AllConstraints
        - `light` ClusterConstraint[], required
          - `constraint_key` string
          - `cluster_key` string
          - `metadata` Metadatum[]
            - `key` string
            - `value` string
          - `properties` Metadatum[]
            - `key` string
            - `value` string
          - `response_data` ResponseData
            - `headers` HeaderDatum[]
              - …
            - `cookies` CookieDatum[]
              - …
          - `weight` integer
        - `dark` ClusterConstraint[]
          - `constraint_key` string
          - `cluster_key` string
          - `metadata` Metadatum[]
            - `key` string
            - `value` string
          - `properties` Metadatum[]
            - `key` string
            - `value` string
          - `response_data` ResponseData
            - `headers` HeaderDatum[]
              - …
            - `cookies` CookieDatum[]
              - …
          - `weight` integer
        - `tap` ClusterConstraint[]
          - `constraint_key` string
          - `cluster_key` string
          - `metadata` Metadatum[]
            - `key` string
            - `value` string
          - `properties` Metadatum[]
            - `key` string
            - `value` string
          - `response_data` ResponseData
            - `headers` HeaderDatum[]
              - …
            - `cookies` CookieDatum[]
              - …
          - `weight` integer
      - `cohort_seed` CohortSeed
        - `type` 'header' | 'cookie' | 'query' — Where a request's cohort seed will be drawn from.
        - `name` string — The name of the cookie, the header field, or the query argument to be checked for a cohort seed value.
        - `use_zero_value_seed` boolean — If true, requests with a seed source which resolves to an empty value will still be grouped and routed consistently. This means a misspelled or missing seed source on a request will sort all such traffic into a single backend. This could result in all traffic being assigned to a backend intended for only a small percentage of traffic. Use with caution.
    - `response_data` ResponseData
      - `headers` HeaderDatum[]
        - `name` string — The name of the header that will be attached to the response sent. This is case insensitive.
        - `value` string — A literal value to send as the header value or a reference to some metadatum value set on the Cluster Intsance that handles a specific request. If this value is empty after looking up an Instance metadatum value no header will be sent.
        - `value_is_literal` boolean — If true then the value attribute is treated as a literal and no attempt to resolve instance metadatum to find a value.
      - `cookies` CookieDatum[]
        - `name` string — The name of the cookie that will be attached to the response sent.
        - `value` string — A literal value to send as the cookie value or a reference to some metadatum value set on the Cluster Intsance that handles a specific request.
        - `value_is_literal` boolean — If true then the value attribute is treated as a literal and no attempt to resolve to a server metadatum.
        - `expires_in_sec` integer — This indicates how long a cookie will be valid, in seconds. If not set the default is to provide no expiration information. If set to 0 the cookie will have an 'Expires' attribute set to 'Mon, 1 Jan 0001 12:00:00 UTC'. For values greater than 0 the cookie's 'Max-Age' attribute will be set to that value.
        - `domain` string — Specifies the hosts to hich a cookie will be sent. Maps directly to a cookie's 'Domain' attribute.
        - `path` string — Specifies the path a cookie will be associated with. Maps directly to the 'Path' attribute.
        - `secure` boolean — If set the cookie will only be sent on subsequent requests when accessing a server via HTTPS. Maps directly to 'Secure' attribute.
        - `http_only` boolean — If set the cookie value will not be accessible via Document.cookie. Maps directly to 'HttpOnly' attribute.
        - `same_site` 'Strict' | 'Lax' — Allows assertions how a cookie should behave wend making cross-site requests. Maps directly to 'SameSite' attribute. If unset no guidance will be included in the cookie.
    - `cohort_seed` CohortSeed
      - `type` 'header' | 'cookie' | 'query' — Where a request's cohort seed will be drawn from.
      - `name` string — The name of the cookie, the header field, or the query argument to be checked for a cohort seed value.
      - `use_zero_value_seed` boolean — If true, requests with a seed source which resolves to an empty value will still be grouped and routed consistently. This means a misspelled or missing seed source on a request will sort all such traffic into a single backend. This could result in all traffic being assigned to a backend intended for only a small percentage of traffic. Use with caution.
    - `retry_policy` RetryPolicy — Number of times to retry a request and how long to wait before timing out.
      - `num_retries` integer — Number of times to retry an upstream request. Note that the initial connection attempt is not included in this number, hence 0 means initial attempt and no retries, and 1 means initial attempt plus one retry.
      - `per_try_timeout_msec` integer — Time limit in milliseconds for a single attempt.
      - `timeout_msec` integer — Total time limit in milliseconds for all attempts (including the initial attempt)

## Other responses

- `default` — Unexpected error

---

[API](https://skmtc.net/turbinelabs/apis/turbine-labs-api.md) · [All operations](https://skmtc.net/turbinelabs/apis/turbine-labs-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/turbinelabs/turbine-labs-api/versions/47fce18aa12f/schema)
