Skip to content
This page was translated with AI and may contain inaccuracies. Help improve it on GitHub.

Gately Admin API ​

The Gately Admin API supports scripting and bulk automation.

Authentication: create a token on the "API Tokens" page of the admin console and send the header Authorization: Bearer gtl_xxxx.

Permissions: each token has only the permissions selected at creation, in the form <module>:read or <module>:write; write permission includes read. Account, two-factor authentication and token management endpoints, as well as backup, restore, restart and system settings endpoints, can be used by login sessions only.

Send the request body with Content-Type: application/json; errors are returned uniformly as {"error": "message"}.

Modules turned off under "Settings → Modules" serve no API: their endpoints return 403 and no longer appear in the API docs of the running instance.

Website: https://gately.cn

A machine-readable description is available in openapi.json (OpenAPI 3.0) in the same directory.

Quick start ​

bash
# View system status (requires status:read)
curl -H "Authorization: Bearer gtl_xxxx" http://localhost:16680/api/status

# List all DDNS tasks (requires ddns:read)
curl -H "Authorization: Bearer gtl_xxxx" http://localhost:16680/api/ddns/tasks

# Sync a DDNS task immediately (requires ddns:write; take the key from the list returned in the previous step)
curl -X POST -H "Authorization: Bearer gtl_xxxx" http://localhost:16680/api/ddns/tasks/<key>/sync

Permissions ​

Permission domainNameAvailable permissions
portforwardPort forwardingportforward:read、portforward:write
ddnsDynamic DNSddns:read、ddns:write
stunSTUN traversalstun:read、stun:write
tailscaleTailscale networkingtailscale:read、tailscale:write
frpfrp tunnelingfrp:read、frp:write
cloudflaredCloudflare Tunnelcloudflared:read、cloudflared:write
sslSSL certificatessl:read、ssl:write
wafWAF firewallwaf:read、waf:write
webserviceWeb servicewebservice:read、webservice:write
guardIntrusion Preventionguard:read、guard:write
wolWake-on-LANwol:read、wol:write
webterminalWeb terminalwebterminal:read、webterminal:write
cronScheduled taskcron:read、cron:write
dockerDocker managementdocker:read、docker:write
webdavWebDAV Servicewebdav:read、webdav:write
ftpFTP serviceftp:read、ftp:write
storageStorage Mountsstorage:read、storage:write
notifyNotification centernotify:read、notify:write
nettoolsNetwork diagnosticsnettools:read、nettools:write
backupConfiguration backupbackup:read、backup:write
statusSystem statusstatus:read
logsSystem logslogs:read
metricsMetrics (Prometheus)metrics:read
importLucky configuration importimport:write

Wildcards: *:read means read-only access to all modules; *:write or * means read-write access to all modules.

Port forwarding ​

MethodPathRequired permissionDescription
GET/api/portforward/logsportforward:readView module runtime logs
DELETE/api/portforward/logsportforward:writeClear module runtime logs
GET/api/portforward/rulesportforward:readList Port forwarding rule
POST/api/portforward/rulesportforward:writeCreate Port forwarding rule
PUT/api/portforward/rules/{key}portforward:writeUpdate Port forwarding rule
DELETE/api/portforward/rules/{key}portforward:writeDelete Port forwarding rule
PUT/api/portforward/rules/{key}/enableportforward:writeEnable or disable Port forwarding rule
PUT/api/portforward/rules-orderportforward:writeReorder Port forwarding rule
GET/api/portforward/settingsportforward:readRead port forwarding global settings
PUT/api/portforward/settingsportforward:writeSave port forwarding global settings

Dynamic DNS ​

MethodPathRequired permissionDescription
GET/api/ddns/logsddns:readView module runtime logs
DELETE/api/ddns/logsddns:writeClear module runtime logs
GET/api/ddns/tasksddns:readList DDNS task
POST/api/ddns/tasksddns:writeCreate DDNS task
PUT/api/ddns/tasks/{key}ddns:writeUpdate DDNS task
DELETE/api/ddns/tasks/{key}ddns:writeDelete DDNS task
PUT/api/ddns/tasks/{key}/enableddns:writeEnable or disable DDNS task
PUT/api/ddns/tasks-orderddns:writeReorder DDNS task
POST/api/ddns/tasks/{key}/syncddns:writeSync a DDNS task immediately
GET/api/ddns/providersddns:readList supported DNS providers and their required parameters
GET/api/ddns/netinterfacesddns:readList network interfaces and addresses on this machine
POST/api/ddns/iptestddns:writeTest public IP lookup
GET/api/ddns/defaultsddns:readRead DDNS defaults
GET/api/ddns/settingsddns:readRead DDNS global settings
PUT/api/ddns/settingsddns:writeSave DDNS global settings

STUN traversal ​

MethodPathRequired permissionDescription
GET/api/stun/logsstun:readView module runtime logs
DELETE/api/stun/logsstun:writeClear module runtime logs
GET/api/stun/rulesstun:readList STUN rule
POST/api/stun/rulesstun:writeCreate STUN rule
PUT/api/stun/rules/{key}stun:writeUpdate STUN rule
DELETE/api/stun/rules/{key}stun:writeDelete STUN rule
PUT/api/stun/rules/{key}/enablestun:writeEnable or disable STUN rule
PUT/api/stun/rules-orderstun:writeReorder STUN rule
POST/api/stun/rules/{key}/restartstun:writeRestart a STUN rule
GET/api/stun/netinterfacesstun:readList network interfaces and addresses on this machine
GET/api/stun/settingsstun:readRead STUN global settings
PUT/api/stun/settingsstun:writeSave STUN global settings

Tailscale networking ​

MethodPathRequired permissionDescription
GET/api/tailscale/logstailscale:readView module runtime logs
DELETE/api/tailscale/logstailscale:writeClear module runtime logs
GET/api/tailscale/settingstailscale:readRead Tailscale settings
PUT/api/tailscale/settingstailscale:writeSave Tailscale settings
GET/api/tailscale/statustailscale:readView Tailscale connection status
POST/api/tailscale/restarttailscale:writeRestart Tailscale
POST/api/tailscale/logouttailscale:writeSign out of Tailscale

frp tunneling ​

MethodPathRequired permissionDescription
GET/api/frp/logsfrp:readView module runtime logs
DELETE/api/frp/logsfrp:writeClear module runtime logs
GET/api/frp/proxiesfrp:readList Entry
POST/api/frp/proxiesfrp:writeCreate Entry
PUT/api/frp/proxies/{key}frp:writeUpdate Entry
DELETE/api/frp/proxies/{key}frp:writeDelete Entry
PUT/api/frp/proxies/{key}/enablefrp:writeEnable or disable Entry
PUT/api/frp/proxies-orderfrp:writeReorder Entry
POST/api/frp/importfrp:writeImport an existing frpc / frps configuration (legacy ini and new toml are supported); preview only when apply is false
GET/api/frp/clientfrp:readRead frp client configuration
PUT/api/frp/clientfrp:writeSave frp client configuration
GET/api/frp/serverfrp:readRead frp server configuration
PUT/api/frp/serverfrp:writeSave frp server configuration

Cloudflare Tunnel ​

MethodPathRequired permissionDescription
GET/api/cloudflared/logscloudflared:readView module runtime logs
DELETE/api/cloudflared/logscloudflared:writeClear module runtime logs
GET/api/cloudflared/tunnelscloudflared:readList Cloudflare Tunnel
POST/api/cloudflared/tunnelscloudflared:writeCreate Cloudflare Tunnel
PUT/api/cloudflared/tunnels/{key}cloudflared:writeUpdate Cloudflare Tunnel
DELETE/api/cloudflared/tunnels/{key}cloudflared:writeDelete Cloudflare Tunnel
PUT/api/cloudflared/tunnels/{key}/enablecloudflared:writeEnable or disable Cloudflare Tunnel
PUT/api/cloudflared/tunnels-ordercloudflared:writeReorder Cloudflare Tunnel
POST/api/cloudflared/tunnels/{key}/restartcloudflared:writeRestart a Cloudflare Tunnel
GET/api/cloudflared/settingscloudflared:readRead Cloudflare Tunnel settings
PUT/api/cloudflared/settingscloudflared:writeSave Cloudflare Tunnel settings

SSL certificate ​

MethodPathRequired permissionDescription
GET/api/ssl/logsssl:readView module runtime logs
DELETE/api/ssl/logsssl:writeClear module runtime logs
GET/api/ssl/certsssl:readList Certificate
POST/api/ssl/certsssl:writeCreate Certificate
PUT/api/ssl/certs/{key}ssl:writeUpdate Certificate
DELETE/api/ssl/certs/{key}ssl:writeDelete Certificate
PUT/api/ssl/certs/{key}/enablessl:writeEnable or disable Certificate
PUT/api/ssl/certs-orderssl:writeReorder Certificate
POST/api/ssl/certs/{key}/renewssl:writeIssue or renew a certificate immediately
GET/api/ssl/certs/{key}/downloadssl:writeDownload certificate and private key
POST/api/ssl/certs/{key}/deployssl:writeDeploy a certificate now
GET/api/ssl/deploy-targetsssl:readList available deployment targets
GET/api/ssl/providersssl:readList supported DNS validation providers
GET/api/ssl/settingsssl:readRead certificate global settings
PUT/api/ssl/settingsssl:writeSave certificate global settings

WAF firewall ​

MethodPathRequired permissionDescription
GET/api/waf/logswaf:readView module runtime logs
DELETE/api/waf/logswaf:writeClear module runtime logs
GET/api/waf/instanceswaf:readList WAF instance
POST/api/waf/instanceswaf:writeCreate WAF instance
PUT/api/waf/instances/{key}waf:writeUpdate WAF instance
DELETE/api/waf/instances/{key}waf:writeDelete WAF instance
PUT/api/waf/instances/{key}/enablewaf:writeEnable or disable WAF instance
PUT/api/waf/instances-orderwaf:writeReorder WAF instance
GET/api/waf/crswaf:readList OWASP CRS rule files
GET/api/waf/crs/{file}waf:readRead a CRS rule file

Web service ​

MethodPathRequired permissionDescription
GET/api/webservice/logswebservice:readView module runtime logs
DELETE/api/webservice/logswebservice:writeClear module runtime logs
GET/api/webservice/listenerswebservice:readList Web service listening
POST/api/webservice/listenerswebservice:writeCreate Web service listening
PUT/api/webservice/listeners/{key}webservice:writeUpdate Web service listening
DELETE/api/webservice/listeners/{key}webservice:writeDelete Web service listening
PUT/api/webservice/listeners/{key}/enablewebservice:writeEnable or disable Web service listening
PUT/api/webservice/listeners-orderwebservice:writeReorder Web service listening
GET/api/webservice/iplistswebservice:readList Subscribed IP list
POST/api/webservice/iplistswebservice:writeCreate Subscribed IP list
PUT/api/webservice/iplists/{key}webservice:writeUpdate Subscribed IP list
DELETE/api/webservice/iplists/{key}webservice:writeDelete Subscribed IP list
PUT/api/webservice/iplists/{key}/enablewebservice:writeEnable or disable Subscribed IP list
PUT/api/webservice/iplists-orderwebservice:writeReorder Subscribed IP list
POST/api/webservice/iplists/{key}/refreshwebservice:writeRefresh a subscribed IP list now
POST/api/webservice/import/nginxwebservice:writeImport nginx config
GET/api/webservice/settingswebservice:readRead Web service global settings
POST/api/webservice/totp-secretwebservice:writeGenerate a new TOTP key for a shared user (not saved; takes effect after saving settings)
PUT/api/webservice/settingswebservice:writeSave Web service global settings
GET/api/webservice/statswebservice:readPer-minute site statistics (?listener=&site=&minutes=)
GET/api/webservice/metricswebservice:readMetrics in Prometheus text format
GET/api/webservice/banswebservice:readCurrently banned IPs
POST/api/webservice/banswebservice:writeManually ban an IP
DELETE/api/webservice/banswebservice:writeRemove a ban (body is {"key": address})
GET/api/webservice/geoipwebservice:readGeoIP database status
POST/api/webservice/geoip/uploadwebservice:writeUpload a GeoIP database (multipart field file, .mmdb)
POST/api/webservice/geoip/downloadwebservice:writeDownload a GeoIP database (.mmdb) from a URL
DELETE/api/webservice/geoipwebservice:writeRemove the GeoIP database

Intrusion Prevention ​

MethodPathRequired permissionDescription
GET/api/guard/logsguard:readView module runtime logs
DELETE/api/guard/logsguard:writeClear module runtime logs
GET/api/guard/jailsguard:readList Entry
POST/api/guard/jailsguard:writeCreate Entry
PUT/api/guard/jails/{key}guard:writeUpdate Entry
DELETE/api/guard/jails/{key}guard:writeDelete Entry
PUT/api/guard/jails/{key}/enableguard:writeEnable or disable Entry
PUT/api/guard/jails-orderguard:writeReorder Entry
GET/api/guard/presetsguard:readJail templates for common services
POST/api/guard/jails/testguard:writeTest filters against sample log lines
GET/api/guard/statusguard:readFirewall sync status and environment
GET/api/guard/settingsguard:readGlobal settings
PUT/api/guard/settingsguard:writeUpdate global settings
GET/api/guard/bansguard:readCurrently banned IPs
POST/api/guard/bansguard:writeBan an IP or network manually
DELETE/api/guard/bansguard:writeRemove a ban (body is {"key": address})
GET/api/guard/firewall/rulesguard:readRules Gately wrote to nftables (text)

Wake-on-LAN ​

MethodPathRequired permissionDescription
GET/api/wol/logswol:readView module runtime logs
DELETE/api/wol/logswol:writeClear module runtime logs
GET/api/wol/deviceswol:readList Wake a device
POST/api/wol/deviceswol:writeCreate Wake a device
PUT/api/wol/devices/{key}wol:writeUpdate Wake a device
DELETE/api/wol/devices/{key}wol:writeDelete Wake a device
PUT/api/wol/devices/{key}/enablewol:writeEnable or disable Wake a device
PUT/api/wol/devices-orderwol:writeReorder Wake a device
POST/api/wol/devices/{key}/wakewol:writeSend a Wake-on-LAN magic packet to a device
GET/api/wol/statuswol:readView device online status

Web terminal ​

MethodPathRequired permissionDescription
GET/api/webterminal/logswebterminal:readView module runtime logs
DELETE/api/webterminal/logswebterminal:writeClear module runtime logs
GET/api/webterminal/connectionswebterminal:readList Terminal connection
POST/api/webterminal/connectionswebterminal:writeCreate Terminal connection
PUT/api/webterminal/connections/{key}webterminal:writeUpdate Terminal connection
DELETE/api/webterminal/connections/{key}webterminal:writeDelete Terminal connection
PUT/api/webterminal/connections/{key}/enablewebterminal:writeEnable or disable Terminal connection
PUT/api/webterminal/connections-orderwebterminal:writeReorder Terminal connection
DELETE/api/webterminal/connections/{key}/hostkeywebterminal:writeClear the recorded host key
POST/api/webterminal/connections/{key}/testwebterminal:writeTest a saved connection
POST/api/webterminal/connections/testwebterminal:writeTest temporary connection parameters
PUT/api/webterminal/connections/{key}/quickaccesswebterminal:writeSet the quick access for a connection
GET/api/webterminal/credentialswebterminal:readList Entry
POST/api/webterminal/credentialswebterminal:writeCreate Entry
PUT/api/webterminal/credentials/{key}webterminal:writeUpdate Entry
DELETE/api/webterminal/credentials/{key}webterminal:writeDelete Entry
PUT/api/webterminal/credentials/{key}/enablewebterminal:writeEnable or disable Entry
PUT/api/webterminal/credentials-orderwebterminal:writeReorder Entry
GET/api/webterminal/connections/{key}/wswebterminal:writeOpen a terminal session (WebSocket)
GET/api/webterminal/sessions/{id}/wswebterminal:writeAttach to an existing terminal session (WebSocket)
GET/api/webterminal/sessionswebterminal:readList terminal sessions
GET/api/webterminal/sessions/{id}webterminal:readView terminal session details
PUT/api/webterminal/sessions/{id}/remarkwebterminal:writeModify the note of a terminal session
GET/api/webterminal/sessions/{id}/statswebterminal:readView terminal session statistics
DELETE/api/webterminal/sessions/{id}webterminal:writeClose a terminal session
GET/api/webterminal/securityLogin sessions onlyView terminal security settings status
POST/api/webterminal/security/agreementLogin sessions onlyAccept the terminal user agreement
POST/api/webterminal/security/2fa/setupLogin sessions onlyGenerate a terminal two-factor secret
POST/api/webterminal/security/2fa/enableLogin sessions onlyEnable terminal two-factor authentication
POST/api/webterminal/security/2fa/disableLogin sessions onlyDisable terminal two-factor authentication
POST/api/webterminal/security/verify2faLogin sessions onlyVerify a terminal two-factor code
GET/api/webterminal/security/check2faLogin sessions onlyCheck whether terminal two-factor verification has passed
GET/api/webterminal/sftp/{key}/listwebterminal:readList a remote directory
GET/api/webterminal/sftp/{key}/readwebterminal:writeRead a remote file
POST/api/webterminal/sftp/{key}/writewebterminal:writeWrite a remote file
POST/api/webterminal/sftp/{key}/uploadwebterminal:writeUpload a file to a remote host
POST/api/webterminal/sftp/{key}/mkdirwebterminal:writeCreate a remote directory
POST/api/webterminal/sftp/{key}/touchwebterminal:writeCreate an empty remote file
POST/api/webterminal/sftp/{key}/renamewebterminal:writeRename or move a remote file
POST/api/webterminal/sftp/{key}/copywebterminal:writeCopy a remote file
POST/api/webterminal/sftp/{key}/chmodwebterminal:writeChange remote file permissions
DELETE/api/webterminal/sftp/{key}/removewebterminal:writeDelete a remote file
POST/api/webterminal/sftp/{key}/compresswebterminal:writeCompress files on a remote host
POST/api/webterminal/sftp/{key}/decompresswebterminal:writeExtract files on a remote host
GET/api/webterminal/sftp/{key}/preview-archivewebterminal:writePreview the contents of a remote archive
GET/api/webterminal/settingswebterminal:readRead Web terminal settings
PUT/api/webterminal/settingswebterminal:writeSave Web terminal settings
GET/api/webterminal/shellswebterminal:readList the shells available on this machine
GET/api/webterminal/globalshortcutswebterminal:readRead global quick commands
PUT/api/webterminal/globalshortcutswebterminal:writeSave global quick commands
GET/api/webterminal/splitlayoutwebterminal:readRead split-pane layout
PUT/api/webterminal/splitlayoutwebterminal:writeSave split-pane layout
DELETE/api/webterminal/splitlayoutwebterminal:writeClear split-pane layout

Scheduled task ​

MethodPathRequired permissionDescription
GET/api/cron/logscron:readView module runtime logs
DELETE/api/cron/logscron:writeClear module runtime logs
GET/api/cron/taskscron:readList Scheduled task
POST/api/cron/taskscron:writeCreate Scheduled task
PUT/api/cron/tasks/{key}cron:writeUpdate Scheduled task
DELETE/api/cron/tasks/{key}cron:writeDelete Scheduled task
PUT/api/cron/tasks/{key}/enablecron:writeEnable or disable Scheduled task
PUT/api/cron/tasks-ordercron:writeReorder Scheduled task
POST/api/cron/tasks/{key}/runcron:writeRun a scheduled task immediately
POST/api/cron/parsecron:writeParse and preview a Cron expression

Docker management ​

MethodPathRequired permissionDescription
GET/api/docker/logsdocker:readView module runtime logs
DELETE/api/docker/logsdocker:writeClear module runtime logs
GET/api/docker/tasksdocker:readList background tasks
GET/api/docker/tasks/{id}docker:readView background task progress and output
DELETE/api/docker/tasksdocker:writeClean up finished background tasks
GET/api/docker/imagesdocker:readList images
POST/api/docker/images/pulldocker:writePull an image
POST/api/docker/images/pushdocker:writePush an image
POST/api/docker/images/searchdocker:writeSearch images
POST/api/docker/images/loaddocker:writeImport an image file
POST/api/docker/images/builddocker:writeBuild an image
GET/api/docker/images/{id}docker:readView image details
POST/api/docker/images/{id}/tagdocker:writeTag an image
DELETE/api/docker/images/{id}docker:writeDelete an image
GET/api/docker/images/{id}/exportdocker:writeExport an image
GET/api/docker/networksdocker:readList networks
POST/api/docker/networksdocker:writeCreate a network
DELETE/api/docker/networks/{id}docker:writeDelete a network
POST/api/docker/networks/{id}/connectdocker:writeConnect a container to a network
POST/api/docker/networks/{id}/disconnectdocker:writeDisconnect a container from a network
GET/api/docker/volumesdocker:readList volumes
POST/api/docker/volumesdocker:writeCreate a volume
DELETE/api/docker/volumes/{name}docker:writeDelete a volume
GET/api/docker/volumes/{name}/exportdocker:writeExport a volume
POST/api/docker/volumes/{name}/importdocker:writeImport data into a volume
GET/api/docker/compose/projectsdocker:readList Compose projects
POST/api/docker/compose/projectsdocker:writeCreate a Compose project
POST/api/docker/compose/{project}/updocker:writeStart a Compose project
POST/api/docker/compose/{project}/pulldocker:writePull Compose project images
POST/api/docker/compose/{project}/{action}docker:writeRun an action on a Compose project
GET/api/docker/compose/{project}/configdocker:writeRead a Compose file
PUT/api/docker/compose/{project}/configdocker:writeSave a Compose file
GET/api/docker/compose/{project}/logsdocker:readView Compose project logs
DELETE/api/docker/compose/{project}docker:writeDelete a Compose project
GET/api/docker/infodocker:readView Docker engine info
GET/api/docker/disk-usagedocker:readView Docker disk usage
POST/api/docker/prunedocker:writeClean up unused Docker resources
GET/api/docker/settingsdocker:readRead Docker module settings
PUT/api/docker/settingsdocker:writeSave Docker module settings
GET/api/docker/containersdocker:readList containers
POST/api/docker/containersdocker:writeCreate a container
POST/api/docker/containers/check-alldocker:writeCheck all containers for image updates
POST/api/docker/containers/upgrade-batchdocker:writeUpgrade containers in bulk
POST/api/docker/images/upgrade-checkdocker:writeCheck whether an image has a new version
GET/api/docker/containers/{id}docker:readView container details
DELETE/api/docker/containers/{id}docker:writeDelete a container
POST/api/docker/containers/{id}/editdocker:writeModify container configuration and recreate it
POST/api/docker/containers/{id}/renamedocker:writeRename a container
POST/api/docker/containers/{id}/commitdocker:writeCommit a container as an image
POST/api/docker/containers/{id}/checkdocker:writeCheck whether a container image has updates
POST/api/docker/containers/{id}/upgradedocker:writeUpgrade a container image and recreate the container
POST/api/docker/containers/{id}/{action}docker:writeRun an action on a container
GET/api/docker/containers/{id}/logsdocker:readView container logs
GET/api/docker/containers/{id}/statsdocker:readView container resource usage
GET/api/docker/containers/{id}/processesdocker:readView processes inside a container
GET/api/docker/containers/{id}/files/listdocker:readList a directory inside a container
GET/api/docker/containers/{id}/files/readdocker:writeRead a file inside a container
GET/api/docker/containers/{id}/files/downloaddocker:writeDownload a file from a container
POST/api/docker/containers/{id}/files/writedocker:writeWrite a file inside a container
POST/api/docker/containers/{id}/files/mkdirdocker:writeCreate a directory inside a container
POST/api/docker/containers/{id}/files/renamedocker:writeRename a file inside a container
POST/api/docker/containers/{id}/files/uploaddocker:writeUpload a file to a container
DELETE/api/docker/containers/{id}/filesdocker:writeDelete a file inside a container
GET/api/docker/containers/{id}/execdocker:writeOpen a terminal inside a container (WebSocket)

WebDAV Service ​

MethodPathRequired permissionDescription
GET/api/webdav/logswebdav:readView module runtime logs
DELETE/api/webdav/logswebdav:writeClear module runtime logs
GET/api/webdav/settingswebdav:readRead WebDAV settings
PUT/api/webdav/settingswebdav:writeSave WebDAV settings

FTP service ​

MethodPathRequired permissionDescription
GET/api/ftp/logsftp:readView module runtime logs
DELETE/api/ftp/logsftp:writeClear module runtime logs
GET/api/ftp/settingsftp:readRead FTP settings
PUT/api/ftp/settingsftp:writeSave FTP settings

Storage Mounts ​

MethodPathRequired permissionDescription
GET/api/storage/logsstorage:readView module runtime logs
DELETE/api/storage/logsstorage:writeClear module runtime logs
GET/api/storage/mountsstorage:readList Entry
POST/api/storage/mountsstorage:writeCreate Entry
PUT/api/storage/mounts/{key}storage:writeUpdate Entry
DELETE/api/storage/mounts/{key}storage:writeDelete Entry
PUT/api/storage/mounts/{key}/enablestorage:writeEnable or disable Entry
PUT/api/storage/mounts-orderstorage:writeReorder Entry
GET/api/storage/files/{key}/liststorage:readList a storage directory
GET/api/storage/files/{key}/downloadstorage:writeDownload a storage file
POST/api/storage/files/{key}/uploadstorage:writeUpload a file to storage
POST/api/storage/files/{key}/mkdirstorage:writeCreate a storage directory
POST/api/storage/files/{key}/renamestorage:writeRename or move a storage file
DELETE/api/storage/files/{key}storage:writeDelete a storage file

Notification center ​

MethodPathRequired permissionDescription
GET/api/notify/logsnotify:readView module runtime logs
DELETE/api/notify/logsnotify:writeClear module runtime logs
GET/api/notify/channelsnotify:readList Notification channel
POST/api/notify/channelsnotify:writeCreate Notification channel
PUT/api/notify/channels/{key}notify:writeUpdate Notification channel
DELETE/api/notify/channels/{key}notify:writeDelete Notification channel
PUT/api/notify/channels/{key}/enablenotify:writeEnable or disable Notification channel
PUT/api/notify/channels-ordernotify:writeReorder Notification channel
GET/api/notify/rulesnotify:readList Notification rule
POST/api/notify/rulesnotify:writeCreate Notification rule
PUT/api/notify/rules/{key}notify:writeUpdate Notification rule
DELETE/api/notify/rules/{key}notify:writeDelete Notification rule
PUT/api/notify/rules/{key}/enablenotify:writeEnable or disable Notification rule
PUT/api/notify/rules-ordernotify:writeReorder Notification rule
GET/api/notify/event-typesnotify:readEvent types that can be subscribed to
GET/api/notify/historynotify:readRecent delivery records
POST/api/notify/channels/{key}/testnotify:writeSend a test notification to a channel

Network diagnostics ​

MethodPathRequired permissionDescription
GET/api/nettools/logsnettools:readView module runtime logs
DELETE/api/nettools/logsnettools:writeClear module runtime logs
POST/api/nettools/runnettools:writeRun a diagnostic tool and return a task (tool: ping / traceroute / tcp / dns / speed / scan)
GET/api/nettools/tasksnettools:readRecent diagnostic tasks
GET/api/nettools/tasks/{id}nettools:readTask details and output
DELETE/api/nettools/tasks/{id}nettools:writeCancel a running task, or delete a finished one
GET/api/nettools/settingsnettools:readDiagnostic settings
PUT/api/nettools/settingsnettools:writeModify the probe blocklist
GET/api/nettools/networksnettools:readNetwork ranges on this machine that can be used for LAN scanning

Configuration backup ​

MethodPathRequired permissionDescription
GET/api/backup/logsbackup:readView module runtime logs
DELETE/api/backup/logsbackup:writeClear module runtime logs
GET/api/backup/targetsbackup:readList Backup destinations
POST/api/backup/targetsbackup:writeCreate Backup destinations
PUT/api/backup/targets/{key}backup:writeUpdate Backup destinations
DELETE/api/backup/targets/{key}backup:writeDelete Backup destinations
PUT/api/backup/targets/{key}/enablebackup:writeEnable or disable Backup destinations
PUT/api/backup/targets-orderbackup:writeReorder Backup destinations
GET/api/backup/settingsbackup:readBackup settings
PUT/api/backup/settingsbackup:writeModify backup settings (send the placeholder for the passphrase to keep it unchanged)
POST/api/backup/runbackup:writeRun a backup now
GET/api/backup/statusbackup:readLatest backup result and next run time
GET/api/backup/mountsbackup:readStorage mount points that can serve as backup destinations
GET/api/backup/localLogin sessions onlyList of local backup files
GET/api/backup/local/{name}Login sessions onlyDownload a local backup file

System ​

MethodPathRequired permissionDescription
GET/api/sessionAny valid tokenView the current authenticated identity
GET/api/statusstatus:readView system and module status
GET/api/logslogs:readView system logs
GET/api/system/settingsLogin sessions onlyRead global settings
PUT/api/system/settingsLogin sessions onlySave global settings
GET/api/system/infostatus:readView system information
GET/api/system/updatestatus:readCheck for a new version
POST/api/system/upgradeLogin sessions onlyUpgrade online to the latest version
GET/api/system/upgrade/statusLogin sessions onlyShow online upgrade progress
POST/api/system/upgrade/cancelLogin sessions onlyCancel online upgrade
POST/api/system/upgrade/uploadLogin sessions onlyUpgrade from an uploaded package
GET/api/system/backupLogin sessions onlyDownload a configuration backup
GET/api/system/diagnosticsLogin sessions onlyExport redacted diagnostics bundle
GET/api/auditLogin sessions onlyQuery the audit log
GET/api/metricsmetrics:readGlobal Prometheus metrics
GET/api/historyLogin sessions onlyList configuration history versions
GET/api/history/{name}/{id}/diffLogin sessions onlyCompare a history version with the current configuration
POST/api/history/{name}/{id}/restoreLogin sessions onlyRoll a configuration back to a history version
POST/api/system/restoreLogin sessions onlyRestore configuration from a backup
POST/api/system/restartLogin sessions onlyRestart Gately
POST/api/system/selfcheckLogin sessions onlyNetwork and configuration self-check
GET/api/system/onboardingLogin sessions onlyWhether first-run onboarding is pending
POST/api/system/onboarding/dismissLogin sessions onlyComplete or skip first-run onboarding
GET/api/openapi.jsonAny valid tokenGet the OpenAPI description of this API

Configuration import ​

MethodPathRequired permissionDescription
POST/api/import/luckyimport:writeImport Lucky configuration

API token ​

MethodPathRequired permissionDescription
GET/api/tokensLogin sessions onlyList API tokens
GET/api/tokens/scopesLogin sessions onlyList the permission domains that can be granted
POST/api/tokensLogin sessions onlyCreate an API token
PUT/api/tokens/{id}Login sessions onlyModify an API token's name, permissions, expiry and enabled state
POST/api/tokens/{id}/regenerateLogin sessions onlyRegenerate token plaintext
DELETE/api/tokens/{id}Login sessions onlyDelete an API token

Account ​

MethodPathRequired permissionDescription
PUT/api/accountLogin sessions onlyChange the administrator username and password
GET/api/account/passkeysLogin sessions onlyList registered Passkeys
POST/api/account/passkeys/beginLogin sessions onlyStart Passkey registration
POST/api/account/passkeysLogin sessions onlyFinish Passkey registration
DELETE/api/account/passkeys/{id}Login sessions onlyDelete a Passkey
GET/api/account/usersLogin sessions onlyList read-only accounts
POST/api/account/usersLogin sessions onlyCreate a read-only account
PUT/api/account/users/{name}Login sessions onlyReset a read-only account's password
DELETE/api/account/users/{name}Login sessions onlyDelete a read-only account
GET/api/account/totpLogin sessions onlyView two-factor authentication status
POST/api/account/totp/setupLogin sessions onlyGenerate a two-factor secret
POST/api/account/totp/enableLogin sessions onlyEnable two-factor authentication
POST/api/account/totp/disableLogin sessions onlyDisable two-factor authentication

Data structures ​

backup.LocalFile ​

FieldType
modTimeTime (RFC 3339)
namestring
sizeinteger

backup.Result ​

FieldType
errorstring
filestring
okboolean
prunedinteger
targetstring

backup.Settings ​

FieldType
enableboolean
keepinteger
localEnableboolean
passwordstring
schedulestring

backup.Status ​

FieldType
lastRunTime (RFC 3339)
manualboolean
nextRunTime (RFC 3339)
resultsArray of backup.Result
runningboolean

backup.Target ​

FieldType
dirstring
enableboolean
keystring
mountstring
namestring

backup.settingsView ​

FieldType
enableboolean
hasPasswordboolean
keepinteger
localEnableboolean
passwordstring
schedulestring

banlist.Entry ​

FieldType
countinteger
createdTime (RFC 3339)
keystring
reasonstring
sourcestring
untilTime (RFC 3339)

cloudflared.Tunnel ​

FieldType
edgeIpVersionstring
enableboolean
keystring
modestring
namestring
protocolstring
remarkstring
servicestring
tokenstring

cron.Task ​

FieldType
commandstring
enableboolean
httpwebhook.Config
keystring
namestring
remarkstring
specstring
typestring

crud.enableRequest ​

FieldType
enableboolean

crud.orderRequest ​

FieldType
keysArray of string

ddns.Record ​

FieldType
enableboolean
keystring
linestring
remarkstring
substring
ttlinteger
typestring
valuestring
zonestring

ddns.Task ​

FieldType
credentialsdnsprovider.Credentials
enableboolean
forceIntervalinteger
httpTimeoutinteger
intervalinteger
ipv4ipsource.Source
ipv6ipsource.Source
keystring
namestring
providerstring
recordsArray of ddns.Record
remarkstring
webhookwebhook.Config

dnsprovider.Credentials ​

FieldType
extraMap of string
idstring
secretstring

events.TypeInfo ​

FieldType
levelstring
namestring
typestring

frp.ClientSettings ​

FieldType
binPathstring
enableboolean
protocolstring
serverAddrstring
serverPortinteger
tokenstring
userstring

frp.ImportRequest ​

FieldType
applyboolean
contentstring
proxyModestring
rolestring

frp.ImportResponse ​

FieldType
addedinteger
appliedboolean
clientfrp.ClientSettings
proxiesArray of frp.Proxy
rolestring
serverfrp.ServerSettings
warningsArray of string

frp.Proxy ​

FieldType
customDomainsArray of string
enableboolean
keystring
localIpstring
localPortinteger
namestring
remarkstring
remotePortinteger
secretKeystring
subdomainstring
typestring

frp.ServerSettings ​

FieldType
allowPortsstring
binPathstring
bindPortinteger
dashboardAddrstring
dashboardPortinteger
dashboardPwdstring
dashboardUserstring
enableboolean
subdomainHoststring
tokenstring
vhostHttpPortinteger
vhostHttpsPortinteger

geoip.Info ​

FieldType
buildTimeTime (RFC 3339)
loadedboolean
sizeinteger
typestring

guard.BanView ​

FieldType
countinteger
createdTime (RFC 3339)
jailstring
keystring
reasonstring
sourcestring
untilTime (RFC 3339)

guard.FirewallStatus ​

FieldType
activeboolean
checkedAtTime (RFC 3339)
droppedMap of integer
enabledboolean
errorstring
hitsMap of integer
openPortsinteger
reasonstring
trapPortsstring
trapSkippedArray of integer
versionstring

guard.Jail ​

FieldType
banTimeinteger
enableboolean
filterstring
findTimeinteger
ignorestring
keystring
maxRetryinteger
namestring
presetstring
remarkstring
sourcestring
targetstring

guard.Platform ​

FieldType
dockerboolean
inDockerboolean
journalboolean
osstring

guard.ScanSettings ​

FieldType
banSecondsinteger
enableboolean
excludePortsstring
thresholdinteger

guard.Settings ​

FieldType
banSecondsinteger
firewallboolean
ignoreListArray of string
ignorePrivateboolean
incrementboolean
maxBanSecondsinteger
scanguard.ScanSettings
trapguard.TrapSettings

guard.Status ​

FieldType
bansinteger
firewallguard.FirewallStatus
platformguard.Platform
userTrapPortsArray of integer

guard.TestResult ​

FieldType
hoststring
ignoredboolean
linestring
matchedboolean

guard.TrapSettings ​

FieldType
banSecondsinteger
enableboolean
portsstring

guard.banRequest ​

FieldType
keystring
reasonstring
secondsinteger

guard.testRequest ​

FieldType
filterstring
ignorestring
linesstring

ipsource.Source ​

FieldType
commandstring
enableboolean
interfacestring
regexstring
typestring
urlsArray of string

nettools.Request ​

FieldType
cidrstring
countinteger
portsstring
secondsinteger
serverstring
targetstring
toolstring
typestring
urlstring

nettools.Settings ​

FieldType
denyArray of string

nettools.Task ​

FieldType
errorstring
finishedTime (RFC 3339)
idstring
linesArray of string
resultAny
startedTime (RFC 3339)
statusstring
titlestring
toolstring

notify.Channel ​

FieldType
enableboolean
fromstring
hoststring
keystring
kindstring
namestring
portinteger
remarkstring
secretstring
securitystring
targetstring
urlstring
userstring
webhookwebhook.Config

notify.Record ​

FieldType
channelstring
errorstring
okboolean
rulestring
timeTime (RFC 3339)
titlestring
typestring

notify.Rule ​

FieldType
channelsArray of string
enableboolean
eventsArray of string
keystring
minLevelstring
namestring
silenceinteger

portforward.Rule ​

FieldType
enableboolean
keystring
listenAddressstring
listenPortsstring
maxConnectionsinteger
modestring
namestring
protocolsArray of string
proxyProtocolstring
remarkstring
sniRoutesArray of portforward.SNIRoute
targetAddressesArray of string
targetPortsstring
udpSessionTimeoutinteger

portforward.SNIRoute ​

FieldType
domainsArray of string
namestring
proxyProtocolstring
targetAddressesArray of string
targetPortinteger

ssl.ACMEConfig ​

FieldType
castring
challengestring
credentialsdnsprovider.Credentials
directoryUrlstring
disableAuthoritativeCheckboolean
domainsArray of string
eabHmacstring
eabKidstring
emailstring
httpPortinteger
keyTypestring
propagationTimeoutinteger
providerstring
resolversArray of string
skipPropagationCheckboolean
zonestring

ssl.Cert ​

FieldType
acmessl.ACMEConfig
certFilestring
certPemstring
deploysArray of ssl.Deploy
enableboolean
issuerPemstring
keystring
keyFilestring
keyPemstring
mappingssl.Mapping
remarkstring
sourcestring
updatedAtTime (RFC 3339)

ssl.Deploy ​

FieldType
certNamestring
commandstring
connectionstring
containersArray of string
deployedAtTime (RFC 3339)
deployedHashstring
dirstring
enableboolean
keyNamestring
remarkstring
typestring

ssl.Mapping ​

FieldType
dirstring
enableboolean
scriptstring

storage.Mount ​

FieldType
domainstring
enableboolean
keystring
namestring
passwordstring
pathstring
readOnlyboolean
remarkstring
skipVerifyboolean
typestring
urlstring
usernamestring

storage.MountInfo ​

FieldType
enableboolean
keystring
namestring
readOnlyboolean
typestring

stun.Bind ​

FieldType
interfacestring
ipstring
modestring
regexstring

stun.Rule ​

FieldType
autoRetryboolean
bindstun.Bind
disableCheckboolean
disableForwardboolean
enableboolean
heartbeatIntervalinteger
keepAliveServersArray of string
keystring
localPortinteger
maxConnectionsinteger
namestring
natpmpboolean
natpmpGatewaystring
protocolstring
remarkstring
retryIntervalinteger
scriptstring
scriptEnableboolean
stunServersArray of string
stunTimeoutinteger
targetAddressesArray of string
targetPortinteger
udpSessionTimeoutinteger
upnpboolean
upnpControlUrlstring
upnpGatewaystring
upnpInternalPortinteger
upnpLocalHoststring
useGlobalServersboolean
useGlobalWebhookboolean
webhookwebhook.Config
webhookOnlyOnChangeboolean

waf.Instance ​

FieldType
bodyLimitActionstring
bodyLimitMBinteger
enableboolean
inboundThresholdinteger
keystring
modestring
namestring
outboundThresholdinteger
paranoiainteger
remarkstring
ruleSetsArray of waf.RuleSet
skipBodyPathsstring
webdavboolean

waf.RuleSet ​

FieldType
enableboolean
paramstring
remarkstring
typestring

webhook.Config ​

FieldType
bodystring
enableboolean
headersArray of string
insecureSkipVerifyboolean
methodstring
successContentArray of string
timeoutinteger
urlstring

webservice.BanInfo ​

FieldType
keystring
manualboolean
permanentboolean
reasonstring
sourcestring
untilTime (RFC 3339)

webservice.CacheConfig ​

FieldType
enableboolean
maxMbinteger
ttlinteger

webservice.ForwardAuth ​

FieldType
copyHeadersArray of string
loginUrlstring
urlstring

webservice.HealthCheck ​

FieldType
enableboolean
failsinteger
intervalinteger
modestring
passesinteger
pathstring
timeoutinteger

webservice.IPList ​

FieldType
countinteger
enableboolean
keystring
namestring
refreshHoursinteger
remarkstring
updatedAtTime (RFC 3339)
urlstring

webservice.Listener ​

FieldType
acceptProxyProtocolboolean
defaultwebservice.Site
enableboolean
http3boolean
keystring
listenIpstring
minTlsstring
namestring
networkstring
portinteger
remarkstring
sitesArray of webservice.Site
tlsboolean

webservice.Location ​

FieldType
prefixstring
requestHeadersArray of string
targetsArray of string

webservice.PathRule ​

FieldType
authstring
ipListArray of string
ipModestring
ipSetsArray of string
prefixstring

webservice.Point ​

FieldType
bytesinteger
requestsinteger
s4xxinteger
s5xxinteger
tinteger

webservice.RateLimit ​

FieldType
burstinteger
enableboolean
maxConnsinteger
ratenumber

webservice.Rewrite ​

FieldType
codeinteger
patternstring
redirectboolean
tostring
FieldType
expiresAtTime (RFC 3339)
keystring
maxUsesinteger
namestring
pathPrefixstring
tokenstring

webservice.Site ​

FieldType
accessLogboolean
authOptionalboolean
basicAuthboolean
cachewebservice.CacheConfig
cleanUrlsboolean
compressboolean
contentTypestring
corsboolean
countriesArray of string
countryModestring
disableKeepAlivesboolean
domainsArray of string
enableboolean
forwardAuthwebservice.ForwardAuth
forwardedHeadersboolean
healthwebservice.HealthCheck
insecureSkipVerifyboolean
ipListArray of string
ipModestring
ipSetsArray of string
keepPathboolean
keystring
lbPolicystring
listDirboolean
locationsArray of webservice.Location
namestring
notFoundPagestring
oauthUsersArray of string
rateLimitwebservice.RateLimit
redirectCodeinteger
redirectTostring
remarkstring
requestHeadersArray of string
responseHeadersArray of string
rewritesArray of webservice.Rewrite
rootstring
rulesArray of webservice.PathRule
sendProxyProtocolboolean
shareLinksArray of webservice.ShareLink
sharedUsersboolean
statusCodeinteger
targetsArray of string
textstring
typestring
upstreamSniFromHostboolean
useTargetHostboolean
usersArray of string
wafstring
webAuthboolean

webservice.SiteStatsView ​

FieldType
bytesOutinteger
seriesArray of webservice.Point
statusMap of integer
topCountriesArray of webservice.TopItem
topIpsArray of webservice.TopItem
upstreamsArray of webservice.UpstreamStatus

webservice.TopItem ​

FieldType
countinteger
keystring

webservice.UpstreamStatus ​

FieldType
backupboolean
connsinteger
healthyboolean
urlstring
weightinteger

webservice.banRequest ​

FieldType
keystring
secondsinteger

webservice.geoipDownload ​

FieldType
urlstring

webservice.totpRequest ​

FieldType
namestring

webservice.totpResponse ​

FieldType
secretstring
urlstring

webterminal.Connection ​

FieldType
enableboolean
keystring
localwebterminal.LocalConfig
namestring
quickAccessDirsArray of string
remarkstring
sshwebterminal.SSHConfig
telnetwebterminal.TelnetConfig
typestring

webterminal.Credential ​

FieldType
authTypestring
enableboolean
keystring
keyFilestring
namestring
passphrasestring
passwordstring
privateKeystring
remarkstring
usernamestring

webterminal.LocalConfig ​

FieldType
envMap of string
shellstring
workDirstring

webterminal.Proxy ​

FieldType
enabledboolean
hoststring
passwordstring
portinteger
typestring
usernamestring

webterminal.SSHConfig ​

FieldType
authTypestring
credentialKeystring
hoststring
hostKeystring
keepAliveinteger
keyFilestring
passphrasestring
passwordstring
portinteger
privateKeystring
proxywebterminal.Proxy
timeoutinteger
usernamestring
workDirstring

webterminal.TelnetConfig ​

FieldType
hoststring
passwordstring
portinteger
proxywebterminal.Proxy
timeoutinteger
usernamestring

wol.Device ​

FieldType
broadcastIpsArray of string
checkAddrstring
enableboolean
keystring
macsArray of string
namestring
portinteger
remarkstring
repeatinteger

Released under the Apache-2.0 license.