VPSBG's dev hub
HomePricingKnowledge BaseContact us
HomePricingKnowledge BaseContact us
  1. Servers
  • šŸ‘‹ Hello
  • API Introduction
    • API Introduction
    • How to generate API key?
  • API Reference
    • User
      • 2FA
        • Get 2FA secret key
        • Enable 2FA
        • Disable 2FA
      • Update user
      • Get account information
    • Balance
      • Balance
      • Deposit funds
      • List balance transactions
    • Affiliate
      • Get affiliate information
      • List conversions
      • List payouts
      • Activate affiliate program
      • Update referral code
    • Invoices
      • List invoices
      • Download an invoice
      • Download invoices
    • Support
      • Tickets
        • List tickets
        • List departments
        • List related services
        • Get a ticket
        • Create new ticket
        • Reply to ticket
        • Mark ticket as resolved
        • Download attachment
      • List plans
      • Purchase support plan
      • Renew support plan
      • Cancel support plan
      • Undo cancel request
    • SSH Keys
      • Get an SSH Key
      • Update SSH Key
      • Delete SSH Key
      • List SSH keys
      • Add SSH Key
    • Servers
      • Scale
        • List plans
        • Calculate scale cost
        • Scale a server
      • Addons
        • List available addons
        • Scale addons
        • Calculate scale cost
        • Purchase new addons
        • Cancel addon
        • Undo cancel request
      • Rescue
        • Enable rescue mode
        • Disable rescue mode
      • List plans
        GET
      • List servers
        GET
      • Server status
        GET
      • Get a server
        GET
      • Server metrics
        GET
      • Bandwidth
        GET
      • Deploy new server
        POST
      • Start a server
        POST
      • Restart a server
        POST
      • Stop a server
        POST
      • Power off
        POST
      • Cancel server
        POST
      • Undo cancel request
        DELETE
      • Change password
        PUT
      • Update hostname
        PUT
      • Update SSH Keys
        PATCH
      • Modify ISOs
        POST
      • Restore
        POST
      • Renew server
        POST
      • Reinstall Server
        POST
      • Change Primary IP
        POST
      • Calculate renew amount
        POST
    • Plans
      • Plan addon
      • Plan promo-codes
    • Snapshots
      • List snapshots
      • Delete snapshot
    • Backups
      • List backups
      • Delete backup
    • Server Images
      • List server images
    • Floating IPs
      • List Floating IPs
      • Plans
      • Purchase Floating IPs
      • Attach Floating IP
      • Detach Floating IP
      • Cancel Floating IP
      • Delete Floating IP Cancellation
    • IP Addresses
      • Update IP address
    • Network Protection
      • Geo filter
        • Get current geo filter
        • Set geo filter
        • Update geo filter
        • Delete geo filter
      • Whitelist
        • Get status and list of IPs
        • Whitelist IP addresses
        • Update IP addresses list
        • Delete all rules
      • Blacklist
        • Get status and list of IPs
        • Blacklist IP addresses
        • Update IP addresses list
        • Delete all rules
      • General information
      • Bandwidth
      • List blocked IPs
      • List attacks
      • Get an attack
      • Attack bandwidth
    • Orders
      • List orders
      • Get an order
      • Delete order
      • Pay orders
      • Update order
      • Change renewal period
    • ISOs
      • Get an ISO
      • Delete an ISO
      • List ISOs
      • Add ISO
  1. Servers

Change Primary IP

POST
https://api.vpsbg.eu/v1/servers/{id}/primary-ip
Servers
This endpoint changes the primary IP address of a virtual server. The new IP address replaces the current primary IP assigned to the main network interface.
šŸ”„ This action triggers an automatic server reboot to apply the changes.

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Path Params
id
integerĀ 
required
Header Params
Accept
stringĀ 
required
Default:
application/json
Body Params application/json
ip_id
integerĀ 
required
ID of the IP that you would like to place as main.
Example:
33112
Example
{
  "ip_id": 33112
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.vpsbg.eu/v1/servers//primary-ip' \
--header 'Accept;' \
--header 'Content-Type: application/json' \
--data-raw '{
    "ip_id": 33112
}'

Responses

🟢200Success
application/json
Body
id
integerĀ 
required
Internal ID of the server.
Example:
2864
hostname
stringĀ 
required
Actual hostname installed on the server.
Example:
ubuntu-2gb
billing_cycle
integerĀ 
required
Example:
1
plan
objectĀ 
required
id
integerĀ 
optional
Example:
104
type
stringĀ 
optional
The VDS servers have dedicated CPU cores. Cloud VPS is using shared CPU power.
Example:
cloud-vps
key
stringĀ 
optional
name
stringĀ 
optional
Example:
cloud-vps-2gb
vcpus
integerĀ 
optional
CPU cores limit. Dedicated, if it is a VDS product.
Example:
2
memory
integerĀ 
optional
RAM of the server.
Example:
2
disk
integerĀ 
optional
NVMe disk size limit in gigabytes.
Example:
50
bandwidth
integerĀ 
optional
Traffic limit in terabytes.
Example:
5
minimum_billing_cycle
integerĀ 
optional
The minimum billing period for which this plan can be purchased.
Example:
1
plan_with_more_disk
integerĀ Ā |Ā nullĀ 
optional
The same plan but with more disk (usually 2x).
plan_with_more_memory
integerĀ Ā |Ā nullĀ 
optional
The same plan but with more RAM (usually 2x).
available
booleanĀ 
optional
Whether in stock or not.
price
numberĀ 
optional
Monthly price without VAT adjustments.
Example:
100
price_with_vat
numberĀ 
optional
Monthly prices adjusted for your VAT when applicable; use a promo code when ordering servers for discounts, or one may be automatically applied during promotional periods for your billing cycle.
Example:
120
status
stringĀ 
required
This is the billing status of the server. It does not represent the technical status of the server - running, stopped, etc.
Examples:
active processing suspended terminated
running
booleanĀ Ā |Ā nullĀ 
optional
virtualization
stringĀ 
required
Example:
kvm
promo_code
stringĀ Ā |Ā nullĀ 
optional
Latest used promo code.
renew_amount
numberĀ 
required
The amount needed to renew your server for the current period.
renew_amount_with_vat
numberĀ 
required
Renew amount with vat if applicable.
locked
booleanĀ 
required
The server might be locked in some scenarios like creating a snapshot, backup or other operation.
locked_at
stringĀ Ā |Ā nullĀ 
optional
lock_reason
stringĀ Ā |Ā nullĀ 
optional
created_at
stringĀ 
required
Example:
2024-08-29T14:21:54.000000Z
expiry_at
stringĀ 
required
Example:
2024-10-27T11:03:10.000000Z
potential_expiry_at
stringĀ 
required
Accounts for unpaid or processing renew Orders.
Example:
2024-11-27T11:03:10.000000Z
auto_renew
booleanĀ 
required
If set to true, the server will be renewed using funds from your account balance or saved credit/credit cards.
show_smtp_unblock_form
booleanĀ 
required
server_image
objectĀ 
required
id
integerĀ 
required
Example:
73
name
stringĀ 
required
Example:
Ubuntu 22.04
group
objectĀ 
required
ip_addresses
array[objectĀ (IP address) {10}]Ā 
required
id
integerĀ 
required
Example:
417
ip_address
stringĀ 
required
The IP address.
Example:
87.120.37.46
prefix
integerĀ 
required
Examples:
3264
version
integerĀ 
required
Example:
4
type
stringĀ 
required
Example:
public
main
booleanĀ 
required
ddos_protected
booleanĀ 
required
Whether the IP is DDoS protected or not.
floating_ip
optional
Whether or not this IP is sold as a Floating IP.
ptr
objectĀ Ā |Ā nullĀ 
optional
assigned_on
stringĀ 
required
Datetime when the IP address was assigned to your account.
addons
arrayĀ [object {8}]Ā Ā |Ā nullĀ 
optional
id
integerĀ 
required
name
stringĀ 
required
Default:
100mbps-unmetered
Example:
100mbps-unmetered
status
stringĀ 
required
Default:
active
Examples:
activesuspendedcancelled
quantity
integerĀ 
required
Default:
1
Example:
1
amount
numberĀ 
required
Default:
50
Example:
50
amount_with_vat
numberĀ 
required
Default:
60
Example:
60
created_at
stringĀ 
required
Default:
2025-01-16 14:29:56
Example:
2025-01-16 14:29:56
ended_at
stringĀ 
required
cancel_request
optional
Any of
id
integerĀ 
required
Example:
1
now
integerĀ 
required
Canceled now or at the end of the billing cycle.
Example:
1
reason
stringĀ 
optional
Reason given by the user for the cancelation.
created_at
stringĀ 
required
Date of creation.
settings
objectĀ 
required
renew_enabled
booleanĀ 
required
Default:
true
snapshots_enabled
booleanĀ 
required
Default:
true
root_password_login_enabled
booleanĀ 
required
Default:
true
app_getting_started
stringĀ Ā |Ā nullĀ 
optional
App template getting started text. Shown only if "include" contains app_getting_started.
Example
{
  "id": 2864,
  "hostname": "ubuntu-2gb",
  "billing_cycle": 1,
  "plan": {
    "id": 104,
    "type": "cloud-vps",
    "key": "string",
    "name": "cloud-vps-2gb",
    "vcpus": 2,
    "memory": 2,
    "disk": 50,
    "bandwidth": 5,
    "minimum_billing_cycle": 1,
    "plan_with_more_disk": 0,
    "plan_with_more_memory": 0,
    "available": true,
    "price": 100,
    "price_with_vat": 120
  },
  "status": "active",
  "virtualization": "kvm",
  "promo_code": null,
  "renew_amount": 100,
  "renew_amount_with_vat": 120,
  "locked": true,
  "created_at": "2024-08-29T14:21:54.000000Z",
  "expiry_at": "2024-10-27T11:03:10.000000Z",
  "potential_expiry_at": "2024-11-27T11:03:10.000000Z",
  "auto_renew": true,
  "show_smtp_form": true,
  "server_image": {
    "id": 73,
    "name": "Ubuntu 22.04",
    "eol": false,
    "group": {
      "name": "Ubuntu",
      "type": "os",
      "key": "ubuntu"
    }
  },
  "ip_addresses": [
    {
      "id": 10,
      "ip_address": "87.120.37.9",
      "prefix": 32,
      "version": 4,
      "type": "public",
      "main": false,
      "ddos_protected": false,
      "floating_ip": true,
      "floating_ip_id": 637,
      "ptr": null,
      "assigned_on": "2021-01-22T11:43:54.000000Z"
    },
    {
      "id": 48,
      "ip_address": "87.120.37.47",
      "prefix": 32,
      "version": 4,
      "type": "public",
      "main": true,
      "ddos_protected": false,
      "floating_ip": false,
      "floating_ip_id": null,
      "ptr": null,
      "assigned_on": "2025-03-14T11:52:22.000000Z"
    }
  ],
  "addons": [
    {
      "id": 801,
      "name": "backups",
      "status": "active",
      "quantity": 60,
      "amount": 36,
      "amount_with_vat": 43.2,
      "created_at": "2025-01-10 11:45:31",
      "ended_at": null
    },
    {
      "id": 802,
      "name": "100mbps-unmetered",
      "status": "active",
      "quantity": 1,
      "amount": 300,
      "amount_with_vat": 360,
      "created_at": "2025-01-16 14:29:56",
      "ended_at": null
    }
  ],
  "cancel_request": null,
  "settings": {
    "renew_enabled": true,
    "snapshots_enabled": true
  }
}
šŸ”“500Server Error
🟠422Validation error (specified in the response)
Previous
Reinstall Server
Next
Calculate renew amount
Built with