---
title: "Create a deploy target"
method: POST
path: "/projects/{projectId}/deploy-targets"
tags: ["Deploys"]
---

# Create a deploy target

`POST /projects/{projectId}/deploy-targets`

## Request

- Base URL: `https://api.grapesjs.com/v1`
- URL: `https://api.grapesjs.com/v1/projects/{projectId}/deploy-targets`
- Auth: HTTP bearer

Creates a reusable deployment destination for this project. Targets let a project use separate environments such as production and staging.

## Request body

- CreateDeployTargetRequest
  - `providerId` 'default': Deploy provider identifier. Omit this field to use the default provider.
  - `subdomain` string: Optional subdomain for this target. When omitted, one is generated from the project name and ID.
  - `displayName` string, required
  - `customDomain` string

## Response `201`

Deploy target created successfully

- DeployTargetResponse
  - `target` DeployTarget, required
    - `id` string, required: Deploy target ID.
    - `providerId` 'default', required: Deploy provider identifier. Omit this field to use the default provider.
    - `subdomain` string, required: Immutable subdomain for the deploy target.
    - `displayName` string, nullable, required: Optional human-readable target label.
    - `customDomain` string, nullable, required: Optional primary custom domain attached to the target.
    - `deployedUrl` string, nullable, required: Preferred deployed URL, using the custom domain when present.
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required

## Other responses

- `400`: Invalid request
- `401`: Unauthorized
- `404`: Resource not found
- `500`: Server error

---

[API](https://skmtc.dev/grapesjs/apis/studio-platform-api.md) - [All operations](https://skmtc.dev/grapesjs/apis/studio-platform-api/llms.txt) - [OpenAPI document](https://skmtc.dev/grapesjs/apis/studio-platform-api/revisions/acc4ffe35e2d?raw)
