Deployments
Preview

Change how a deployment is shared

Turns sharing on or off and sets who may claim, the longest claim, what happens when a claim ends, and the hand-over jobs and migration check. Answers 409 `share.needs_branch` for a deployment that does not follow a branch and 409 `share.in_use` when sharing is turned off while someone holds it. Wri

PUT
/deployments/{deploymentId}/share/settings
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
enabled*boolean
claimTeamIds*array<string>

Teams whose members may claim; none lets anyone who may sync the deployment claim it.

maxClaimMinutes*integer

The longest a claim may last, in minutes.

Range15 <= value <= 10080
onEnd*string

When a claim ends with nobody next, the deployment goes back to its branch (main) or stays on the last one (stay).

Value in"main""stay"
defaultBranch?string

The branch the deployment goes back to; empty goes back to the branch it had when the claim began.

keepOtherPushes*boolean

A push to a branch nobody holds is kept and not applied.

takeOverByAdmins*boolean

Admins of the deployment may end a claim with a reason.

handover*

Response Body

The settings as saved.

application/json
  1. response
enabled*boolean
claimTeamIds*array<string>

Teams whose members may claim; none lets anyone who may sync the deployment claim it.

maxClaimMinutes*integer

The longest a claim may last, in minutes.

Range15 <= value <= 10080
onEnd*string

When a claim ends with nobody next, the deployment goes back to its branch (main) or stays on the last one (stay).

Value in"main""stay"
defaultBranch?string

The branch the deployment goes back to; empty goes back to the branch it had when the claim began.

keepOtherPushes*boolean

A push to a branch nobody holds is kept and not applied.

takeOverByAdmins*boolean

Admins of the deployment may end a claim with a reason.

handover*
Example Request
curl -X PUT 'https://wardn.example.com/api/v1/deployments/497f6eca-6276-4993-bfeb-53cbbbba6f08/share/settings' \  -H 'Content-Type: application/json' \  -d '{  "enabled": true,  "claimTeamIds": [    "string"  ],  "maxClaimMinutes": 15,  "onEnd": "main",  "keepOtherPushes": true,  "takeOverByAdmins": true,  "handover": {    "jobs": [      {        "name": "string",        "when": "before_next_holder",        "job": {},        "failure": "stop"      }    ],    "migration": {      "mode": "off"    }  }}'
Example Response
{  "enabled": true,  "claimTeamIds": [    "string"  ],  "maxClaimMinutes": 15,  "onEnd": "main",  "defaultBranch": "string",  "keepOtherPushes": true,  "takeOverByAdmins": true,  "handover": {    "jobs": [      {        "name": "string",        "when": "before_next_holder",        "job": {},        "failure": "stop"      }    ],    "migration": {      "mode": "off",      "folder": "string",      "job": {}    }  }}