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.