For AI agents: The documentation index is at https://docs.digitalocean.com/llms.txt. Markdown versions of pages use the same URL with index.html.md in place of the HTML page (for example, append index.html.md to the directory path instead of opening the HTML document).
How to Reassign or Unassign BYOIP IPs
Last verified 9 Jun 2026
DigitalOcean Reserved IPs are publicly-accessible static IPv4 and IPv6 addresses. Assign and reassign reserved IP addresses to Droplets as needed, or implement an automated failover mechanism with reserved IPs to build a high availability infrastructure.
Reassign a BYOIP IP Address Using Automation
Use the standard reserved IP assign actions to reassign BYOIP IP addresses. Substitute the address you’d like to reassign for any <reserved-ip> placeholders. You can only reassign BYOIP IPs to Droplets in the same datacenter.
How to Reassign a BYOIP Address Using the DigitalOcean CLI
# Assign a Reserved IP to a Dropletcurl -X POST \
-H "Content-Type: application/json"\
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN"\
-d '{"type":"assign","droplet_id":8219222}'\
"https://api.digitalocean.com/v2/reserved_ips/45.55.96.47/actions"# Unassign a Reserved IP# curl -X POST \ -H "Content-Type: application/json"\
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN"\
-d '{"type":"unassign"}'\
"https://api.digitalocean.com/v2/reserved_ips/45.55.96.47/actions"
Go
Using Godo, the official DigitalOcean API client for Go:
import("context""os""github.com/digitalocean/godo")funcmain(){token:=os.Getenv("DIGITALOCEAN_TOKEN")client:=godo.NewFromToken(token)ctx:=context.TODO()// Assign a Reserved IP to a Dropletaction,_,err:=client.ReservedIPActions.Assign(ctx,"45.55.96.47",8219222)// Unassign a Reserved IPaction,_,err:=client.ReservedIPActions.Unassign(ctx,"45.55.96.47")}
Ruby
Using DropletKit, the official DigitalOcean API client for Ruby:
require'droplet_kit'token=ENV['DIGITALOCEAN_TOKEN']client=DropletKit::Client.new(access_token:token)# Assign a Reserved IP to a Dropletclient.reserved_ip_actions.assign(ip:'45.55.96.47',droplet_id:8219222)# Unassign a Reserved IP# client.reserved_ip_actions.unassign(ip: '45.55.96.47')
Python
Using PyDo, the official DigitalOcean API client for Python:
Reassign a BYOIP IP Address Using the Control Panel
To reassign a BYOIP IP address from the Control Panel, click Networking in the main menu, then click Reserved IPs to see a list of your reserved IPs and BYOIP prefixes.
Click the prefix that contains the IP address you’d like to reassign. You’re taken to a page with details about your BYOIP prefix, including a list of IP address that are assigned to Droplets.
Find the IP address in the list, click its … (More) menu, and then click Reassign.
In the Reassign window, select a Droplet to reassign the IP address to, and then click Reassign Reserved IP. You can only reassign BYOIP IPs to Droplets in the same datacenter.
Unassign a BYOIP IP Address Using Automation
Use the standard reserved IP unassign actions to unassign BYOIP IP addresses. Substitute the address you’d like to unassign for any <reserved-ip> placeholders.
How to Unassign a BYOIP Address Using the DigitalOcean CLI
# Assign a Reserved IP to a Dropletcurl -X POST \
-H "Content-Type: application/json"\
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN"\
-d '{"type":"assign","droplet_id":8219222}'\
"https://api.digitalocean.com/v2/reserved_ips/45.55.96.47/actions"# Unassign a Reserved IP# curl -X POST \ -H "Content-Type: application/json"\
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN"\
-d '{"type":"unassign"}'\
"https://api.digitalocean.com/v2/reserved_ips/45.55.96.47/actions"
Go
Using Godo, the official DigitalOcean API client for Go:
import("context""os""github.com/digitalocean/godo")funcmain(){token:=os.Getenv("DIGITALOCEAN_TOKEN")client:=godo.NewFromToken(token)ctx:=context.TODO()// Assign a Reserved IP to a Dropletaction,_,err:=client.ReservedIPActions.Assign(ctx,"45.55.96.47",8219222)// Unassign a Reserved IPaction,_,err:=client.ReservedIPActions.Unassign(ctx,"45.55.96.47")}
Ruby
Using DropletKit, the official DigitalOcean API client for Ruby:
require'droplet_kit'token=ENV['DIGITALOCEAN_TOKEN']client=DropletKit::Client.new(access_token:token)# Assign a Reserved IP to a Dropletclient.reserved_ip_actions.assign(ip:'45.55.96.47',droplet_id:8219222)# Unassign a Reserved IP# client.reserved_ip_actions.unassign(ip: '45.55.96.47')
Python
Using PyDo, the official DigitalOcean API client for Python:
Unassign a BYOIP IP Address Using the Control Panel
To unassign a BYOIP IP address from the Control Panel, click Networking in the main menu, then click Reserved IPs to see a list of your reserved IPs and BYOIP prefixes.
Click the prefix that contains the IP address you’d like to unassign. A page with details about your BYOIP prefix loads, including a list of IP address that are assigned to Droplets.
Find the IP address in the list, click its … (More) menu, and then click Unassign.
In the Unassign window, type the name of the currently assigned Droplet to confirm, and then click Unassign IP address.
We can't find any results for your search.
Try using different keywords or simplifying your search terms.