dots.v2.droplets.byDroplet_id().destroy_with_associated_resources.selective.delete()

Generated on 5 Nov 2026 from DoTs version v1.23.0

Usage

client.v2.droplets.byDroplet_id(droplet_id).destroy_with_associated_resources.selective.delete(body: Selective_destroy_associated_resource, requestConfiguration?: RequestConfiguration<object>): Promise<void>

Description

To destroy a Droplet along with a sub-set of its associated resources, send a DELETE request to the /v2/droplets/{droplet_id}/destroy_with_associated_resources/selective endpoint. The JSON body of the request should include reserved_ips, snapshots, volumes, or volume_snapshots keys each set to an array of IDs for the associated resources to be destroyed. The IDs can be found by querying the Droplet’s associated resources. Any associated resource not included in the request will remain and continue to accrue changes on your account.

A successful response will include a 202 response code and no content. Use the status endpoint to check on the success or failure of the destruction of the individual resources.

Parameters

Path Parameters

droplet_id integer required

Example: 3164444

A unique identifier for a Droplet instance.

Min: 1

Request Body

floatingIps array of strings optional deprecated

Example: ["6186916"]

An array of unique identifiers for the floating IPs to be scheduled for deletion.

reservedIps array of strings optional

Example: ["6186916"]

An array of unique identifiers for the reserved IPs to be scheduled for deletion.

snapshots array of strings optional

Example: ["61486916"]

An array of unique identifiers for the snapshots to be scheduled for deletion.

volumes array of strings optional

Example: ["ba49449a-7435-11ea-b89e-0a58ac14480f"]

An array of unique identifiers for the volumes to be scheduled for deletion.

volumeSnapshots array of strings optional

Example: ["edb0478d-7436-11ea-86e6-0a58ac144b91"]

An array of unique identifiers for the volume snapshots to be scheduled for deletion.

Request Sample

Show Request Sample
import { FetchRequestAdapter } from "@microsoft/kiota-http-fetchlibrary";
import {
    createDigitalOceanClient,
    DigitalOceanApiKeyAuthenticationProvider,
} from "@digitalocean/dots";

const authProvider = new DigitalOceanApiKeyAuthenticationProvider(process.env.DIGITALOCEAN_TOKEN!);
const adapter = new FetchRequestAdapter(authProvider);
const client = createDigitalOceanClient(adapter);

await client.v2.droplets
    .byDroplet_id(3164444).destroy_with_associated_resources.selective.delete({
    floatingIps: [
        "6186916",
    ],
    reservedIps: [
        "6186916",
    ],
    snapshots: [
        "61486916",
    ],
    volumes: [
        "ba49449a-7435-11ea-b89e-0a58ac14480f",
    ],
    volumeSnapshots: [
        "edb0478d-7436-11ea-86e6-0a58ac144b91",
    ],
});

More Information

See /v2/droplets/{droplet_id}/destroy_with_associated_resources/selective in the API reference for additional detail on responses, headers, parameters, and more.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.