Platform.sh Routing API

These endpoints modify an environment's `routes:` section of the `.upsun/config.yaml` file. For routes to propagate to child environments, the child environments must be synchronized with their parent. More information about routing can be found in the [Routes](https://docs.upsun.com/anchors/routes/) section of the documentation.

Operations 2

GET /projects/{projectId}/environments/{environmentId}/routes Get list of routes #
GET /projects/{projectId}/environments/{environmentId}/routes/{routeId} Get a route's info #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/platform.sh-routing-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

platform.sh-routing-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Platform.sh Routing API
  version: '1.0'
  contact:
    name: Support
    url: https://upsun.com/contact-us/
  termsOfService: https://upsun.com/trust-center/legal/tos/
  x-logo:
    url: https://docs.upsun.com/images/upsun-api.svg
    href: https://upsun.com/#section/Introduction
    altText: Upsun logo
  description: 'Operations tagged Routing across 2 of this provider''s published API definitions: platform.sh-developer-portal-openapi-original.json, platform.sh-openapi-original.json. Each path carries the servers of the definition it was published in.'
servers:
- url: '{schemes}://api.upsun.com'
  description: The Upsun.com API gateway
  variables:
    schemes:
      default: https
tags:
- name: Routing
  description: 'These endpoints modify an environment''s `routes:` section of the `.upsun/config.yaml` file.

    For routes to propagate to child environments, the child environments

    must be synchronized with their parent.


    More information about routing can be found in the Routes

    section of the documentation.'
paths:
  /projects/{projectId}/environments/{environmentId}/routes:
    get:
      parameters:
      - in: path
        required: true
        schema:
          type: string
        name: projectId
      - in: path
        required: true
        schema:
          type: string
        name: environmentId
      operationId: list-projects-environments-routes
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RouteCollection'
      tags:
      - Routing
      summary: Get list of routes
      description: '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.'
      security:
      - OAuth2: []
    servers:
    - url: '{schemes}://api.upsun.com'
      description: The Upsun.com API gateway
      variables:
        schemes:
          default: https
  /projects/{projectId}/environments/{environmentId}/routes/{routeId}:
    get:
      parameters:
      - in: path
        required: true
        schema:
          type: string
        name: projectId
      - in: path
        required: true
        schema:
          type: string
        name: environmentId
      - in: path
        required: true
        schema:
          type: string
        name: routeId
      operationId: get-projects-environments-routes
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Route'
      tags:
      - Routing
      summary: Get a route's info
      description: 'Get details of a route from an environment using the `id` of the entry

        retrieved by the Get environment routes list

        endpoint.'
      security:
      - OAuth2: []
    servers:
    - url: '{schemes}://api.upsun.com'
      description: The Upsun.com API gateway
      variables:
        schemes:
          default: https
components:
  schemas:
    ProxyRoute:
      type: object
      properties:
        id:
          type: string
          title: ProxyRoute Identifier
          description: The identifier of ProxyRoute
        primary:
          type:
          - boolean
          - 'null'
          title: Is primary
          description: This route is the primary route of the environment
        production_url:
          type:
          - string
          - 'null'
          title: Production URL
          description: How this URL route would look on production environment
        attributes:
          type: object
          additionalProperties:
            type: string
          title: Arbitrary attributes
          description: Arbitrary attributes attached to this resource
        type:
          type: string
          enum:
          - proxy
          - redirect
          - upstream
          title: Route type
          description: Route type.
        tls:
          type: object
          properties:
            strict_transport_security:
              type: object
              properties:
                enabled:
                  type:
                  - boolean
                  - 'null'
                  title: Is enabled
                  description: Whether strict transport security is enabled or not.
                include_subdomains:
                  type:
                  - boolean
                  - 'null'
                  title: Is subdomains included
                  description: Whether the strict transport security policy should include all subdomains.
                preload:
                  type:
                  - boolean
                  - 'null'
                  title: Is strict transport security preloaded
                  description: Whether the strict transport security policy should be preloaded in browsers.
              required:
              - enabled
              - include_subdomains
              - preload
              additionalProperties: false
              title: Strict-Transport-Security options.
              description: ''
            min_version:
              type:
              - string
              - 'null'
              enum:
              - TLSv1.0
              - TLSv1.1
              - TLSv1.2
              - TLSv1.3
              title: Minimum TLS version
              description: The minimum TLS version to support.
            client_authentication:
              type:
              - string
              - 'null'
              enum:
              - request
              - require
              title: Client authentication
              description: The type of client authentication to request.
            client_certificate_authorities:
              type: array
              items:
                type: string
              title: Client certificate authorities
              description: Certificate authorities to validate the client certificate against. If not specified, a default set of trusted CAs will be used.
          required:
          - strict_transport_security
          - min_version
          - client_authentication
          - client_certificate_authorities
          additionalProperties: false
          title: TLS settings
          description: TLS settings for the route.
        to:
          type: string
          title: Proxy destination
          description: ''
      required:
      - primary
      - id
      - production_url
      - attributes
      - type
      - tls
      - to
      additionalProperties: false
    Route:
      oneOf:
      - $ref: '#/components/schemas/ProxyRoute'
      - $ref: '#/components/schemas/RedirectRoute'
      - $ref: '#/components/schemas/UpstreamRoute'
    RedirectRoute:
      type: object
      properties:
        id:
          type: string
          title: RedirectRoute Identifier
          description: The identifier of RedirectRoute
        primary:
          type:
          - boolean
          - 'null'
          title: Is primary
          description: This route is the primary route of the environment
        production_url:
          type:
          - string
          - 'null'
          title: Production URL
          description: How this URL route would look on production environment
        attributes:
          type: object
          additionalProperties:
            type: string
          title: Arbitrary attributes
          description: Arbitrary attributes attached to this resource
        type:
          type: string
          enum:
          - proxy
          - redirect
          - upstream
          title: Route type
          description: Route type.
        tls:
          type: object
          properties:
            strict_transport_security:
              type: object
              properties:
                enabled:
                  type:
                  - boolean
                  - 'null'
                  title: Is enabled
                  description: Whether strict transport security is enabled or not.
                include_subdomains:
                  type:
                  - boolean
                  - 'null'
                  title: Is subdomains included
                  description: Whether the strict transport security policy should include all subdomains.
                preload:
                  type:
                  - boolean
                  - 'null'
                  title: Is strict transport security preloaded
                  description: Whether the strict transport security policy should be preloaded in browsers.
              required:
              - enabled
              - include_subdomains
              - preload
              additionalProperties: false
              title: Strict-Transport-Security options.
              description: ''
            min_version:
              type:
              - string
              - 'null'
              enum:
              - TLSv1.0
              - TLSv1.1
              - TLSv1.2
              - TLSv1.3
              title: Minimum TLS version
              description: The minimum TLS version to support.
            client_authentication:
              type:
              - string
              - 'null'
              enum:
              - request
              - require
              title: Client authentication
              description: The type of client authentication to request.
            client_certificate_authorities:
              type: array
              items:
                type: string
              title: Client certificate authorities
              description: Certificate authorities to validate the client certificate against. If not specified, a default set of trusted CAs will be used.
          required:
          - strict_transport_security
          - min_version
          - client_authentication
          - client_certificate_authorities
          additionalProperties: false
          title: TLS settings
          description: TLS settings for the route.
        to:
          type: string
          title: Redirect destination
          description: ''
        redirects:
          type: object
          properties:
            expires:
              type: string
              title: Expires
              description: The amount of time, in seconds, to cache the redirects.
            paths:
              type: object
              additionalProperties:
                type: object
                properties:
                  regexp:
                    type: boolean
                    title: Is regexp
                    description: Whether the path is a regular expression.
                  to:
                    type: string
                    title: Redirect URL
                    description: The URL to redirect to.
                  prefix:
                    type:
                    - boolean
                    - 'null'
                    title: Is prefix
                    description: Whether to redirect all the paths that start with the path.
                  append_suffix:
                    type:
                    - boolean
                    - 'null'
                    title: Append suffix
                    description: Whether to append the incoming suffix to the redirected URL.
                  code:
                    type: integer
                    enum:
                    - 301
                    - 302
                    - 307
                    - 308
                    title: Redirect code
                    description: The redirect code to use.
                  expires:
                    type:
                    - string
                    - 'null'
                    title: Expires
                    description: The amount of time, in seconds, to cache the redirects.
                required:
                - regexp
                - to
                - prefix
                - append_suffix
                - code
                - expires
                additionalProperties: false
              title: Path
              description: The paths to redirect
          required:
          - expires
          - paths
          additionalProperties: false
          title: Redirect configuration
          description: The configuration of the redirects.
      required:
      - primary
      - id
      - production_url
      - attributes
      - type
      - tls
      - to
      - redirects
      additionalProperties: false
    UpstreamRoute:
      type: object
      properties:
        id:
          type: string
          title: UpstreamRoute Identifier
          description: The identifier of UpstreamRoute
        primary:
          type:
          - boolean
          - 'null'
          title: Is primary
          description: This route is the primary route of the environment
        production_url:
          type:
          - string
          - 'null'
          title: Production URL
          description: How this URL route would look on production environment
        attributes:
          type: object
          additionalProperties:
            type: string
          title: Arbitrary attributes
          description: Arbitrary attributes attached to this resource
        type:
          type: string
          enum:
          - proxy
          - redirect
          - upstream
          title: Route type
          description: Route type.
        tls:
          type: object
          properties:
            strict_transport_security:
              type: object
              properties:
                enabled:
                  type:
                  - boolean
                  - 'null'
                  title: Is enabled
                  description: Whether strict transport security is enabled or not.
                include_subdomains:
                  type:
                  - boolean
                  - 'null'
                  title: Is subdomains included
                  description: Whether the strict transport security policy should include all subdomains.
                preload:
                  type:
                  - boolean
                  - 'null'
                  title: Is strict transport security preloaded
                  description: Whether the strict transport security policy should be preloaded in browsers.
              required:
              - enabled
              - include_subdomains
              - preload
              additionalProperties: false
              title: Strict-Transport-Security options.
              description: ''
            min_version:
              type:
              - string
              - 'null'
              enum:
              - TLSv1.0
              - TLSv1.1
              - TLSv1.2
              - TLSv1.3
              title: Minimum TLS version
              description: The minimum TLS version to support.
            client_authentication:
              type:
              - string
              - 'null'
              enum:
              - request
              - require
              title: Client authentication
              description: The type of client authentication to request.
            client_certificate_authorities:
              type: array
              items:
                type: string
              title: Client certificate authorities
              description: Certificate authorities to validate the client certificate against. If not specified, a default set of trusted CAs will be used.
          required:
          - strict_transport_security
          - min_version
          - client_authentication
          - client_certificate_authorities
          additionalProperties: false
          title: TLS settings
          description: TLS settings for the route.
        cache:
          type: object
          properties:
            enabled:
              type: boolean
              title: Is enabled
              description: Whether the cache is enabled.
            default_ttl:
              type: integer
              title: Default TTL
              description: The TTL to apply when the response doesn't specify one. Only applies to static files.
            cookies:
              type: array
              items:
                type: string
              title: Cookies
              description: The cookies to take into account for the cache key.
            headers:
              type: array
              items:
                type: string
              title: Headers
              description: The headers to take into account for the cache key.
          required:
          - enabled
          - default_ttl
          - cookies
          - headers
          additionalProperties: false
          title: Cache configuration
          description: Cache configuration.
        ssi:
          type: object
          properties:
            enabled:
              type: boolean
              title: Is enabled
              description: Whether SSI include is enabled.
          required:
          - enabled
          additionalProperties: false
          title: SSI configuration
          description: Server-Side Include configuration.
        upstream:
          type: string
          title: Upstream
          description: The upstream to use for this route.
        redirects:
          type: object
          properties:
            expires:
              type: string
              title: Expires
              description: The amount of time, in seconds, to cache the redirects.
            paths:
              type: object
              additionalProperties:
                type: object
                properties:
                  regexp:
                    type: boolean
                    title: Is regexp
                    description: Whether the path is a regular expression.
                  to:
                    type: string
                    title: Redirect URL
                    description: The URL to redirect to.
                  prefix:
                    type:
                    - boolean
                    - 'null'
                    title: Is prefix
                    description: Whether to redirect all the paths that start with the path.
                  append_suffix:
                    type:
                    - boolean
                    - 'null'
                    title: Append suffix
                    description: Whether to append the incoming suffix to the redirected URL.
                  code:
                    type: integer
                    enum:
                    - 301
                    - 302
                    - 307
                    - 308
                    title: Redirect code
                    description: The redirect code to use.
                  expires:
                    type:
                    - string
                    - 'null'
                    title: Expires
                    description: The amount of time, in seconds, to cache the redirects.
                required:
                - regexp
                - to
                - prefix
                - append_suffix
                - code
                - expires
                additionalProperties: false
              title: Path
              description: The paths to redirect
          required:
          - expires
          - paths
          additionalProperties: false
          title: Redirect configuration
          description: The configuration of the redirects.
        sticky:
          type: object
          properties:
            enabled:
              type: boolean
              title: Is enabled
              description: Whether sticky routing is enabled.
          required:
          - enabled
          additionalProperties: false
          title: Sticky configuration
          description: Sticky routing configuration.
      required:
      - primary
      - id
      - production_url
      - attributes
      - type
      - tls
      - cache
      - ssi
      - upstream
      - redirects
      - sticky
      additionalProperties: false
    RouteCollection:
      type: array
      items:
        $ref: '#/components/schemas/Route'
    ProxyRoute_2:
      type: object
      properties:
        id:
          type: string
          title: ProxyRoute Identifier
          description: The identifier of ProxyRoute
        primary:
          type:
          - boolean
          - 'null'
          title: Is primary
          description: This route is the primary route of the environment
        production_url:
          type:
          - string
          - 'null'
          title: Production URL
          description: How this URL route would look on production environment
        attributes:
          type: object
          additionalProperties:
            type: string
          title: Arbitrary attributes
          description: Arbitrary attributes attached to this resource
        type:
          type: string
          enum:
          - proxy
          - redirect
          - upstream
          title: Route type
          description: Route type
        tls:
          type: object
          properties:
            strict_transport_security:
              type: object
              properties:
                enabled:
                  type:
                  - boolean
                  - 'null'
                  title: Is enabled
                  description: Whether strict transport security is enabled or not
                include_subdomains:
                  type:
                  - boolean
                  - 'null'
                  title: Is subdomains included
                  description: Whether the strict transport security policy should include all subdomains
                preload:
                  type:
                  - boolean
                  - 'null'
                  title: Is strict transport security preloaded
                  description: Whether the strict transport security policy should be preloaded in browsers
              required:
              - enabled
              - include_subdomains
              - preload
              additionalProperties: false
              title: Strict-Transport-Security options.
              description: ''
            min_version:
              type:
              - string
              - 'null'
              enum:
              - TLSv1.0
              - TLSv1.1
              - TLSv1.2
              - TLSv1.3
              title: Minimum TLS version
              description: The minimum TLS version to support.
            client_authentication:
              type:
              - string
              - 'null'
              enum:
              - request
              - require
              title: Client authentication
              description: The type of client authentication to request.
            client_certificate_authorities:
              type: array
              items:
                type: string
              title: Client certificate authorities
              description: Certificate authorities to validate the client certificate against. If not specified, a default set of trusted CAs will be used.
          required:
          - strict_transport_security
          - min_version
          - client_authentication
          - client_certificate_authorities
          additionalProperties: false
          title: TLS settings
          description: TLS settings for the route
        to:
          type: string
          title: Proxy destination
          description: The destination of the proxy
      required:
      - primary
      - id
      - production_url
      - attributes
      - type
      - tls
      - to
      additionalProperties: false
    RedirectRoute_2:
      type: object
      properties:
        id:
          type: string
          title: RedirectRoute Identifier
          description: The identifier of RedirectRoute
        primary:
          type:
          - boolean
          - 'null'
          title: Is primary
          description: This route is the primary route of the environment
        production_url:
          type:
          - string
          - 'null'
          title: Production URL
          description: How this URL route would look on production environment
        attributes:
          type: object
          additionalProperties:
            type: string
          title: Arbitrary attributes
          description: Arbitrary attributes attached to this resource
        type:
          type: string
          enum:
          - proxy
          - redirect
          - upstream
          title: Route type
          description: Route type
        tls:
          type: object
          properties:
            strict_transport_security:
              type: object
              properties:
                enabled:
                  type:
                  - boolean
                  - 'null'
                  title: Is enabled
                  description: Whether strict transport security is enabled or not
                include_subdomains:
                  type:
                  - boolean
                  - 'null'
                  title: Is subdomains included
                  description: Whether the strict transport security policy should include all subdomains
                preload:
                  type:
                  - boolean
                  - 'null'
                  title: Is strict transport security preloaded
                  description: Whether the strict transport security policy should be preloaded in browsers
              required:
              - enabled
              - include_subdomains
              - preload
              additionalProperties: false
              title: Strict-Transport-Security options.
              description: ''
            min_version:
              type:
              - string
              - 'null'
              enum:
              - TLSv1.0
              - TLSv1.1
              - TLSv1.2
              - TLSv1.3
              title: Minimum TLS version
              description: The minimum TLS version to support.
            client_authentication:
              type:
              - string
              - 'null'
              enum:
              - request
              - require
              title: Client authentication
              description: The type of client authentication to request.
            client_certificate_authorities:
              type: array
              items:
                type: string
              title: Client certificate authorities
              description: Certificate authorities to validate the client certificate against. If not specified, a default set of trusted CAs will be used.
          required:
          - strict_transport_security
          - min_version
          - client_authentication
          - client_certificate_authorities
          additionalProperties: false
          title: TLS settings
          description: TLS settings for the route
        to:
          type: string
          title: Redirect destination
          description: The destination of the proxy
        redirects:
          type: object
          properties:
            expires:
              type: string
              title: Expires
              description: The amount of time, in seconds, to cache the redirects
            paths:
              type: object
              additionalProperties:
                type: object
                properties:
                  regexp:
                    type: boolean
                    title: Is regexp
                    description: Whether the path is a regular expression.
                  to:
                    type: string
                    title: Redirect URL
                    description: The URL to redirect to.
                  prefix:
                    type:
                    - boolean
                    - 'null'
                    title: Is prefix
                    description: Whether to redirect all the paths that start with the path.
                  append_suffix:
                    type:
                    - boolean
                    - 'null'
                    title: Append suffix
                    description: Whether to append the incoming suffix to the redirected URL.
                  code:
                    type: integer
                    enum:
                    - 301
                    - 302
                    - 307
                    - 308
                    title: Redirect code
                    description: The redirect code to use.
                  expires:
                    type:
                    - string
                    - 'null'
                    title: Expires
                    description: The amount of time, in seconds, to cache the redirects.
                required:
                - regexp
                - to
                - prefix
                - append_suffix
                - code
                - expires
                additionalProperties: false
              title: Path
              description: The paths to redirect
          required:
          - expires
          - paths
          additionalProperties: false
          title: Redirect configuration
          description: The configuration of the redirects
      required:
      - primary
      - id
      - production_url
      - attributes
      - type
      - tls
      - to
      - redirects
      additionalProperties: false
    UpstreamRoute_2:
      type: object
      properties:
        id:
          type: string
          title: UpstreamRoute Identifier
          description: The identifier of UpstreamRoute
        primary:
          type:
          - boolean
          - 'null'
          title: Is primary
          description: This route is the primary route of the environment
        production_url:
          type:
          - string
          - 'null'
          title: Production URL
          description: How this URL route would look on production environment
        attributes:
          type: object
          additionalProperties:
            type: string
          title: Arbitrary attributes
          description: Arbitrary attributes attached to this resource
        type:
          type: string
          enum:
          - proxy
          - redirect
          - upstream
          title: Route type
          description: Route type
        tls:
          type: object
          properties:
            strict_transport_security:
              type: object
              properties:
                enabled:
                  type:
                  - boolean
                  - 'null'
                  title: Is enabled
                  description: Whether strict transport security is enabled or not
                include_subdomains:
                  type:
                  - boolean
                  - 'null'
                  title: Is subdomains included
                  description: Whether the strict transport security policy should include all subdomains
                preload:
                  type:
                  - boolean
                  - 'null'
                  title: Is strict transport security preloaded
                  description: Whether the strict transport security policy should be preloaded in browsers
              required:
              - enabled
              - include_subdomains
              - preload
              additionalProperties: false
              title: Strict-Transport-Security options.
              description: ''
            min_version:
              type:
              - string
              - 'null'
              enum:
              - TLSv1.0
              - TLSv1.1
              - TLSv1.2
              - TLSv1.3
              title: Minimum TLS version
              description: The minimum TLS version to support.
            client_authentication:
              type:
              - string
              - 'null'
              enum:
              - request
              - require
              title: Client authentication
              description: The type of client authentication to request.
            client_certificate_authorities:
              type: array
              items:
                type: string
              title: Client certificate authorities
              description: Certificate authorities to validate the client certificate against. If not specified, a default set of trusted CAs will be used.
          required:
          - strict_transport_se

# --- truncated at 32 KB (38 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/platform.sh/refs/heads/main/openapi/platform.sh-routing-api-openapi.yml