---
title: "Generate upload URL"
method: POST
path: "/v2/deploy.generateUploadUrl"
tags: ["deploy"]
---

# Generate upload URL

`POST /v2/deploy.generateUploadUrl`

Generates a presigned S3 URL for uploading build context archives.

**Authentication**: Requires a valid root key with appropriate permissions.

## Request body

- V2DeployGenerateUploadUrlRequestBody
  - `projectId` string, required — Unkey project ID for which to generate the upload URL

## Response `200`

Upload URL generated successfully

- V2DeployGenerateUploadUrlResponseBody
  - `meta` Meta, required — Metadata object included in every API response. This provides context about the request and is essential for debugging, audit trails, and support inquiries. The `requestId` is particularly important when troubleshooting issues with the Unkey support team.
    - `requestId` string, required — A unique id for this request. Always include this ID when contacting support about a specific API request. This identifier allows Unkey's support team to trace the exact request through logs and diagnostic systems to provide faster assistance.
  - `data` V2DeployGenerateUploadUrlResponseData, required
    - `uploadUrl` string, required — Presigned PUT URL for uploading the build context tar file
    - `context` string, required — S3 path to use in the createDeployment request when building from source

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `404` — Not found
- `500` — Internal server error

## Changes

- **2026-01-14** `bdbbfa847a6f` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/unkeyed/apis/unkey-api/changes/v2/deploy.generateUploadUrl/post.md)

---

[API](https://skmtc.dev/unkeyed/apis/unkey-api.md) · [All operations](https://skmtc.dev/unkeyed/apis/unkey-api/llms.txt) · [OpenAPI document](https://skmtc.dev/unkeyed/apis/unkey-api/revisions/9a9c22b6dd09?raw)
