Skip to content

Get the connect command of your own server

GET /v1/servers/{serverId}/connection

Servers of your own only: the one line to run on the server as root to connect it to Rabbitflare, and the ports its firewall must allow. The command carries a one-time key: keep it private, and make a new one with POST /servers/{serverId}/connection/actions/renew if it was shared by mistake. command is null once the server is connected. A server Rabbitflare created has no connection command (409 invalid_state).

Scopes

The token needs this scope. Without it, the request is refused with insufficient_scope (see Scopes).

servers:write
Manage servers. Power, reboot, snapshots and restores, log settings, restarting PHP, server security (Imunify360), and connecting your own servers.

Path parameters

FieldType and description
serverId Required

string

The server's id.

Example request

curl "https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/connection" \
  -H "Authorization: Bearer $RABBITFLARE_TOKEN"

Response

200 OK Returns the ServerConnection object in data.

The ServerConnection object's fields 5 fields
FieldType and description
command

string or null

The one line to run on your server as root to connect it. It carries a one-time key: keep it private. Null once the server is connected.

ports

array of objects

The ports your server's firewall must allow from the internet.

port

integer

The port.

protocol

string

The protocol.

Known values: TCP More can appear.

purpose

string

What it's for.

Example response

200 OK
{
  "data": {
    "command": "curl -fsSL https://app.rabbitflare.com/api/connect/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/EXAMPLE-ONE-TIME-KEY | sudo bash",
    "ports": [
      {
        "port": 80,
        "protocol": "TCP",
        "purpose": "Web traffic (HTTP), and SSL certificate checks"
      },
      {
        "port": 443,
        "protocol": "TCP",
        "purpose": "Web traffic (HTTPS)"
      },
      {
        "port": 22022,
        "protocol": "TCP",
        "purpose": "SSH for the Rabbitflare control panel"
      }
    ]
  }
}

Errors

The errors this request can answer besides those every request can (a missing token, a missing scope, the rate limits). Each answer is an Error object (see Errors).

Status and codeWhen, and what to do
404 not_found

The resource doesn't exist, or isn't this account's.

Check the id. Ids of other accounts' resources answer the same way.

409 invalid_state

The resource's status doesn't allow this now (for example, powering on a server that is running). message says why.

Check the resource's status, then do what message says.

Rate limit

Read requests: 120 a minute per token, 240 per account. More in Rate limits.

Added on .

Popular

API docs