dots.v2.droplets.backups.policies.get()

Generated on 5 Nov 2026 from DoTs version v1.23.0

Usage

client.v2.droplets.backups.policies.get(requestConfiguration?: RequestConfiguration<PoliciesRequestBuilderGetQueryParameters>): Promise<undefined | PoliciesGetResponse>

Description

To list information about the backup policies for all Droplets in the account, send a GET request to /v2/droplets/backups/policies.

Parameters

perPage integer optional

Example: 2

Number of items returned per page

Default: 20

Min: 1

Max: 200

page integer optional

Example: 1

Which 'page' of paginated results to return.

Default: 1

Min: 1

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);

const response = await client.v2.droplets.backups.policies.get();

Pagination

This method returns paginated results. The response includes a links.pages object with URLs for navigating between pages. To retrieve the next page, parse the next URL and pass the page query parameter:

let response = await client.v2.droplets.backups.policies.get();
let pages = response?.links?.pages;

while (pages && "next" in pages && typeof pages.next === "string") {
    const page = Number(new URL(pages.next).searchParams.get("page"));
    response = await client.v2.droplets.backups.policies.get({
        queryParameters: {
            page,
        },
    });
    pages = response?.links?.pages;
}

Response Example

Show Response Example
{
  "policies": {
    "436444618": {
      "droplet_id": 436444618,
      "backup_enabled": false
    },
    "444909314": {
      "droplet_id": 444909314,
      "backup_enabled": true,
      "backup_policy": {
        "plan": "daily",
        "hour": 20,
        "window_length_hours": 4,
        "retention_period_days": 7
      },
      "next_backup_window": {
        "start": "2024-09-13T20:00:00Z",
        "end": "2024-09-14T00:00:00Z"
      }
    },
    "444909706": {
      "droplet_id": 444909706,
      "backup_enabled": true,
      "backup_policy": {
        "plan": "weekly",
        "weekday": "SUN",
        "hour": 20,
        "window_length_hours": 4,
        "retention_period_days": 28
      },
      "next_backup_window": {
        "start": "2024-09-15T20:00:00Z",
        "end": "2024-09-16T00:00:00Z"
      }
    }
  },
  "links": {},
  "meta": {
    "total": 3
  }
}

More Information

See /v2/droplets/backups/policies 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.