Render Services - Routes API

Add Redirect or Rewrite Rules to modify requests to your site without writing code. You can use URL parameters to capture path segments, and wildcards to redirect everything under a given path.

Documentation

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

render-services-routes-api-openapi.yml Raw ↑
openapi: 3.0.2
info:
  title: Render Public Audit Logs Services - Routes API
  description: Manage everything about your Render services
  version: 1.0.0
  contact:
    name: Render API
    url: https://community.render.com
    email: support@render.com
servers:
- url: https://api.render.com/v1
security:
- BearerAuth: []
tags:
- name: Services - Routes
  description: Add Redirect or Rewrite Rules to modify requests to your site without writing code. You can use URL parameters to capture path segments, and wildcards to redirect everything under a given path.
paths:
  /services/{serviceId}/routes:
    parameters:
    - $ref: '#/components/parameters/serviceIdParam'
    get:
      summary: List redirect/rewrite rules
      description: 'List a particular service''s redirect/rewrite rules that match the provided filters. If no filters are provided, all rules for the service are returned.

        '
      operationId: list-routes
      tags:
      - Services - Routes
      parameters:
      - name: type
        in: query
        schema:
          type: array
          items:
            type: string
            enum:
            - redirect
            - rewrite
        style: form
        explode: false
        required: false
        description: Filter for the type of route rule
      - name: source
        in: query
        schema:
          type: array
          items:
            type: string
        style: form
        explode: false
        required: false
        description: Filter for the source path of the route
      - name: destination
        in: query
        schema:
          type: array
          items:
            type: string
        style: form
        explode: false
        required: false
        description: Filter for the destination path of the route
      - $ref: '#/components/parameters/cursorParam'
      - $ref: '#/components/parameters/limitParam'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/routeWithCursor'
        '401':
          $ref: '#/components/responses/401Unauthorized'
        '403':
          $ref: '#/components/responses/403Forbidden'
        '404':
          $ref: '#/components/responses/404NotFound'
        '406':
          $ref: '#/components/responses/406NotAcceptable'
        '410':
          $ref: '#/components/responses/410Gone'
        '429':
          $ref: '#/components/responses/429RateLimit'
        '500':
          $ref: '#/components/responses/500InternalServerError'
        '503':
          $ref: '#/components/responses/503ServiceUnavailable'
    post:
      summary: Add redirect/rewrite rules
      description: 'Add redirect/rewrite rules to the service with the provided ID.

        '
      operationId: add-route
      tags:
      - Services - Routes
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/routePost'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/route'
        '400':
          $ref: '#/components/responses/400BadRequest'
        '401':
          $ref: '#/components/responses/401Unauthorized'
        '403':
          $ref: '#/components/responses/403Forbidden'
        '404':
          $ref: '#/components/responses/404NotFound'
        '406':
          $ref: '#/components/responses/406NotAcceptable'
        '410':
          $ref: '#/components/responses/410Gone'
        '429':
          $ref: '#/components/responses/429RateLimit'
        '500':
          $ref: '#/components/responses/500InternalServerError'
        '503':
          $ref: '#/components/responses/503ServiceUnavailable'
    patch:
      summary: Update redirect/rewrite rule priority
      description: 'Update the priority for a particular redirect/rewrite rule.


        To apply redirect/rewrite rules to an incoming request, Render starts from the rule with priority `0` and applies the first encountered rule that matches the request''s path (if any).


        Render increments the priority of other rules by `1` as necessary to make space for the updated rule.

        '
      operationId: patch-route
      tags:
      - Services - Routes
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/routePatch'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  headers:
                    $ref: '#/components/schemas/route'
        '401':
          $ref: '#/components/responses/401Unauthorized'
        '403':
          $ref: '#/components/responses/403Forbidden'
        '404':
          $ref: '#/components/responses/404NotFound'
        '406':
          $ref: '#/components/responses/406NotAcceptable'
        '410':
          $ref: '#/components/responses/410Gone'
        '429':
          $ref: '#/components/responses/429RateLimit'
        '500':
          $ref: '#/components/responses/500InternalServerError'
        '503':
          $ref: '#/components/responses/503ServiceUnavailable'
    put:
      summary: Update redirect/rewrite rules
      description: 'Replace all redirect/rewrite rules for a particular service with the provided list.


        **This deletes all existing redirect/rewrite rules for the service that aren''t included in the request.**


        Rule priority is assigned according to list order (the first rule in the list has the highest priority).

        '
      operationId: put-routes
      tags:
      - Services - Routes
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/routePut'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/route'
        '400':
          $ref: '#/components/responses/400BadRequest'
        '401':
          $ref: '#/components/responses/401Unauthorized'
        '403':
          $ref: '#/components/responses/403Forbidden'
        '404':
          $ref: '#/components/responses/404NotFound'
        '406':
          $ref: '#/components/responses/406NotAcceptable'
        '410':
          $ref: '#/components/responses/410Gone'
        '429':
          $ref: '#/components/responses/429RateLimit'
        '500':
          $ref: '#/components/responses/500InternalServerError'
        '503':
          $ref: '#/components/responses/503ServiceUnavailable'
  /services/{serviceId}/routes/{routeId}:
    parameters:
    - $ref: '#/components/parameters/serviceIdParam'
    - name: routeId
      in: path
      required: true
      description: The id of the route
      schema:
        type: string
    delete:
      summary: Delete redirect/rewrite rule
      description: 'Delete a particular redirect/rewrite rule for a particular service.

        '
      operationId: delete-route
      tags:
      - Services - Routes
      responses:
        '204':
          description: Route deleted
        '401':
          $ref: '#/components/responses/401Unauthorized'
        '403':
          $ref: '#/components/responses/403Forbidden'
        '404':
          $ref: '#/components/responses/404NotFound'
        '406':
          $ref: '#/components/responses/406NotAcceptable'
        '410':
          $ref: '#/components/responses/410Gone'
        '429':
          $ref: '#/components/responses/429RateLimit'
        '500':
          $ref: '#/components/responses/500InternalServerError'
        '503':
          $ref: '#/components/responses/503ServiceUnavailable'
components:
  responses:
    429RateLimit:
      description: Rate limit has been surpassed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
    503ServiceUnavailable:
      description: Server currently unavailable.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
    403Forbidden:
      description: You do not have permissions for the requested resource.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
    500InternalServerError:
      description: An unexpected server error has occurred.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
    404NotFound:
      description: Unable to find the requested resource.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
    406NotAcceptable:
      description: Unable to generate preferred media types as specified by Accept request header.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
    400BadRequest:
      description: The request could not be understood by the server.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
    401Unauthorized:
      description: Authorization information is missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
    410Gone:
      description: The requested resource is no longer available.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
  parameters:
    cursorParam:
      name: cursor
      in: query
      required: false
      description: The position in the result list to start from when fetching paginated results. For details, see [Pagination](https://api-docs.render.com/reference/pagination).
      schema:
        type: string
    limitParam:
      name: limit
      in: query
      required: false
      description: The maximum number of items to return. For details, see [Pagination](https://api-docs.render.com/reference/pagination).
      schema:
        type: integer
        default: 20
        minimum: 1
        maximum: 100
        description: Defaults to 20
    serviceIdParam:
      name: serviceId
      in: path
      required: true
      description: The ID of the service
      schema:
        type: string
  schemas:
    routePatch:
      type: object
      required:
      - priority
      properties:
        priority:
          x-go-type: '*int'
          type: integer
          description: Redirect and Rewrite Rules are applied in priority order starting at 0. Moves this route to the specified priority and adjusts other route priorities accordingly.
    route:
      type: object
      required:
      - id
      - type
      - source
      - destination
      - priority
      properties:
        id:
          type: string
        type:
          $ref: '#/components/schemas/routeType'
        source:
          type: string
        destination:
          type: string
        priority:
          type: integer
          description: Redirect and Rewrite Rules are applied in priority order starting at 0
    routeWithCursor:
      type: object
      required:
      - route
      - cursor
      properties:
        route:
          $ref: '#/components/schemas/route'
        cursor:
          type: string
    routeType:
      type: string
      enum:
      - redirect
      - rewrite
    routePut:
      type: object
      required:
      - type
      - source
      - destination
      properties:
        type:
          $ref: '#/components/schemas/routeType'
        source:
          type: string
          example: /:bar/foo
        destination:
          type: string
          example: /foo/:bar
    error:
      type: object
      properties:
        id:
          type: string
        message:
          type: string
    routePost:
      type: object
      required:
      - type
      - source
      - destination
      properties:
        type:
          $ref: '#/components/schemas/routeType'
        source:
          type: string
          example: /:bar/foo
        destination:
          type: string
          example: /foo/:bar
        priority:
          type: integer
          description: Redirect and Rewrite Rules are applied in priority order starting at 0. Defaults to last in the priority list.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
x-readme:
  metrics-enabled: false