Skip to main content
POST
/
projects
/
{project_reference}
/
policies
Create Branch Policy
curl --request POST \
  --url https://api.veryfront.com/projects/{project_reference}/policies \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "is_enabled": true,
  "target_branch_pattern": "<string>",
  "required_approvals": 123,
  "allow_self_approval": true,
  "required_reviewer_ids": [
    "<string>"
  ],
  "required_reviewer_roles": [
    "<string>"
  ],
  "block_direct_edits": true,
  "auto_merge_when_approved": true,
  "dismiss_approvals_on_change": true
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "is_enabled": true,
  "target_branch_pattern": "<string>",
  "required_approvals": 123,
  "allow_self_approval": true,
  "required_reviewer_ids": [
    "<string>"
  ],
  "required_reviewer_roles": [
    "<string>"
  ],
  "block_direct_edits": true,
  "auto_merge_when_approved": true,
  "dismiss_approvals_on_change": true,
  "created_at": "<string>",
  "updated_at": "<string>"
}

Authorizations

Authorization
string
header
required

Authentication via JWT token or API key. JWT: Get from Veryfront dashboard. API Key: Format "vf__" - create via /api-keys endpoint.

Path Parameters

project_reference
string
required

Project ID or slug

Body

application/json
name
string
required
is_enabled
boolean
target_branch_pattern
string
required_approvals
number
allow_self_approval
boolean
required_reviewer_ids
string[]
required_reviewer_roles
string[]
block_direct_edits
boolean
auto_merge_when_approved
boolean
dismiss_approvals_on_change
boolean

Response

Policy created

id
string<uuid>
required
project_id
string<uuid>
required
name
string
required
is_enabled
boolean
required
target_branch_pattern
string | null
required
required_approvals
number
required
allow_self_approval
boolean
required
required_reviewer_ids
string[] | null
required
required_reviewer_roles
string[] | null
required
block_direct_edits
boolean
required
auto_merge_when_approved
boolean
required
dismiss_approvals_on_change
boolean
required
created_at
string
required
updated_at
string
required