---
title: "Get list of routes"
method: GET
path: "/projects/{projectId}/environments/{environmentId}/routes"
tags: ["Routing"]
---

# Get list of routes

`GET /projects/{projectId}/environments/{environmentId}/routes`

Retrieve a list of objects containing route definitions for
a specific environment. The definitions returned by this endpoint
are those present in an environment's `.upsun/config.yaml` file.

## Path parameters

- `projectId` string, required
- `environmentId` string, required

## Response `default`

- Route[]
  - union
    - ProxyRoute
      - `id` string, required — The identifier of ProxyRoute
      - `primary` boolean, nullable, required — This route is the primary route of the environment
      - `production_url` string, nullable, required — How this URL route would look on production environment
      - `attributes` object, required — Arbitrary attributes attached to this resource
      - `type` 'proxy' | 'redirect' | 'upstream', required — Route type.
      - `tls` object, required — TLS settings for the route.
        - `strict_transport_security` object, required
          - `enabled` boolean, nullable, required — Whether strict transport security is enabled or not.
          - `include_subdomains` boolean, nullable, required — Whether the strict transport security policy should include all subdomains.
          - `preload` boolean, nullable, required — Whether the strict transport security policy should be preloaded in browsers.
        - `min_version` 'TLSv1.0' | 'TLSv1.1' | 'TLSv1.2' | 'TLSv1.3', nullable, required — The minimum TLS version to support.
        - `client_authentication` 'request' | 'require', nullable, required — The type of client authentication to request.
        - `client_certificate_authorities` string[], required — Certificate authorities to validate the client certificate against. If not specified, a default set of trusted CAs will be used.
      - `to` string, required
    - RedirectRoute
      - `id` string, required — The identifier of RedirectRoute
      - `primary` boolean, nullable, required — This route is the primary route of the environment
      - `production_url` string, nullable, required — How this URL route would look on production environment
      - `attributes` object, required — Arbitrary attributes attached to this resource
      - `type` 'proxy' | 'redirect' | 'upstream', required — Route type.
      - `tls` object, required — TLS settings for the route.
        - `strict_transport_security` object, required
          - `enabled` boolean, nullable, required — Whether strict transport security is enabled or not.
          - `include_subdomains` boolean, nullable, required — Whether the strict transport security policy should include all subdomains.
          - `preload` boolean, nullable, required — Whether the strict transport security policy should be preloaded in browsers.
        - `min_version` 'TLSv1.0' | 'TLSv1.1' | 'TLSv1.2' | 'TLSv1.3', nullable, required — The minimum TLS version to support.
        - `client_authentication` 'request' | 'require', nullable, required — The type of client authentication to request.
        - `client_certificate_authorities` string[], required — Certificate authorities to validate the client certificate against. If not specified, a default set of trusted CAs will be used.
      - `to` string, required
      - `redirects` object, required — The configuration of the redirects.
        - `expires` string, required — The amount of time, in seconds, to cache the redirects.
        - `paths` object, required — The paths to redirect
    - UpstreamRoute
      - `id` string, required — The identifier of UpstreamRoute
      - `primary` boolean, nullable, required — This route is the primary route of the environment
      - `production_url` string, nullable, required — How this URL route would look on production environment
      - `attributes` object, required — Arbitrary attributes attached to this resource
      - `type` 'proxy' | 'redirect' | 'upstream', required — Route type.
      - `tls` object, required — TLS settings for the route.
        - `strict_transport_security` object, required
          - `enabled` boolean, nullable, required — Whether strict transport security is enabled or not.
          - `include_subdomains` boolean, nullable, required — Whether the strict transport security policy should include all subdomains.
          - `preload` boolean, nullable, required — Whether the strict transport security policy should be preloaded in browsers.
        - `min_version` 'TLSv1.0' | 'TLSv1.1' | 'TLSv1.2' | 'TLSv1.3', nullable, required — The minimum TLS version to support.
        - `client_authentication` 'request' | 'require', nullable, required — The type of client authentication to request.
        - `client_certificate_authorities` string[], required — Certificate authorities to validate the client certificate against. If not specified, a default set of trusted CAs will be used.
      - `cache` object, required — Cache configuration.
        - `enabled` boolean, required — Whether the cache is enabled.
        - `default_ttl` integer, required — The TTL to apply when the response doesn't specify one. Only applies to static files.
        - `cookies` string[], required — The cookies to take into account for the cache key.
        - `headers` string[], required — The headers to take into account for the cache key.
      - `ssi` object, required — Server-Side Include configuration.
        - `enabled` boolean, required — Whether SSI include is enabled.
      - `upstream` string, required — The upstream to use for this route.
      - `redirects` object, required — The configuration of the redirects.
        - `expires` string, required — The amount of time, in seconds, to cache the redirects.
        - `paths` object, required — The paths to redirect
      - `sticky` object, required — Sticky routing configuration.
        - `enabled` boolean, required — Whether sticky routing is enabled.

---

[API](https://skmtc.net/upsun/apis/upsun-com-rest-api.md) · [All operations](https://skmtc.net/upsun/apis/upsun-com-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/upsun/upsun-com-rest-api/revisions/6cc88fde6435/schema)
