Approve or decline a change waiting for a review
Records the caller's decision. It takes `pipeline:read`: what decides is whether the caller is an approver of this draft (an owner of the organization, an admin of the pipeline's owner team, or a member of a team its settings name), and anyone else is refused (409 `pipeline.review_refused`). A decli
better-auth.session_token<token>Better Auth session cookie. Production uses the __Secure- prefixed name.
pipelineId*stringuuiddraftId*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
decision*string"approve""decline"note?stringlength <= 1000The draft after the decision.
application/json- response
yaml*stringThe draft's graph as pipeline.yaml, which the diff against baseYaml shows.
baseYaml*stringThe graph of the version the draft was made on, as pipeline.yaml.
approverGroups*array<>Who may approve, row by row, with the people in each.
number*integerThe draft's number among the pipeline's drafts.
graph?|The graph the draft proposes, for a draft of the graph; null for a draft of the settings.
id*stringuuidpipelineId*stringuuidkind*string"graph""settings"source?stringWhat made the draft when it was not a person's edit, such as preset:<id>.
changes*array<>What the draft changes against the version it was made on.
approvers*array<string>Who may approve it, as the rules stood when the draft was made.
basedOn*integerThe version the change was made on.
summary*stringcreatedBy*createdAt*stringdate-timestate*string"open""approved""declined""superseded""withdrawn"version?|The version an approved draft became.
reviews*array<>curl -X POST 'https://wardn.example.com/api/v1/pipelines/497f6eca-6276-4993-bfeb-53cbbbba6f08/drafts/497f6eca-6276-4993-bfeb-53cbbbba6f08/reviews' \ -H 'Content-Type: application/json' \ -d '{ "decision": "approve"}'{ "yaml": "string", "baseYaml": "string", "approverGroups": [ { "label": "string", "why": "string", "people": [ { "id": "string", "name": "string", "image": "string" } ] } ], "number": 0, "graph": { "stages": [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "environmentId": "19f5cc2e-7657-437a-9268-83cd3d563563", "arrival": "auto_promote", "soakSeconds": 0, "config": { "which": "qualified", "ifSeveral": "replace", "allowRequests": true, "configOnly": true, "incoming": "all", "narrow": [ { "field": "cluster", "op": "is", "value": "string" } ], "rules": [ { "id": "string", "type": "approval", "section": "gate", "title": "string", "note": "string", "locked": true, "params": {} } ], "onReject": "keep", "onQualify": "notify", "notifyTarget": "string", "rollout": { "mode": "all", "waves": [ { "id": "string", "name": "string", "detail": "string", "targets": "string", "verify": "string", "next": "confirm", "soakSeconds": 0, "selector": { "property1": "string", "property2": "string" } } ], "onFail": "pause", "retries": "2", "timeout": "15m" }, "health": { "watchSeconds": 0, "onFail": "pause" }, "requestForm": "string", "agents": { "autonomy": "observe", "cap": "observe", "perHour": 0, "may": { "property1": true, "property2": true }, "read": { "mode": "off", "agentId": "string" } }, "preset": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "version": 1 } }, "position": 0, "environmentName": "string", "environmentClass": "string" } ], "routes": [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "fromStageId": "877db427-5907-4b80-a8b2-ab6c3e6f1fc9", "toStageId": "ccc70001-c375-49a1-b702-44689ce3757f", "kind": "main", "must": "qualified", "label": "string" } ] }, "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "pipelineId": "621ef2b0-ba1d-48e5-89dc-b778e6ed42fd", "kind": "graph", "source": "string", "changes": [ { "kind": "string", "subject": "string", "detail": "string" } ], "approvers": [ "string" ], "basedOn": 0, "summary": "string", "createdBy": { "id": "string", "name": "string" }, "createdAt": "2019-08-24T14:15:22Z", "state": "open", "version": 0, "reviews": [ { "approver": true, "by": { "id": "string", "name": "string" }, "decision": "approve", "note": "string", "at": "2019-08-24T14:15:22Z" } ]}Withdraw a change waiting for a review POST
Closes an open draft at the request of the person who made it; it takes `pipeline:read`, because what is checked is who the person is, not what they may edit. The pipeline stays as it is. Anyone else is refused (409 `pipeline.withdraw_refused`), and so is a draft that was already decided (409 `pipel
List a pipeline's versions GET
Every saved version, newest first, with what changed, who saved it and who reviewed it.