Deployments
Preview

Discard a held snapshot

Refuses a held snapshot for good. The deployment keeps running what it ran, and a later commit renders a new snapshot. A snapshot that is not held is a conflict.

POST
/deployments/{deploymentId}/snapshots/{snapshotId}/discard
cookiebetter-auth.session_token<token>

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

deploymentId*string
Formatuuid
snapshotId*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

Response Body

The snapshot's review, as decided.

application/json
  1. response

Why a render was held back from being applied, and what a person decided.

snapshotId*string
Formatuuid
deploymentId*string
Formatuuid
commit*string

The commit the snapshot was rendered from.

state*string
Value in"held""released""discarded"
reason*string

empty is a render with no objects; mass_removal removes more of the current snapshot's objects than the guard allows.

Value in"empty""mass_removal"
message*string
objectsBefore*integer

How many objects the deployment's current snapshot holds.

objectsAfter*integer

How many objects this snapshot holds.

objectsRemoved*integer

How many of the current snapshot's objects this one lacks.

heldAt*string
Formatdate-time
decidedBy?string

Who released or discarded it. Absent while it is held.

decidedAt?string
Formatdate-time
Example Request
curl -X POST 'https://wardn.example.com/api/v1/deployments/497f6eca-6276-4993-bfeb-53cbbbba6f08/snapshots/497f6eca-6276-4993-bfeb-53cbbbba6f08/discard'
Example Response
{  "snapshotId": "09520abc-01e6-4da1-8fa5-f10e3883c861",  "deploymentId": "a73c85a1-d857-491e-a6b2-51dce05de7a2",  "commit": "string",  "state": "held",  "reason": "empty",  "message": "string",  "objectsBefore": 0,  "objectsAfter": 0,  "objectsRemoved": 0,  "heldAt": "2019-08-24T14:15:22Z",  "decidedBy": "string",  "decidedAt": "2019-08-24T14:15:22Z"}