API

V2Ray provides some API for remote access. These APIs are based on gRPC.

When API is enabled, V2Ray creates an outbound proxy automatically, tagged as tag. User must route all gRPC connections to this outbound.

ApiObject

ApiObject is used as api field in top level configuration.

{
  "tag": "api",
  "services": [
    "HandlerService",
    "LoggerService",
    "StatsService"
  ]
}

tag: string

The tag of the outbound proxy.

services: [ string ]

List of enabled APIs.

Supported API list

HandlerService

API for manipulating inbound and outbound proxies. The following functionalities are provided:

  • Add a new inbound/outbound proxy.
  • Remove an existing inbound/outbound proxy.
  • Add a new user to an inbound proxy (VMess only).
  • Remove an existing user from an inbound proxy (VMess only).

LoggerService

To restart internal logger. Can work with logrotate for operating log files.

StatsService

Support for internal Statistics.