# Deployments (/docs/guides/deployments)



Every project has a promotion path — **development → staging → production** by default — and
every API key belongs to one environment.

## Promote one decision [#promote-one-decision]

```
POST /decisions/:key/deployments
{ "environment": "production", "version": 3 }
# or
{ "environment": "production", "from": "staging" }
```

A deployment rotates the project's cache generation like a publish does. Deployments are recorded
in the audit log with who, when and which version.

## Promote everything an environment runs [#promote-everything-an-environment-runs]

```
POST /environments/production/promote
```

One call walks the whole dependency graph and puts the right version of every decision into the
target environment. Useful when staging is green and you want everything that has been tested to
go live together.

## Protected environments [#protected-environments]

Production is **protected** by default: only a project admin can deploy to it. This is the
mechanism that keeps an editor from shipping a draft straight to live traffic.

## Champion / challenger [#champion--challenger]

Any deployment can run an experiment against another version of the same decision:

* **split** — the challenger answers a share of the traffic, with its actions. Give a
  `routingField` such as `customer_id` and each customer always lands on the same arm.
* **shadow** — everyone gets the champion's answer and the challenger runs on the same input
  right after; its result is stored as a `SHADOW` execution and none of its actions are enqueued.

Only callers asking for the live version take part — a pinned version is never routed. Responses
carry `meta.variant`, and the results endpoint reports executions, failures, decision
distribution and p95 per arm.

## Rollback [#rollback]

A rollback is just a deploy to a previous version:

```
POST /decisions/:key/deployments
{ "environment": "production", "version": 2 }
```

History is never rewritten — the rollback produces a new deployment record, and the older
versions stay on the list.
