---
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}`

## Request

- Base URL: `https://api.vercel.com`
- URL: `https://api.vercel.com/v2/sandboxes/drives/{name}`
- Auth: HTTP bearer

Gets an existing drive by project and name, or creates it when it does not exist.

## 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. Must be a multiple of 4096 bytes. Defaults to 1 TiB when omitted (1 GiB for Hobby). The maximum quota is 16 TiB. Request a quota above 16 TiB at https://vercel.com/help.
  - `region` 'iad1' | 'sfo1' | 'cle1' | 'cdg1' | 'fra1' | 'arn1' | 'sin1' | 'pdx1' | 'lhr1' | 'icn1' | 'bom1' | 'cpt1' | 'dub1' | 'gru1' | 'hkg1' | 'syd1' | 'yul1' | 'hnd1' | 'kix1': Region where the drive is stored. Defaults to iad1.

## Response `200`

- object
  - `drive` Drive, required: This object contains information related to a Vercel Sandbox Drive.
    - `createdAt` number, required: The time when the drive was created, in milliseconds since the epoch.
    - `currentSandboxName` string: Current sandbox name the drive is attached to, if any.
    - `currentSessionId` string: Current session ID the drive is attached to, if any.
    - `id` string, required: The unique drive ID.
    - `maxSizeBytes` number, required: The maximum drive size in bytes.
    - `name` string, required: The unique drive name within the project.
    - `parentDriveId` string: The ID of the source drive when this drive is a fork.
    - `projectId` string, required: The project that owns the drive.
    - `region` string, required: The region where the drive is stored.
    - `rootDriveId` string: The ID of the original drive at the root of this fork.
    - `updatedAt` number, required: The last time the drive was updated, in milliseconds since the epoch.
    - `workloadType` 'sandbox' | 'v0': The workload type of this drive.

## 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`
- `422`
- `429`
- `503`

## Changes

- **2026-10-26** `60805ed942bc`: 1 info
  - added the non-success response with the status `503`
- **2026-10-26** `01d3fe4ea5c3`: 2 warning, 2 info
  - removed the optional property `drive/v0` from the response with the `200` status
  - removed the optional property `drive/v0` from the response with the `201` status
  - added the optional property `drive/workloadType` to the response with the `200` status
  - added the optional property `drive/workloadType` to the response with the `201` status
- **2026-10-24** `4a06e85c2848`: 1 info
  - added the non-success response with the status `422`
- **2026-10-08** `b426de1e3932`: 4 info
  - added the optional property `drive/parentDriveId` to the response with the `200` status
  - added the optional property `drive/parentDriveId` to the response with the `201` status
  - added the optional property `drive/rootDriveId` to the response with the `200` status
  - added the optional property `drive/rootDriveId` to the response with the `201` status
- **2026-10-01** `9958fd10bb05`: 2 info
  - added the optional property `drive/v0` to the response with the `200` status
  - added the optional property `drive/v0` to the response with the `201` status

[Operation history](https://skmtc.dev/vercel/apis/vercel-api/changes/v2/sandboxes/drives/:name/post.md)

---

[API](https://skmtc.dev/vercel/apis/vercel-api.md) - [All operations](https://skmtc.dev/vercel/apis/vercel-api/llms.txt) - [OpenAPI document](https://skmtc.dev/vercel/apis/vercel-api/revisions/60686c0e1f6a?raw)
