POST/v2/floating_ips

Create a floating IP

Creates a floating IP assigned to a Droplet or reserved to a region. Supply droplet_id to assign it to a Droplet, or supply region to reserve it; project_id can associate a region-reserved floating IP with a project. A 202 response returns the floating IP object and, when assigning it to a Droplet, links to the Droplet and assignment action.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 body field

Choose one creation mode: assign the floating IP to a Droplet with droplet_id, or reserve it to a region with region; project_id is available with the region option.

droplet_idintegerrequired
The ID of the Droplet that the floating IP will be assigned to.

5 status codes
202Returns a `floating_ip` object with the standard floating IP attributes. When the IP is assigned to a Droplet during creation, the response also includes links to the Droplet and the assignment action.
floating_ipobjectoptional
linksobjectoptional
401Returned when authentication fails because the credentials are invalid.
idstringrequired
A 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."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429Returned when the API rate limit has been exceeded.
idstringrequired
A 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."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500Returned when a server error occurs.
idstringrequired
A 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."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
defaultThere was an unexpected error.
idstringrequired
A 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."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.

Error handling

A 401 is returned when authentication fails because the credentials are invalid; a 429 indicates the API rate limit was exceeded; and a 500 indicates a server error. Provide either droplet_id or region as required by the selected request shape. When using region, project_id must be a UUID if supplied.