> ## Documentation Index
> Fetch the complete documentation index at: https://unkey-chronark-cli.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# deployment_not_production

> Promote and rollback change the app's current production deployment, so they only apply to deployments in the production environment.

<Danger>`err:unkey:application:deployment_not_production`</Danger>

```json Example theme={"theme":"kanagawa-wave"}
{
  "meta": {
    "requestId": "req_2c9a0jf23l4k567"
  },
  "error": {
    "detail": "Only production deployments can be promoted or rolled back.",
    "status": 412,
    "title": "Precondition Failed",
    "type": "https://unkey.com/docs/errors/unkey/application/deployment_not_production"
  }
}
```

## What Happened?

You called `promoteDeployment` or `rollbackDeployment` on a deployment that does not belong to the `production` environment. Both operations move the app's current production deployment, so they are only meaningful for production deployments. Preview and other non-production environments do not have a current deployment to move.

`getDeployment` reports the deployment's `environmentId`, and `availableActions` omits `promote` and `rollback` for non-production deployments.

## How To Fix

1. Fetch the deployment with `getDeployment` and inspect `availableActions`; `promote` and `rollback` are only listed for production deployments.
2. If you meant to act on production, target a deployment in the production environment.
3. If you are working in a preview environment, promotion and rollback do not apply; deploy directly instead.

```bash theme={"theme":"kanagawa-wave"}
# Inspect the deployment's environment before promoting
curl -X POST https://api.unkey.com/v2/deployments.getDeployment \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer unkey_YOUR_API_KEY" \
  -d '{ "deploymentId": "d_1234abcd" }'
```

## Common Mistakes

* **Confusing preview with production**: Trying to promote a preview deployment that has no current deployment to move.
* **Wrong deployment id**: Passing a non-production deployment id by mistake.

## Related Errors

* [err:unkey:application:deployment\_no\_current](./deployment_no_current) - When the app has no current deployment to act over
* [err:unkey:application:deployment\_is\_current](./deployment_is_current) - When the target is already the current deployment
* [err:unkey:application:deployment\_not\_ready](./deployment_not_ready) - When the target deployment cannot serve traffic
