godo.Droplets.CreateMultiple()

Generated on 5 Nov 2026 from godo version v1.236.0

Usage

client.Droplets.CreateMultiple(ctx context.Context, createRequest *godo.DropletMultiCreateRequest) ([]godo.Droplet, *godo.Response, error)

Description

CreateMultiple creates multiple Droplets.

This method sends a POST request to /v2/droplets.

Parameters

createRequest *godo.DropletMultiCreateRequest required

Fields of godo.DropletMultiCreateRequest

DropletMultiCreateRequest is a request to create multiple Droplets.

Names []string

JSON key: names

Region string

JSON key: region

Size string

JSON key: size

Image godo.DropletCreateImage

JSON key: image

SSHKeys []godo.DropletCreateSSHKey

JSON key: ssh_keys

Backups bool

JSON key: backups

IPv6 bool

JSON key: ipv6

PrivateNetworking bool

JSON key: private_networking

Monitoring bool

JSON key: monitoring

UserData string

Omitted from JSON when empty. JSON key: user_data

Tags []string

JSON key: tags

VPCUUID string

Omitted from JSON when empty. JSON key: vpc_uuid

SubnetUUID string

Omitted from JSON when empty. JSON key: subnet_uuid

WithDropletAgent *bool

Omitted from JSON when empty. JSON key: with_droplet_agent

BackupPolicy *godo.DropletBackupPolicyRequest

Omitted from JSON when empty. JSON key: backup_policy

PublicNetworking *bool

Omitted from JSON when empty. JSON key: public_networking

GPUPartitionMode string

GPUPartitionMode selects the partition mode for the GPU Droplets. Omit or
leave empty for PARTITION_MODE_UNSET (full GPU). Use one of the
GPUPartitionMode* constants for supported values.

Omitted from JSON when empty. JSON key: gpu_partition_mode

Returns

[]godo.Droplet
*godo.Response

The HTTP response, with pagination Links, Meta, and Rate limit information.

error

Non-nil when the request fails. API errors are returned as *godo.ErrorResponse.

Fields of godo.Droplet

Droplet represents a DigitalOcean Droplet

ID int

Omitted from JSON when empty. JSON key: id

Name string

Omitted from JSON when empty. JSON key: name

Memory int

Omitted from JSON when empty. JSON key: memory

Vcpus int

Omitted from JSON when empty. JSON key: vcpus

Disk int

Omitted from JSON when empty. JSON key: disk

Region *godo.Region

Omitted from JSON when empty. JSON key: region

Image *godo.Image

Omitted from JSON when empty. JSON key: image

Size *godo.Size

Omitted from JSON when empty. JSON key: size

SizeSlug string

Omitted from JSON when empty. JSON key: size_slug

BackupIDs []int

Omitted from JSON when empty. JSON key: backup_ids

NextBackupWindow *godo.BackupWindow

Omitted from JSON when empty. JSON key: next_backup_window

SnapshotIDs []int

Omitted from JSON when empty. JSON key: snapshot_ids

Features []string

Omitted from JSON when empty. JSON key: features

Locked bool

Omitted from JSON when empty. JSON key: locked

Status string

Omitted from JSON when empty. JSON key: status

Networks *godo.Networks

Omitted from JSON when empty. JSON key: networks

Created string

Omitted from JSON when empty. JSON key: created_at

Kernel *godo.Kernel

Omitted from JSON when empty. JSON key: kernel

Tags []string

Omitted from JSON when empty. JSON key: tags

VolumeIDs []string

JSON key: volume_ids

VPCUUID string

Omitted from JSON when empty. JSON key: vpc_uuid

SubnetUUID string

Omitted from JSON when empty. JSON key: subnet_uuid

GPUPartitionMode string

GPUPartitionMode is echoed back on create when the Droplet was created
with a partitioned GPU. Note: read-back on droplet GET is not delivered in
v1, so this is only reliably populated on the create response.

Omitted from JSON when empty. JSON key: gpu_partition_mode

Request Sample

Show Request Sample
package main

import (
	"context"
	"fmt"
	"log"
	"os"

	"github.com/digitalocean/godo"
)

func main() {
	client := godo.NewFromToken(os.Getenv("DIGITALOCEAN_TOKEN"))
	ctx := context.TODO()

	result, _, err := client.Droplets.CreateMultiple(ctx, &godo.DropletMultiCreateRequest{
		Region: "<your-region>",
		Size: "<your-size>",
		Backups: true,
		IPv6: true,
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", result)
}

Response Example

Show Response Example
{
  "droplet": {
    "id": 3164444,
    "name": "example.com",
    "memory": 1024,
    "vcpus": 1,
    "disk": 25,
    "disk_info": [
      {
        "type": "local",
        "size": {
          "amount": 25,
          "unit": "gib"
        }
      }
    ],
    "locked": false,
    "status": "new",
    "kernel": null,
    "created_at": "2020-07-21T18:37:44Z",
    "features": [
      "backups",
      "private_networking",
      "ipv6",
      "monitoring"
    ],
    "backup_ids": [],
    "next_backup_window": null,
    "snapshot_ids": [],
    "image": {
      "id": 63663980,
      "name": "20.04 (LTS) x64",
      "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",
      "type": "snapshot",
      "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": [],
      "v6": []
    },
    "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"
      ]
    },
    "tags": [
      "web",
      "env:prod"
    ]
  },
  "links": {
    "actions": [
      {
        "id": 7515,
        "rel": "create",
        "href": "https://api.digitalocean.com/v2/actions/7515"
      }
    ]
  }
}

More Information

See POST /v2/droplets in the API reference for additional detail on responses, headers, parameters, and more.

See the Go package documentation for the source of this method.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.