frp

frp Client Admin API

The frp client admin API is the HTTP control plane exposed by frpc on its local web server. It supports hot-reloading the proxy and visitor configuration, stopping the running client, returning the active config, replacing the active config, querying per-proxy and per-visitor status, and (when a configuration store is enabled) listing, creating, updating, and deleting persisted proxy and visitor definitions. The API is secured with HTTP Basic auth using the user and password configured in the frpc webServer block.

OpenAPI Specification

frp-client-admin-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: frp Client Admin API
  description: >-
    The frp client (frpc) exposes a built-in HTTP admin API on its local
    web server. The API lets operators inspect or hot-reload the client
    configuration, stop the client, query proxy and visitor status, and
    (when a configuration store is enabled) manage stored proxy and visitor
    definitions. All routes (except /healthz) require HTTP Basic
    authentication using the user and password configured in
    webServer.user and webServer.password.
  version: "0.0.1"
  contact:
    name: frp
    url: https://gofrp.org/
  license:
    name: Apache-2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
servers:
  - url: http://{host}:{port}
    description: frp client admin server (frpc webServer)
    variables:
      host:
        default: 127.0.0.1
        description: Address where frpc webServer is listening (webServer.addr)
      port:
        default: "7400"
        description: Port where frpc webServer is listening (webServer.port)
tags:
  - name: Health
    description: Liveness probe
  - name: Lifecycle
    description: Reload and stop the running frpc process
  - name: Status
    description: Runtime status of proxies and visitors
  - name: Configuration
    description: Read and replace the in-memory frpc configuration
  - name: Store
    description: Persistent configuration store for proxies and visitors
paths:
  /healthz:
    get:
      tags:
        - Health
      summary: Health check
      description: Returns HTTP 200 when the client is running. This route requires no authentication.
      operationId: getHealthz
      security: []
      responses:
        "200":
          description: Client is healthy
  /api/reload:
    get:
      tags:
        - Lifecycle
      summary: Reload configuration
      description: Reloads proxy and visitor configuration from the configuration source without restarting frpc.
      operationId: reloadConfig
      responses:
        "200":
          description: Reload succeeded
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GeneralResponse"
  /api/stop:
    post:
      tags:
        - Lifecycle
      summary: Stop client
      description: Initiates a graceful shutdown of the running frpc process.
      operationId: stopClient
      responses:
        "200":
          description: Stop accepted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GeneralResponse"
  /api/status:
    get:
      tags:
        - Status
      summary: Get proxy status
      description: Returns the working status for every proxy currently managed by this frpc instance, grouped by proxy type.
      operationId: getStatus
      responses:
        "200":
          description: Proxy status grouped by type
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: array
                  items:
                    $ref: "#/components/schemas/ProxyStatus"
  /api/config:
    get:
      tags:
        - Configuration
      summary: Get current configuration
      description: Returns the raw text of the active frpc configuration.
      operationId: getConfig
      responses:
        "200":
          description: Active configuration
          content:
            text/plain:
              schema:
                type: string
    put:
      tags:
        - Configuration
      summary: Replace configuration
      description: Replaces the active frpc configuration with the request body.
      operationId: putConfig
      requestBody:
        required: true
        content:
          text/plain:
            schema:
              type: string
              description: Replacement configuration text (TOML or INI as supported by frpc)
      responses:
        "200":
          description: Configuration replaced
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GeneralResponse"
  /api/proxy/{name}/config:
    get:
      tags:
        - Configuration
      summary: Get proxy configuration
      description: Returns the runtime configuration for a single proxy identified by name.
      operationId: getProxyConfig
      parameters:
        - name: name
          in: path
          required: true
          description: Proxy name
          schema:
            type: string
      responses:
        "200":
          description: Proxy configuration
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        "404":
          description: Proxy not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /api/visitor/{name}/config:
    get:
      tags:
        - Configuration
      summary: Get visitor configuration
      description: Returns the runtime configuration for a single visitor identified by name.
      operationId: getVisitorConfig
      parameters:
        - name: name
          in: path
          required: true
          description: Visitor name
          schema:
            type: string
      responses:
        "200":
          description: Visitor configuration
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        "404":
          description: Visitor not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /api/store/proxies:
    get:
      tags:
        - Store
      summary: List stored proxies
      description: Lists proxy definitions persisted in the configuration store. Available only when a store source is configured.
      operationId: listStoreProxies
      responses:
        "200":
          description: Stored proxy definitions
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/StoredProxy"
    post:
      tags:
        - Store
      summary: Create stored proxy
      description: Persists a new proxy definition in the configuration store.
      operationId: createStoreProxy
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/StoredProxy"
      responses:
        "200":
          description: Proxy created
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StoredProxy"
  /api/store/proxies/{name}:
    get:
      tags:
        - Store
      summary: Get stored proxy
      operationId: getStoreProxy
      parameters:
        - name: name
          in: path
          required: true
          description: Stored proxy name
          schema:
            type: string
      responses:
        "200":
          description: Stored proxy
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StoredProxy"
        "404":
          description: Stored proxy not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
    put:
      tags:
        - Store
      summary: Update stored proxy
      operationId: updateStoreProxy
      parameters:
        - name: name
          in: path
          required: true
          description: Stored proxy name
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/StoredProxy"
      responses:
        "200":
          description: Stored proxy updated
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StoredProxy"
        "404":
          description: Stored proxy not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
    delete:
      tags:
        - Store
      summary: Delete stored proxy
      operationId: deleteStoreProxy
      parameters:
        - name: name
          in: path
          required: true
          description: Stored proxy name
          schema:
            type: string
      responses:
        "200":
          description: Stored proxy deleted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GeneralResponse"
        "404":
          description: Stored proxy not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /api/store/visitors:
    get:
      tags:
        - Store
      summary: List stored visitors
      description: Lists visitor definitions persisted in the configuration store. Available only when a store source is configured.
      operationId: listStoreVisitors
      responses:
        "200":
          description: Stored visitor definitions
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/StoredVisitor"
    post:
      tags:
        - Store
      summary: Create stored visitor
      operationId: createStoreVisitor
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/StoredVisitor"
      responses:
        "200":
          description: Visitor created
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StoredVisitor"
  /api/store/visitors/{name}:
    get:
      tags:
        - Store
      summary: Get stored visitor
      operationId: getStoreVisitor
      parameters:
        - name: name
          in: path
          required: true
          description: Stored visitor name
          schema:
            type: string
      responses:
        "200":
          description: Stored visitor
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StoredVisitor"
        "404":
          description: Stored visitor not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
    put:
      tags:
        - Store
      summary: Update stored visitor
      operationId: updateStoreVisitor
      parameters:
        - name: name
          in: path
          required: true
          description: Stored visitor name
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/StoredVisitor"
      responses:
        "200":
          description: Stored visitor updated
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StoredVisitor"
        "404":
          description: Stored visitor not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
    delete:
      tags:
        - Store
      summary: Delete stored visitor
      operationId: deleteStoreVisitor
      parameters:
        - name: name
          in: path
          required: true
          description: Stored visitor name
          schema:
            type: string
      responses:
        "200":
          description: Stored visitor deleted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GeneralResponse"
        "404":
          description: Stored visitor not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
components:
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
      description: HTTP Basic auth using webServer.user and webServer.password
  schemas:
    ProxyStatus:
      type: object
      properties:
        name:
          type: string
        type:
          type: string
        status:
          type: string
        err:
          type: string
        localAddr:
          type: string
        plugin:
          type: string
        remoteAddr:
          type: string
    StoredProxy:
      type: object
      properties:
        name:
          type: string
        type:
          type: string
        config:
          type: object
          additionalProperties: true
      required:
        - name
        - type
    StoredVisitor:
      type: object
      properties:
        name:
          type: string
        type:
          type: string
        config:
          type: object
          additionalProperties: true
      required:
        - name
        - type
    GeneralResponse:
      type: object
      properties:
        code:
          type: integer
        msg:
          type: string
    Error:
      type: object
      properties:
        code:
          type: integer
        msg:
          type: string
security:
  - BasicAuth: []