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
better-auth.session_token<token>Better Auth session cookie. Production uses the __Secure- prefixed name.
deploymentId*stringuuidIdempotency-Key?stringMakes 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.
^[A-Za-z0-9_.:-]+$1 <= length <= 255application/json- body
enabled*booleanclaimTeamIds*array<string>Teams whose members may claim; none lets anyone who may sync the deployment claim it.
maxClaimMinutes*integerThe longest a claim may last, in minutes.
15 <= value <= 10080onEnd*stringWhen a claim ends with nobody next, the deployment goes back to its branch (main) or stays on the last one (stay).
"main""stay"defaultBranch?stringThe branch the deployment goes back to; empty goes back to the branch it had when the claim began.
keepOtherPushes*booleanA push to a branch nobody holds is kept and not applied.
takeOverByAdmins*booleanAdmins of the deployment may end a claim with a reason.
handover*The settings as saved.
application/json- response
enabled*booleanclaimTeamIds*array<string>Teams whose members may claim; none lets anyone who may sync the deployment claim it.
maxClaimMinutes*integerThe longest a claim may last, in minutes.
15 <= value <= 10080onEnd*stringWhen a claim ends with nobody next, the deployment goes back to its branch (main) or stays on the last one (stay).
"main""stay"defaultBranch?stringThe branch the deployment goes back to; empty goes back to the branch it had when the claim began.
keepOtherPushes*booleanA push to a branch nobody holds is kept and not applied.
takeOverByAdmins*booleanAdmins of the deployment may end a claim with a reason.
handover*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" } }}'{ "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": {} } }}What to know before taking a shared deployment GET
Read-only checks for a person about to claim or ask for the deployment with `branch`: what runs now and whose it is, how many apps would move to other commits, whether the branch differs in database migration files from what runs (compared by file names in git, and by the names of the jobs that run;
List the claims that ended on a deployment GET
The last 50 claims that ended, newest first, with who held them, for how long, and how they ended. Needs `deployment:read`.