Skip to content
  • Auto
  • Light
  • Dark

Create

Create a New Floating IP
post/v2/floating_ips

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_ips with the droplet_id attribute.

  • To create a new floating IP reserved to a region, send a POST request to /v2/floating_ips with the region attribute.

Note: In addition to the standard rate limiting, only 12 floating IPs may be created per 60 seconds.

Body ParametersExpand Collapse
body: object { droplet_id } or object { region, project_id }
Accepts one of the following:
AssignToDroplet = object { droplet_id }
droplet_id: number

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

ReserveToRegion = object { region, project_id }
region: string

The slug identifier for the region the floating IP will be reserved to.

project_id: optional string

The UUID of the project to which the floating IP will be assigned.

formatuuid
ReturnsExpand Collapse
floating_ip: optional FloatingIP
curl https://api.digitalocean.com/v2/floating_ips \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $DIGITALOCEAN_ACCESS_TOKEN" \
    -d '{
          "droplet_id": 2457247
        }'
{
  "floating_ip": {
    "ip": "45.55.96.47",
    "droplet": null,
    "region": {
      "name": "New York 3",
      "slug": "nyc3",
      "features": [
        "private_networking",
        "backups",
        "ipv6",
        "metadata",
        "install_agent",
        "storage",
        "image_transfer"
      ],
      "available": true,
      "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"
      ]
    },
    "locked": true,
    "project_id": "746c6152-2fa2-11ed-92d3-27aaa54e4988"
  },
  "links": {
    "droplets": [
      {
        "id": 213939433,
        "rel": "droplet",
        "href": "https://api.digitalocean.com/v2/droplets/213939433"
      }
    ],
    "actions": [
      {
        "id": 1088924622,
        "rel": "assign_ip",
        "href": "https://api.digitalocean.com/v2/actions/1088924622"
      }
    ]
  }
}
Returns Examples
{
  "floating_ip": {
    "ip": "45.55.96.47",
    "droplet": null,
    "region": {
      "name": "New York 3",
      "slug": "nyc3",
      "features": [
        "private_networking",
        "backups",
        "ipv6",
        "metadata",
        "install_agent",
        "storage",
        "image_transfer"
      ],
      "available": true,
      "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"
      ]
    },
    "locked": true,
    "project_id": "746c6152-2fa2-11ed-92d3-27aaa54e4988"
  },
  "links": {
    "droplets": [
      {
        "id": 213939433,
        "rel": "droplet",
        "href": "https://api.digitalocean.com/v2/droplets/213939433"
      }
    ],
    "actions": [
      {
        "id": 1088924622,
        "rel": "assign_ip",
        "href": "https://api.digitalocean.com/v2/actions/1088924622"
      }
    ]
  }
}