---
title: "Create deployment"
method: POST
path: "/projects/{project_id}/create_deployment"
tags: ["Deployments"]
---

# Create deployment

`POST /projects/{project_id}/create_deployment`

Create a new deployment for a project.

## Path parameters

- `project_id` integer, required

## Request body

- PlatformCreateDeploymentArgs
  - `type` 'dev' | 'prod' | 'preview' | 'custom', required
  - `class` string, nullable — The class to use for this deployment. If not provided, the default deployment class for your team will be used.
  - `region` 'aws-us-east-1' | 'aws-eu-west-1'
  - `reference` string, nullable — An identifier that uniquely identifies this deployment within the project. By providing a reference, you can create multiple dev and prod deployments in the project. If you don’t provide a reference, the endpoint will create the default production deployment for the project, or the default development deployment for the member that creates it (i.e. the deployment used by default when running `npx convex deploy` or `npx convex dev` respectively). When not providing a reference, a reference will be automatically generated.
  - `isDefault` boolean, nullable — When creating a prod deployment, whether the deployment is the default production deployment for the project (i.e. the one used by default when running `npx convex deploy`). When creating a dev deployment, whether the deployment is the default development deployment for the member that creates it (i.e. the one used by default when running `npx convex dev`). This option can’t be set on other types of deployments. If not provided, defaults to `true` when creating a dev or prod deployment without providing a reference (and defaults to `false` otherwise).
  - `expiresAt` integer, nullable — Timestamp in milliseconds when this deployment will be deleted. Preview deployments have this set by default unless overridden. Must be at least 30 minutes in the future and cannot exceed the team’s preview deployment retention days entitlement from now. Set to `null` to clear the expiration.

## Response `200`

- union
  - object
    - `id` integer, required
    - `name` string, required — The readable identifier for this deployment, something like playful-otter-123.
    - `createTime` integer, required — Timestamp in milliseconds when this deployment was created.
    - `lastDeployTime` integer, nullable — Timestamp in milliseconds of the last deploy to this deployment, if any.
    - `deploymentType` 'dev' | 'prod' | 'preview' | 'custom', required
    - `projectId` integer, required
    - `creator` integer
    - `previewIdentifier` string
    - `region` 'aws-us-east-1' | 'aws-eu-west-1', required
    - `isDefault` boolean, required — Indicates whether the deployment is the default prod deployment for the project, or the default cloud dev deployment for the member in the project.
    - `reference` string, required — An identifier that uniquely identifies this deployment within the project.
    - `dashboardEditConfirmation` boolean, nullable — Controls whether the dashboard requires a confirmation before allowing edits during a browser session for this deployment. If not set, defaults to true for prod deployments and false for dev and preview deployments.
    - `deploymentUrl` string, required — The full backend URL for this deployment (e.g. "https://joyful-capybara-123.convex.cloud" or "https://calm-cow-456.eu-west-1.convex.cloud"). This is always a `.convex.cloud` URL, even when the deployment is using custom domains. To get the canonical URL, use [`/get_canonical_urls`](https://docs.convex.dev/deployment-api/get-canonical-urls).
    - `expiresAt` integer, nullable — Timestamp in milliseconds when this deployment will be deleted. Preview deployments have this set by default unless overridden.
    - `class` string, required — The deployment class for this deployment.
    - `sendLogsToClient` boolean, nullable — Whether to send function logs to the client. If `null`, the deployment-type default is used (true for dev/preview, false for prod).
    - `kind` 'cloud', required
  - object
    - `name` string, required — The readable identifier for this deployment.
    - `createTime` integer, required — Timestamp in milliseconds when this deployment was created.
    - `deploymentType` 'dev' | 'prod' | 'preview' | 'custom', required
    - `projectId` integer, required
    - `creator` integer, required
    - `previewIdentifier` string
    - `port` integer, required — The port where this local deployment is running.
    - `deviceName` string, required
    - `isActive` boolean, required — Whether this local deployment is currently active.
    - `kind` 'local', required

---

[API](https://skmtc.dev/convex/apis/convex-management-api.md) · [All operations](https://skmtc.dev/convex/apis/convex-management-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/convex/convex-management-api/revisions/3dd5e601c536/schema)
