# create-deployment

> Create deployment with the Unkey API CLI

Create a deployment from a Git branch, container image, or existing deployment.

## Usage

```bash
unkey api deployments create-deployment [flags]
```

## Flags

<ParamField body="--project" type="string" required>
Project identifier or slug.
</ParamField>
<ParamField body="--app" type="string" required>
Application identifier or slug.
</ParamField>
<ParamField body="--environment" type="string" required>
Environment identifier or slug.
</ParamField>
<ParamField body="--git" type="JSON string">
Git source with branch, commitSha, and repository.
<Expandable title="JSON schema">The JSON object uses the properties and constraints listed above.</Expandable>
</ParamField>
<ParamField body="--image" type="JSON string">
Image source with dockerImage.
<Expandable title="JSON schema">The JSON object uses the properties and constraints listed above.</Expandable>
</ParamField>
<ParamField body="--deployment" type="JSON string">
Existing source with deploymentId.
<Expandable title="JSON schema">The JSON object uses the properties and constraints listed above.</Expandable>
</ParamField>

## Global Flags

| Flag | Type | Description |
|------|------|-------------|
| `--root-key` | string | Override root key (`$UNKEY_ROOT_KEY`) |
| `--api-url` | string | Override API base URL (default: `https://api.unkey.com`) |
| `--config` | string | Path to config file (default: `~/.unkey/config.toml`) |
| `--output` | string | Output format - use `json` for raw JSON |
| `--body` | string | Send this JSON string as the request body. You cannot combine it with request-building flags. |

## Examples

<CodeGroup>
```bash Basic
unkey api deployments create-deployment --project=payments --app=payments-api \
  --environment=production --git='{"branch":"main"}'
```
</CodeGroup>

See the [Create deployment API reference](https://www.unkey.com/docs/api-reference/v2/deployments/create-deployment).
