Get a guardrail
The guardrail at its newest version, or at `version` for the history and for a stored decision that used it.
better-auth.session_token<token>Better Auth session cookie. Production uses the __Secure- prefixed name.
guardrailId*stringuuidversion?integerA saved version; the newest when omitted.
1 <= valueThe guardrail.
application/json- response
actions*array<>The actions it governs. A guardrail saved before it named any reads as release and rollback, which is what it has always governed.
id*stringuuidname*stringdescription*stringkind*string"rule""relax"mode*string"enforce""warn""off"builtin*booleanfromPreset?stringThe preset it was made from, when it was.
builtinKey?stringSet on the guardrails Wardn ships, such as protected_branch and freezes.
ownerTeamId?stringThe team that owns it and alone may add exceptions; absent for the organization and for a caller who may not read the team.
ownerTeamName?stringThe owning team's name, shown to anyone who reads the guardrail.
cover?exceptionsInEffect?integerExceptions in effect on places the caller may see. Present on a single guardrail read, with cover.
scope*array<>requires*array<>version*newestVersion*integerarchived*booleancreatedAt*stringdate-timeupdatedAt*stringdate-timecurl -X GET 'https://wardn.example.com/api/v1/guardrails/497f6eca-6276-4993-bfeb-53cbbbba6f08'{ "actions": [ "release" ], "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "description": "string", "kind": "rule", "mode": "enforce", "builtin": true, "fromPreset": "string", "builtinKey": "string", "ownerTeamId": "string", "ownerTeamName": "string", "cover": { "deployments": 0, "apps": 0, "clusters": 0, "leftOut": 0, "summary": "string", "lowered": [ "string" ] }, "exceptionsInEffect": 0, "scope": [ { "field": "class", "op": "is", "value": "string", "label": "string" } ], "requires": [ { "id": "string", "kind": "approval", "count": 1, "humanOnly": true, "group": "security", "level": "propose", "when": "freeze", "branch": "string", "system": "servicenow", "afterSeconds": 60, "days": 1, "label": "string" } ], "version": { "version": 1, "summary": "string", "mode": "enforce", "createdBy": { "id": "string", "name": "string" }, "createdAt": "2019-08-24T14:15:22Z" }, "newestVersion": 0, "archived": true, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z"}Create a guardrail POST
Makes version 1. Where it applies is a list of conditions that all have to hold; what it requires is a list of requirements. A relaxing guardrail holds one fast path and waives the approvals other guardrails ask for where it holds. Taking `guardrail:manage` on the organization.
Save a guardrail as a new version PUT
The editor's Save version: name, owner, mode, where it applies and what it requires make the next version. `expectedVersion` is the version the editor opened; another answers 409 `guardrail.version_conflict` with `currentVersion`. A built-in guardrail keeps its name and kind.