Skip to main content
POST
/
storage
/
volumes
Go (SDK)
package main

import(
	"context"
	"os"
	latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
	"github.com/latitudesh/latitudesh-go-sdk/models/operations"
	"log"
)

func main() {
    ctx := context.Background()

    s := latitudeshgosdk.New(
        latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
    )

    res, err := s.Storage.PostStorageVolumes(ctx, operations.PostStorageVolumesStorageRequestBody{
        Data: operations.PostStorageVolumesStorageData{
            Type: operations.PostStorageVolumesStorageTypeVolumes,
            Attributes: operations.PostStorageVolumesStorageAttributes{
                Project: "proj_8NkvdyPXOeLpx",
                Name: "my-data",
            },
        },
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}
{
  "data": {
    "id": "vol_Av9BVDavORm1W",
    "type": "volumes",
    "attributes": {
      "name": "Incredible Linen Chair",
      "size_in_gb": 1500,
      "created_at": "2025-10-03T18:09:37.000Z",
      "namespace_id": null,
      "connector_id": null,
      "initiators": null,
      "project": {
        "id": "proj_8NkvdyPXOeLpx",
        "name": "Small Concrete Bag",
        "slug": "small-concrete-bag",
        "description": "Enormous Iron Shoes",
        "billing_type": "Normal",
        "billing_method": "Normal",
        "bandwidth_alert": false,
        "environment": null,
        "billing": {
          "subscription_id": null,
          "type": "Normal",
          "method": "Normal"
        },
        "stats": {
          "databases": 0,
          "ip_addresses": 0,
          "prefixes": 0,
          "servers": 0,
          "storages": 1,
          "virtual_machines": 0,
          "vlans": 0
        }
      },
      "team": {
        "id": "team_mPzlevJWQotr05vlaQ6mu9XaWvK",
        "name": "578 Team",
        "slug": "578-team",
        "description": "578 Team",
        "address": "Suite 629 420 Lindgren Square, Mahaven, KY 74726",
        "status": "verified",
        "currency": {
          "id": "cur_AW6Q2D9lqKLpr",
          "code": "BRL",
          "name": "Brazilian Real",
          "currency_id": null
        }
      }
    }
  }
}

Authorizations

Authorization
string
header
required

Body

data
object
required

Response

201 - application/vnd.api+json

Created

data
object
I