Spring Cloud Gateway Routes API

Manage gateway route definitions at runtime

OpenAPI Specification

spring-cloud-gateway-routes-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Spring Cloud Gateway Actuator Filters Routes API
  description: Actuator endpoints exposed by Spring Cloud Gateway for managing routes, global filters, and route filter factories at runtime. These endpoints are available under the /actuator/gateway path and allow dynamic route management without application restart.
  version: 4.1.0
  contact:
    name: Spring Cloud Team
    url: https://spring.io/projects/spring-cloud-gateway
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
servers:
- url: http://localhost:8080/actuator/gateway
  description: Default Gateway Actuator base path
tags:
- name: Routes
  description: Manage gateway route definitions at runtime
paths:
  /routes:
    get:
      operationId: getRoutes
      summary: List All Gateway Routes
      description: Returns all route definitions including predicates, filters, URI, order, and metadata
      tags:
      - Routes
      responses:
        '200':
          description: List of route definitions
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RouteDefinition'
    post:
      operationId: createRoute
      summary: Create a New Route Definition
      tags:
      - Routes
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RouteDefinition'
      responses:
        '201':
          description: Route created
        '400':
          description: Invalid route definition
  /routes/{id}:
    get:
      operationId: getRoute
      summary: Get a Specific Route Definition
      tags:
      - Routes
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
        description: Route identifier
      responses:
        '200':
          description: Route definition
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RouteDefinition'
        '404':
          description: Route not found
    put:
      operationId: updateRoute
      summary: Update a Route Definition
      tags:
      - Routes
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
        description: Route identifier
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RouteDefinition'
      responses:
        '200':
          description: Route updated
    delete:
      operationId: deleteRoute
      summary: Delete a Route Definition
      tags:
      - Routes
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
        description: Route identifier
      responses:
        '200':
          description: Route deleted
        '404':
          description: Route not found
  /refresh:
    post:
      operationId: refreshRoutes
      summary: Refresh the Routes Cache
      description: Forces a refresh of the route definitions from the configuration source
      tags:
      - Routes
      responses:
        '200':
          description: Routes refreshed successfully
components:
  schemas:
    RouteDefinition:
      type: object
      required:
      - id
      - uri
      - predicates
      properties:
        id:
          type: string
          description: Unique route identifier
        uri:
          type: string
          description: Destination URI for the route
        predicates:
          type: array
          items:
            $ref: '#/components/schemas/PredicateDefinition'
          description: List of predicates that must match for this route
        filters:
          type: array
          items:
            $ref: '#/components/schemas/FilterDefinition'
          description: List of filters applied to matching requests
        order:
          type: integer
          description: Route priority order (lower = higher priority)
        metadata:
          type: object
          additionalProperties: true
          description: Additional route metadata
    FilterDefinition:
      type: object
      properties:
        name:
          type: string
          description: Filter factory name (e.g., AddRequestHeader, RewritePath)
        args:
          type: object
          additionalProperties:
            type: string
          description: Filter configuration arguments
    PredicateDefinition:
      type: object
      properties:
        name:
          type: string
          description: Predicate factory name (e.g., Path, Host, Method)
        args:
          type: object
          additionalProperties:
            type: string
          description: Predicate configuration arguments