Environments
Preview

Get an environment's protected-branch guardrail

Whether the environment takes snapshots only from a protected branch, and which. An environment nobody configured follows its class: production is guarded.

GET
/environments/{environmentId}/branch-guard
cookiebetter-auth.session_token<token>

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

environmentId*string
Formatuuid

Response Body

The guardrail in force.

application/json
  1. response
enforced*boolean
protectedBranch*string

The branch snapshots must come from. Empty means the branch the git host protects.

isDefault*boolean

True when nobody set it and the environment's class decides.

Example Request
curl -X GET 'https://wardn.example.com/api/v1/environments/497f6eca-6276-4993-bfeb-53cbbbba6f08/branch-guard'
Example Response
{  "enforced": true,  "protectedBranch": "string",  "isDefault": true}