Deployments
Preview

Promote a snapshot to a deployment

Copies the exact snapshot of another deployment holding the same apps into this one, as a new snapshot with origin `promotion` that names the one it copies, and delivers it the normal way. Nothing is rendered again. A held snapshot, a target with an apply under way, or a target holding other apps is

POST
/deployments/{deploymentId}/promotions
cookiebetter-auth.session_token<token>

Better Auth session cookie. Production uses the __Secure- prefixed name.

deploymentId*string
Formatuuid
Idempotency-Key?string

Makes retries safe. A repeated key with the same request returns the first result and sets Idempotent-Replayed: true. The same key with a different request answers 409 idempotency.key_reused, and while the first request is still running 409 idempotency.in_progress. Results are kept for 24 hours. Server errors and refusals for lack of sign-in or permission are not kept, so a retry runs again.

Match^[A-Za-z0-9_.:-]+$
Length1 <= length <= 255
application/json
  1. body
snapshotId*string
Formatuuid
reason?string
Lengthlength <= 1000
bypass?

Lets a snapshot the guardrails block through, once. Needs release:bypass.

apps?array<>

Shape only. Promote only these apps; answers 409 promotion.partial_not_supported for now.

Response Body

The promotion.

application/json
  1. response
deploymentId*string
Formatuuid
snapshotId*string

The snapshot the promotion made in the target.

Formatuuid
sourceSnapshotId*string
Formatuuid
source*

Another deployment named by this one. One outside the caller's reach keeps its id, with a null name and visible: false.

promotedBy*string
reason*string
createdAt*string
Formatdate-time
Example Request
curl -X POST 'https://wardn.example.com/api/v1/deployments/497f6eca-6276-4993-bfeb-53cbbbba6f08/promotions' \  -H 'Content-Type: application/json' \  -d '{  "snapshotId": "09520abc-01e6-4da1-8fa5-f10e3883c861"}'
Example Response
{  "deploymentId": "a73c85a1-d857-491e-a6b2-51dce05de7a2",  "snapshotId": "09520abc-01e6-4da1-8fa5-f10e3883c861",  "sourceSnapshotId": "7f07e884-6f41-498e-a6a8-6365a22fbc3a",  "source": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "name": "string",    "visible": true  },  "promotedBy": "string",  "reason": "string",  "createdAt": "2019-08-24T14:15:22Z"}