openapi: 3.0.0 info: title: DigitalOcean Reserved IPs API version: '2.0' description: "# Introduction\n\nThe DigitalOcean API allows you to manage Droplets and resources within the\nDigitalOcean cloud in a simple, programmatic way using conventional HTTP requests.\n\nAll of the functionality that you are familiar with in the DigitalOcean\ncontrol panel is also available through the API, allowing you to script the\ncomplex actions that your situation requires.\n\nThe API documentation will start with a general overview about the design\nand technology that has been implemented, followed by reference information\nabout specific endpoints.\n\n## Requests\n\nAny tool that is fluent in HTTP can communicate with the API simply by\nrequesting the correct URI. Requests should be made using the HTTPS protocol\nso that traffic is encrypted. The interface responds to different methods\ndepending on the action required.\n\n|Method|Usage|\n|--- |--- |\n|GET|For simple retrieval of information about your account, Droplets, or environment, you should use the GET method. The information you request will be returned to you as a JSON object. The attributes defined by the JSON object can be used to form additional requests. Any request using the GET method is read-only and will not affect any of the objects you are querying.|\n|DELETE|To destroy a resource and remove it from your account and environment, the DELETE method should be used. This will remove the specified object if it is found. If it is not found, the operation will return a response indicating that the object was not found. This idempotency means that you do not have to check for a resource's availability prior to issuing a delete command, the final state will be the same regardless of its existence.|\n|PUT|To update the information about a resource in your account, the PUT method is available. Like the DELETE Method, the PUT method is idempotent. It sets the state of the target using the provided values, regardless of their current values. Requests using the PUT method do not need to check the current attributes of the object.|\n|PATCH|Some resources support partial modification. In these cases, the PATCH method is available. Unlike PUT which generally requires a complete representation of a resource, a PATCH request is a set of instructions on how to modify a resource updating only specific attributes.|\n|POST|To create a new object, your request should specify the POST method. The POST request includes all of the attributes necessary to create a new object. When you wish to create a new object, send a POST request to the target endpoint.|\n|HEAD|Finally, to retrieve metadata information, you should use the HEAD method to get the headers. This returns only the header of what would be returned with an associated GET request. Response headers contain some useful information about your API access and the results that are available for your request. For instance, the headers contain your current rate-limit value and the amount of time available until the limit resets. It also contains metrics about the total number of objects found, pagination information, and the total content length.|\n\n\n## HTTP Statuses\n\nAlong with the HTTP methods that the API responds to, it will also return\nstandard HTTP statuses, including error codes.\n\nIn the event of a problem, the status will contain the error code, while the\nbody of the response will usually contain additional information about the\nproblem that was encountered.\n\nIn general, if the status returned is in the 200 range, it indicates that\nthe request was fulfilled successfully and that no error was encountered.\n\nReturn codes in the 400 range typically indicate that there was an issue\nwith the request that was sent. Among other things, this could mean that you\ndid not authenticate correctly, that you are requesting an action that you\ndo not have authorization for, that the object you are requesting does not\nexist, or that your request is malformed.\n\nIf you receive a status in the 500 range, this generally indicates a\nserver-side problem. This means that we are having an issue on our end and\ncannot fulfill your request currently.\n\n400 and 500 level error responses will include a JSON object in their body,\nincluding the following attributes:\n\n|Name|Type|Description|\n|--- |--- |--- |\n|id|string|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.\"|\n|message|string|A message providing additional information about the error, including details to help resolve it when possible.|\n|request_id|string|Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.|\n\n### Example Error Response\n\n```\n HTTP/1.1 403 Forbidden\n {\n \"id\": \"forbidden\",\n \"message\": \"You do not have access for the attempted action.\"\n }\n```\n\n## Responses\n\nWhen a request is successful, a response body will typically be sent back in\nthe form of a JSON object. An exception to this is when a DELETE request is\nprocessed, which will result in a successful HTTP 204 status and an empty\nresponse body.\n\nInside of this JSON object, the resource root that was the target of the\nrequest will be set as the key. This will be the singular form of the word\nif the request operated on a single object, and the plural form of the word\nif a collection was processed.\n\nFor example, if you send a GET request to `/v2/droplets/$DROPLET_ID` you\nwill get back an object with a key called \"`droplet`\". However, if you send\nthe GET request to the general collection at `/v2/droplets`, you will get\nback an object with a key called \"`droplets`\".\n\nThe value of these keys will generally be a JSON object for a request on a\nsingle object and an array of objects for a request on a collection of\nobjects.\n\n### Response for a Single Object\n\n```json\n {\n \"droplet\": {\n \"name\": \"example.com\"\n . . .\n }\n }\n```\n\n### Response for an Object Collection\n\n```json\n {\n \"droplets\": [\n {\n \"name\": \"example.com\"\n . . .\n },\n {\n \"name\": \"second.com\"\n . . .\n }\n ]\n }\n```\n\n## Meta\n\nIn addition to the main resource root, the response may also contain a\n`meta` object. This object contains information about the response itself.\n\nThe `meta` object contains a `total` key that is set to the total number of\nobjects returned by the request. This has implications on the `links` object\nand pagination.\n\nThe `meta` object will only be displayed when it has a value. Currently, the\n`meta` object will have a value when a request is made on a collection (like\n`droplets` or `domains`).\n\n\n### Sample Meta Object\n\n```json\n {\n . . .\n \"meta\": {\n \"total\": 43\n }\n . . .\n }\n```\n\n## Links & Pagination\n\nThe `links` object is returned as part of the response body when pagination\nis enabled. By default, 20 objects are returned per page. If the response\ncontains 20 objects or fewer, no `links` object will be returned. If the\nresponse contains more than 20 objects, the first 20 will be returned along\nwith the `links` object.\n\nYou can request a different pagination limit or force pagination by\nappending `?per_page=` to the request with the number of items you would\nlike per page. For instance, to show only two results per page, you could\nadd `?per_page=2` to the end of your query. The maximum number of results\nper page is 200.\n\nThe `links` object contains a `pages` object. The `pages` object, in turn,\ncontains keys indicating the relationship of additional pages. The values of\nthese are the URLs of the associated pages. The keys will be one of the\nfollowing:\n\n* **first**: The URI of the first page of results.\n* **prev**: The URI of the previous sequential page of results.\n* **next**: The URI of the next sequential page of results.\n* **last**: The URI of the last page of results.\n\nThe `pages` object will only include the links that make sense. So for the\nfirst page of results, no `first` or `prev` links will ever be set. This\nconvention holds true in other situations where a link would not make sense.\n\n### Sample Links Object\n\n```json\n {\n . . .\n \"links\": {\n \"pages\": {\n \"last\": \"https://api.digitalocean.com/v2/images?page=2\",\n \"next\": \"https://api.digitalocean.com/v2/images?page=2\"\n }\n }\n . . .\n }\n```\n\n## Rate Limit\n\nRequests through the API are rate limited per OAuth token. Current rate limits:\n\n* 5,000 requests per hour\n* 250 requests per minute (5% of the hourly total)\n\nOnce you exceed either limit, you will be rate limited until the next cycle\nstarts. Space out any requests that you would otherwise issue in bursts for\nthe best results.\n\nThe rate limiting information is contained within the response headers of\neach request. The relevant headers are:\n\n* **ratelimit-limit**: The number of requests that can be made per hour.\n* **ratelimit-remaining**: The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.\n* **ratelimit-reset**: This represents the time when the oldest request will expire. The value is given in [Unix epoch time](http://en.wikipedia.org/wiki/Unix_time). See below for more information about how request limits expire.\n\nMore rate limiting information is returned only within burst limit error response headers:\n* **retry-after**: The number of seconds to wait before making another request when rate limited.\n\nAs long as the `ratelimit-remaining` count is above zero, you will be able\nto make additional requests.\n\nThe way that a request expires and is removed from the current limit count\nis important to understand. Rather than counting all of the requests for an\nhour and resetting the `ratelimit-remaining` value at the end of the hour,\neach request instead has its own timer.\n\nThis means that each request contributes toward the `ratelimit-remaining`\ncount for one complete hour after the request is made. When that request's\ntimer runs out, it is no longer counted towards the request limit.\n\nThis has implications on the meaning of the `ratelimit-reset` header as\nwell. Because the entire rate limit is not reset at one time, the value of\nthis header is set to the time when the _oldest_ request will expire.\n\nKeep this in mind if you see your `ratelimit-reset` value change, but not\nmove an entire hour into the future.\n\nIf the `ratelimit-remaining` reaches zero, subsequent requests will receive\na 429 error code until the request reset has been reached. \n\n`ratelimit-remaining` reaching zero can also indicate that the \"burst limit\" of 250 \nrequests per minute limit was met, even if the 5,000 requests per hour limit was not. \nIn this case, the 429 error response will include a `retry-after` header to indicate how \nlong to wait (in seconds) until the request may be retried.\n\nYou can see the format of the response in the examples. \n\n**Note:** The following endpoints have special rate limit requirements that\nare independent of the limits defined above.\n\n* Only 12 `POST` requests to the `/v2/floating_ips` endpoint to create Floating IPs can be made per 60 seconds.\n* Only 10 `GET` requests to the `/v2/account/keys` endpoint to list SSH keys can be made per 60 seconds.\n* Only 5 requests to any and all `v2/cdn/endpoints` can be made per 10 seconds. This includes `v2/cdn/endpoints`, \n `v2/cdn/endpoints/$ENDPOINT_ID`, and `v2/cdn/endpoints/$ENDPOINT_ID/cache`.\n* Only 50 strings within the `files` json struct in the `v2/cdn/endpoints/$ENDPOINT_ID/cache` [payload](https://docs.digitalocean.com/reference/api/api-reference/#operation/cdn_purge_cache) \n can be requested every 20 seconds.\n\n### Sample Rate Limit Headers\n\n```\n . . .\n ratelimit-limit: 1200\n ratelimit-remaining: 1193\n rateLimit-reset: 1402425459\n . . .\n```\n\n ### Sample Rate Limit Headers When Burst Limit is Reached:\n\n```\n . . .\n ratelimit-limit: 5000\n ratelimit-remaining: 0\n rateLimit-reset: 1402425459\n retry-after: 29\n . . .\n```\n\n### Sample Rate Exceeded Response\n\n```\n 429 Too Many Requests\n {\n id: \"too_many_requests\",\n message: \"API Rate limit exceeded.\"\n }\n```\n\n## Curl Examples\n\nThroughout this document, some example API requests will be given using the\n`curl` command. This will allow us to demonstrate the various endpoints in a\nsimple, textual format.\n \n These examples assume that you are using a Linux or macOS command line. To run\nthese commands on a Windows machine, you can either use cmd.exe, PowerShell, or WSL:\n\n* For cmd.exe, use the `set VAR=VALUE` [syntax](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/set_1)\nto define environment variables, call them with `%VAR%`, then replace all backslashes (`\\`) in the examples with carets (`^`).\n\n* For PowerShell, use the `$Env:VAR = \"VALUE\"` [syntax](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_environment_variables?view=powershell-7.2)\nto define environment variables, call them with `$Env:VAR`, then replace `curl` with `curl.exe` and all backslashes (`\\`) in the examples with backticks (`` ` ``).\n\n* WSL is a compatibility layer that allows you to emulate a Linux terminal on a Windows machine.\nInstall WSL with our [community tutorial](https://www.digitalocean.com/community/tutorials/how-to-install-the-windows-subsystem-for-linux-2-on-microsoft-windows-10), \nthen follow this API documentation normally.\n\nThe names of account-specific references (like Droplet IDs, for instance)\nwill be represented by variables. For instance, a Droplet ID may be\nrepresented by a variable called `$DROPLET_ID`. You can set the associated\nvariables in your environment if you wish to use the examples without\nmodification.\n\nThe first variable that you should set to get started is your OAuth\nauthorization token. The next section will go over the details of this, but\nyou can set an environmental variable for it now.\n\nGenerate a token by going to the [Apps & API](https://cloud.digitalocean.com/settings/applications)\nsection of the DigitalOcean control panel. Use an existing token if you have\nsaved one, or generate a new token with the \"Generate new token\" button.\nCopy the generated token and use it to set and export the TOKEN variable in\nyour environment as the example shows.\n\nYou may also wish to set some other variables now or as you go along. For\nexample, you may wish to set the `DROPLET_ID` variable to one of your\nDroplet IDs since this will be used frequently in the API.\n\nIf you are following along, make sure you use a Droplet ID that you control\nso that your commands will execute correctly.\n\nIf you need access to the headers of a response through `curl`, you can pass\nthe `-i` flag to display the header information along with the body. If you\nare only interested in the header, you can instead pass the `-I` flag, which\nwill exclude the response body entirely.\n\n\n### Set and Export your OAuth Token\n\n```\nexport DIGITALOCEAN_TOKEN=your_token_here\n```\n\n### Set and Export a Variable\n\n```\nexport DROPLET_ID=1111111\n```\n\n## Parameters\n\nThere are two different ways to pass parameters in a request with the API.\n\nWhen passing parameters to create or update an object, parameters should be\npassed as a JSON object containing the appropriate attribute names and\nvalues as key-value pairs. When you use this format, you should specify that\nyou are sending a JSON object in the header. This is done by setting the\n`Content-Type` header to `application/json`. This ensures that your request\nis interpreted correctly.\n\nWhen passing parameters to filter a response on GET requests, parameters can\nbe passed using standard query attributes. In this case, the parameters\nwould be embedded into the URI itself by appending a `?` to the end of the\nURI and then setting each attribute with an equal sign. Attributes can be\nseparated with a `&`. Tools like `curl` can create the appropriate URI when\ngiven parameters and values; this can also be done using the `-F` flag and\nthen passing the key and value as an argument. The argument should take the\nform of a quoted string with the attribute being set to a value with an\nequal sign.\n\n### Pass Parameters as a JSON Object\n\n```\n curl -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"name\": \"example.com\", \"ip_address\": \"127.0.0.1\"}' \\\n -X POST \"https://api.digitalocean.com/v2/domains\"\n```\n\n### Pass Filter Parameters as a Query String\n\n```\n curl -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n -X GET \\\n \"https://api.digitalocean.com/v2/images?private=true\"\n```\n\n## Cross Origin Resource Sharing\n\nIn order to make requests to the API from other domains, the API implements\nCross Origin Resource Sharing (CORS) support.\n\nCORS support is generally used to create AJAX requests outside of the domain\nthat the request originated from. This is necessary to implement projects\nlike control panels utilizing the API. This tells the browser that it can\nsend requests to an outside domain.\n\nThe procedure that the browser initiates in order to perform these actions\n(other than GET requests) begins by sending a \"preflight\" request. This sets\nthe `Origin` header and uses the `OPTIONS` method. The server will reply\nback with the methods it allows and some of the limits it imposes. The\nclient then sends the actual request if it falls within the allowed\nconstraints.\n\nThis process is usually done in the background by the browser, but you can\nuse curl to emulate this process using the example provided. The headers\nthat will be set to show the constraints are:\n\n* **Access-Control-Allow-Origin**: This is the domain that is sent by the client or browser as the origin of the request. It is set through an `Origin` header.\n* **Access-Control-Allow-Methods**: This specifies the allowed options for requests from that domain. This will generally be all available methods.\n* **Access-Control-Expose-Headers**: This will contain the headers that will be available to requests from the origin domain.\n* **Access-Control-Max-Age**: This is the length of time that the access is considered valid. After this expires, a new preflight should be sent.\n* **Access-Control-Allow-Credentials**: This will be set to `true`. It basically allows you to send your OAuth token for authentication.\n\nYou should not need to be concerned with the details of these headers,\nbecause the browser will typically do all of the work for you.\n" license: name: Apache 2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html contact: name: DigitalOcean API Team email: api-engineering@digitalocean.com termsOfService: https://www.digitalocean.com/legal/terms-of-service-agreement/ servers: - url: https://api.digitalocean.com description: production security: - bearer_auth: [] tags: - name: Reserved IPs description: 'As of 16 June 2022, we have renamed the [Floating IP](https://docs.digitalocean.com/reference/api/api-reference/#tag/Floating-IPs) product to 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](https://docs.digitalocean.com/reference/api/api-reference/#tag/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 Reserved 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. Reserved IPs are bound to a specific region.' paths: /v2/reserved_ips: get: operationId: reservedIPs_list summary: List All Reserved IPs description: To list all of the reserved IPs available on your account, send a GET request to `/v2/reserved_ips`. tags: - Reserved IPs parameters: - $ref: '#/components/parameters/per_page' - $ref: '#/components/parameters/page' responses: '200': $ref: '#/components/responses/reserved_ip_list' '401': $ref: '#/components/responses/unauthorized' '429': $ref: '#/components/responses/too_many_requests' '500': $ref: '#/components/responses/server_error' default: $ref: '#/components/responses/unexpected_error' x-codeSamples: - lang: cURL source: "curl -X GET \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n \"https://api.digitalocean.com/v2/reserved_ips?page=1&per_page=20\" " - lang: Go source: "import (\n \"context\"\n \"os\"\n\n \"github.com/digitalocean/godo\"\n)\n\nfunc main() {\n token := os.Getenv(\"DIGITALOCEAN_TOKEN\")\n\n client := godo.NewFromToken(token)\n ctx := context.TODO()\n\n opt := &godo.ListOptions{\n Page: 1,\n PerPage: 200,\n }\n\n reservedIPs, _, err := client.ReservedIPs.List(ctx, opt)\n}" - lang: Ruby source: 'require ''droplet_kit'' token = ENV[''DIGITALOCEAN_TOKEN''] client = DropletKit::Client.new(access_token: token) reserved_ips = client.reserved_ips.all reserved_ips.each' - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) resp = client.reserved_ips.list()' security: - bearer_auth: - reserved_ip:read post: operationId: reservedIPs_create summary: Create a New Reserved IP description: "On creation, a reserved IP must be either assigned to a Droplet or reserved to a region.\n* To create a new reserved IP assigned to a Droplet, send a POST\n request to `/v2/reserved_ips` with the `droplet_id` attribute.\n\n* To create a new reserved IP reserved to a region, send a POST request to\n `/v2/reserved_ips` with the `region` attribute.\n\n**Note**: In addition to the standard rate limiting, only 12 reserved IPs may be created per 60 seconds." tags: - Reserved IPs requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/reserved_ip_create' responses: '202': $ref: '#/components/responses/reserved_ip_created' '401': $ref: '#/components/responses/unauthorized' '429': $ref: '#/components/responses/too_many_requests' '500': $ref: '#/components/responses/server_error' default: $ref: '#/components/responses/unexpected_error' x-codeSamples: - lang: cURL source: "curl -X POST \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n -d '{\"droplet_id\": 123456}' \\\n \"https://api.digitalocean.com/v2/reserved_ips\" " - lang: Go source: "import (\n \"context\"\n \"os\"\n\n \"github.com/digitalocean/godo\"\n)\n\nfunc main() {\n token := os.Getenv(\"DIGITALOCEAN_TOKEN\")\n\n client := godo.NewFromToken(token)\n ctx := context.TODO()\n\n createRequest := &godo.ReservedIPCreateRequest{\n DropletID: 123456,\n Region: \"nyc3\",\n ProjectID: \"1234a77a-12cd-11ed-909f-43c99lbf6030\",\n }\n\n reservedIP, _, err := client.ReservedIPs.Create(ctx, createRequest)\n}" - lang: Ruby source: 'require ''droplet_kit'' token = ENV[''DIGITALOCEAN_TOKEN''] client = DropletKit::Client.new(access_token: token) reserved_ip = DropletKit::ReservedIp.new(droplet_id: 123456) client.reserved_ips.create(reserved_ip) ' - lang: Python source: "import os\nfrom pydo import Client\n\nclient = Client(token=os.environ.get(\"DIGITALOCEAN_TOKEN\"))\n\nreq = {\n \"droplet_id\": 2457247\n}\n\nresp = client.reserved_ips.create(body=req)" security: - bearer_auth: - reserved_ip:create /v2/reserved_ips/{reserved_ip}: get: operationId: reservedIPs_get summary: Retrieve an Existing Reserved IP description: To show information about a reserved IP, send a GET request to `/v2/reserved_ips/$RESERVED_IP_ADDR`. tags: - Reserved IPs parameters: - $ref: '#/components/parameters/reserved_ip' responses: '200': $ref: '#/components/responses/reserved_ip' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found' '429': $ref: '#/components/responses/too_many_requests' '500': $ref: '#/components/responses/server_error' default: $ref: '#/components/responses/unexpected_error' x-codeSamples: - lang: cURL source: "curl -X GET \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n \"https://api.digitalocean.com/v2/reserved_ips/45.55.96.47\" " - lang: Go source: "import (\n \"context\"\n \"os\"\n\n \"github.com/digitalocean/godo\"\n)\n\nfunc main() {\n token := os.Getenv(\"DIGITALOCEAN_TOKEN\")\n\n client := godo.NewFromToken(token)\n ctx := context.TODO()\n\n reservedIP, _, err := client.ReservedIPs.Get(ctx, \"45.55.96.47\")\n}" - lang: Ruby source: 'require ''droplet_kit'' token = ENV[''DIGITALOCEAN_TOKEN''] client = DropletKit::Client.new(access_token: token) client.reserved_ips.find(ip: ''45.55.96.47'')' - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) resp = client.reserved_ips.get(reserved_ip="45.55.96.47")' security: - bearer_auth: - reserved_ip:read delete: operationId: reservedIPs_delete summary: Delete a Reserved IP description: 'To delete a reserved IP and remove it from your account, send a DELETE request to `/v2/reserved_ips/$RESERVED_IP_ADDR`. A successful request will receive a 204 status code with no body in response. This indicates that the request was processed successfully. ' tags: - Reserved IPs parameters: - $ref: '#/components/parameters/reserved_ip' responses: '204': $ref: '#/components/responses/no_content' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found' '429': $ref: '#/components/responses/too_many_requests' '500': $ref: '#/components/responses/server_error' default: $ref: '#/components/responses/unexpected_error' x-codeSamples: - lang: cURL source: "curl -X DELETE \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n \"https://api.digitalocean.com/v2/reserved_ips/45.55.96.47\"" - lang: Go source: "import (\n \"context\"\n \"os\"\n\n \"github.com/digitalocean/godo\"\n)\n\nfunc main() {\n token := os.Getenv(\"DIGITALOCEAN_TOKEN\")\n\n client := godo.NewFromToken(token)\n ctx := context.TODO()\n\n _, err := client.ReservedIPs.Delete(ctx, \"45.55.96.34\")\n}" - lang: Ruby source: 'require ''droplet_kit'' token = ENV[''DIGITALOCEAN_TOKEN''] client = DropletKit::Client.new(access_token: token) client.reserved_ips.delete(ip: ''45.55.96.47'') ' - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) resp = client.reserved_ips.delete(reserved_ip="45.55.96.47")' security: - bearer_auth: - reserved_ip:delete components: schemas: size: type: object properties: slug: type: string example: s-1vcpu-1gb description: A human-readable string that is used to uniquely identify each size. memory: type: integer multipleOf: 8 minimum: 8 example: 1024 description: The amount of RAM allocated to Droplets created of this size. The value is represented in megabytes. vcpus: type: integer example: 1 description: The number of CPUs allocated to Droplets of this size. disk: type: integer example: 25 description: The amount of disk space set aside for Droplets of this size. The value is represented in gigabytes. transfer: type: number format: float example: 1 description: 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: type: number format: float example: 5 description: 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: type: number format: float example: 0.00743999984115362 description: This describes the price of the Droplet size as measured hourly. The value is measured in US dollars. regions: type: array items: type: string example: - ams2 - ams3 - blr1 - fra1 - lon1 - nyc1 - nyc2 - nyc3 - sfo1 - sfo2 - sfo3 - sgp1 - tor1 description: An array containing the region slugs where this size is available for Droplet creates. available: type: boolean default: true example: true description: This is a boolean value that represents whether new Droplets can be created with this size. description: type: string example: Basic description: '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: type: array description: An array of objects containing information about the disks available to Droplets created with this size. items: $ref: '#/components/schemas/disk_info' gpu_info: $ref: '#/components/schemas/gpu_info' required: - available - disk - memory - price_hourly - price_monthly - regions - slug - transfer - vcpus - description distribution: type: string description: 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. enum: - Arch Linux - CentOS - CoreOS - Debian - Fedora - Fedora Atomic - FreeBSD - Gentoo - openSUSE - RancherOS - Rocky Linux - Ubuntu - Unknown example: Ubuntu regions_array: type: array items: $ref: '#/components/schemas/region_slug' description: This attribute is an array of the regions that the image is available in. The regions are represented by their identifying slug values. example: - nyc1 - nyc2 network_v6: type: object properties: ip_address: type: string format: ipv6 example: 2604:a880:0:1010::18a:a001 description: The IP address of the IPv6 network interface. netmask: type: integer example: 64 description: The netmask of the IPv6 network interface. gateway: type: string format: ipv6 example: 2604:a880:0:1010::1 description: The gateway of the specified IPv6 network interface. type: type: string enum: - public example: public description: 'The type of the IPv6 network interface. **Note**: IPv6 private networking is not currently supported. ' link_to_prev_page: type: object properties: prev: description: URI of the previous page of the results. type: string example: https://api.digitalocean.com/v2/images?page=1 link_to_last_page: type: object properties: last: description: URI of the last page of the results. type: string example: https://api.digitalocean.com/v2/images?page=2 page_links: type: object properties: pages: anyOf: - $ref: '#/components/schemas/forward_links' - $ref: '#/components/schemas/backward_links' - {} example: pages: first: https://api.digitalocean.com/v2/account/keys?page=1 prev: https://api.digitalocean.com/v2/account/keys?page=2 gpu_info: type: object description: An object containing information about the GPU capabilities of Droplets created with this size. properties: count: type: integer description: The number of GPUs allocated to the Droplet. example: 1 model: type: string description: The model of the GPU. example: nvidia_h100 vram: type: object properties: amount: type: integer description: The amount of VRAM allocated to the GPU. example: 25 unit: type: string description: The unit of measure for the VRAM. example: gib region_slug: type: string description: The slug identifier for the region where the resource will initially be available. enum: - ams1 - ams2 - ams3 - blr1 - fra1 - lon1 - nyc1 - nyc2 - nyc3 - sfo1 - sfo2 - sfo3 - sgp1 - tor1 - syd1 example: nyc3 reserved_ip: type: object properties: ip: type: string format: ipv4 example: 45.55.96.47 description: The public IP address of the reserved IP. It also serves as its identifier. region: allOf: - $ref: '#/components/schemas/region' - type: object description: The region that the reserved IP is reserved to. When you query a reserved IP, the entire region object will be returned. droplet: description: The Droplet that the reserved IP has been assigned to. When you query a reserved 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. anyOf: - title: 'null' type: object nullable: true description: If the reserved IP is not assigned to a Droplet, the value will be null. - $ref: '#/components/schemas/droplet' example: null locked: type: boolean example: true description: A boolean value indicating whether or not the reserved IP has pending actions preventing new ones from being submitted. project_id: type: string format: uuid example: 746c6152-2fa2-11ed-92d3-27aaa54e4988 description: The UUID of the project to which the reserved IP currently belongs. forward_links: allOf: - $ref: '#/components/schemas/link_to_last_page' - $ref: '#/components/schemas/link_to_next_page' image_description: type: string description: An optional free-form text field to describe an image. example: ' ' region: type: object properties: name: type: string description: The display name of the region. This will be a full name that is used in the control panel and other interfaces. example: New York 3 slug: type: string description: A human-readable string that is used as a unique identifier for each region. example: nyc3 features: items: type: string description: This attribute is set to an array which contains features available in this region example: - private_networking - backups - ipv6 - metadata - install_agent - storage - image_transfer available: type: boolean description: This is a boolean value that represents whether new Droplets can be created in this region. example: true sizes: items: type: string description: This attribute is set to an array which contains the identifying slugs for the sizes available in this region. example: - 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 required: - available - features - name - sizes - slug pagination: type: object properties: links: $ref: '#/components/schemas/page_links' link_to_first_page: type: object properties: first: description: URI of the first page of the results. type: string example: https://api.digitalocean.com/v2/images?page=1 error: type: object properties: id: description: 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." type: string example: not_found message: description: A message providing additional information about the error, including details to help resolve it when possible. type: string example: The resource you were accessing could not be found. request_id: description: Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue. type: string example: 4d9d8375-3c56-4925-a3e7-eb137fed17e9 required: - id - message backward_links: allOf: - $ref: '#/components/schemas/link_to_first_page' - $ref: '#/components/schemas/link_to_prev_page' disk_info: type: object properties: type: type: string enum: - local - scratch description: The type of disk. All Droplets contain a `local` disk. Additionally, GPU Droplets can also have a `scratch` disk for non-persistent data. example: local size: type: object properties: amount: type: integer description: The amount of space allocated to the disk. example: 25 unit: type: string description: The unit of measure for the disk size. example: gib action_link: type: object description: The linked actions can be used to check the status of a Droplet's create event. properties: id: type: integer example: 7515 description: A unique numeric ID that can be used to identify and reference an action. rel: type: string example: create description: A string specifying the type of the related action. href: type: string format: uri example: https://api.digitalocean.com/v2/actions/7515 description: A URL that can be used to access the action. image_name: type: string description: 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. example: Nifty New Snapshot meta_properties: type: object description: Information about the response itself. properties: total: description: Number of objects returned by the request. type: integer example: 1 kernel: type: object description: '**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. ' nullable: true deprecated: true properties: id: type: integer example: 7515 description: A unique number used to identify and reference a specific kernel. name: type: string example: DigitalOcean GrubLoader v0.2 (20160714) description: 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: type: string example: 2016.07.13-DigitalOcean_loader_Ubuntu description: A standard kernel version string representing the version, patch, and release information. meta: type: object properties: meta: allOf: - $ref: '#/components/schemas/meta_properties' - required: - total required: - meta droplet_next_backup_window: type: object nullable: true properties: start: type: string format: date-time example: '2019-12-04T00:00:00Z' description: A time value given in ISO8601 combined date and time format specifying the start of the Droplet's backup window. end: type: string format: date-time example: '2019-12-04T23:00:00Z' description: A time value given in ISO8601 combined date and time format specifying the end of the Droplet's backup window. droplet: type: object properties: id: type: integer example: 3164444 description: A unique identifier for each Droplet instance. This is automatically generated upon Droplet creation. name: type: string example: example.com description: The human-readable name set for the Droplet instance. memory: type: integer multipleOf: 8 example: 1024 description: Memory of the Droplet in megabytes. vcpus: type: integer example: 1 description: The number of virtual CPUs. disk: type: integer example: 25 description: The size of the Droplet's disk in gigabytes. disk_info: type: array description: An array of objects containing information about the disks available to the Droplet. items: $ref: '#/components/schemas/disk_info' locked: type: boolean example: false description: A boolean value indicating whether the Droplet has been locked, preventing actions by users. status: type: string enum: - new - active - 'off' - archive example: active description: A status string indicating the state of the Droplet instance. This may be "new", "active", "off", or "archive". kernel: $ref: '#/components/schemas/kernel' created_at: type: string format: date-time example: '2020-07-21T18:37:44Z' description: A time value given in ISO8601 combined date and time format that represents when the Droplet was created. features: type: array items: type: string example: - backups - private_networking - ipv6 description: An array of features enabled on this Droplet. backup_ids: type: array items: type: integer example: - 53893572 description: 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. next_backup_window: allOf: - $ref: '#/components/schemas/droplet_next_backup_window' - description: 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. snapshot_ids: type: array items: type: integer example: - 67512819 description: An array of snapshot IDs of any snapshots created from the Droplet instance. image: $ref: '#/components/schemas/image' volume_ids: type: array items: type: string example: - 506f78a4-e098-11e5-ad9f-000f53306ae1 description: A flat array including the unique identifier for each Block Storage volume attached to the Droplet. size: $ref: '#/components/schemas/size' size_slug: type: string example: s-1vcpu-1gb description: The unique slug identifier for the size of this Droplet. networks: type: object description: 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. properties: v4: type: array items: $ref: '#/components/schemas/network_v4' v6: type: array items: $ref: '#/components/schemas/network_v6' region: $ref: '#/components/schemas/region' tags: type: array items: type: string example: - web - env:prod description: An array of Tags the Droplet has been tagged with. vpc_uuid: type: string example: 760e09ef-dc84-11e8-981e-3cfdfeaae000 description: A string specifying the UUID of the VPC to which the Droplet is assigned. gpu_info: $ref: '#/components/schemas/gpu_info' required: - id - name - memory - vcpus - disk - locked - status - created_at - features - backup_ids - next_backup_window - snapshot_ids - image - volume_ids - size - size_slug - networks - region - tags image: type: object properties: id: type: integer description: A unique number that can be used to identify and reference a specific image. example: 7555620 readOnly: true name: $ref: '#/components/schemas/image_name' type: type: string description: 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). enum: - base - snapshot - backup - custom - admin example: snapshot distribution: $ref: '#/components/schemas/distribution' slug: type: string nullable: true description: 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. example: nifty1 public: type: boolean description: 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. example: true regions: $ref: '#/components/schemas/regions_array' created_at: type: string format: date-time description: A time value given in ISO8601 combined date and time format that represents when the image was created. example: '2020-05-04T22:23:02Z' min_disk_size: type: integer description: The minimum disk size in GB required for a Droplet to use this image. example: 20 nullable: true minimum: 0 size_gigabytes: type: number format: float nullable: true description: The size of the image in gigabytes. example: 2.34 description: $ref: '#/components/schemas/image_description' tags: $ref: '#/components/schemas/tags_array' status: type: string description: "A status string indicating the state of a custom image. This may be `NEW`,\n `available`, `pending`, `deleted`, or `retired`." enum: - NEW - available - pending - deleted - retired example: NEW error_message: type: string description: "A string containing information about errors that may occur when importing\n a custom image." example: ' ' link_to_next_page: type: object properties: next: description: URI of the next page of the results. type: string example: https://api.digitalocean.com/v2/images?page=2 reserved_ip_create: oneOf: - title: Assign to Droplet type: object properties: droplet_id: type: integer example: 2457247 description: The ID of the Droplet that the reserved IP will be assigned to. required: - droplet_id - title: Reserve to Region type: object properties: region: type: string example: nyc3 description: The slug identifier for the region the reserved IP will be reserved to. project_id: type: string format: uuid example: 746c6152-2fa2-11ed-92d3-27aaa54e4988 description: The UUID of the project to which the reserved IP will be assigned. required: - region tags_array: type: array items: type: string nullable: true description: A flat array of tag names as strings to be applied to the resource. Tag names may be for either existing or new tags. example: - base-image - prod network_v4: type: object properties: ip_address: type: string format: ipv4 example: 104.236.32.182 description: The IP address of the IPv4 network interface. netmask: type: string format: ipv4 example: 255.255.192.0 description: The netmask of the IPv4 network interface. gateway: type: string example: 104.236.0.1 description: '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: type: string enum: - public - private example: public description: The type of the IPv4 network interface. examples: reserved_ip_assigning: summary: Assigning to Droplet value: reserved_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 reserved_ip_reserved: summary: Reserved to Region value: reserved_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: false project_id: 746c6152-2fa2-11ed-92d3-27aaa54e4988 reserved_ip_assigned: summary: Assigned to Droplet value: reserved_ip: ip: 45.55.96.47 droplet: id: 3164444 name: example.com memory: 1024 vcpus: 1 disk: 25 locked: false status: active kernel: null created_at: '2020-07-21T18:37:44Z' features: - backups - private_networking - ipv6 backup_ids: - 53893572 next_backup_window: start: '2020-07-30T00:00:00Z' end: '2020-07-30T23:00:00Z' snapshot_ids: - 67512819 image: id: 63663980 name: 20.04 (LTS) x64 type: base distribution: Ubuntu slug: ubuntu-20-04-x64 public: true regions: - ams2 - ams3 - blr1 - fra1 - lon1 - nyc1 - nyc2 - nyc3 - sfo1 - sfo2 - sfo3 - sgp1 - tor1 created_at: '2020-05-15T05:47:50Z' min_disk_size: 20 size_gigabytes: 2.36 description: '' tags: [] status: available error_message: '' volume_ids: [] size: slug: s-1vcpu-1gb memory: 1024 vcpus: 1 disk: 25 transfer: 1 price_monthly: 5 price_hourly: 0.00743999984115362 regions: - ams2 - ams3 - blr1 - fra1 - lon1 - nyc1 - nyc2 - nyc3 - sfo1 - sfo2 - sfo3 - sgp1 - tor1 available: true description: Basic size_slug: s-1vcpu-1gb networks: v4: - ip_address: 10.128.192.124 netmask: 255.255.0.0 gateway: nil type: private - ip_address: 192.241.165.154 netmask: 255.255.255.0 gateway: 192.241.165.1 type: public v6: - ip_address: 2604:a880:0:1010::18a:a001 netmask: 64 gateway: 2604:a880:0:1010::1 type: public region: name: New York 3 slug: nyc3 features: - 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 tags: - web - env:prod vpc_uuid: 760e09ef-dc84-11e8-981e-3cfdfeaae000 region: name: New York 3 slug: nyc3 features: - 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: false project_id: 746c6152-2fa2-11ed-92d3-27aaa54e4988 reserved_ip_reserving: summary: Reserving to Region value: reserved_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: false project_id: 746c6152-2fa2-11ed-92d3-27aaa54e4988 links: {} responses: no_content: description: The action was successful and the response body is empty. headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' ratelimit-remaining: $ref: '#/components/headers/ratelimit-remaining' ratelimit-reset: $ref: '#/components/headers/ratelimit-reset' reserved_ip: description: The response will be a JSON object with a key called `reserved_ip`. The value of this will be an object that contains the standard attributes associated with a reserved IP. headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' ratelimit-remaining: $ref: '#/components/headers/ratelimit-remaining' ratelimit-reset: $ref: '#/components/headers/ratelimit-reset' content: application/json: schema: type: object properties: reserved_ip: $ref: '#/components/schemas/reserved_ip' examples: reserved_ip_assigned: $ref: '#/components/examples/reserved_ip_assigned' reserved_ip_reserved: $ref: '#/components/examples/reserved_ip_reserved' server_error: description: Server error. headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' ratelimit-remaining: $ref: '#/components/headers/ratelimit-remaining' ratelimit-reset: $ref: '#/components/headers/ratelimit-reset' content: application/json: schema: $ref: '#/components/schemas/error' example: id: server_error message: Unexpected server-side error unauthorized: description: Unauthorized headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' ratelimit-remaining: $ref: '#/components/headers/ratelimit-remaining' ratelimit-reset: $ref: '#/components/headers/ratelimit-reset' content: application/json: schema: $ref: '#/components/schemas/error' example: id: unauthorized message: Unable to authenticate you. not_found: description: The resource was not found. headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' ratelimit-remaining: $ref: '#/components/headers/ratelimit-remaining' ratelimit-reset: $ref: '#/components/headers/ratelimit-reset' content: application/json: schema: $ref: '#/components/schemas/error' example: id: not_found message: The resource you requested could not be found. reserved_ip_created: description: 'The response will be a JSON object with a key called `reserved_ip`. The value of this will be an object that contains the standard attributes associated with a reserved IP. When assigning a reserved 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.' headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' ratelimit-remaining: $ref: '#/components/headers/ratelimit-remaining' ratelimit-reset: $ref: '#/components/headers/ratelimit-reset' content: application/json: schema: type: object properties: reserved_ip: $ref: '#/components/schemas/reserved_ip' links: type: object properties: droplets: type: array items: $ref: '#/components/schemas/action_link' actions: type: array items: $ref: '#/components/schemas/action_link' examples: reserved_ip_assigning: $ref: '#/components/examples/reserved_ip_assigning' reserved_ip_reserving: $ref: '#/components/examples/reserved_ip_reserving' reserved_ip_list: description: The response will be a JSON object with a key called `reserved_ips`. This will be set to an array of reserved IP objects, each of which will contain the standard reserved IP attributes headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' ratelimit-remaining: $ref: '#/components/headers/ratelimit-remaining' ratelimit-reset: $ref: '#/components/headers/ratelimit-reset' content: application/json: schema: allOf: - type: object properties: reserved_ips: type: array items: $ref: '#/components/schemas/reserved_ip' - $ref: '#/components/schemas/pagination' - $ref: '#/components/schemas/meta' example: reserved_ips: - 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: false project_id: 746c6152-2fa2-11ed-92d3-27aaa54e4988 links: {} meta: total: 1 too_many_requests: description: API Rate limit exceeded headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' ratelimit-remaining: $ref: '#/components/headers/ratelimit-remaining' ratelimit-reset: $ref: '#/components/headers/ratelimit-reset' content: application/json: schema: $ref: '#/components/schemas/error' example: id: too_many_requests message: API Rate limit exceeded. unexpected_error: description: Unexpected error headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' ratelimit-remaining: $ref: '#/components/headers/ratelimit-remaining' ratelimit-reset: $ref: '#/components/headers/ratelimit-reset' content: application/json: schema: $ref: '#/components/schemas/error' example: id: example_error message: some error message headers: ratelimit-limit: schema: type: integer example: 5000 description: 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-reset: schema: type: integer example: 1444931833 description: The time when the oldest request will expire. The value is given in Unix epoch time. See https://developers.digitalocean.com/documentation/v2/#rate-limit for information about how requests expire. ratelimit-remaining: schema: type: integer example: 4816 description: The number of requests in your hourly quota that remain before you hit your request limit. See https://developers.digitalocean.com/documentation/v2/#rate-limit for information about how requests expire. parameters: per_page: in: query name: per_page required: false description: Number of items returned per page schema: type: integer minimum: 1 default: 20 maximum: 200 example: 2 reserved_ip: in: path name: reserved_ip description: A reserved IP address. required: true schema: type: string format: ipv4 minimum: 1 example: 45.55.96.47 page: in: query name: page required: false description: Which 'page' of paginated results to return. schema: type: integer minimum: 1 default: 1 example: 1 securitySchemes: bearer_auth: type: http scheme: bearer description: '## 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](https://cloud.digitalocean.com/account/api/tokens) 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 panel - `doo_v1_` for tokens generated by applications using [the OAuth flow](https://docs.digitalocean.com/reference/api/oauth-api/) - `dor_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 | `:read` | | POST | Create | `:create` | | PUT/PATCH | Update | `:update` | | DELETE | Delete | `: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" ``` '