Floating IPs
Validated on 19 Jun 2018 • Last edited on 23 Mar 2026
As of 16 June 2022, we have renamed the Floating IP product to [Reserved IPs](/reference/api/reference/reserved-ips/.
The Reserved IP product's endpoints function the exact same way as Floating IPs.
The only difference is the name change throughout the URLs and fields.
For example, the floating_ips field is now the reserved_ips field.
The Floating IP endpoints will remain active until fall 2023 before being
permanently deprecated.
With the exception of the [Projects API](/reference/api/reference/projects/,
we will reflect this change as an additional field in the responses across the API
where the floating_ip field is used. For example, the Droplet metadata response
will contain the field reserved_ips in addition to the floating_ips field.
Floating IPs retrieved using the Projects API will retain the original name.
DigitalOcean Floating IPs are publicly-accessible static IP addresses that can be mapped to one of your Droplets. They can be used to create highly available setups or other configurations requiring movable addresses.
Floating IPs are bound to a specific region.
https://api.digitalocean.com
Endpoints
GET List All Floating IPs
/v2/floating_ips
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
To list all of the floating IPs available on your account, send a GET request to /v2/floating_ips.
Query Parameters
per_page
1 – 200 optional
2Number of items returned per page
Default:20page
>= 1 optional
1Which 'page' of paginated results to return.
Default:1Request: /v2/floating_ips
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/floating_ips?page=1&per_page=20" import (
"context"
"os"
"github.com/digitalocean/godo"
)
func main() {
token := os.Getenv("DIGITALOCEAN_TOKEN")
client := godo.NewFromToken(token)
ctx := context.TODO()
opt := &godo.ListOptions{
Page: 1,
PerPage: 200,
}
floatingIPs, _, err := client.FloatingIPs.List(ctx, opt)
}require 'droplet_kit'
token = ENV['DIGITALOCEAN_TOKEN']
client = DropletKit::Client.new(access_token: token)
floating_ips = client.floating_ips.all
floating_ips.eachResponses
200
The response will be a JSON object with a key called floating_ips. This will be set to an array of floating IP objects, each of which will contain the standard floating IP attributes
floating_ips. This will be set to an array of floating IP objects, each of which will contain the standard floating IP attributesratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
floating_ips
optional
Show child properties
droplet
optional
The Droplet that the floating IP has been assigned to. When you query a floating IP, if it is assigned to a Droplet, the entire Droplet object will be returned. If it is not assigned, the value will be null.
Requires droplet:read scope.
null
Droplet
backup_ids
required
[53893572]An array of backup IDs of any backups that have been taken of the Droplet instance. Droplet backups are enabled at the time of the instance creation.
Requires image:read scope.
created_at
required
2020-07-21T18:37:44ZA time value given in ISO8601 combined date and time format that represents when the Droplet was created.
disk
required
25The size of the Droplet's disk in gigabytes.
disk_info
optional
An array of objects containing information about the disks available to the Droplet.
Show child properties
size
optional
type
optional
localThe type of disk. All Droplets contain a local disk. Additionally, GPU Droplets can also have a scratch disk for non-persistent data.
features
required
["backups","private_networking","ipv6"]An array of features enabled on this Droplet.
gpu_info
optional
An object containing information about the GPU capabilities of Droplets created with this size.
Show child properties
count
optional
1The number of GPUs allocated to the Droplet.
model
optional
nvidia_h100The model of the GPU.
vram
optional
id
required
3164444A unique identifier for each Droplet instance. This is automatically generated upon Droplet creation.
image
required
kernel
optional Deprecated Nullable
Note: All Droplets created after March 2017 use internal kernels by default.
These Droplets will have this attribute set to null.
The current kernel for Droplets with externally managed kernels. This will initially be set to the kernel of the base image when the Droplet is created.
Show child properties
id
optional
7515A unique number used to identify and reference a specific kernel.
name
optional
DigitalOcean GrubLoader v0.2 (20160714)The display name of the kernel. This is shown in the web UI and is generally a descriptive title for the kernel in question.
version
optional
2016.07.13-DigitalOcean_loader_UbuntuA standard kernel version string representing the version, patch, and release information.
locked
required
falseA boolean value indicating whether the Droplet has been locked, preventing actions by users.
memory
required
1024Memory of the Droplet in megabytes.
name
required
example.comThe human-readable name set for the Droplet instance.
networks
required
The details of the network that are configured for the Droplet instance. This is an object that contains keys for IPv4 and IPv6. The value of each of these is an array that contains objects describing an individual IP resource allocated to the Droplet. These will define attributes like the IP address, netmask, and gateway of the specific network depending on the type of network it is.
Show child properties
v4
optional
v6
optional
next_backup_window
required
region
required
Show child properties
available
required
trueThis is a boolean value that represents whether new Droplets can be created in this region.
features
required
["private_networking","backups","ipv6","metadata","install_agent","storage","image_transfer"]This attribute is set to an array which contains features available in this region
name
required
New York 3The display name of the region. This will be a full name that is used in the control panel and other interfaces.
sizes
required
This attribute is set to an array which contains the identifying slugs for the sizes available in this region. sizes:read is required to view.
slug
required
nyc3A human-readable string that is used as a unique identifier for each region.
size
required
Show child properties
available
required
trueThis is a boolean value that represents whether new Droplets can be created with this size.
description
required
BasicA string describing the class of Droplets created from this size. For example: Basic, General Purpose, CPU-Optimized, Memory-Optimized, or Storage-Optimized.
disk
required
25The amount of disk space set aside for Droplets of this size. The value is represented in gigabytes.
disk_info
optional
An array of objects containing information about the disks available to Droplets created with this size.
gpu_info
optional
An object containing information about the GPU capabilities of Droplets created with this size.
memory
required
1024The amount of RAM allocated to Droplets created of this size. The value is represented in megabytes.
price_hourly
required
0.00743999984115362This describes the price of the Droplet size as measured hourly. The value is measured in US dollars.
price_monthly
required
5This attribute describes the monthly cost of this Droplet size if the Droplet is kept for an entire month. The value is measured in US dollars.
regions
required
["ams2","ams3","blr1","fra1","lon1","nyc1","nyc2","nyc3","sfo1","sfo2","sfo3","sgp1","tor1"]An array containing the region slugs where this size is available for Droplet creates.
slug
required
s-1vcpu-1gbA human-readable string that is used to uniquely identify each size.
transfer
required
1The amount of transfer bandwidth that is available for Droplets created in this size. This only counts traffic on the public interface. The value is given in terabytes.
vcpus
required
1The number of CPUs allocated to Droplets of this size.
size_slug
required
s-1vcpu-1gbThe unique slug identifier for the size of this Droplet.
snapshot_ids
required
[67512819]An array of snapshot IDs of any snapshots created from the Droplet instance.
Requires image:read scope.
status
required
activeA status string indicating the state of the Droplet instance. This may be "new", "active", "off", or "archive".
tags
required
["web","env:prod"]An array of Tags the Droplet has been tagged with.
Requires tag:read scope.
vcpus
required
1The number of virtual CPUs.
volume_ids
required
["506f78a4-e098-11e5-ad9f-000f53306ae1"]A flat array including the unique identifier for each Block Storage volume attached to the Droplet.
Requires block_storage:read scope.
vpc_uuid
optional
760e09ef-dc84-11e8-981e-3cfdfeaae000A string specifying the UUID of the VPC to which the Droplet is assigned.
Requires vpc:read scope.
ip
optional
45.55.96.47The public IP address of the floating IP. It also serves as its identifier.
locked
optional
trueA boolean value indicating whether or not the floating IP has pending actions preventing new ones from being submitted.
project_id
optional
746c6152-2fa2-11ed-92d3-27aaa54e4988The UUID of the project to which the reserved IP currently belongs.
Requires project:read scope.
region
optional
links
optional
Show child properties
pages
optional
Forward Links
last
optional
https://api.digitalocean.com/v2/images?page=2URI of the last page of the results.
next
optional
https://api.digitalocean.com/v2/images?page=2URI of the next page of the results.
Backward Links
first
optional
https://api.digitalocean.com/v2/images?page=1URI of the first page of the results.
prev
optional
https://api.digitalocean.com/v2/images?page=1URI of the previous page of the results.
meta
required
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"floating_ips": [
{
"droplet": null,
"ip": "45.55.96.47",
"locked": false,
"project_id": "746c6152-2fa2-11ed-92d3-27aaa54e4988",
"region": {
"available": true,
"features": [
"private_networking",
"backups",
"ipv6",
"metadata",
"install_agent",
"storage",
"image_transfer"
],
"name": "New York 3",
"sizes": [
"s-1vcpu-1gb",
"s-1vcpu-2gb",
"s-1vcpu-3gb",
"s-2vcpu-2gb",
"s-3vcpu-1gb",
"s-2vcpu-4gb",
"s-4vcpu-8gb",
"s-6vcpu-16gb",
"s-8vcpu-32gb",
"s-12vcpu-48gb",
"s-16vcpu-64gb",
"s-20vcpu-96gb",
"s-24vcpu-128gb",
"s-32vcpu-192g"
],
"slug": "nyc3"
}
}
],
"links": {},
"meta": {
"total": 1
}
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}POST Create a New Floating IP
/v2/floating_ips
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
On creation, a floating IP must be either assigned to a Droplet or reserved to a region.
-
To create a new floating IP assigned to a Droplet, send a POST request to
/v2/floating_ipswith thedroplet_idattribute. -
To create a new floating IP reserved to a region, send a POST request to
/v2/floating_ipswith theregionattribute.
Request Body: application/json
droplet_id
required
2457247The ID of the Droplet that the floating IP will be assigned to.
project_id
optional
746c6152-2fa2-11ed-92d3-27aaa54e4988The UUID of the project to which the floating IP will be assigned.
region
required
nyc3The slug identifier for the region the floating IP will be reserved to.
Request: /v2/floating_ips
{
"droplet_id": 2457247
}curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
-d '{"droplet_id": 123456}' \
"https://api.digitalocean.com/v2/floating_ips" import (
"context"
"os"
"github.com/digitalocean/godo"
)
func main() {
token := os.Getenv("DIGITALOCEAN_TOKEN")
client := godo.NewFromToken(token)
ctx := context.TODO()
createRequest := &godo.FloatingIPCreateRequest{
DropletID: 123456,
}
}require 'droplet_kit'
token = ENV['DIGITALOCEAN_TOKEN']
client = DropletKit::Client.new(access_token: token)
floating_ip = DropletKit::FloatingIp.new(droplet_id: 123456)
client.floating_ips.create(floating_ip) Responses
202
The response will be a JSON object with a key called floating_ip. The value of this will be an object that contains the standard attributes associated with a floating IP.
When assigning a floating IP to a Droplet at same time as it created, the response's links object will contain links to both the Droplet and the assignment action. The latter can be used to check the status of the action.
floating_ip. The value of this will be an object that contains the standard attributes associated with a floating IP.
When assigning a floating IP to a Droplet at same time as it created, the response's links object will contain links to both the Droplet and the assignment action. The latter can be used to check the status of the action.ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
floating_ip
optional
Show child properties
droplet
optional
The Droplet that the floating IP has been assigned to. When you query a floating IP, if it is assigned to a Droplet, the entire Droplet object will be returned. If it is not assigned, the value will be null.
Requires droplet:read scope.
null
Droplet
backup_ids
required
[53893572]An array of backup IDs of any backups that have been taken of the Droplet instance. Droplet backups are enabled at the time of the instance creation.
Requires image:read scope.
created_at
required
2020-07-21T18:37:44ZA time value given in ISO8601 combined date and time format that represents when the Droplet was created.
disk
required
25The size of the Droplet's disk in gigabytes.
disk_info
optional
An array of objects containing information about the disks available to the Droplet.
Show child properties
size
optional
type
optional
localThe type of disk. All Droplets contain a local disk. Additionally, GPU Droplets can also have a scratch disk for non-persistent data.
features
required
["backups","private_networking","ipv6"]An array of features enabled on this Droplet.
gpu_info
optional
An object containing information about the GPU capabilities of Droplets created with this size.
Show child properties
count
optional
1The number of GPUs allocated to the Droplet.
model
optional
nvidia_h100The model of the GPU.
vram
optional
id
required
3164444A unique identifier for each Droplet instance. This is automatically generated upon Droplet creation.
image
required
kernel
optional Deprecated Nullable
Note: All Droplets created after March 2017 use internal kernels by default.
These Droplets will have this attribute set to null.
The current kernel for Droplets with externally managed kernels. This will initially be set to the kernel of the base image when the Droplet is created.
Show child properties
id
optional
7515A unique number used to identify and reference a specific kernel.
name
optional
DigitalOcean GrubLoader v0.2 (20160714)The display name of the kernel. This is shown in the web UI and is generally a descriptive title for the kernel in question.
version
optional
2016.07.13-DigitalOcean_loader_UbuntuA standard kernel version string representing the version, patch, and release information.
locked
required
falseA boolean value indicating whether the Droplet has been locked, preventing actions by users.
memory
required
1024Memory of the Droplet in megabytes.
name
required
example.comThe human-readable name set for the Droplet instance.
networks
required
The details of the network that are configured for the Droplet instance. This is an object that contains keys for IPv4 and IPv6. The value of each of these is an array that contains objects describing an individual IP resource allocated to the Droplet. These will define attributes like the IP address, netmask, and gateway of the specific network depending on the type of network it is.
Show child properties
v4
optional
v6
optional
next_backup_window
required
region
required
Show child properties
available
required
trueThis is a boolean value that represents whether new Droplets can be created in this region.
features
required
["private_networking","backups","ipv6","metadata","install_agent","storage","image_transfer"]This attribute is set to an array which contains features available in this region
name
required
New York 3The display name of the region. This will be a full name that is used in the control panel and other interfaces.
sizes
required
This attribute is set to an array which contains the identifying slugs for the sizes available in this region. sizes:read is required to view.
slug
required
nyc3A human-readable string that is used as a unique identifier for each region.
size
required
Show child properties
available
required
trueThis is a boolean value that represents whether new Droplets can be created with this size.
description
required
BasicA string describing the class of Droplets created from this size. For example: Basic, General Purpose, CPU-Optimized, Memory-Optimized, or Storage-Optimized.
disk
required
25The amount of disk space set aside for Droplets of this size. The value is represented in gigabytes.
disk_info
optional
An array of objects containing information about the disks available to Droplets created with this size.
gpu_info
optional
An object containing information about the GPU capabilities of Droplets created with this size.
memory
required
1024The amount of RAM allocated to Droplets created of this size. The value is represented in megabytes.
price_hourly
required
0.00743999984115362This describes the price of the Droplet size as measured hourly. The value is measured in US dollars.
price_monthly
required
5This attribute describes the monthly cost of this Droplet size if the Droplet is kept for an entire month. The value is measured in US dollars.
regions
required
["ams2","ams3","blr1","fra1","lon1","nyc1","nyc2","nyc3","sfo1","sfo2","sfo3","sgp1","tor1"]An array containing the region slugs where this size is available for Droplet creates.
slug
required
s-1vcpu-1gbA human-readable string that is used to uniquely identify each size.
transfer
required
1The amount of transfer bandwidth that is available for Droplets created in this size. This only counts traffic on the public interface. The value is given in terabytes.
vcpus
required
1The number of CPUs allocated to Droplets of this size.
size_slug
required
s-1vcpu-1gbThe unique slug identifier for the size of this Droplet.
snapshot_ids
required
[67512819]An array of snapshot IDs of any snapshots created from the Droplet instance.
Requires image:read scope.
status
required
activeA status string indicating the state of the Droplet instance. This may be "new", "active", "off", or "archive".
tags
required
["web","env:prod"]An array of Tags the Droplet has been tagged with.
Requires tag:read scope.
vcpus
required
1The number of virtual CPUs.
volume_ids
required
["506f78a4-e098-11e5-ad9f-000f53306ae1"]A flat array including the unique identifier for each Block Storage volume attached to the Droplet.
Requires block_storage:read scope.
vpc_uuid
optional
760e09ef-dc84-11e8-981e-3cfdfeaae000A string specifying the UUID of the VPC to which the Droplet is assigned.
Requires vpc:read scope.
ip
optional
45.55.96.47The public IP address of the floating IP. It also serves as its identifier.
locked
optional
trueA boolean value indicating whether or not the floating IP has pending actions preventing new ones from being submitted.
project_id
optional
746c6152-2fa2-11ed-92d3-27aaa54e4988The UUID of the project to which the reserved IP currently belongs.
Requires project:read scope.
region
optional
links
optional
Show child properties
actions
optional
Show child properties
href
optional
https://api.digitalocean.com/v2/actions/7515A URL that can be used to access the action.
id
optional
7515A unique numeric ID that can be used to identify and reference an action.
rel
optional
createA string specifying the type of the related action.
droplets
optional
Show child properties
href
optional
https://api.digitalocean.com/v2/actions/7515A URL that can be used to access the action.
id
optional
7515A unique numeric ID that can be used to identify and reference an action.
rel
optional
createA string specifying the type of the related action.
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"floating_ip": {
"droplet": null,
"ip": "45.55.96.47",
"locked": true,
"project_id": "746c6152-2fa2-11ed-92d3-27aaa54e4988",
"region": {
"available": true,
"features": [
"private_networking",
"backups",
"ipv6",
"metadata",
"install_agent",
"storage",
"image_transfer"
],
"name": "New York 3",
"sizes": [
"s-1vcpu-1gb",
"s-1vcpu-2gb",
"s-1vcpu-3gb",
"s-2vcpu-2gb",
"s-3vcpu-1gb",
"s-2vcpu-4gb",
"s-4vcpu-8gb",
"s-6vcpu-16gb",
"s-8vcpu-32gb",
"s-12vcpu-48gb",
"s-16vcpu-64gb",
"s-20vcpu-96gb",
"s-24vcpu-128gb",
"s-32vcpu-192g"
],
"slug": "nyc3"
}
},
"links": {
"actions": [
{
"href": "https://api.digitalocean.com/v2/actions/1088924622",
"id": 1088924622,
"rel": "assign_ip"
}
],
"droplets": [
{
"href": "https://api.digitalocean.com/v2/droplets/213939433",
"id": 213939433,
"rel": "droplet"
}
]
}
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}GET Retrieve an Existing Floating IP
/v2/floating_ips/{floating_ip}
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
To show information about a floating IP, send a GET request to /v2/floating_ips/$FLOATING_IP_ADDR.
Path Parameters
floating_ip
>= 1 required
45.55.96.47A floating IP address.
Request: /v2/floating_ips/{floating_ip}
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/floating_ips/45.55.96.47" import (
"context"
"os"
"github.com/digitalocean/godo"
)
func main() {
token := os.Getenv("DIGITALOCEAN_TOKEN")
client := godo.NewFromToken(token)
ctx := context.TODO()
floatingIP, _, err := client.FloatingIPs.Get(ctx, "45.55.96.47")
}require 'droplet_kit'
token = ENV['DIGITALOCEAN_TOKEN']
client = DropletKit::Client.new(access_token: token)
client.floating_ips.find(ip: '45.55.96.47')Responses
200
The response will be a JSON object with a key called floating_ip. The value of this will be an object that contains the standard attributes associated with a floating IP.
floating_ip. The value of this will be an object that contains the standard attributes associated with a floating IP.ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
floating_ip
optional
Show child properties
droplet
optional
The Droplet that the floating IP has been assigned to. When you query a floating IP, if it is assigned to a Droplet, the entire Droplet object will be returned. If it is not assigned, the value will be null.
Requires droplet:read scope.
null
Droplet
backup_ids
required
[53893572]An array of backup IDs of any backups that have been taken of the Droplet instance. Droplet backups are enabled at the time of the instance creation.
Requires image:read scope.
created_at
required
2020-07-21T18:37:44ZA time value given in ISO8601 combined date and time format that represents when the Droplet was created.
disk
required
25The size of the Droplet's disk in gigabytes.
disk_info
optional
An array of objects containing information about the disks available to the Droplet.
Show child properties
size
optional
type
optional
localThe type of disk. All Droplets contain a local disk. Additionally, GPU Droplets can also have a scratch disk for non-persistent data.
features
required
["backups","private_networking","ipv6"]An array of features enabled on this Droplet.
gpu_info
optional
An object containing information about the GPU capabilities of Droplets created with this size.
Show child properties
count
optional
1The number of GPUs allocated to the Droplet.
model
optional
nvidia_h100The model of the GPU.
vram
optional
id
required
3164444A unique identifier for each Droplet instance. This is automatically generated upon Droplet creation.
image
required
kernel
optional Deprecated Nullable
Note: All Droplets created after March 2017 use internal kernels by default.
These Droplets will have this attribute set to null.
The current kernel for Droplets with externally managed kernels. This will initially be set to the kernel of the base image when the Droplet is created.
Show child properties
id
optional
7515A unique number used to identify and reference a specific kernel.
name
optional
DigitalOcean GrubLoader v0.2 (20160714)The display name of the kernel. This is shown in the web UI and is generally a descriptive title for the kernel in question.
version
optional
2016.07.13-DigitalOcean_loader_UbuntuA standard kernel version string representing the version, patch, and release information.
locked
required
falseA boolean value indicating whether the Droplet has been locked, preventing actions by users.
memory
required
1024Memory of the Droplet in megabytes.
name
required
example.comThe human-readable name set for the Droplet instance.
networks
required
The details of the network that are configured for the Droplet instance. This is an object that contains keys for IPv4 and IPv6. The value of each of these is an array that contains objects describing an individual IP resource allocated to the Droplet. These will define attributes like the IP address, netmask, and gateway of the specific network depending on the type of network it is.
Show child properties
v4
optional
v6
optional
next_backup_window
required
region
required
Show child properties
available
required
trueThis is a boolean value that represents whether new Droplets can be created in this region.
features
required
["private_networking","backups","ipv6","metadata","install_agent","storage","image_transfer"]This attribute is set to an array which contains features available in this region
name
required
New York 3The display name of the region. This will be a full name that is used in the control panel and other interfaces.
sizes
required
This attribute is set to an array which contains the identifying slugs for the sizes available in this region. sizes:read is required to view.
slug
required
nyc3A human-readable string that is used as a unique identifier for each region.
size
required
Show child properties
available
required
trueThis is a boolean value that represents whether new Droplets can be created with this size.
description
required
BasicA string describing the class of Droplets created from this size. For example: Basic, General Purpose, CPU-Optimized, Memory-Optimized, or Storage-Optimized.
disk
required
25The amount of disk space set aside for Droplets of this size. The value is represented in gigabytes.
disk_info
optional
An array of objects containing information about the disks available to Droplets created with this size.
gpu_info
optional
An object containing information about the GPU capabilities of Droplets created with this size.
memory
required
1024The amount of RAM allocated to Droplets created of this size. The value is represented in megabytes.
price_hourly
required
0.00743999984115362This describes the price of the Droplet size as measured hourly. The value is measured in US dollars.
price_monthly
required
5This attribute describes the monthly cost of this Droplet size if the Droplet is kept for an entire month. The value is measured in US dollars.
regions
required
["ams2","ams3","blr1","fra1","lon1","nyc1","nyc2","nyc3","sfo1","sfo2","sfo3","sgp1","tor1"]An array containing the region slugs where this size is available for Droplet creates.
slug
required
s-1vcpu-1gbA human-readable string that is used to uniquely identify each size.
transfer
required
1The amount of transfer bandwidth that is available for Droplets created in this size. This only counts traffic on the public interface. The value is given in terabytes.
vcpus
required
1The number of CPUs allocated to Droplets of this size.
size_slug
required
s-1vcpu-1gbThe unique slug identifier for the size of this Droplet.
snapshot_ids
required
[67512819]An array of snapshot IDs of any snapshots created from the Droplet instance.
Requires image:read scope.
status
required
activeA status string indicating the state of the Droplet instance. This may be "new", "active", "off", or "archive".
tags
required
["web","env:prod"]An array of Tags the Droplet has been tagged with.
Requires tag:read scope.
vcpus
required
1The number of virtual CPUs.
volume_ids
required
["506f78a4-e098-11e5-ad9f-000f53306ae1"]A flat array including the unique identifier for each Block Storage volume attached to the Droplet.
Requires block_storage:read scope.
vpc_uuid
optional
760e09ef-dc84-11e8-981e-3cfdfeaae000A string specifying the UUID of the VPC to which the Droplet is assigned.
Requires vpc:read scope.
ip
optional
45.55.96.47The public IP address of the floating IP. It also serves as its identifier.
locked
optional
trueA boolean value indicating whether or not the floating IP has pending actions preventing new ones from being submitted.
project_id
optional
746c6152-2fa2-11ed-92d3-27aaa54e4988The UUID of the project to which the reserved IP currently belongs.
Requires project:read scope.
region
optional
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"floating_ip": {
"droplet": {
"backup_ids": [
53893572
],
"created_at": "2020-07-21T18:37:44Z",
"disk": 25,
"features": [
"backups",
"private_networking",
"ipv6"
],
"id": 3164444,
"image": {
"created_at": "2020-05-15T05:47:50Z",
"description": "",
"distribution": "Ubuntu",
"error_message": "",
"id": 63663980,
"min_disk_size": 20,
"name": "20.04 (LTS) x64",
"public": true,
"regions": [
"ams2",
"ams3",
"blr1",
"fra1",
"lon1",
"nyc1",
"nyc2",
"nyc3",
"sfo1",
"sfo2",
"sfo3",
"sgp1",
"tor1"
],
"size_gigabytes": 2.36,
"slug": "ubuntu-20-04-x64",
"status": "available",
"tags": [],
"type": "base"
},
"kernel": null,
"locked": false,
"memory": 1024,
"name": "example.com",
"networks": {
"v4": [
{
"gateway": "nil",
"ip_address": "10.128.192.124",
"netmask": "255.255.0.0",
"type": "private"
},
{
"gateway": "192.241.165.1",
"ip_address": "192.241.165.154",
"netmask": "255.255.255.0",
"type": "public"
}
],
"v6": [
{
"gateway": "2604:a880:0:1010::1",
"ip_address": "2604:a880:0:1010::18a:a001",
"netmask": 64,
"type": "public"
}
]
},
"next_backup_window": {
"end": "2020-07-30T23:00:00Z",
"start": "2020-07-30T00:00:00Z"
},
"region": {
"available": true,
"features": [
"backups",
"ipv6",
"metadata",
"install_agent",
"storage",
"image_transfer"
],
"name": "New York 3",
"sizes": [
"s-1vcpu-1gb",
"s-1vcpu-2gb",
"s-1vcpu-3gb",
"s-2vcpu-2gb",
"s-3vcpu-1gb",
"s-2vcpu-4gb",
"s-4vcpu-8gb",
"s-6vcpu-16gb",
"s-8vcpu-32gb",
"s-12vcpu-48gb",
"s-16vcpu-64gb",
"s-20vcpu-96gb",
"s-24vcpu-128gb",
"s-32vcpu-192g"
],
"slug": "nyc3"
},
"size": {
"available": true,
"description": "Basic",
"disk": 25,
"memory": 1024,
"price_hourly": 0.00743999984115362,
"price_monthly": 5,
"regions": [
"ams2",
"ams3",
"blr1",
"fra1",
"lon1",
"nyc1",
"nyc2",
"nyc3",
"sfo1",
"sfo2",
"sfo3",
"sgp1",
"tor1"
],
"slug": "s-1vcpu-1gb",
"transfer": 1,
"vcpus": 1
},
"size_slug": "s-1vcpu-1gb",
"snapshot_ids": [
67512819
],
"status": "active",
"tags": [
"web",
"env:prod"
],
"vcpus": 1,
"volume_ids": [],
"vpc_uuid": "760e09ef-dc84-11e8-981e-3cfdfeaae000"
},
"ip": "45.55.96.47",
"locked": false,
"project_id": "746c6152-2fa2-11ed-92d3-27aaa54e4988",
"region": {
"available": true,
"features": [
"backups",
"ipv6",
"metadata",
"install_agent",
"storage",
"image_transfer"
],
"name": "New York 3",
"sizes": [
"s-1vcpu-1gb",
"s-1vcpu-2gb",
"s-1vcpu-3gb",
"s-2vcpu-2gb",
"s-3vcpu-1gb",
"s-2vcpu-4gb",
"s-4vcpu-8gb",
"s-6vcpu-16gb",
"s-8vcpu-32gb",
"s-12vcpu-48gb",
"s-16vcpu-64gb",
"s-20vcpu-96gb",
"s-24vcpu-128gb",
"s-32vcpu-192g"
],
"slug": "nyc3"
}
}
}{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}DELETE Delete a Floating IP
/v2/floating_ips/{floating_ip}
Authorizations:
bearer_auth
(1 scope)
OAuth Authentication
In order to interact with the DigitalOcean API, you or your application must authenticate.
The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints.
You can generate an OAuth token by visiting the Apps & API section of the DigitalOcean control panel for your account.
An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
Because of this, it is absolutely essential that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised.
DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens.
dop_v1_for personal access tokens generated in the control paneldoo_v1_for tokens generated by applications using the OAuth flowdor_v1_for OAuth refresh tokens
Scopes
Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes.
Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete).
| HTTP Verb | CRUD Operation | Scope |
|---|---|---|
| GET | Read | <resource>:read |
| POST | Create | <resource>:create |
| PUT/PATCH | Update | <resource>:update |
| DELETE | Delete | <resource>:delete |
For example, creating a new Droplet by making a POST request to the
/v2/droplets endpoint requires the droplet:create scope while
listing Droplets by making a GET request to the /v2/droplets
endpoint requires the droplet:read scope.
Each endpoint below specifies which scope is required to access it when using custom scopes.
How to Authenticate with OAuth
In order to make an authenticated request, include a bearer-type
Authorization header containing your OAuth token. All requests must be
made over HTTPS.
Authenticate with a Bearer Authorization Header
curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"
To delete a floating IP and remove it from your account, send a DELETE request
to /v2/floating_ips/$FLOATING_IP_ADDR.
A successful request will receive a 204 status code with no body in response. This indicates that the request was processed successfully.
Path Parameters
floating_ip
>= 1 required
45.55.96.47A floating IP address.
Request: /v2/floating_ips/{floating_ip}
curl -X DELETE \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/floating_ips/45.55.96.47"import (
"context"
"os"
"github.com/digitalocean/godo"
)
func main() {
token := os.Getenv("DIGITALOCEAN_TOKEN")
client := godo.NewFromToken(token)
ctx := context.TODO()
_, err := client.FloatingIPs.Delete(ctx, "45.55.96.34")
}require 'droplet_kit'
token = ENV['DIGITALOCEAN_TOKEN']
client = DropletKit::Client.new(access_token: token)
client.floating_ips.delete(ip: '45.55.96.47') Responses
204
The action was successful and the response body is empty.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
401
Authentication failed due to invalid credentials.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404
The resource was not found.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429
The API rate limit has been exceeded.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500
There was a server error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
default
There was an unexpected error.
ratelimit-limit
The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute.
ratelimit-remaining
The number of requests in your hourly quota that remain before you hit your request limit. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
ratelimit-reset
The time when the oldest request will expire. The value is given in Unix epoch time. See https://docs.digitalocean.com/reference/api/reference/#rate-limit for information about how requests expire.
application/json
id
required
not_foundA short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
message
required
The resource you were accessing could not be found.A message providing additional information about the error, including details to help resolve it when possible.
request_id
optional
4d9d8375-3c56-4925-a3e7-eb137fed17e9Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Response
{
"id": "unauthorized",
"message": "Unable to authenticate you."
}{
"id": "not_found",
"message": "The resource you requested could not be found."
}{
"id": "too_many_requests",
"message": "API rate limit exceeded."
}{
"id": "server_error",
"message": "Unexpected server-side error"
}{
"id": "example_error",
"message": "some error message"
}