---
title: "Create a New Floating IP"
method: POST
path: "/v2/floating_ips"
tags: ["DigitalOcean-public.v2-new_Floating IPs"]
---

# 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.

## Request body

- union
  - object
    - `droplet_id` integer, required — The ID of the Droplet that the floating IP will be assigned to.
  - object
    - `region` string, required — The slug identifier for the region the floating IP will be reserved to.
    - `project_id` string, uuid — The UUID of the project to which the floating IP will be assigned.

## Response `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.

- object
  - `floating_ip` FloatingIp
    - `ip` string, ipv4 — The public IP address of the floating IP. It also serves as its identifier.
    - `region` object — The region that the floating IP is reserved to. When you query a floating IP, the entire region object will be returned.
      - `name` string, required — The display name of the region. This will be a full name that is used in the control panel and other interfaces.
      - `slug` string, required — A human-readable string that is used as a unique identifier for each region.
      - `features` string[], required — This attribute is set to an array which contains features available in this region
      - `available` boolean, required — This is a boolean value that represents whether new Droplets can be created in this region.
      - `sizes` string[], 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.
    - `droplet` union — 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. <br><br>Requires `droplet:read` scope.
      - object, nullable — If the floating IP is not assigned to a Droplet, the value will be null.
      - Droplet
        - `id` integer, required — A unique identifier for each Droplet instance. This is automatically generated upon Droplet creation.
        - `name` string, required — The human-readable name set for the Droplet instance.
        - `memory` integer, required — Memory of the Droplet in megabytes.
        - `vcpus` integer, required — The number of virtual CPUs.
        - `disk` integer, required — The size of the Droplet's disk in gigabytes.
        - `disk_info` DiskInfo[] — An array of objects containing information about the disks available to the Droplet.
          - `type` 'local' | 'scratch' — The type of disk. All Droplets contain a `local` disk. Additionally, GPU Droplets can also have a `scratch` disk for non-persistent data.
          - `size` object
            - `amount` integer — The amount of space allocated to the disk.
            - `unit` string — The unit of measure for the disk size.
        - `locked` boolean, required — A boolean value indicating whether the Droplet has been locked, preventing actions by users.
        - `status` 'new' | 'active' | 'off' | 'archive', required — A status string indicating the state of the Droplet instance. This may be "new", "active", "off", or "archive".
        - `kernel` Kernel, 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](https://docs.digitalocean.com/products/droplets/how-to/kernel/) for Droplets with externally managed kernels. This will initially be set to the kernel of the base image when the Droplet is created.
          - `id` integer — A unique number used to identify and reference a specific kernel.
          - `name` string — 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` string — A standard kernel version string representing the version, patch, and release information.
        - `created_at` string, date-time, required — A time value given in ISO8601 combined date and time format that represents when the Droplet was created.
        - `features` string[], required — An array of features enabled on this Droplet.
        - `backup_ids` integer[], required — 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.<br>Requires `image:read` scope.
        - `next_backup_window` object, nullable, required — The details of the Droplet's backups feature, if backups are configured for the Droplet. This object contains keys for the start and end times of the window during which the backup will start.
          - `start` string, date-time — A time value given in ISO8601 combined date and time format specifying the start of the Droplet's backup window.
          - `end` string, date-time — A time value given in ISO8601 combined date and time format specifying the end of the Droplet's backup window.
        - `snapshot_ids` integer[], required — An array of snapshot IDs of any snapshots created from the Droplet instance.<br>Requires `image:read` scope.
        - `image` object, required — The Droplet's image.<br>Requires `image:read` scope.
          - `id` integer — A unique number that can be used to identify and reference a specific image.
          - `name` string — The display name that has been given to an image. This is what is shown in the control panel and is generally a descriptive title for the image in question.
          - `type` 'base' | 'snapshot' | 'backup' | 'custom' | 'admin' — Describes the kind of image. It may be one of `base`, `snapshot`, `backup`, `custom`, or `admin`. Respectively, this specifies whether an image is a DigitalOcean base OS image, user-generated Droplet snapshot, automatically created Droplet backup, user-provided virtual machine image, or an image used for DigitalOcean managed resources (e.g. DOKS worker nodes).
          - `distribution` 'Arch Linux' | 'CentOS' | 'CoreOS' | 'Debian' | 'Fedora' | 'Fedora Atomic' | 'FreeBSD' | 'Gentoo' | 'openSUSE' | 'RancherOS' | 'Rocky Linux' | 'Ubuntu' | 'Unknown' — The name of a custom image's distribution. Currently, the valid values are `Arch Linux`, `CentOS`, `CoreOS`, `Debian`, `Fedora`, `Fedora Atomic`, `FreeBSD`, `Gentoo`, `openSUSE`, `RancherOS`, `Rocky Linux`, `Ubuntu`, and `Unknown`. Any other value will be accepted but ignored, and `Unknown` will be used in its place.
          - `slug` string, nullable — A uniquely identifying string that is associated with each of the DigitalOcean-provided public images. These can be used to reference a public image as an alternative to the numeric id.
          - `public` boolean — This is a boolean value that indicates whether the image in question is public or not. An image that is public is available to all accounts. A non-public image is only accessible from your account.
          - `regions` RegionSlug[] — This attribute is an array of the regions that the image is available in. The regions are represented by their identifying slug values.
          - `created_at` string, date-time — A time value given in ISO8601 combined date and time format that represents when the image was created.
          - `min_disk_size` integer, nullable — The minimum disk size in GB required for a Droplet to use this image.
          - `size_gigabytes` number, float, nullable — The size of the image in gigabytes.
          - `description` string — An optional free-form text field to describe an image.
          - `tags` string[], nullable — A flat array of tag names as strings to be applied to the resource. Tag names may be for either existing or new tags. <br><br>Requires `tag:create` scope.
          - `status` 'NEW' | 'available' | 'pending' | 'deleted' | 'retired' — A status string indicating the state of a custom image. This may be `NEW`, `available`, `pending`, `deleted`, or `retired`.
          - `error_message` string — A string containing information about errors that may occur when importing a custom image.
        - `volume_ids` string[], required — A flat array including the unique identifier for each Block Storage volume attached to the Droplet.<br>Requires `block_storage:read` scope.
        - `size` Size, required
          - `slug` string, required — A human-readable string that is used to uniquely identify each size.
          - `memory` integer, required — The amount of RAM allocated to Droplets created of this size. The value is represented in megabytes.
          - `vcpus` integer, required — The number of CPUs allocated to Droplets of this size.
          - `disk` integer, required — The amount of disk space set aside for Droplets of this size. The value is represented in gigabytes.
          - `transfer` number, float, required — The 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.
          - `price_monthly` number, float, required — This 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.
          - `price_hourly` number, float, required — This describes the price of the Droplet size as measured hourly. The value is measured in US dollars.
          - `regions` string[], required — An array containing the region slugs where this size is available for Droplet creates.
          - `available` boolean, required — This is a boolean value that represents whether new Droplets can be created with this size.
          - `description` string, required — A string describing the class of Droplets created from this size. For example: Basic, General Purpose, CPU-Optimized, Memory-Optimized, or Storage-Optimized.
          - `disk_info` DiskInfo[] — An array of objects containing information about the disks available to Droplets created with this size.
            - `type` 'local' | 'scratch' — The type of disk. All Droplets contain a `local` disk. Additionally, GPU Droplets can also have a `scratch` disk for non-persistent data.
            - `size` object
              - …
          - `gpu_info` GpuInfo — An object containing information about the GPU capabilities of Droplets created with this size.
            - `count` integer — The number of GPUs allocated to the Droplet.
            - `model` string — The model of the GPU.
            - `vram` object
              - …
        - `size_slug` string, required — The unique slug identifier for the size of this Droplet.
        - `networks` object, 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.
          - `v4` NetworkV4[]
            - `ip_address` string, ipv4 — The IP address of the IPv4 network interface.
            - `netmask` string, ipv4 — The netmask of the IPv4 network interface.
            - `gateway` string — The gateway of the specified IPv4 network interface. For private interfaces, a gateway is not provided. This is denoted by returning `nil` as its value.
            - `type` 'public' | 'private' — The type of the IPv4 network interface.
          - `v6` NetworkV6[]
            - `ip_address` string, ipv6 — The IP address of the IPv6 network interface.
            - `netmask` integer — The netmask of the IPv6 network interface.
            - `gateway` string, ipv6 — The gateway of the specified IPv6 network interface.
            - `type` 'public' — The type of the IPv6 network interface. **Note**: IPv6 private networking is not currently supported.
        - `region` Region, required
          - `name` string, required — The display name of the region. This will be a full name that is used in the control panel and other interfaces.
          - `slug` string, required — A human-readable string that is used as a unique identifier for each region.
          - `features` string[], required — This attribute is set to an array which contains features available in this region
          - `available` boolean, required — This is a boolean value that represents whether new Droplets can be created in this region.
          - `sizes` string[], 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.
        - `tags` string[], required — An array of Tags the Droplet has been tagged with.<br>Requires `tag:read` scope.
        - `vpc_uuid` string — A string specifying the UUID of the VPC to which the Droplet is assigned.<br>Requires `vpc:read` scope.
        - `gpu_info` GpuInfo — An object containing information about the GPU capabilities of Droplets created with this size.
          - `count` integer — The number of GPUs allocated to the Droplet.
          - `model` string — The model of the GPU.
          - `vram` object
            - `amount` integer — The amount of VRAM allocated to the GPU.
            - `unit` string — The unit of measure for the VRAM.
    - `locked` boolean — A boolean value indicating whether or not the floating IP has pending actions preventing new ones from being submitted.
    - `project_id` string, uuid — The UUID of the project to which the reserved IP currently belongs.<br><br>Requires `project:read` scope.
  - `links` object
    - `droplets` ActionLink[]
      - `id` integer — A unique numeric ID that can be used to identify and reference an action.
      - `rel` string — A string specifying the type of the related action.
      - `href` string, uri — A URL that can be used to access the action.
    - `actions` ActionLink[]
      - `id` integer — A unique numeric ID that can be used to identify and reference an action.
      - `rel` string — A string specifying the type of the related action.
      - `href` string, uri — A URL that can be used to access the action.

## Other responses

- `401` — Authentication failed due to invalid credentials.
- `429` — The API rate limit has been exceeded.
- `500` — There was a server error.
- `default` — There was an unexpected error.

---

[API](https://skmtc.net/digitalocean/apis/digitalocean-api.md) · [All operations](https://skmtc.net/digitalocean/apis/digitalocean-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/digitalocean/digitalocean-api/revisions/cb3bf9b21459/schema)
