Skip to content
HTTP Tweak API documentation

Developers API v1

Client API

Manage panel resources

Start here

Manage panel resources

Manage configurations, servers, and tweaks through API requests.

On this page

Create, read, update, and delete configurations, servers, and tweaks in your panel using your account’s API key. No panel login session is required.

1. Get your key

Open Client API in the panel, generate a key, and save it when it is displayed. The full key is shown once. Keep it in your backend's secret storage.

In a local terminal, set the URL and key for this session. Replace the example key before running the next command.

export API_BASE='https://httptweak.com/api/v1'
export CLIENT_API_KEY='YOUR_CLIENT_API_KEY'

2. Create a configuration

curl --fail-with-body --request POST "$API_BASE/configs" \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --data '{"name":"My configuration"}'

configuration.unique_key → CONFIG_KEY

export CONFIG_KEY='PASTE_YOUR_CONFIGURATION_UNIQUE_KEY'

3. Add a server

Save this JSON as server.json. Replace the host, username, and password with your SSH server's details. Keep accepted_methods: [[]] for this direct connection.

{
    "name": "My SSH server",
    "tunnel": {
        "family": "ssh",
        "variant": "default"
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "accepted_methods": [
        []
    ],
    "settings": {
        "endpoint": {
            "hosts": [
                "ssh.example.com"
            ],
            "ports": [
                22
            ]
        },
        "credentials": {
            "username": "demo",
            "password": "replace-me"
        }
    }
}

Send the file:

curl --fail-with-body --request POST "$API_BASE/configs/$CONFIG_KEY/servers" \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --data-binary @server.json

Expect HTTP 201 Created, success: true, and a server object. Save the new server.unique_key if you will edit or remove the server later. You can also see the new server in the panel.

Running this creation request again adds another server. To change an existing server, use its returned key with update a server.

4. Add the direct tweak

The apps need a selected tweak even for a direct connection. Save this as tweak.json:

{
    "name": "Direct SSH",
    "tunnels": {
        "ssh": {
            "variants": [
                "default"
            ]
        }
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "methods": {}
}
curl --fail-with-body --request POST "$API_BASE/configs/$CONFIG_KEY/tweaks" \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --data-binary @tweak.json

Expect HTTP 201 Created and a tweak object. Keep tweak.unique_key for later edits. The empty methods object means direct: no payload, proxy, or extra TLS layer. Both example resources omit category so they match.

5. Read saved resources

export SERVER_KEY='PASTE_THE_RETURNED_SERVER_UNIQUE_KEY'
export TWEAK_KEY='PASTE_THE_RETURNED_TWEAK_UNIQUE_KEY'

curl --fail-with-body "$API_BASE/configs" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY"

curl --fail-with-body "$API_BASE/configs/$CONFIG_KEY" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY"

curl --fail-with-body "$API_BASE/configs/$CONFIG_KEY/servers/$SERVER_KEY" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY"

curl --fail-with-body "$API_BASE/configs/$CONFIG_KEY/tweaks/$TWEAK_KEY" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY"

6. Update specific fields

PATCH changes only the fields you send and preserves omitted settings. A supplied list replaces the entire list. If an updates, access.password, or access.hwid object includes mode, that entire object is replaced, clearing values from the previous mode.

curl --fail-with-body --request PATCH "$API_BASE/configs/$CONFIG_KEY" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{"name":"Managed VPN"}'

curl --fail-with-body --request PATCH "$API_BASE/configs/$CONFIG_KEY/servers/$SERVER_KEY" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{"name":"Primary SSH"}'

curl --fail-with-body --request PATCH "$API_BASE/configs/$CONFIG_KEY/tweaks/$TWEAK_KEY" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{"note":"Managed through the API"}'

7. Cloud locks and device blocks

8. Delete resources

This permanently removes the saved configuration and its dependent resources. Only call it when you intend to delete the configuration.

curl --fail-with-body --request DELETE "$API_BASE/configs/$CONFIG_KEY/servers/$SERVER_KEY" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY"

curl --fail-with-body --request DELETE "$API_BASE/configs/$CONFIG_KEY/tweaks/$TWEAK_KEY" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY"

curl --fail-with-body --request DELETE "$API_BASE/configs/$CONFIG_KEY" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY"

Optional: export for the app

Export is only needed when you want to use a configuration in the VPN app. Panel CRUD takes effect immediately without downloading or importing a file.

Get panel changes into the app

Start here

Authentication

Create, use, and rotate the right key for your integration.

On this page

Every request needs your account's API key for this API. A configuration's unique key identifies a resource; it does not authenticate the request.

Client API credentials use the current Base64URL format. Old UUID credentials are no longer accepted; rotate an old key before using this API.

Create the right credential

API Get a key Scope
Client Client API account Manage configurations owned by your panel account

The full credential is displayed once when created or rotated. The panel stores its hash and a masked preview. If you lose the full key, rotate it and update your integration.

Send the key in a header

The recommended header on this installation is X-API-Key:

X-API-Key: YOUR_CLIENT_API_KEY
Accept: application/json
Content-Type: application/json

Content-Type is needed when sending a JSON body.

You can alternatively send:

Authorization: Bearer YOUR_CLIENT_API_KEY

When both headers are present, X-API-Key takes precedence. Credentials in a query string or request body are not accepted. Do not put these keys in a mobile app, browser bundle, public repository, or share link.

Rotate or revoke

Rotate a key in the corresponding account page, then replace the secret in your backend. The old credential stops working. Revoke it to stop access. Rotation does not reset your daily usage.

An inactive key or owner cannot use the API.

Ownership and IDs

Client API calls are restricted to the account that owns the configuration. A different owner's configuration returns 403; a missing configuration returns 404.

Value Where to get it Where to use it
Configuration unique_key GET /api/v1/configs {config_key} in resource and batch-sync URLs
Server or tweak unique_key Resource list or creation response {server_key} / {tweak_key} in URLs
Password or device row id Access list or creation response {password_id} / {device_id} in access URLs
Device hardware identifier The user's app The device_ids creation array; it is not the numeric row ID

Copy keys exactly as returned. Never substitute database IDs for a resource unique key.

Platform and language

Client API calls normally do not need a platform header. When you send X-Platform, use android or ios; if a platform body/query value is also present, the two values must match.

Send Accept: application/json so validation failures are returned as JSON. Treat HTTP status, success, and structured error fields as the contract rather than comparing human-readable messages, which may be localized.

Client API

Configurations

Manage configurations, servers, and tweaks through API requests.

On this page

Create, read, update, and delete configurations, servers, and tweaks in your panel using your account’s API key. No panel login session is required.

All endpoints on this page require your Client API key. For terminal examples, set API_BASE, CLIENT_API_KEY, and CONFIG_KEY as shown in your first request.

Create a configuration

POST /api/v1/configs

The configuration, servers, tweaks, allowed devices, cloud passwords, and blocked devices are saved in a single transaction. If any entry is invalid, nothing is saved. Allowed-device and password records require their corresponding cloud lock to be enabled; blocked-device records do not.

{
  "name": "API configuration",
  "message": "Welcome",
  "support_contact": "[email protected]",
  "sharing": {"allow_reshare": false},
  "owner": {"device_hwid": null},
  "revision": {"code": 1, "name": "1.0"},
  "settings": {
    "updates": {"mode": "cloud"},
    "access": {
      "mode": "restricted",
      "password": {"mode": "cloud"},
      "hwid": {"mode": "cloud"}
    },
    "restrictions": {"block_root": true, "blocked_apps": ["com.example.capture"]}
  },
  "servers": [],
  "tweaks": [],
  "device_ids": [{"device_id": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "note": "Allowed", "is_active": true, "delete_after_used": false, "expire_date": null}],
  "passwords": [{"password": "secret123", "type": "reusable"}],
  "blocked_device_ids": [{"device_id": "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"}]
}

HTTP 201 · Location · configuration: unique_key, settings, servers_count, tweaks_count, device_ids_count, passwords_count, blocked_device_ids_count.

Read saved resources / Update specific fields

  • GET /api/v1/configs/{config_key}
  • PATCH /api/v1/configs/{config_key}

PATCH changes only the fields you send and preserves omitted settings. A supplied list replaces the entire list. If an updates, access.password, or access.hwid object includes mode, that entire object is replaced, clearing values from the previous mode.

Writable configuration fields

Field Create / update
name Required on creation; 1–255 characters. Omit on PATCH to preserve it.
message String or null; installation message limit applies. Null clears it.
support_contact String or null, up to 100 characters. Null clears it.
settings Configuration settings; omitted fields are preserved on PATCH.
sharing.allow_reshare Boolean; controls whether recipients may share the imported copy.
owner.device_hwid Optional string or null, up to 32 characters; use the device ID shown in the app.
revision.code Integer from 0 to 2147483647, or null. Client API only.
revision.name String up to 255 characters, or null. Client API only.
servers, tweaks Creation only; complete resource documents. Use individual endpoints or sync for later edits.
device_ids, passwords, blocked_device_ids Creation only; arrays of access-record objects. Use their dedicated endpoints for later edits.

Do not send id, unique_key, timestamps, or resource counts from a GET response back in a write request. PATCH rejects unknown fields and an empty body. The configuration key belongs in the URL. Business generation uses installation version information and does not accept revision.

List configurations

GET /api/v1/configs

curl --fail-with-body "$API_BASE/configs" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY"

Returns configurations, total, max_configurations, and remaining_configurations. Each entry includes id, name, unique_key, servers_count, tweaks_count, is_cloud_hwid_lock, is_cloud_password, created_at, and updated_at. The cloud booleans describe whether those access modes are enabled.

The list includes all configurations belonging to the account, ordered by most recently updated, then highest ID. This endpoint does not paginate.

List a configuration's resources

GET /api/v1/configs/{config_key}/resources

curl --fail-with-body "$API_BASE/configs/$CONFIG_KEY/resources" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY"

Returns configuration_id, configuration_name, config_unique_key, servers, and tweaks alongside success and message.

These are summary lists. Connection credentials, full profiles, and method values are omitted. Carrier and method settings may appear as empty objects. Use the individual server or tweak endpoint for editable details; do not submit a summary as a replacement document.

Read the message

GET /api/v1/configs/{config_key}/message

curl --fail-with-body "$API_BASE/configs/$CONFIG_KEY/message" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY"

The message is returned as config_message, with configuration_id, configuration_name, and config_unique_key.

Update the message

PUT /api/v1/configs/{config_key}/message

curl --fail-with-body --request PUT "$API_BASE/configs/$CONFIG_KEY/message" \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --data '{"message":"Welcome to my configuration."}'
Field Required Meaning
message Yes, may be null Message text; the installation's configured message length limit applies. Send null to clear it.

Returns the updated config_message and the same configuration identifiers. Text placeholders such as {config_name}, {server_count}, and {server_list} are resolved during export; the message endpoint stores the template.

Message placeholders use curly braces only, such as {config_name}.

Delete a configuration

DELETE /api/v1/configs/{config_key}

This permanently removes the saved configuration and its dependent resources. Only call it when you intend to delete the configuration.

curl --fail-with-body --request DELETE "$API_BASE/configs/$CONFIG_KEY" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY"

Returns success: true, configuration_deleted: true, and a configuration object containing the deleted record's id, name, and unique_key. For multiple configurations, see batch deletion.

Message placeholders

Use these tokens in either a saved configuration message or a Business generation request's message. Placeholders are case-sensitive. Unknown tokens remain unchanged; empty server or tweak lists resolve to an empty string. The Client message endpoint stores and returns the template unchanged. Business generation resolves it before returning encrypted import text.

Token Replaced with
{config_name} Configuration name.
{created_at} Creation date and time in YYYY-MM-DD HH:mm:ss format.
{created_date} Creation date in YYYY-MM-DD format.
{updated_at} Last-updated date and time in YYYY-MM-DD HH:mm:ss format.
{updated_date} Last-updated date in YYYY-MM-DD format.
{server_count} Number of servers included in the generated configuration.
{tweak_count} Number of tweaks included in the generated configuration.
{server_list} Server names in alphabetical order, separated by commas.
{tweak_list} Tweak names in alphabetical order, separated by commas.

Get panel changes into the app

The panel stores the source configuration; an app import stores a local copy. A server or tweak is identified by its own unique_key inside that configuration. Updating an existing key preserves that identity; deleting and recreating without the key creates a different resource.

  1. POST /api/v1/configs → configuration.unique_key.
  2. settings.updates.mode = cloud → POST /api/v1/configs/{config_key}/export → .ht.
  3. Change the existing resources through the Client API. Resource changes also update the parent configuration's timestamp and invalidate its cached export.
  4. Let the app perform its configured update check, or use its update action. Automatic updates depend on app preferences and lifecycle; the API response is not a device delivery receipt.

Without an update source, export and import the changed configuration again. A cloud share is an export snapshot: making a share does not itself enable cloud updates. If you enable updates after distributing a file with updates disabled, distribute a new export containing that setting.

Both Android and iOS require the remote configuration's unique_key to match the imported one. They compare updated_at to detect a change; increasing a displayed revision alone is not the update contract. A custom URL must serve a valid app configuration with the same key, not a Client API resource-list response. Changes to live tunnel settings take effect when the app builds a new connection.

Business generation creates fresh keys and therefore cannot replace this saved-configuration update workflow.

Support contact (optional)

Contact details shown in password, HWID, and expiry prompts. Max 100 characters.

GET /api/v1/configs/{config_key}/support-contact

curl --fail-with-body "$API_BASE/configs/$CONFIG_KEY/support-contact" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY"

PUT /api/v1/configs/{config_key}/support-contact

curl --fail-with-body --request PUT "$API_BASE/configs/$CONFIG_KEY/support-contact" \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --data '{"support_contact":"[email protected]"}'

Send support_contact as a string of up to 100 characters. Send null or an empty string to clear it; omitting the field is invalid. Both endpoints return support_contact with the configuration identifiers. The configuration list also includes support_contact. Updating it leaves the message unchanged.

Optional: export for the app

POST /api/v1/configs/{config_key}/export

Send an empty request body to the export endpoint. It returns encrypted configuration text that can be imported into the VPN app.

Create a ready-to-connect configuration

This single request saves a configuration together with a direct SSH server, tweak, cloud access records, and a device block. Replace the host, credentials, and device IDs. Both cloud locks are enabled, so recipients must satisfy both access checks.

curl --fail-with-body --request POST "$API_BASE/configs" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '
{
    "name": "My first configuration",
    "servers": [
        {
            "name": "My SSH server",
            "tunnel": {
                "family": "ssh",
                "variant": "default"
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "accepted_methods": [
                []
            ],
            "settings": {
                "endpoint": {
                    "hosts": [
                        "ssh.example.com"
                    ],
                    "ports": [
                        22
                    ]
                },
                "credentials": {
                    "username": "demo",
                    "password": "replace-me"
                }
            }
        }
    ],
    "tweaks": [
        {
            "name": "Direct SSH",
            "tunnels": {
                "ssh": {
                    "variants": [
                        "default"
                    ]
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "methods": {}
        }
    ],
    "message": "Welcome",
    "support_contact": "[email protected]",
    "sharing": {
        "allow_reshare": false
    },
    "settings": {
        "updates": {
            "mode": "cloud"
        },
        "access": {
            "mode": "restricted",
            "password": {
                "mode": "cloud"
            },
            "hwid": {
                "mode": "cloud"
            }
        }
    },
    "device_ids": [
        {
            "device_id": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
            "note": "Subscriber device"
        }
    ],
    "passwords": [
        {
            "password": "ReplaceThisPassword",
            "type": "reusable"
        }
    ],
    "blocked_device_ids": [
        {
            "device_id": "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB",
            "note": "Blocked device"
        }
    ]
}
'

Use configuration.unique_key from the response as CONFIG_KEY in later requests. Resource lists return the server and tweak keys; access lists return numeric record IDs. The API stores connection details; it does not create an SSH account or deploy a server.

Export a saved configuration

Use the key of the existing saved configuration. A successful response is import text; errors are JSON. Import or publish only a successful response.

curl --fail-with-body --request POST "$API_BASE/configs/$CONFIG_KEY/export" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY"

Update metadata without changing connections

This request changes the message, support contact, sharing preference, owner device, and revision. Replace the example contact and device ID. It preserves the name, settings, servers, and tweaks.

curl --fail-with-body --request PATCH "$API_BASE/configs/$CONFIG_KEY" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '
{
  "message": "Welcome to {config_name}",
  "support_contact": "[email protected]",
  "sharing": {
    "allow_reshare": true
  },
  "owner": {
    "device_hwid": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
  },
  "revision": {
    "code": 2,
    "name": "2.0"
  }
}
'

Clear optional metadata with explicit null values. Omit any field you want to keep:

curl --fail-with-body --request PATCH "$API_BASE/configs/$CONFIG_KEY" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '
{
  "message": null,
  "support_contact": null,
  "owner": {
    "device_hwid": null
  },
  "revision": {
    "code": null,
    "name": null
  }
}
'

Client API

Servers

Add a connection, read its full settings, or update an existing server.

On this page

A server contains a tunnel, carrier, accepted method combinations, and the settings needed to connect. Start with the direct SSH example, then use connection examples for other tunnels.

All endpoints require the owning account's Client API key. Set the quickstart variables before running shell examples.

List servers

GET /api/v1/configs/{config_key}/servers

Returns a servers array plus configuration identifiers. Entries contain id, unique_key, name, category, tunnel, carrier, accepted_methods, created_at, and updated_at. This is a summary: credentials and full connection settings are omitted.

Create a server

POST /api/v1/configs/{config_key}/servers

Save this as server.json and replace the example connection details:

{
    "name": "My SSH server",
    "tunnel": {
        "family": "ssh",
        "variant": "default"
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "accepted_methods": [
        []
    ],
    "settings": {
        "endpoint": {
            "hosts": [
                "ssh.example.com"
            ],
            "ports": [
                22
            ]
        },
        "credentials": {
            "username": "demo",
            "password": "replace-me"
        }
    }
}
curl --fail-with-body --request POST "$API_BASE/configs/$CONFIG_KEY/servers" \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --data-binary @server.json
Field Type On creation
name string Required; up to 100 characters
tunnel object Required; family and variant identify the protocol
carrier object Required; type and settings identify the transport carrier
accepted_methods array of arrays Required; [[]] allows direct connections only
settings object Required; protocol-specific endpoint, credentials, or profile
category string or null Optional; up to 100 characters; participates in app matching
note string or null Optional; up to 255 characters
unique_key string Only in batch sync; individual creation assigns a key and individual edits use the URL

The server count limit applies per configuration, using the owning account's allowance. Successful creation returns HTTP 201 Created, a Location header pointing to the new resource, and the full editable object in server, beside success and message. The response includes private settings and uses Cache-Control: no-store, private.

Read a server for editing

GET /api/v1/configs/{config_key}/servers/{server_key}

export SERVER_KEY='PASTE_THE_RETURNED_SERVER_UNIQUE_KEY'
curl --fail-with-body "$API_BASE/configs/$CONFIG_KEY/servers/$SERVER_KEY" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY"

Returns the full editable object in server, including settings, carrier settings, and credentials. The response uses Cache-Control: no-store, private. Owner API key required. Protected servers cannot be read for editing and return 403.

For a read/edit/write workflow, copy only writable fields from server: name, category, note, tunnel, carrier, accepted_methods, and settings. Do not send response-only id fields back. The URL supplies the resource key.

Update a server

PATCH /api/v1/configs/{config_key}/servers/{server_key}

Rename a server without resending credentials:

curl --fail-with-body --request PATCH "$API_BASE/configs/$CONFIG_KEY/servers/$SERVER_KEY" \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --data '{"name":"Primary SSH"}'

Metadata-only edits preserve the connection. To update credentials, send a complete credentials object, including both values you want to keep:

{
  "settings": {
    "credentials": {"username": "demo", "password": "new-password"}
  }
}

Settings merge at the first level: a supplied credentials or endpoint object replaces that entire object. Supplying tunnel replaces the connection and requires a complete valid connection document. Send a whole carrier object or accepted_methods array when changing those values.

PATCH changes an existing server and returns the full editable object in server. A missing key returns 404 and never creates a server. Use batch sync when you intentionally need upsert.

Replace a server

PUT /api/v1/configs/{config_key}/servers/{server_key}

Use PUT only for a complete replacement of an existing server. Include name, tunnel, carrier, accepted_methods, and settings. Omitted optional fields reset to their defaults: category and note become null; other optional fields return to their defaults. The existing identity is preserved. Missing required groups return 422; a missing resource returns 404.

Use the same complete JSON shape as creation, without response-only id, or unique_key fields. PUT returns HTTP 200 and the editable object in server. Use PATCH for a rename, credential rotation, or another partial change.

Use the complete creation body below with your own connection values. This example replaces the connection with direct SSH.

curl --fail-with-body --request PUT "$API_BASE/configs/$CONFIG_KEY/servers/$SERVER_KEY" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '
{
    "name": "My SSH server",
    "tunnel": {
        "family": "ssh",
        "variant": "default"
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "accepted_methods": [
        []
    ],
    "settings": {
        "endpoint": {
            "hosts": [
                "ssh.example.com"
            ],
            "ports": [
                22
            ]
        },
        "credentials": {
            "username": "demo",
            "password": "replace-me"
        }
    }
}
'

Delete a server

DELETE /api/v1/configs/{config_key}/servers/{server_key}

curl --fail-with-body --request DELETE "$API_BASE/configs/$CONFIG_KEY/servers/$SERVER_KEY" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY"

Returns success: true and server containing unique_key and action: "deleted". A missing resource returns 404. This removes the server from the configuration.

Protected resources

Protected resources expose only basic identity and display information in lists. Connection groups, credentials, profiles, method values, and notes are omitted.

Only removal is allowed. Detail reads and PATCH/PUT edits return 403; batch sync also rejects any attempt to update a protected key, including a request that removes and recreates that same key. Delete it through the individual DELETE endpoint or the batch removal array. API requests cannot turn protected resources into editable resources.

Client API

Tweaks

Describe how the app reaches a compatible server.

On this page

A tweak provides connection methods for compatible servers. Its tunnels object describes the allowed families and variants; carrier chooses the transport carrier; methods holds payload, TLS, or proxy values.

Use your Client API key for every endpoint here. The quickstart sets the shell variables used below.

List tweaks

GET /api/v1/configs/{config_key}/tweaks

Returns configuration identifiers and a tweaks array. Entries include id, unique_key, name, category, tunnels, carrier, methods, and timestamps. Method values and carrier settings are omitted in this summary.

Create a tweak

POST /api/v1/configs/{config_key}/tweaks

For a direct SSH connection, save this as tweak.json:

{
    "name": "Direct SSH",
    "tunnels": {
        "ssh": {
            "variants": [
                "default"
            ]
        }
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "methods": {}
}
curl --fail-with-body --request POST "$API_BASE/configs/$CONFIG_KEY/tweaks" \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --data-binary @tweak.json
Field Type On creation
name string Required; up to 100 characters
tunnels object Required; one or more supported families, each with a variants array
carrier object Required; type and settings
methods object Required; {} for direct, or named method objects
category string or null Optional; up to 100 characters; participates in app matching
note string or null Optional; up to 255 characters
unique_key string Only in batch sync; individual creation assigns a key and individual edits use the URL

Success is HTTP 201 Created, with a Location header and the full editable object in tweak, beside success and message. Private method values are included; the response uses Cache-Control: no-store, private. The owning account's tweak allowance applies per configuration.

Read a tweak for editing

GET /api/v1/configs/{config_key}/tweaks/{tweak_key}

export TWEAK_KEY='PASTE_THE_RETURNED_TWEAK_UNIQUE_KEY'
curl --fail-with-body "$API_BASE/configs/$CONFIG_KEY/tweaks/$TWEAK_KEY" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY"

Returns the full object in tweak, including method values and carrier settings. It is owner-only and uses Cache-Control: no-store, private. Copy only name, category, note, tunnels, carrier, and methods into an update body; omit the response-only id. The URL supplies the resource key.

Update a tweak

PATCH /api/v1/configs/{config_key}/tweaks/{tweak_key}

This example enables TLS for the direct SSH server and tweak created in these guides. First configure a working TLS listener on your infrastructure; the API only records its settings. Replace 443 below if your listener uses another port.

Update the existing server to allow both direct and TLS connections:

curl --fail-with-body --request PATCH "$API_BASE/configs/$CONFIG_KEY/servers/$SERVER_KEY" \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --data '{"accepted_methods":[[],["tls"]],"settings":{"tls_ports":[443]}}'

Then update the tweak with your TLS hostname:

curl --fail-with-body --request PATCH "$API_BASE/configs/$CONFIG_KEY/tweaks/$TWEAK_KEY" \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --data '{"methods":{"tls":{"sni":["edge.example.com"],"version":"TLSv1.2"}}}'

Omitted metadata and connection groups stay unchanged. A supplied nested group replaces that group; it is not a recursive patch. For example, supplying methods with only tls removes an existing payload or proxy. Send "methods": {} to clear all methods.

PATCH changes an existing tweak and returns the full editable object in tweak. A missing key returns 404 and never creates a record. Use batch sync for intentional upsert.

Replace a tweak

PUT /api/v1/configs/{config_key}/tweaks/{tweak_key}

Use PUT only for a complete replacement of an existing tweak. Include name, tunnels, carrier, and methods. Omitted optional fields reset to their defaults: category and note become null. The existing identity is preserved. Missing required groups return 422; a missing resource returns 404.

Use the same complete JSON shape as creation, without response-only id, or unique_key fields. PUT returns HTTP 200 and the editable object in tweak. Use PATCH for a rename, method change, or another partial change.

Use the complete creation body below with your own connection values. This example replaces the connection with direct SSH.

curl --fail-with-body --request PUT "$API_BASE/configs/$CONFIG_KEY/tweaks/$TWEAK_KEY" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '
{
    "name": "Direct SSH",
    "tunnels": {
        "ssh": {
            "variants": [
                "default"
            ]
        }
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "methods": {}
}
'

Delete a tweak

DELETE /api/v1/configs/{config_key}/tweaks/{tweak_key}

curl --fail-with-body --request DELETE "$API_BASE/configs/$CONFIG_KEY/tweaks/$TWEAK_KEY" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY"

Returns success: true and tweak containing unique_key and action: "deleted". A missing tweak returns 404.

Match a tweak to a server

A matching pair uses the same carrier, a supported tunnel family and variant, a method set explicitly allowed by the server, and compatible categories. A server accepting [[], ["tls"]] supports direct or TLS; it does not support a tweak using both payload and TLS.

See connection format and complete examples before combining more methods.

Categories affect matching

category is also a connection filter in Android and iOS, not just a display label. Matching ignores case and surrounding whitespace. Separate multiple category tokens with semicolons or newlines; commas do not separate tokens.

Server category Tweak category Match?
Omitted or empty Omitted or empty Yes
Premium premium Yes
Premium;Mobile Mobile Yes; one shared token is enough
Premium Omitted or empty No
Omitted or empty Premium No
Premium Standard No

Keep both categories empty for the first example. If you categorize a server later, update the intended tweaks too. The API validates each resource's structure; it does not guarantee that every submitted tweak has a matching server in the configuration.

One tweak can match several servers and tunnel variants. The app filters available servers for the selected tweak; a successful API response with no matching pair can still leave the app with nothing to connect to.

Protected resources

Protected resources expose only basic identity and display information in lists. Connection groups, credentials, profiles, method values, and notes are omitted.

Only removal is allowed. Detail reads and PATCH/PUT edits return 403; batch sync also rejects any attempt to update a protected key, including a request that removes and recreates that same key. Delete it through the individual DELETE endpoint or the batch removal array. API requests cannot turn protected resources into editable resources.

Client API

Passwords & device access

Cloud locks and device blocks

On this page

Create, read, update, and delete configurations, servers, and tweaks in your panel using your account’s API key. No panel login session is required.

PATCH /api/v1/configs/{config_key} → settings.access.password.mode, settings.access.hwid.mode: none, local, cloud.

PATCH changes only the fields you send and preserves omitted settings. A supplied list replaces the entire list. If an updates, access.password, or access.hwid object includes mode, that entire object is replaced, clearing values from the previous mode.

Allow device IDs

POST /api/v1/configs/{config_key}/device-ids

Save this as access.json:

{
  "device_ids": ["AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"],
  "note": "My devices",
  "is_active": true
}

With the quickstart variables set, send it:

curl --fail-with-body --request POST "$API_BASE/configs/$CONFIG_KEY/device-ids" \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --data-binary @access.json
Field Type Meaning
device_ids string array Required: 1–1,000 device IDs. Each ID must contain exactly 32 hexadecimal characters; letters are converted to uppercase.
note string or null Optional; up to 255 characters; applied to every entry.
is_active boolean Optional; defaults to true.
delete_after_used boolean Optional; defaults to false.
expire_date string or null Optional; YYYY-MM-DD.

Whitespace is trimmed and letters are uppercased on creation. Duplicate IDs within the request are deduplicated. An ID already saved for this configuration causes 422. The owner's configured device access limit still applies.

Success returns configuration_id, config_unique_key, added_count, and device_ids. Each record has a numeric id, the hardware device_id, the access fields above, and timestamps.

List, update, or remove device access

Operation Endpoint Body / result
List GET /api/v1/configs/{config_key}/device-ids Returns device_ids
Update PATCH /api/v1/configs/{config_key}/device-ids/{device_id} At least one of device_id, note, is_active, delete_after_used, expire_date; returns device_id object
Delete DELETE /api/v1/configs/{config_key}/device-ids/{device_id} No request body; returns deleted_device_id

The final URL segment is the numeric record id returned by the API, not the 32-character hardware ID. Updating a hardware ID requires exactly 32 hexadecimal characters and must not duplicate another entry.

For example, to disable access record 42, send {"is_active":false} to PATCH /api/v1/configs/{config_key}/device-ids/42.

Create passwords

POST /api/v1/configs/{config_key}/passwords

{
  "passwords": ["Secret123", "Secret456"],
  "type": "reusable",
  "note": "Subscribers",
  "is_active": true
}

For reusable passwords, optional max_uses sets a per-password limit from 1 to 2147483647; omit it or send null for unlimited use. It applies to supplied and generated passwords. Each successful password authentication counts once, including repeat authentications by the same device. Invalid, expired, disabled, or blocked requests do not count. Responses include the read-only use_count. Changing the limit preserves this count; increasing the limit or setting it to null allows further use. Reaching the limit rejects future password authentications and leaves issued tokens valid until their expiry.

Send this body using the same request pattern as device access, with /passwords as the final path segment.

Field Type Meaning
passwords string array Required for supplied passwords; 1–100 distinct entries, each 6–255 characters.
type string Required: reusable or one_time.
note string or null Optional; up to 255 characters.
is_active boolean Optional; defaults to true.
delete_after_used boolean Optional; may be true only for one_time passwords.
expire_date string or null Optional; YYYY-MM-DD.

Success returns added_count and a passwords array, plus configuration identifiers. Password values are returned to the owner; treat these responses as secrets. Each record also includes id, access fields, used_device_id, used_at, and timestamps.

Generate passwords automatically

Use the same creation endpoint, omit passwords, and send:

{
  "generate_multiple": true,
  "count": 3,
  "type": "one_time",
  "delete_after_used": true
}

count must be 1–100 and is only accepted when generate_multiple is true. Generated passwords are returned in the response. The owner's configured password count limit applies to both creation modes.

List, update, or remove passwords

Operation Endpoint Body / result
List GET /api/v1/configs/{config_key}/passwords Returns passwords, including their values
Update PATCH /api/v1/configs/{config_key}/passwords/{password_id} At least one of password, type, max_uses, note, is_active, delete_after_used, expire_date; returns password object
Delete DELETE /api/v1/configs/{config_key}/passwords/{password_id} No request body; returns deleted_password

Use the numeric record id in the URL. For example, send {"is_active":false} to PATCH /api/v1/configs/{config_key}/passwords/42 to disable one record. All successful access operations return HTTP 200. Missing access records return 404; invalid fields return 422.

What happens when the app uses an access record?

Use the device ID displayed in the app for device_ids. Do not send the device-registration ID, a database device-row ID, or your Client API key.

Cloud passwords and allowed-device records are checked through the app's signed authentication flow. Local password/HWID modes use the imported configuration instead. After enabling a cloud mode on a saved configuration, update or reimport the configuration so recipient apps know to use it. Keep the configuration's access mode restricted; open access does not carry cloud locks.

A one_time password permits one successful authentication, not permanent rebinding to the first device. It is then marked used and rejected on later authentication attempts, including attempts from that same device. With delete_after_used: true, it is deleted instead. An allowed-device record with that flag is deleted after successful device authentication.

The app can continue using the authorization token it already received until that token expires. Disabling or deleting the underlying access record affects future authentication; it is not an immediate revocation of an issued token. Access-record expire_date is inclusive through the end of that date in the panel's configured timezone and also determines token expiry. Without an entry expiration, the current server issues a token lasting up to one year. Use reusable passwords or persistent device records for recurring access.

Block device IDs

  • GET /api/v1/configs/{config_key}/blocked-device-ids
  • POST /api/v1/configs/{config_key}/blocked-device-ids
  • PATCH /api/v1/configs/{config_key}/blocked-device-ids/{id}
  • DELETE /api/v1/configs/{config_key}/blocked-device-ids/{id}

POST: device_ids (1–1,000), note, is_active, expire_date (YYYY-MM-DD). HTTP 201: blocked_device_ids, added_count.

PATCH: device_id, note, is_active, expire_date. HTTP 200: blocked_device_id.

Use the numeric record ID to edit or delete a block. Inactive or expired blocks do not prevent access. The blocklist is separate from the allowed-device list: a device can be blocked even if it is on the allowed list.

Cloud access walkthrough

Run these commands on a saved configuration using the quickstart variables. Replace the device IDs with IDs displayed in your users’ apps. This walkthrough enables both cloud locks, adds access records, and demonstrates disabling and removing them. Run the removal commands only when you intend to withdraw that access.

Enable cloud locks

Enable cloud password and device access:

curl --fail-with-body --request PATCH "$API_BASE/configs/$CONFIG_KEY" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '
{
  "settings": {
    "access": {
      "mode": "restricted",
      "password": {
        "mode": "cloud"
      },
      "hwid": {
        "mode": "cloud"
      }
    }
  }
}
'

Manage allowed devices

Create the device record:

curl --fail-with-body --request POST "$API_BASE/configs/$CONFIG_KEY/device-ids" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '
{
  "device_ids": [
    "CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC"
  ],
  "note": "Subscriber device",
  "is_active": true
}
'

Copy the numeric id from device_ids[0].id in that response. Replace 42 below with that returned ID.

export DEVICE_RECORD_ID=42
curl --fail-with-body --request GET "$API_BASE/configs/$CONFIG_KEY/device-ids" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY"
curl --fail-with-body --request PATCH "$API_BASE/configs/$CONFIG_KEY/device-ids/$DEVICE_RECORD_ID" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '
{
  "is_active": false,
  "note": "Disabled by API"
}
'
curl --fail-with-body --request DELETE "$API_BASE/configs/$CONFIG_KEY/device-ids/$DEVICE_RECORD_ID" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY"

Manage reusable passwords

Create the password record:

curl --fail-with-body --request POST "$API_BASE/configs/$CONFIG_KEY/passwords" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '
{
  "passwords": [
    "ReplaceThisPassword"
  ],
  "type": "reusable",
  "note": "Subscriber",
  "is_active": true
}
'

Copy the numeric id from passwords[0].id in that response. Replace 42 below with that returned ID.

export PASSWORD_RECORD_ID=42
curl --fail-with-body --request GET "$API_BASE/configs/$CONFIG_KEY/passwords" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY"
curl --fail-with-body --request PATCH "$API_BASE/configs/$CONFIG_KEY/passwords/$PASSWORD_RECORD_ID" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '
{
  "is_active": false,
  "note": "Disabled by API"
}
'
curl --fail-with-body --request DELETE "$API_BASE/configs/$CONFIG_KEY/passwords/$PASSWORD_RECORD_ID" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY"

Block and unblock devices

Create the block record:

curl --fail-with-body --request POST "$API_BASE/configs/$CONFIG_KEY/blocked-device-ids" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '
{
  "device_ids": [
    "DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"
  ],
  "note": "Blocked device",
  "is_active": true
}
'

Copy the numeric id from blocked_device_ids[0].id in that response. Replace 42 below with that returned ID.

export BLOCK_RECORD_ID=42
curl --fail-with-body --request GET "$API_BASE/configs/$CONFIG_KEY/blocked-device-ids" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY"
curl --fail-with-body --request PATCH "$API_BASE/configs/$CONFIG_KEY/blocked-device-ids/$BLOCK_RECORD_ID" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '
{
  "is_active": false,
  "note": "Disabled by API"
}
'
curl --fail-with-body --request DELETE "$API_BASE/configs/$CONFIG_KEY/blocked-device-ids/$BLOCK_RECORD_ID" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY"

Disabling or deleting a block allows that device to pass the blocklist check again; other locks still apply. Disabling or deleting an allowed-device or password record prevents future authentication with that record, subject to the existing-token behavior described above.

Generate one-time passwords

To generate three one-time passwords instead of supplying their values:

curl --fail-with-body --request POST "$API_BASE/configs/$CONFIG_KEY/passwords" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '
{
  "generate_multiple": true,
  "count": 3,
  "type": "one_time",
  "delete_after_used": true
}
'

Disable cloud locks

To turn off both cloud locks, send the request below. Saved access records are not deleted by changing the modes. Recipients need to update or reimport the configuration when its lock modes change.

curl --fail-with-body --request PATCH "$API_BASE/configs/$CONFIG_KEY" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '
{
  "settings": {
    "access": {
      "password": {
        "mode": "none"
      },
      "hwid": {
        "mode": "none"
      }
    }
  }
}
'

Client API

Batch operations

Apply several resource changes in one transaction.

On this page

Use batch operations after the individual resource endpoints are familiar. A batch can create, update, and remove servers and tweaks in one configuration. It does not create the configuration itself.

Sync resources

POST /api/v1/configs/{config_key}/sync

Use the owner's Client API key. Save this as batch.json, replacing the configuration and resource keys with values returned by the API:

{
  "servers": [
    {"unique_key": "YOUR_SERVER_UNIQUE_KEY", "name": "Primary SSH"}
  ],
  "tweaks": [
    {"unique_key": "YOUR_TWEAK_UNIQUE_KEY", "note": "Updated by my backend"}
  ],
  "list_resources": true
}
curl --fail-with-body --request POST "$API_BASE/configs/$CONFIG_KEY/sync" \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --data-binary @batch.json
Field Type Purpose
servers array of objects Create or update servers using the server fields.
tweaks array of objects Create or update tweaks using the tweak fields.
remove_servers array of strings Unique keys of servers to delete.
remove_tweaks array of strings Unique keys of tweaks to delete.
list_resources boolean Include the final summary lists in resource_list. Can also be used alone.

The configuration key belongs only in the URL. Do not include config_unique_key, config_key, or remove_config in this body; delete configurations through their dedicated endpoints.

At least one resource operation or list_resources: true is required. Omit a resource's unique_key to create it with a generated key. A matching key updates the resource; a new unused key can create one when all required creation fields are supplied. A key already used by another configuration is rejected.

Transaction and response

Removals run first, followed by server upserts and tweak upserts. If any operation fails validation, all resource changes in that request roll back. This lets you remove a resource before creating its replacement without exceeding the account's resource count limit.

HTTP 200 returns configuration_id, configuration_name, config_unique_key, summary, servers, tweaks, and resource_list. The latter is null unless requested. The summary counts servers_created, servers_updated, servers_deleted, tweaks_created, tweaks_updated, and tweaks_deleted. Each mutation result includes its action and unique_key.

A 422 response contains indexed errors such as servers.0.name. A failed batch can still consume a Client API quota unit. See limits.

Delete several configurations

POST /api/v1/configs/remove

This permanently deletes saved configurations and their dependent resources.

{
  "config_unique_keys": [
    "FIRST_CONFIGURATION_UNIQUE_KEY",
    "SECOND_CONFIGURATION_UNIQUE_KEY"
  ]
}

Send 1–100 distinct keys, each no more than 64 characters. Only configurations owned by your account are deleted. Missing keys and keys not owned by the account are counted as not found. The response reports deleted and not_found counts; inspect them before assuming all requested configurations were removed.

With API_BASE and CLIENT_API_KEY set, replace the two keys and send:

curl --fail-with-body --request POST "$API_BASE/configs/remove" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '
{
  "config_unique_keys": [
    "FIRST_CONFIGURATION_UNIQUE_KEY",
    "SECOND_CONFIGURATION_UNIQUE_KEY"
  ]
}
'

For one configuration, use DELETE a configuration.

Protected resources

Internal servers and tweaks expose only basic identity/display information. You may remove them using remove_servers or remove_tweaks, but cannot include their keys in upsert arrays. An attempted edit returns 403 and rolls back the entire batch, even if the same key also appears in a removal array. Removal responses and resource_list never reveal their connection details.

Create, update, and delete together

This complete request creates one direct SSH server and tweak, edits a different existing server and tweak, and deletes two other resources. Replace every YOUR_... key with a key belonging to this configuration. Update and deletion keys must refer to different resources. Omitted keys on new entries let the API assign their identities.

curl --fail-with-body --request POST "$API_BASE/configs/$CONFIG_KEY/sync" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '
{
    "servers": [
        {
            "name": "My SSH server",
            "tunnel": {
                "family": "ssh",
                "variant": "default"
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "accepted_methods": [
                []
            ],
            "settings": {
                "endpoint": {
                    "hosts": [
                        "ssh.example.com"
                    ],
                    "ports": [
                        22
                    ]
                },
                "credentials": {
                    "username": "demo",
                    "password": "replace-me"
                }
            }
        },
        {
            "unique_key": "YOUR_SERVER_TO_UPDATE",
            "name": "Renamed SSH"
        }
    ],
    "tweaks": [
        {
            "name": "Direct SSH",
            "tunnels": {
                "ssh": {
                    "variants": [
                        "default"
                    ]
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "methods": {}
        },
        {
            "unique_key": "YOUR_TWEAK_TO_UPDATE",
            "note": "Updated by API"
        }
    ],
    "remove_servers": [
        "YOUR_SERVER_TO_DELETE"
    ],
    "remove_tweaks": [
        "YOUR_TWEAK_TO_DELETE"
    ],
    "list_resources": true
}
'

Read the returned per-resource results for assigned keys and actions. resource_list contains the final summaries. If any operation fails validation, the entire transaction is rolled back. Do not retry an uncertain result automatically: entries without a key can create duplicates.

Reference

Configuration settings

Control access, restrictions, editing, and sharing.

On this page

Control access, restrictions, editing, and sharing.

Client API: POST /api/v1/configs, PATCH /api/v1/configs/{config_key} → settings.

PATCH changes only the fields you send and preserves omitted settings. A supplied list replaces the entire list. If an updates, access.password, or access.hwid object includes mode, that entire object is replaced, clearing values from the previous mode.

Updates default to cloud when creating a saved configuration.

Start with defaults

When creating a configuration, omit settings to use an enabled configuration without a password, device lock, or expiry date. Editing permissions, shared/custom resources, and banner hiding default to false. Access defaults to restricted, so locks and restrictions can be added later.

In a PATCH request, omitting settings leaves the saved settings unchanged.

A small example that permits credential editing:

{
  "settings": {
    "permissions": {
      "edit": {"credentials": true}
    }
  }
}

Include this settings object in your request body. Credential editing also enables the server permission flag, but the app interprets the combination as permission to edit credentials only. Server addresses and the full tunnel profile remain locked.

Access and updates

Paths below are relative to settings.

Field Values Behavior
enabled boolean Defaults to true; false is preserved in the generated export
updates.mode none, url, cloud Defaults to cloud when creating a saved configuration
updates.url URL string, max 255 characters Required for updates.mode: "url"; use an HTTP(S) URL that returns an exported configuration with the same unique_key
access.mode restricted, open Defaults to restricted. Open access cannot be combined with password/device locks or access restrictions.
access.password.mode none, local, cloud Defaults to none
access.password.verifier string Required only for local password mode
access.hwid.mode none, local, cloud Defaults to none
access.hwid.allowed string array Required for local device locking; 1–1,000 distinct device IDs, up to 128 characters each, without whitespace or semicolons

The API accepts a plaintext password of up to 100 bytes in access.password.verifier and converts it to the app’s password verifier. A lowercase hexadecimal string of exactly 64 characters is treated as an existing verifier. An arbitrary SHA-256 hash is not necessarily compatible with the app.

{
  "settings": {
    "access": {
      "password": {"mode": "local", "verifier": "ReplaceThisPassword"}
    }
  }
}

Specify mode when choosing an update source or password/device lock type. Only send values that apply to the selected mode.

With Client API PATCH, you can omit mode to change values within the current mode.

Restrictions

Field Type Meaning
restrictions.expires_at UTC string or null YYYY-MM-DDTHH:MM:SSZ; null means no expiration
restrictions.mobile_only boolean Restrict to mobile connectivity
restrictions.block_root boolean Block rooted devices
restrictions.require_store_install boolean Require store installation where supported by the app
restrictions.blocked_apps string array Up to 1,000 distinct app names or package IDs; max 255 characters each
restrictions.allowed_carrier_codes string array Up to 128 distinct mobile-operator codes, each containing 5–6 digits
{
  "settings": {
    "restrictions": {
      "expires_at": "2027-01-01T00:00:00Z",
      "block_root": true,
      "allowed_carrier_codes": ["51502", "51503"]
    }
  }
}

Use JSON booleans (true / false), not quoted strings. Lists must be JSON arrays. Send mobile-operator codes as strings to preserve leading zeroes.

Editing and display

All these fields are booleans and default to false:

Field Allows or controls
permissions.edit.server Editing server connection details when credentials is false; retains the authored identity and tunnel selection
permissions.edit.credentials Credential-only editing; sets the server flag too, while keeping endpoint/profile fields locked
permissions.edit.payload Editing tweak payload, SNI/TLS, DNS carrier values, and protocol tuning exposed by the app
permissions.edit.proxy Editing proxy values where the selected tunnel/carrier supports proxy methods
permissions.resources.use_shared Makes this configuration a source of shared servers and tweaks for other imported configurations
permissions.resources.show_shared Includes resources from other imported configurations that enable use_shared
permissions.resources.add_custom Allows local custom servers and tweaks in the recipient app
display.hide_banner Hiding the SSH banner

Shared resources retain their source configuration. Its access checks still apply when a recipient uses one of those resources. These flags do not publish resources to the panel's public server catalog. Local custom resources and permitted local edits stay on the recipient device.

For access.mode: "open", the generator clears individual edit permissions and add_custom along with locks and restrictions. Open access corresponds to the panel's Unlock All behavior: the apps can transfer the imported copy to the recipient as owner. Use restricted access with explicit permissions when you want recipients to make only selected edits; restricted access can still have no password or device lock.

Android and iOS restrictions

Restriction Android iOS
Local password, device lock, expiration Enforced for ordinary recipients Enforced for ordinary recipients
mobile_only Requires mobile connectivity Requires cellular connectivity
block_root Root checks Jailbreak checks
require_store_install Store-install checks App Store-install checks
blocked_apps Checks blocked applications Preserved in the document; not enforced
allowed_carrier_codes Provider Lock checks Preserved in the document; not enforced

Test access as an ordinary recipient. Verified configuration owners can bypass recipient restrictions, so importing as the owner is not a sufficient lock test. The app's displayed device ID is the value to use for device locks; it is different from an API key and from a raw device-registration identifier.

Sharing and owner metadata

Place these fields at the top level of your request, alongside settings:

{
  "sharing": {"allow_reshare": false},
  "owner": {"device_hwid": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}
}

sharing.allow_reshare defaults to false. The optional owner device ID can contain up to 32 characters. The owner’s username comes from the authenticated API account and cannot be supplied in the request.

Ready-to-send settings requests

The following requests update an existing saved configuration with your Client API variables. Each request demonstrates a separate choice; use only the choices you want.

Editing and shared resources

Allow credential, payload, and proxy editing while keeping server endpoints locked; allow shared and custom resources; hide the banner:

curl --fail-with-body --request PATCH "$API_BASE/configs/$CONFIG_KEY" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '
{
  "settings": {
    "permissions": {
      "edit": {
        "server": true,
        "credentials": true,
        "payload": true,
        "proxy": true
      },
      "resources": {
        "use_shared": true,
        "show_shared": true,
        "add_custom": true
      }
    },
    "display": {
      "hide_banner": true
    }
  }
}
'

Local locks and restrictions

Use local password and device locks, with a configuration expiration and platform restrictions. Replace the password, device ID, date, package names, and carrier codes before sending:

curl --fail-with-body --request PATCH "$API_BASE/configs/$CONFIG_KEY" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '
{
  "settings": {
    "access": {
      "mode": "restricted",
      "password": {
        "mode": "local",
        "verifier": "ReplaceThisPassword"
      },
      "hwid": {
        "mode": "local",
        "allowed": [
          "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
        ]
      }
    },
    "restrictions": {
      "expires_at": "2027-12-31T23:59:59Z",
      "mobile_only": true,
      "block_root": true,
      "require_store_install": true,
      "blocked_apps": [
        "com.example.capture"
      ],
      "allowed_carrier_codes": [
        "51502"
      ]
    }
  }
}
'

Clear locks and restrictions

Generate or update a configuration without expiration, list restrictions, or local locks:

curl --fail-with-body --request PATCH "$API_BASE/configs/$CONFIG_KEY" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '
{
  "settings": {
    "access": {
      "password": {
        "mode": "none"
      },
      "hwid": {
        "mode": "none"
      }
    },
    "restrictions": {
      "expires_at": null,
      "mobile_only": false,
      "block_root": false,
      "require_store_install": false,
      "blocked_apps": [],
      "allowed_carrier_codes": []
    }
  }
}
'

Cloud updates

Use panel cloud updates:

curl --fail-with-body --request PATCH "$API_BASE/configs/$CONFIG_KEY" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '
{
  "settings": {
    "updates": {
      "mode": "cloud"
    }
  }
}
'

Custom update URL

Use your own URL that serves a same-key exported configuration:

curl --fail-with-body --request PATCH "$API_BASE/configs/$CONFIG_KEY" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '
{
  "settings": {
    "updates": {
      "mode": "url",
      "url": "https://updates.example.com/subscriber.ht"
    }
  }
}
'

Disable updates

Disable automatic updates:

curl --fail-with-body --request PATCH "$API_BASE/configs/$CONFIG_KEY" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '
{
  "settings": {
    "updates": {
      "mode": "none"
    }
  }
}
'

Pause and resume

Choose whether the exported configuration is enabled. Recipients must receive the changed configuration; this is not an immediate disconnect command:

curl --fail-with-body --request PATCH "$API_BASE/configs/$CONFIG_KEY" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '
{
  "settings": {
    "enabled": false
  }
}
'
curl --fail-with-body --request PATCH "$API_BASE/configs/$CONFIG_KEY" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '
{
  "settings": {
    "enabled": true
  }
}
'

Open access

Choose open access only if you intend to give recipients control of their imported copy. This clears its locks, restrictions, and granular editing permissions:

curl --fail-with-body --request PATCH "$API_BASE/configs/$CONFIG_KEY" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $CLIENT_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '
{
  "settings": {
    "access": {
      "mode": "open",
      "password": {
        "mode": "none"
      },
      "hwid": {
        "mode": "none"
      }
    },
    "restrictions": {
      "expires_at": null,
      "mobile_only": false,
      "block_root": false,
      "require_store_install": false,
      "blocked_apps": [],
      "allowed_carrier_codes": []
    },
    "permissions": {
      "edit": {
        "server": false,
        "credentials": false,
        "payload": false,
        "proxy": false
      },
      "resources": {
        "add_custom": false
      }
    }
  }
}
'

Reference

Connection format

Understand tunnels, carriers, methods, and endpoint values.

On this page

Both APIs accept the same server and tweak connection documents. Use explicit objects and arrays; keep endpoints, credentials, and method values in their own fields.

Server and tweak at a glance

Part Server Tweak
Protocol tunnel: one family and variant tunnels: one or more families with variant arrays
Carrier carrier: type and server carrier settings carrier: type and client carrier settings
Methods accepted_methods: permitted method combinations methods: values for the chosen methods
Connection settings: endpoint, credentials, or profile Protocol-specific tuning belongs under tunnels

Tunnel families

family variant values
ssh default, bhttp, hcr
openvpn tcp, udp
v2ray vless, vmess, trojan, ss, socks, http, hysteria2, wireguard
hysteria default

A server uses {"family":"ssh","variant":"default"}. A tweak uses {"ssh":{"variants":["default"]}}. Select the exact profile protocol for V2Ray.

Carrier

Every connection needs carrier.type and carrier.settings.

Type Server settings Tweak settings
default Empty object {} Empty object {}
slowdns nameservers array and public_key resolvers array; optional kcp_window (1–4,096, default 512)
slipstream domains array of 1–16 distinct names resolvers and/or authoritative; optional keep_alive_ms and congestion_control
masterdns domains array; optional encryption_method and method-dependent encryption_key resolvers array; optional resolver_balancing_strategy, max_upload_mtu, and max_download_mtu

DNS carriers are available for SSH default, OpenVPN TCP, and the stream-capable V2Ray variants. Proxy methods are not available with DNS carriers. BHTTP, HCR, OpenVPN UDP, V2Ray Hysteria2, V2Ray WireGuard, and UDP Hysteria use the default carrier.

For SSH/OpenVPN with a DNS carrier, omit settings.endpoint; the server destination comes from the carrier. With the default carrier, supply the endpoint separately.

For SSH/OpenVPN DNS carriers only, optional settings.preserved_ports retains server ports while settings.endpoint is omitted. Use 1–1,000 distinct JSON integers from 1–65,535. These are not DNS resolver ports.

Accepted method combinations

A server's accepted_methods is a nonempty array of distinct combinations. Each combination is an array containing zero or more of payload, proxy, and tls.

{
  "accepted_methods": [[], ["tls"], ["payload", "tls"]]
}

This permits direct, TLS, or payload plus TLS. It does not permit payload alone. [[]] means direct only. [] is invalid because it permits no connection at all.

The supported set depends on the tunnel and carrier. BHTTP, HCR, OpenVPN UDP, Hysteria2, and WireGuard accept direct only. UDP Hysteria supports direct or TLS. Stream protocols on the default carrier support payload, proxy, and TLS combinations; DNS carriers support payload/TLS combinations.

Tweak methods

A direct tweak uses "methods": {}. Here is a TLS-only method object:

{
  "methods": {
    "tls": {"sni": ["edge.example.com"], "version": "TLSv1.2"}
  }
}
Method Main fields
payload value: payload text; tokens such as [crlf] represent line breaks
tls sni: host array; version where supported
proxy hosts, ports; optional credentials.username and credentials.password

A tweak's method names must match one of the server's accepted combinations. SSH/OpenVPN connections offering TLS on the default carrier also need settings.tls_ports. For V2Ray payload/proxy/TLS methods, use a compatible RAW/TCP profile; the profile must support the chosen runtime method; API validation alone does not test that connection. See the dedicated examples.

Endpoints and credentials

SSH: use settings.endpoint.hosts, settings.endpoint.ports, and a settings.credentials object with username and password. Optional settings.private_key contains your existing SSH private key text, up to 1,000,000 characters.

OpenVPN: put the profile text in settings.profile, destinations in settings.endpoint, and login values in settings.credentials. Endpoint and transport selection are separate from profile text. Do not include remote, remote-random, proto, port, rport, or <connection> blocks in the API profile: express the destination in endpoint and the transport in tunnel.variant. Use client (or tls-client) and a TUN device, with inline certificates/keys instead of filesystem paths. A panel .ovpn import can extract this structure for you; the API expects it already separated. Optional fields include private_key_password and tls_ports.

V2Ray: put the share URI or supported raw profile in settings.profile. Its protocol must match tunnel.variant.

UDP Hysteria: use endpoint hosts and port_sets, an authentication string, and hop_interval_seconds (at least 8). Optional settings include bandwidth, ALPN, PEM CA certificates, obfuscation password, receive window, MTU discovery, and UDP idle timeout.

{
  "endpoint": {"hosts": ["ssh.example.com", "2001:db8::10"], "ports": [22, 2222]},
  "credentials": {"username": "demo", "password": "replace-me"}
}

This fragment belongs inside a server's settings. Host values contain only a hostname or IP: no URL scheme, port, or credentials. IPv6 addresses in host arrays are bare (2001:db8::10), without brackets. Port arrays contain 1–1,000 distinct JSON integers between 1 and 65,535. Host arrays contain 1–1,000 distinct entries of at most 253 characters. Hosts and ports are independent alternatives, not pairs matched by array position; do not join values with separators.

A Hysteria port set can contain individual ports and ranges:

{
  "endpoint": {
    "hosts": ["hy.example.com"],
    "port_sets": [[{"from": 443, "to": 443}, {"from": 5000, "to": 5100}]]
  }
}

Use connection examples for complete, copyable documents rather than submitting these field fragments on their own.

Transport tuning

These optional fields belong in the tweak, not in server credentials. Only include tuning for a selected tunnel variant. The defaults below describe what Android and iOS use when an optional value is omitted. To keep a chosen value independent of app defaults, send it explicitly.

Field Allowed value / unit Default when omitted
tunnels.ssh.bhttp.version Integer 1–2; select the version supported by your relay 2
tunnels.ssh.bhttp.chunk_size Integer 64–1,399 bytes per chunk 1399
tunnels.ssh.bhttp.download_batch Integer 1–32 records per download request 8
tunnels.ssh.bhttp.upload_workers Integer 1–64 concurrent upload workers 2
tunnels.ssh.bhttp.download_workers Integer 1–128 concurrent download workers 4
tunnels.ssh.hcr.mode hcr_v1 uses TLS; hcr_v1_plain uses a plain TCP relay connection hcr_v1
tunnels.ssh.hcr.download_batch Integer 1–32 records per download request 32
tunnels.ssh.hcr.upload_workers Integer 1–64 concurrent upload workers 16
tunnels.ssh.hcr.download_workers Integer 1–128 concurrent download workers 32
tunnels.v2ray.bug_hosts 1–1,000 distinct host candidates, max 253 characters each No substitution candidates; supply values when the profile uses [bughost]
methods.tls.version default, TLSv1.1, TLSv1.2, or TLSv1.3; UDP Hysteria allows only default because QUIC selects TLS default

For BHTTP and HCR, settings.endpoint.ports on the server is the relay listener port. BHTTP/HCR tuning belongs to the tweak. For V2Ray, bug_hosts supplies runtime host candidates; it does not change the profile protocol.

For SlowDNS, carrier.settings.resolvers accepts plain DNS addresses or udp://, https://, tls://, and dot:// resolvers. Server carrier.settings.nameservers contains DNS tunnel nameserver hosts; carrier.settings.public_key is the tunnel's public key. Optional tweak carrier.settings.kcp_window is a packet count from 1–4,096, default 512.

For Slipstream, use 1–16 total paths across carrier.settings.resolvers and carrier.settings.authoritative, with optional ports. Resolver paths accept numeric IP addresses or [local]; authoritative paths require numeric IP addresses. IPv6 with a port uses [2001:db8::10]:53 in these strings. Each domain must be a valid delegated DNS name shorter than 240 bytes. Server settings require domains and may include certificate, a single PEM leaf certificate of at most 16,384 characters.

Slipstream tweak field Allowed value / unit Default when omitted
carrier.settings.keep_alive_ms Integer 0–65,535 milliseconds; 0 disables keep-alive packets 400
carrier.settings.congestion_control bbr or dcubic; an explicit value overrides automatic selection Automatic: bbr on authoritative paths, dcubic on recursive resolver paths

For MasterDnsVPN, server carrier.settings.domains contains 1–16 distinct delegated DNS names, each at most 220 bytes.

carrier.settings.encryption_method is a JSON integer (default 5): 0 = no encryption, 1 = XOR, 2 = ChaCha20, 3 = AES-128-GCM, 4 = AES-192-GCM, 5 = AES-256-GCM. Omit carrier.settings.encryption_key for method 0. Otherwise, supply 16 characters for method 3, 24 for method 4, or 32 for methods 1, 2, and 5. Keys use printable ASCII characters without spaces and must match the remote server.

MasterDnsVPN tweak carrier.settings.resolvers requires 1–16 distinct numeric IP addresses or [local] (current network DNS), with optional ports from 1–65,535. For example: 1.1.1.1:53, [2001:db8::10]:53, or [local]:5353. DoH/DoT URLs are not accepted.

Optional MasterDnsVPN tweak values are JSON integers:

Field Allowed value / unit Default when omitted
carrier.settings.resolver_balancing_strategy Integer 0–8; meanings below 2
carrier.settings.max_upload_mtu Integer 38–512 bytes; maximum upload MTU 150
carrier.settings.max_download_mtu Integer 100–4,096 bytes; maximum download MTU 500

The negotiated MTU can be lower than these caps. These are DNS tunnel limits, not the device's network-interface MTU.

Balancing strategy Meaning
0 Round-robin compatibility mode; currently the same selection behavior as 2
1 Random selection among active resolver connections
2 Round-robin selection among active resolver connections
3 Prefer connections with the lowest measured loss
4 Prefer connections with the lowest measured latency
5 Prefer connections with the best combined loss and latency score
6 Shortlist low-loss connections, then prefer low latency within that group
7 Random selection within the best measured loss group
8 Round-robin selection within the best measured loss group

Measured strategies use round-robin until usable measurements are available. For a first configuration, omit the strategy or use 2; change it when you have measured resolver performance.

Hysteria tuning

Paths below are relative to server settings.

Field Allowed value / unit Default when omitted
authentication Required string, up to 65,535 characters Required; supply the value expected by your server
obfuscation_password Optional string, up to 65,535 characters No obfuscation password
bandwidth.upload_mbps, bandwidth.download_mbps Integers 1–1,000,000 megabits per second; provide both if supplying bandwidth 100 in each direction
hop_interval_seconds Required integer 8–2,147,483,647 seconds between port hops Required; no API default
receive_window Integer 1–4,096; receive-window multiplier, explained below 3
udp_idle_timeout_seconds Integer 4–120 seconds 20
disable_mtu_discovery JSON boolean false
alpn String, at most 255 UTF-8 bytes No override; the tunnel core chooses its default
ca Valid PEM certificates, at most 65,535 bytes No custom CA certificates

Each receive_window unit provides 65536 bytes of stream receive window and 163840 bytes of connection receive window. The default 3 therefore gives 196608 and 491520 bytes respectively. Send the multiplier, not either byte count.

Before testing a connection

A valid API document records how to connect; it does not provision remote services or prove they are reachable. SSH users, TLS listeners, proxies, DNS tunnel domains/keys, OpenVPN certificates, and V2Ray profiles must already match your infrastructure.

For a server and tweak used together, verify the tunnel variant, carrier, accepted method combination, and category matching (empty matches empty; named categories must share a token, ignoring case and surrounding spaces; separate tokens with semicolons or newlines). A direct method means no extra payload/proxy/TLS method; it does not disable encryption already supplied by SSH, an OpenVPN profile, or a V2Ray profile.

Field limits and complete values

Field Limit / requirement
SSH/OpenVPN settings.credentials Both username and password must be present as strings; each up to 65,535 characters
OpenVPN/V2Ray settings.profile Nonempty string, up to 10,000,000 characters; installation request-size limits still apply
OpenVPN settings.private_key_password Optional string, up to 65,535 characters
SSH settings.private_key_password Optional string, up to 1,000,000 characters
methods.payload.value Nonblank string; up to 100000 characters on this installation
methods.tls.sni, methods.proxy.hosts 1–1,000 distinct nonempty candidates, each up to 253 characters
methods.proxy.credentials If supplied, both username and password strings are required; each up to 65,535 characters
SlowDNS server nameservers 1–1,000 distinct hostnames/IPs, each up to 253 characters
SlowDNS tweak resolvers 1–1,000 distinct resolver strings, each up to 2,048 characters

Use full values for enabled methods: "tls": {} is a summary marker, not a valid authoring value. Send methods: {} only when no methods are enabled. One tweak's carrier and methods must be eligible for every selected family/variant; for example, a proxy tweak cannot also select OpenVPN UDP.

For OpenVPN, supply a complete usable profile with the necessary inline certificates/keys and options. Panel/API validation is structural; the apps also evaluate profiles with their bundled OpenVPN core. Passing API validation does not guarantee successful native parsing, authentication, or negotiation.

Reference

Payload & server placeholders

Use connection tokens in payloads, SNI, proxies, profiles, and DNS resolvers.

On this page

Keep connection placeholders as literal strings in Client API and Business API requests. The app resolves them when connecting, using the selected server, tweak, proxy, and network. They are field-specific: a token supported in a payload is not automatically supported in a server address or SNI.

Where placeholders work

Field Supported use
Tweak methods.payload.value HTTP payload tokens and controls described below, on a compatible payload connection
Tweak methods.proxy.hosts [host] reuses the selected server host; supply the proxy port separately in methods.proxy.ports
SSH/OpenVPN tweak methods.tls.sni [host] uses the selected server host; [proxy] uses the proxy host without its port
UDP Hysteria tweak methods.tls.sni Host tokens such as [host], [ip], [ssh_host], [rlb], [bughost], and [cf], including uppercase forms; [proxy] is not supported because UDP Hysteria has no tweak proxy
V2Ray server settings.profile [bughost] uses a selected value from the tweak's tunnels.v2ray.bug_hosts
SlowDNS/Slipstream/MasterDnsVPN tweak carrier.settings.resolvers [local] uses the current network's DNS address

Use actual hostnames or IP addresses in server endpoint arrays. For V2Ray SNI and proxy fields, use explicit host values unless the chosen connection supports the desired substitution. See connection examples for compatible methods.

Payload tokens

The following reference describes SSH/OpenVPN payload connections. Use the spelling shown; do not assume every token accepts mixed or uppercase spelling.

Token Replacement / example
[host], [ip], [ssh_host] Destination host, for example ssh.example.com; [ip] does not force a DNS lookup
[port], [ssh_port] Destination port, for example 22
[host_port], [ip_port], [ssh] Destination host and port, for example ssh.example.com:22; IPv6 is bracketed
[proxy] Selected proxy address, including its port when supplied, for example proxy.example.com:8080
[proxy_host], [proxy_port] Proxy host and port separately; use [proxy_host] when a header needs only the hostname
[bughost], [rlb], [cf] Aliases for the destination host in these payloads; the V2Ray profile substitution is separate
[method], [protocol] Connection request method and HTTP version; these depend on the connection path
[raw], [real_raw] Connection request line followed by a blank line
[crlf], [cr], [lf], [lfcr] CR+LF, CR, LF, or LF+CR; normal HTTP headers use [crlf]
[ua] The client's user-agent value; it can differ between connection paths
[auth] Proxy authorization derived from configured proxy credentials; leave credentials in methods.proxy.credentials

For a compatible HTTP CONNECT proxy, this tweak method fragment targets the selected server. The proxy must permit that destination and port.

{
  "methods": {
    "proxy": {"hosts": ["proxy.example.com"], "ports": [8080]},
    "payload": {
      "value": "CONNECT [host_port] HTTP/1.1[crlf]Host: [host_port][crlf][crlf]"
    }
  }
}

V2Ray payload examples use [host], [port], [ua], and [crlf] for the payload destination. A profile's [bughost] is resolved from tunnels.v2ray.bug_hosts before connecting; it is not a universal replacement for every payload token. Use the V2Ray payload example with a compatible RAW/TCP profile and frontend.

Payload choices and write controls

These controls apply to SSH/OpenVPN payload connections. Choices select text; write controls divide the outgoing stream. A write boundary does not guarantee a separate TCP packet.

Syntax Behavior
[rotate=one.example;two.example] Cycles through alternatives on successive uses; rotation state can reset when the connection restarts
[random=one.example;two.example] Chooses one alternative randomly
[split] Splits writes and adds a one-second pause after the complete payload
[splitNoDelay], [instant_split] Splits writes without an added pause
[delay], [delay_split], [split_delay] Splits writes and pauses one second at that boundary

Keep the semicolons inside a choice token. API host and resolver candidates are separate JSON array entries, not one semicolon-separated string.

Local DNS resolver

Use lowercase [local] in SlowDNS, Slipstream, or MasterDnsVPN tweak resolver fields. Both Android and iOS discover the current network's DNS address for each connection and keep the placeholder in the saved configuration. It does not mean localhost, the VPN server, or the panel server's DNS.

Value Use
[local] Network DNS with the default DNS port, 53
[local]:5353 Network DNS with an explicit port
udp://[local], udp://[local]:5353 SlowDNS UDP resolver forms; use the plain forms for Slipstream and MasterDnsVPN

In the panel resolver input, you can enter [local];8.8.8.8. In either API, send separate array values:

{
  "carrier": {
    "type": "slipstream",
    "settings": {"resolvers": ["[local]", "8.8.8.8:53"]}
  }
}

This is a tweak carrier fragment. [local] is not supported in Slipstream carrier.settings.authoritative, server DNS domains/nameservers, payloads, SNI, or ordinary server endpoint fields. If network DNS cannot be discovered when required, the app reports that local DNS is unavailable; adding a fixed resolver does not guarantee automatic fallback.

For MasterDnsVPN, the same placeholder works in carrier.settings.resolvers. Use plain numeric resolver addresses or [local], each with an optional port; URL schemes such as udp://, https://, and tls:// are not accepted:

{
  "carrier": {
    "type": "masterdns",
    "settings": {"resolvers": ["[local]:5353", "1.1.1.1:53"]}
  }
}

Configuration message placeholders

Connection tokens are separate from configuration message templates such as {config_name}. Message templates are rendered by the panel. See configuration message placeholders and the message reference in the tutorial.

Reference

Connection examples

Choose a tunnel and copy a complete server or tweak document.

Choose a protocol below to see a complete server or tweak body. All hostnames, passwords, public keys, and profiles are illustrative. Replace them with working values for your infrastructure.

How to use a sample

Client API: send a server body to POST /api/v1/configs/{config_key}/servers, or a tweak body to POST /api/v1/configs/{config_key}/tweaks, using your Client API key.

Start with Client API quickstart if this is your first request. Some samples deliberately show multiple endpoint choices or advanced methods; the connection format explains each part.

Sample library

The library below uses the application's shared example definitions and converts them to the public JSON format. Expand a sample and copy the request body for this API. Samples remain available with JavaScript disabled.

OpenVPN TCP Server + tweak

Server

POST /api/v1/configs/{config_key}/servers

{
    "name": "OpenVPN",
    "tunnel": {
        "family": "openvpn",
        "variant": "tcp"
    },
    "settings": {
        "endpoint": {
            "hosts": [
                "vpn.example.com"
            ],
            "ports": [
                1194
            ]
        },
        "profile": "client\ndev tun\nauth-user-pass\nremote-cert-tls server\n",
        "credentials": {
            "username": "demo",
            "password": "secret"
        }
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "accepted_methods": [
        [],
        [
            "payload"
        ],
        [
            "proxy"
        ],
        [
            "payload",
            "proxy"
        ],
        [
            "tls"
        ],
        [
            "payload",
            "tls"
        ],
        [
            "tls",
            "proxy"
        ],
        [
            "payload",
            "tls",
            "proxy"
        ]
    ]
}

Tweak

POST /api/v1/configs/{config_key}/tweaks

{
    "name": "OpenVPN TCP",
    "tunnels": {
        "openvpn": {
            "variants": [
                "tcp"
            ]
        }
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "methods": {}
}
OpenVPN UDP Server + tweak

Server

POST /api/v1/configs/{config_key}/servers

{
    "name": "OpenVPN",
    "tunnel": {
        "family": "openvpn",
        "variant": "udp"
    },
    "settings": {
        "endpoint": {
            "hosts": [
                "vpn.example.com"
            ],
            "ports": [
                1194
            ]
        },
        "profile": "client\ndev tun\nauth-user-pass\nremote-cert-tls server\n",
        "credentials": {
            "username": "demo",
            "password": "secret"
        }
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "accepted_methods": [
        []
    ]
}

Tweak

POST /api/v1/configs/{config_key}/tweaks

{
    "name": "OpenVPN UDP",
    "tunnels": {
        "openvpn": {
            "variants": [
                "udp"
            ]
        }
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "methods": {}
}
OpenVPN TCP / UDP Shared tweak

Tweak

POST /api/v1/configs/{config_key}/tweaks

{
    "name": "OpenVPN TCP / UDP",
    "tunnels": {
        "openvpn": {
            "variants": [
                "tcp",
                "udp"
            ]
        }
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "methods": {}
}
OpenVPN / SSH Shared tweak

Tweak

POST /api/v1/configs/{config_key}/tweaks

{
    "name": "OpenVPN / SSH",
    "tunnels": {
        "openvpn": {
            "variants": [
                "tcp"
            ]
        },
        "ssh": {
            "variants": [
                "default"
            ]
        }
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "methods": {
        "payload": {
            "value": "GET / HTTP/1.1[crlf]Host: edge.example.com[crlf][crlf]"
        },
        "tls": {
            "sni": [
                "edge.example.com"
            ],
            "version": "TLSv1.2"
        },
        "proxy": {
            "hosts": [
                "proxy.example.com"
            ],
            "ports": [
                443,
                444
            ]
        }
    }
}
SSH Server + tweak

Server

POST /api/v1/configs/{config_key}/servers

{
    "name": "SSH",
    "tunnel": {
        "family": "ssh",
        "variant": "default"
    },
    "settings": {
        "endpoint": {
            "hosts": [
                "ssh1.example.com",
                "ssh2.example.com"
            ],
            "ports": [
                22,
                2222
            ]
        },
        "credentials": {
            "username": "demo",
            "password": "secret"
        },
        "tls_ports": [
            443,
            8443
        ]
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "accepted_methods": [
        [],
        [
            "payload"
        ],
        [
            "proxy"
        ],
        [
            "payload",
            "proxy"
        ],
        [
            "tls"
        ],
        [
            "payload",
            "tls"
        ],
        [
            "tls",
            "proxy"
        ],
        [
            "payload",
            "tls",
            "proxy"
        ]
    ]
}

Tweak

POST /api/v1/configs/{config_key}/tweaks

{
    "name": "SSH",
    "tunnels": {
        "ssh": {
            "variants": [
                "default"
            ]
        }
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "methods": {
        "payload": {
            "value": "GET / HTTP/1.1[crlf]Host: edge.example.com[crlf][crlf]"
        },
        "tls": {
            "sni": [
                "edge.example.com"
            ],
            "version": "TLSv1.2"
        }
    }
}
SSH BHTTP Server + tweak

Server

POST /api/v1/configs/{config_key}/servers

{
    "name": "BHTTP",
    "tunnel": {
        "family": "ssh",
        "variant": "bhttp"
    },
    "settings": {
        "endpoint": {
            "hosts": [
                "relay.example.com"
            ],
            "ports": [
                8081
            ]
        },
        "credentials": {
            "username": "demo",
            "password": "secret"
        }
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "accepted_methods": [
        []
    ]
}

Tweak

POST /api/v1/configs/{config_key}/tweaks

{
    "name": "SSH BHTTP",
    "tunnels": {
        "ssh": {
            "variants": [
                "bhttp"
            ],
            "bhttp": {
                "version": 2,
                "chunk_size": 1399,
                "download_batch": 8,
                "upload_workers": 2,
                "download_workers": 4
            }
        }
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "methods": {}
}
SSH HCR Server + tweak

Server

POST /api/v1/configs/{config_key}/servers

{
    "name": "HCR",
    "tunnel": {
        "family": "ssh",
        "variant": "hcr"
    },
    "settings": {
        "endpoint": {
            "hosts": [
                "relay.example.com"
            ],
            "ports": [
                8081
            ]
        },
        "credentials": {
            "username": "demo",
            "password": "secret"
        }
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "accepted_methods": [
        []
    ]
}

Tweak

POST /api/v1/configs/{config_key}/tweaks

{
    "name": "SSH HCR",
    "tunnels": {
        "ssh": {
            "variants": [
                "hcr"
            ],
            "hcr": {
                "mode": "hcr_v1",
                "download_batch": 8,
                "upload_workers": 2,
                "download_workers": 4
            }
        }
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "methods": {}
}
SSH SlowDNS Server + tweak

Server

POST /api/v1/configs/{config_key}/servers

{
    "name": "SSH SlowDNS",
    "tunnel": {
        "family": "ssh",
        "variant": "default"
    },
    "settings": {
        "credentials": {
            "username": "demo",
            "password": "secret"
        }
    },
    "carrier": {
        "type": "slowdns",
        "settings": {
            "nameservers": [
                "ns1.example.com",
                "ns2.example.com"
            ],
            "public_key": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
        }
    },
    "accepted_methods": [
        [],
        [
            "payload"
        ],
        [
            "tls"
        ],
        [
            "payload",
            "tls"
        ]
    ]
}

Tweak

POST /api/v1/configs/{config_key}/tweaks

{
    "name": "SSH SlowDNS",
    "tunnels": {
        "ssh": {
            "variants": [
                "default"
            ]
        }
    },
    "carrier": {
        "type": "slowdns",
        "settings": {
            "resolvers": [
                "https://dns.google/dns-query"
            ],
            "kcp_window": 512
        }
    },
    "methods": {
        "payload": {
            "value": "GET / HTTP/1.1[crlf]Host: edge.example.com[crlf][crlf]"
        },
        "tls": {
            "sni": [
                "edge.example.com"
            ],
            "version": "TLSv1.2"
        }
    }
}
OpenVPN SlowDNS Server + tweak

Server

POST /api/v1/configs/{config_key}/servers

{
    "name": "OpenVPN SlowDNS",
    "tunnel": {
        "family": "openvpn",
        "variant": "tcp"
    },
    "settings": {
        "profile": "client\ndev tun\nauth-user-pass\nremote-cert-tls server\n",
        "credentials": {
            "username": "demo",
            "password": "secret"
        }
    },
    "carrier": {
        "type": "slowdns",
        "settings": {
            "nameservers": [
                "ns1.example.com",
                "ns2.example.com"
            ],
            "public_key": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
        }
    },
    "accepted_methods": [
        [],
        [
            "payload"
        ],
        [
            "tls"
        ],
        [
            "payload",
            "tls"
        ]
    ]
}

Tweak

POST /api/v1/configs/{config_key}/tweaks

{
    "name": "OpenVPN SlowDNS",
    "tunnels": {
        "openvpn": {
            "variants": [
                "tcp"
            ]
        }
    },
    "carrier": {
        "type": "slowdns",
        "settings": {
            "resolvers": [
                "https://dns.google/dns-query"
            ],
            "kcp_window": 512
        }
    },
    "methods": {}
}
OpenVPN / SSH SlowDNS Shared tweak

Tweak

POST /api/v1/configs/{config_key}/tweaks

{
    "name": "OpenVPN / SSH SlowDNS",
    "tunnels": {
        "openvpn": {
            "variants": [
                "tcp"
            ]
        },
        "ssh": {
            "variants": [
                "default"
            ]
        }
    },
    "carrier": {
        "type": "slowdns",
        "settings": {
            "resolvers": [
                "https://dns.google/dns-query"
            ],
            "kcp_window": 512
        }
    },
    "methods": {
        "payload": {
            "value": "GET / HTTP/1.1[crlf]Host: edge.example.com[crlf][crlf]"
        },
        "tls": {
            "sni": [
                "edge.example.com"
            ],
            "version": "TLSv1.2"
        }
    }
}
UDP Hysteria Server + tweak

Server

POST /api/v1/configs/{config_key}/servers

{
    "name": "UDP Hysteria",
    "tunnel": {
        "family": "hysteria",
        "variant": "default"
    },
    "settings": {
        "endpoint": {
            "hosts": [
                "hy.example.com",
                "2001:db8::10",
                "2001:db8::11"
            ],
            "port_sets": [
                [
                    {
                        "from": 443,
                        "to": 443
                    },
                    {
                        "from": 500,
                        "to": 3445
                    }
                ],
                [
                    {
                        "from": 3000,
                        "to": 4000
                    },
                    {
                        "from": 4500,
                        "to": 5000
                    }
                ],
                [
                    {
                        "from": 5670,
                        "to": 5670
                    }
                ]
            ]
        },
        "authentication": "auth-token",
        "obfuscation_password": "obfs-password",
        "bandwidth": {
            "upload_mbps": 20,
            "download_mbps": 50
        },
        "alpn": "h3",
        "hop_interval_seconds": 10
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "accepted_methods": [
        [],
        [
            "tls"
        ]
    ]
}

Tweak

POST /api/v1/configs/{config_key}/tweaks

{
    "name": "UDP Hysteria",
    "tunnels": {
        "hysteria": {
            "variants": [
                "default"
            ]
        }
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "methods": {
        "tls": {
            "sni": [
                "hy.example.com"
            ]
        }
    }
}
V2Ray VLESS Server + tweak

Server

POST /api/v1/configs/{config_key}/servers

{
    "name": "V2Ray",
    "tunnel": {
        "family": "v2ray",
        "variant": "vless"
    },
    "settings": {
        "profile": "vless://[email protected]:443?type=tcp&security=tls"
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "accepted_methods": [
        [],
        [
            "payload"
        ],
        [
            "proxy"
        ],
        [
            "payload",
            "proxy"
        ],
        [
            "tls"
        ],
        [
            "payload",
            "tls"
        ],
        [
            "tls",
            "proxy"
        ],
        [
            "payload",
            "tls",
            "proxy"
        ]
    ]
}

Tweak

POST /api/v1/configs/{config_key}/tweaks

{
    "name": "V2Ray VLESS",
    "tunnels": {
        "v2ray": {
            "variants": [
                "vless"
            ],
            "bug_hosts": [
                "edge.example.com"
            ]
        }
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "methods": {}
}
V2Ray VMESS Server + tweak

Server

POST /api/v1/configs/{config_key}/servers

{
    "name": "V2Ray",
    "tunnel": {
        "family": "v2ray",
        "variant": "vmess"
    },
    "settings": {
        "profile": "vmess://eyJ2IjoiMiIsImFkZCI6InZtZXNzLmV4YW1wbGUuY29tIiwicG9ydCI6IjQ0MyIsImlkIjoiMTExMTExMTEtMTExMS00MTExLTgxMTEtMTExMTExMTExMTExIiwiYWlkIjoiMCIsIm5ldCI6InRjcCIsInRscyI6InRscyJ9"
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "accepted_methods": [
        [],
        [
            "payload"
        ],
        [
            "proxy"
        ],
        [
            "payload",
            "proxy"
        ],
        [
            "tls"
        ],
        [
            "payload",
            "tls"
        ],
        [
            "tls",
            "proxy"
        ],
        [
            "payload",
            "tls",
            "proxy"
        ]
    ]
}

Tweak

POST /api/v1/configs/{config_key}/tweaks

{
    "name": "V2Ray VMESS",
    "tunnels": {
        "v2ray": {
            "variants": [
                "vmess"
            ],
            "bug_hosts": [
                "edge.example.com"
            ]
        }
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "methods": {}
}
V2Ray HYSTERIA2 Server + tweak

Server

POST /api/v1/configs/{config_key}/servers

{
    "name": "V2Ray",
    "tunnel": {
        "family": "v2ray",
        "variant": "hysteria2"
    },
    "settings": {
        "profile": "hysteria2://[email protected]:443"
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "accepted_methods": [
        []
    ]
}

Tweak

POST /api/v1/configs/{config_key}/tweaks

{
    "name": "V2Ray HYSTERIA2",
    "tunnels": {
        "v2ray": {
            "variants": [
                "hysteria2"
            ],
            "bug_hosts": [
                "edge.example.com"
            ]
        }
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "methods": {}
}
V2Ray SOCKS Server + tweak

Server

POST /api/v1/configs/{config_key}/servers

{
    "name": "V2Ray",
    "tunnel": {
        "family": "v2ray",
        "variant": "socks"
    },
    "settings": {
        "profile": "socks://demo:[email protected]:1080"
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "accepted_methods": [
        [],
        [
            "payload"
        ],
        [
            "proxy"
        ],
        [
            "payload",
            "proxy"
        ],
        [
            "tls"
        ],
        [
            "payload",
            "tls"
        ],
        [
            "tls",
            "proxy"
        ],
        [
            "payload",
            "tls",
            "proxy"
        ]
    ]
}

Tweak

POST /api/v1/configs/{config_key}/tweaks

{
    "name": "V2Ray SOCKS",
    "tunnels": {
        "v2ray": {
            "variants": [
                "socks"
            ],
            "bug_hosts": [
                "edge.example.com"
            ]
        }
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "methods": {}
}
V2Ray HTTP Server + tweak

Server

POST /api/v1/configs/{config_key}/servers

{
    "name": "V2Ray",
    "tunnel": {
        "family": "v2ray",
        "variant": "http"
    },
    "settings": {
        "profile": "http://demo:[email protected]:8080"
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "accepted_methods": [
        [],
        [
            "payload"
        ],
        [
            "proxy"
        ],
        [
            "payload",
            "proxy"
        ],
        [
            "tls"
        ],
        [
            "payload",
            "tls"
        ],
        [
            "tls",
            "proxy"
        ],
        [
            "payload",
            "tls",
            "proxy"
        ]
    ]
}

Tweak

POST /api/v1/configs/{config_key}/tweaks

{
    "name": "V2Ray HTTP",
    "tunnels": {
        "v2ray": {
            "variants": [
                "http"
            ],
            "bug_hosts": [
                "edge.example.com"
            ]
        }
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "methods": {}
}
V2Ray SS Server + tweak

Server

POST /api/v1/configs/{config_key}/servers

{
    "name": "V2Ray",
    "tunnel": {
        "family": "v2ray",
        "variant": "ss"
    },
    "settings": {
        "profile": "ss://[email protected]:8388"
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "accepted_methods": [
        [],
        [
            "payload"
        ],
        [
            "proxy"
        ],
        [
            "payload",
            "proxy"
        ],
        [
            "tls"
        ],
        [
            "payload",
            "tls"
        ],
        [
            "tls",
            "proxy"
        ],
        [
            "payload",
            "tls",
            "proxy"
        ]
    ]
}

Tweak

POST /api/v1/configs/{config_key}/tweaks

{
    "name": "V2Ray SS",
    "tunnels": {
        "v2ray": {
            "variants": [
                "ss"
            ],
            "bug_hosts": [
                "edge.example.com"
            ]
        }
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "methods": {}
}
V2Ray TROJAN Server + tweak

Server

POST /api/v1/configs/{config_key}/servers

{
    "name": "V2Ray",
    "tunnel": {
        "family": "v2ray",
        "variant": "trojan"
    },
    "settings": {
        "profile": "trojan://[email protected]:443?type=tcp&security=tls"
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "accepted_methods": [
        [],
        [
            "payload"
        ],
        [
            "proxy"
        ],
        [
            "payload",
            "proxy"
        ],
        [
            "tls"
        ],
        [
            "payload",
            "tls"
        ],
        [
            "tls",
            "proxy"
        ],
        [
            "payload",
            "tls",
            "proxy"
        ]
    ]
}

Tweak

POST /api/v1/configs/{config_key}/tweaks

{
    "name": "V2Ray TROJAN",
    "tunnels": {
        "v2ray": {
            "variants": [
                "trojan"
            ],
            "bug_hosts": [
                "edge.example.com"
            ]
        }
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "methods": {}
}
V2Ray WIREGUARD Server + tweak

Server

POST /api/v1/configs/{config_key}/servers

{
    "name": "V2Ray",
    "tunnel": {
        "family": "v2ray",
        "variant": "wireguard"
    },
    "settings": {
        "profile": "[Interface]\nPrivateKey = YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWE=\nAddress = 10.0.0.2/32\n\n[Peer]\nPublicKey = YmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmI=\nEndpoint = wg.example.com:51820"
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "accepted_methods": [
        []
    ]
}

Tweak

POST /api/v1/configs/{config_key}/tweaks

{
    "name": "V2Ray WIREGUARD",
    "tunnels": {
        "v2ray": {
            "variants": [
                "wireguard"
            ],
            "bug_hosts": [
                "edge.example.com"
            ]
        }
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "methods": {}
}
V2Ray VLESS + Payload Server + tweak

Server

POST /api/v1/configs/{config_key}/servers

{
    "name": "V2Ray RAW/TCP",
    "tunnel": {
        "family": "v2ray",
        "variant": "vless"
    },
    "settings": {
        "profile": "vless://[email protected]:443?type=tcp&security=tls"
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "accepted_methods": [
        [],
        [
            "payload"
        ],
        [
            "proxy"
        ],
        [
            "payload",
            "proxy"
        ],
        [
            "tls"
        ],
        [
            "payload",
            "tls"
        ],
        [
            "tls",
            "proxy"
        ],
        [
            "payload",
            "tls",
            "proxy"
        ]
    ]
}

Tweak

POST /api/v1/configs/{config_key}/tweaks

{
    "name": "V2Ray VLESS + Payload",
    "tunnels": {
        "v2ray": {
            "variants": [
                "vless"
            ]
        }
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "methods": {
        "payload": {
            "value": "GET / HTTP/1.1[crlf]Host: edge.example.com[crlf][crlf]"
        },
        "tls": {
            "sni": [
                "edge.example.com"
            ],
            "version": "TLSv1.2"
        },
        "proxy": {
            "hosts": [
                "proxy.example.com"
            ],
            "ports": [
                443,
                444
            ]
        }
    }
}
V2Ray VMESS + Payload Server + tweak

Server

POST /api/v1/configs/{config_key}/servers

{
    "name": "V2Ray RAW/TCP",
    "tunnel": {
        "family": "v2ray",
        "variant": "vmess"
    },
    "settings": {
        "profile": "vmess://eyJ2IjoiMiIsImFkZCI6InZtZXNzLmV4YW1wbGUuY29tIiwicG9ydCI6IjQ0MyIsImlkIjoiMTExMTExMTEtMTExMS00MTExLTgxMTEtMTExMTExMTExMTExIiwiYWlkIjoiMCIsIm5ldCI6InRjcCIsInRscyI6InRscyJ9"
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "accepted_methods": [
        [],
        [
            "payload"
        ],
        [
            "proxy"
        ],
        [
            "payload",
            "proxy"
        ],
        [
            "tls"
        ],
        [
            "payload",
            "tls"
        ],
        [
            "tls",
            "proxy"
        ],
        [
            "payload",
            "tls",
            "proxy"
        ]
    ]
}

Tweak

POST /api/v1/configs/{config_key}/tweaks

{
    "name": "V2Ray VMESS + Payload",
    "tunnels": {
        "v2ray": {
            "variants": [
                "vmess"
            ]
        }
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "methods": {
        "payload": {
            "value": "GET / HTTP/1.1[crlf]Host: edge.example.com[crlf][crlf]"
        },
        "tls": {
            "sni": [
                "edge.example.com"
            ],
            "version": "TLSv1.2"
        },
        "proxy": {
            "hosts": [
                "proxy.example.com"
            ],
            "ports": [
                443,
                444
            ]
        }
    }
}
V2Ray TROJAN + Payload Server + tweak

Server

POST /api/v1/configs/{config_key}/servers

{
    "name": "V2Ray RAW/TCP",
    "tunnel": {
        "family": "v2ray",
        "variant": "trojan"
    },
    "settings": {
        "profile": "trojan://[email protected]:443?type=tcp&security=tls"
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "accepted_methods": [
        [],
        [
            "payload"
        ],
        [
            "proxy"
        ],
        [
            "payload",
            "proxy"
        ],
        [
            "tls"
        ],
        [
            "payload",
            "tls"
        ],
        [
            "tls",
            "proxy"
        ],
        [
            "payload",
            "tls",
            "proxy"
        ]
    ]
}

Tweak

POST /api/v1/configs/{config_key}/tweaks

{
    "name": "V2Ray TROJAN + Payload",
    "tunnels": {
        "v2ray": {
            "variants": [
                "trojan"
            ]
        }
    },
    "carrier": {
        "type": "default",
        "settings": {}
    },
    "methods": {
        "payload": {
            "value": "GET / HTTP/1.1[crlf]Host: edge.example.com[crlf][crlf]"
        },
        "tls": {
            "sni": [
                "edge.example.com"
            ],
            "version": "TLSv1.2"
        },
        "proxy": {
            "hosts": [
                "proxy.example.com"
            ],
            "ports": [
                443,
                444
            ]
        }
    }
}
V2Ray SlowDNS Server + tweak

Server

POST /api/v1/configs/{config_key}/servers

{
    "name": "V2Ray SlowDNS",
    "tunnel": {
        "family": "v2ray",
        "variant": "vless"
    },
    "settings": {
        "profile": "vless://[email protected]:443?type=tcp&security=tls"
    },
    "carrier": {
        "type": "slowdns",
        "settings": {
            "nameservers": [
                "ns1.example.com",
                "ns2.example.com"
            ],
            "public_key": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
        }
    },
    "accepted_methods": [
        [],
        [
            "payload"
        ],
        [
            "tls"
        ],
        [
            "payload",
            "tls"
        ]
    ]
}

Tweak

POST /api/v1/configs/{config_key}/tweaks

{
    "name": "V2Ray SlowDNS",
    "tunnels": {
        "v2ray": {
            "variants": [
                "vless"
            ]
        }
    },
    "carrier": {
        "type": "slowdns",
        "settings": {
            "resolvers": [
                "https://dns.google/dns-query"
            ],
            "kcp_window": 512
        }
    },
    "methods": {
        "payload": {
            "value": "GET / HTTP/1.1[crlf]Host: edge.example.com[crlf][crlf]"
        },
        "tls": {
            "sni": [
                "edge.example.com"
            ],
            "version": "TLSv1.2"
        }
    }
}
SSH Slipstream Server + tweak

Server

POST /api/v1/configs/{config_key}/servers

{
    "name": "SSH over Slipstream",
    "tunnel": {
        "family": "ssh",
        "variant": "default"
    },
    "carrier": {
        "type": "slipstream",
        "settings": {
            "domains": [
                "tunnel.example.com"
            ]
        }
    },
    "accepted_methods": [
        []
    ],
    "settings": {
        "credentials": {
            "username": "demo",
            "password": "replace-me"
        }
    }
}

Tweak

POST /api/v1/configs/{config_key}/tweaks

{
    "name": "Slipstream",
    "tunnels": {
        "ssh": {
            "variants": [
                "default"
            ]
        }
    },
    "carrier": {
        "type": "slipstream",
        "settings": {
            "resolvers": [
                "1.1.1.1:53"
            ],
            "keep_alive_ms": 400,
            "congestion_control": "bbr"
        }
    },
    "methods": {}
}
SSH MasterDnsVPN Server + tweak

Server

POST /api/v1/configs/{config_key}/servers

{
    "name": "SSH over MasterDnsVPN",
    "tunnel": {
        "family": "ssh",
        "variant": "default"
    },
    "carrier": {
        "type": "masterdns",
        "settings": {
            "domains": [
                "tunnel.example.com"
            ],
            "encryption_key": "00000000000000000000000000000000",
            "encryption_method": 5
        }
    },
    "accepted_methods": [
        []
    ],
    "settings": {
        "credentials": {
            "username": "demo",
            "password": "replace-me"
        },
        "preserved_ports": [
            22,
            2222
        ]
    }
}

Tweak

POST /api/v1/configs/{config_key}/tweaks

{
    "name": "MasterDnsVPN",
    "tunnels": {
        "ssh": {
            "variants": [
                "default"
            ]
        }
    },
    "carrier": {
        "type": "masterdns",
        "settings": {
            "resolvers": [
                "1.1.1.1:53",
                "[2001:db8::10]:53",
                "[local]:5353"
            ],
            "resolver_balancing_strategy": 6,
            "max_upload_mtu": 180,
            "max_download_mtu": 900
        }
    },
    "methods": {}
}

Reference

Responses, errors & limits

Read responses, diagnose a failed request, and handle quotas.

On this page

Always inspect the HTTP status and content type before using a response. Errors are JSON.

Client API management success is JSON. Client configuration export returns plain text on success.

JSON responses

Client API response fields sit at the top level beside success and message. There is no universal data wrapper.

{
  "success": true,
  "message": "Configuration message updated",
  "configuration_id": 12,
  "configuration_name": "My configuration",
  "config_unique_key": "0123456789abcdef0123456789abcdef",
  "config_message": "Welcome!"
}

Every API error returns success: false, a stable string error code, a human-readable message, and an errors object. errors is empty when there are no field errors. Rate/quota errors can also include their details and headers. This applies to validation, authentication, middleware failures, and unsupported methods.

{
  "success": false,
  "error": "validation_failed",
  "message": "The given data was invalid.",
  "errors": {
    "name": ["The name field is required."]
  }
}

Troubleshoot by status

Status Meaning What to do
200 Read, update, delete, sync, or export succeeded Parse JSON for management; preserve plain text for configuration export
201 A configuration, server, tweak, or device block was created Read the resource key or numeric block ID from the response; resource creation includes Location
400 Invalid operation or malformed app request Check the endpoint's required input
401 Missing or invalid authentication Use the correct API key in a supported header; check rotation
403 Access unavailable or ownership denied Check account status and access permissions
404 Configuration, access record, or target resource not found Copy the key/ID from a current list response
405 This HTTP method is not supported Check the documented HTTP method and endpoint path; inspect the Allow header
409 A one-time share has already been consumed (app import) Generate or distribute a new share if another import is needed
410 Cloud share expired (app import) Obtain a new share; this does not alter previously imported copies
413 Cloud export exceeds the size limit Reduce generated content or use direct delivery
422 Validation failed Read each field in errors
429 Burst limit or daily quota reached Wait for Retry-After; inspect error and quota headers
500 Generation, delivery, or resource processing failed Preserve diagnostic information and check the outcome before retrying a mutation
503 API or quota service unavailable Respect Retry-After when present and retry later

Messages can be localized. Do not build control flow around a specific English sentence.

Burst limits

The Client API's configured burst limit is 60,1 (attempts, minutes). It also passes through the general API IP limiter.

Header Meaning
X-RateLimit-Limit Maximum attempts in the current rate window
X-RateLimit-Remaining Remaining attempts
X-RateLimit-Reset Reset Unix timestamp when supplied
Retry-After Seconds to wait before retrying

Client configuration creation also has an account budget of 10,1; sync/removal share 12,1; exports share 30,1 (attempts, minutes). These are independent of the overall account limit. A request rejected by any burst limiter does not consume daily quota. Key rotation does not reset these budgets. Other requests, including validation failures, still count as documented below.

Repeated invalid or disabled Client credentials have a separate IP-based rejection budget. Correcting the key does not immediately clear an exhausted IP budget.

Daily quota

Quotas reset at 00:00 UTC and are separate from burst limits.

API When a unit is consumed
Client Every authenticated request that passes the rate limiter, including reads and requests that later return validation/ownership errors

The configured Client default is 1000 requests per UTC day. Account overrides can change the effective limit.

Rotation does not reset usage.

Header Meaning
X-DailyQuota-Limit Daily allowance
X-DailyQuota-Used Units consumed today
X-DailyQuota-Remaining Units remaining today
X-DailyQuota-Reset Next reset as a Unix timestamp

Daily exhaustion returns HTTP 429 with error: "daily_quota_exceeded", quota details, and Retry-After. Read headers from the actual response rather than assuming the default quota applies to your account.

Retry without creating duplicates

An individual POST creation assigns a new key every time. Batch sync also creates a new resource when its entry omits unique_key. Before retrying after a lost response, list the configuration's resources and check whether the operation completed.

For repeatable Client updates, retain the returned resource keys and update those resources. A failed transactional batch rolls back resource changes, but its quota unit is not refunded.

The API succeeds, but the app cannot connect

Symptom Check
App asks to add a tweak Add a matching tweak even for direct connections; use methods: {}
Server disappears after selecting a tweak Tunnel variant, carrier, exact accepted method set, and both categories; empty categories do not match named categories
Panel shows changes, but the app still shows old resources Update source was included in the imported configuration; run an update or export/import again
Update reports a different configuration key Serve the original configuration; a new Business generation is a new identity
One-time password works once, then fails It is consumed on authentication; use reusable access for future authentications
Disabling an access record does not disconnect a user An already issued authorization token can remain valid until expiry
A restriction works on Android but not iOS Check the platform restriction table
A sample imports but cannot reach a host Replace placeholder profiles/credentials and configure the actual tunnel service; validation does not contact the remote server

Stable error codes

Code Typical status
invalid_request 400
unauthenticated 401
forbidden 403
not_found 404
method_not_allowed 405
conflict 409
payload_too_large 413
validation_failed 422
rate_limited, authentication_rate_limited, daily_quota_exceeded 429
internal_error 500
service_unavailable 503

More specific quota/service codes may accompany the same status. Handle unknown codes by HTTP status. Validation errors identify the request field; array paths include the item index, such as servers.0.settings.credentials.password.

HTTP Tweak developer documentation Current API contract