---
title: "Get or create a drive"
method: POST
path: "/v2/sandboxes/drives/{name}"
tags: ["sandboxes"]
---

# Get or create a drive

`POST /v2/sandboxes/drives/{name}`

Gets an existing drive by project and name, or creates it when it does not exist. Drives are in private beta. Register your interest to get access: https://vercel.com/changelog/drives-for-vercel-sandbox-in-private-beta

## Path parameters

- `name` string, required — Name for the drive. Must be unique per project and URL-safe (alphanumeric, hyphens, underscores).

## Query parameters

- `teamId` string
- `slug` string

## Request body

- object
  - `projectId` string — The project ID or name to associate the drive with. Required unless using a Vercel OIDC token scoped to a project.
  - `maxSizeBytes` integer — Maximum drive size in bytes. Defaults to 100 GiB when omitted.

## Response `200`

- object
  - `drive` Drive, required — This object contains information related to a Vercel Sandbox Drive.
    - `name` string, required — The unique drive name within the project.
    - `projectId` string, required — The project that owns the drive.
    - `maxSizeBytes` number, required — The maximum drive size in bytes.
    - `currentSessionId` string — Current session ID the drive is attached to, if any.
    - `currentSandboxName` string — Current sandbox name the drive is attached to, if any.
    - `createdAt` number, required — The time when the drive was created, in milliseconds since the epoch.
    - `updatedAt` number, required — The last time the drive was updated, in milliseconds since the epoch.

## Other responses

- `201`
- `400` — One of the provided values in the request body is invalid. One of the provided values in the request query is invalid.
- `401` — The request is not authorized.
- `402` — The account is missing a payment so payment method must be updated
- `403` — You do not have permission to access this resource.
- `404`
- `409`
- `410`
- `429`

---

[API](https://skmtc.net/vercel/apis/api.md) · [All operations](https://skmtc.net/vercel/apis/api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/vercel/api/versions/b4d86a3e3479/schema)
