---
title: "Create preview deploy key"
method: POST
path: "/projects/{project_id}/create_preview_deploy_key"
tags: ["Deploy Keys"]
---

# Create preview deploy key

`POST /projects/{project_id}/create_preview_deploy_key`

Create a preview deploy key like "preview:team-slug:project-slug|ey..."
which can be used with the Convex CLI to create and manage preview
deployments within the project.

When access to the project is granted through an OAuth token this preview
deploy key will use the same OAuth-granted token.

When access to the project is granted any other way a new token scoped to
preview deployments in this project will be created.

## Path parameters

- `project_id` integer, required

## Request body

- PlatformCreatePreviewDeployKeyArgs
  - `name` string, required — Name for the preview deploy key.
  - `expiresAt` integer, nullable — Timestamp in milliseconds when this preview deploy key will expire. Must be at least 30 minutes in the future.

## Response `200`

- PlatformCreatePreviewDeployKeyResponse
  - `previewDeployKey` string, required — Encrypted admin key

---

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