Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Accepted Answer
Hey @realmag777 👋
You’re almost there! The reason plan isn’t working is because it needs to be part of the backup_policy object, not a top-level field.
You can find that information in the API docs here:
https://docs.digitalocean.com/reference/api/digitalocean/#tag/Droplets/operation/droplets_create

Here’s how to update your code:
const droplet = await client.droplets.create({
name: domain,
region: 'ams3',
size: 's-1vcpu-1gb',
image: snapshot_id,
ssh_keys: [await this.get_ssh_key()],
backups: true,
backup_policy: {
plan: 'weekly',
weekday: 'SUN',
hour: 4
},
ipv6: false,
private_networking: true,
volumes: null,
tags: ['test'],
user_data
});
- Bobby
Heya, @realmag777
On top of what’s already mentioned, you can use the API to check the backup status like this:
const dropletInfo = await client.droplets.get(droplet.id); console.log(dropletInfo.backup_ids); // Will list backup IDs if enabled
Regards