does Zeabur provide the way to buy a new VPS through API call ? if yes, is there any API docs ?
Thanks
does Zeabur provide the way to buy a new VPS through API call ? if yes, is there any API docs ?
Thanks
Zeabur exposes a GraphQL API for renting and managing dedicated servers across multiple cloud providers.
Quick Start
All requests go to the Zeabur GraphQL endpoint with your API token in the Authorization header.
List Providers
query {
dedicatedServerProviders {
code
name
icon
canRefund
}
}
Supported providers: DIGITALOCEAN, HETZNER, TENCENT, ALIYUN, VOLCENGINE, LINODE, LIGHTSAIL
List Regions
query {
dedicatedServerRegions(provider: "HETZNER") {
key
name
}
}
List Plans
query {
dedicatedServerPlans(provider: "HETZNER", region: "fsn1") {
name
cpu
memory
disk
egress
price # monthly price in USD cents
gpu
available
}
}
mutation {
rentServer(
provider: "HETZNER"
region: "fsn1"
plan: "cpx22"
) {
_id
name
ip
isManaged
expiresAt
price
status {
vmStatus
}
}
}
Payment is charged automatically via your account balance or linked payment method.
query {
servers {
_id
name
ip
provider
isManaged
expiresAt
price
createdAt
status {
isOnline
vmStatus
totalCPU
usedCPU
totalMemory
usedMemory
totalDisk
usedDisk
sshAvailable
}
}
}
Single server:
query {
server(_id: "<serverID>") {
_id
name
ip
status { isOnline vmStatus }
firewallRules { id protocol portRange sourceIP action }
}
}
Power Operations
mutation { poweroffServer(_id: "<serverID>") }
mutation { poweronServer(_id: "<serverID>") }
mutation { rebootServer(_id: "<serverID>") }
mutation { reinstallServer(_id: "<serverID>", imageID: null) }
Upgrade Spec
# Check available upgrades
query {
serverUpgradeOptions(serverID: "<serverID>") {
currentPlanID
availablePlans { name cpu memory disk price }
}
}
# Upgrade
mutation {
upgradeServerSpec(serverID: "<serverID>", targetPlanID: "cpx32")
}
Rename
mutation {
updateServerName(_id: "<serverID>", name: "my-prod-server")
}
# Toggle auto-renewal
mutation {
updateServerAutoRenew(serverID: "<serverID>", autoRenew: true)
}
# Manually renew
mutation {
renewServer(serverID: "<serverID>")
}
# Reveal initial root password (managed servers only)
mutation {
revealManagedServerInitialPassword(serverID: "<serverID>")
}
# Add rule
mutation {
addFirewallRule(serverID: "<serverID>", rule: {
protocol: "tcp"
portRange: "8080"
sourceIP: "0.0.0.0/0"
action: ACCEPT
})
}
# Delete rule
mutation {
deleteFirewallRule(serverID: "<serverID>", ruleID: "<ruleID>")
}
mutation {
createServerAlert(input: {
serverId: "<serverID>"
metricType: CPU # CPU | MEMORY | DISK
threshold: 90 # 0-100 (%)
consecutiveIntervals: 3 # trigger after N consecutive breaches
}) {
_id
metricType
threshold
}
}
Thanks Yuanlin, much appreciated!
New replies are disabled for resolved issues.