/Docs
Search docs or ask a question⌘K
DocsAgent
Changelog
API Reference Update Approval Gate

Update Approval Gate

Edit an approval gate, or switch it on or off.

PATCH/v1/projects/{projectId}/approval-gates/{gateId}Try it
Session token

Edit a gate's name, path pattern, approver rules — or switch it off without deleting it. Send only the fields you want to change; the response is the full gate.

Note

Requires the admin or owner role, signed in with a session JWT — API keys are refused with 401. A member gets 403 forbidden with details.requiredRole: "admin" and details.currentRole — see Role errors. You must belong to the organization that owns {projectId}. Available on every plan.

Path Parameters

NameDescription
projectId:stringpathRequired
The project ID.
gateId:stringpathRequired
The gate ID. A gate that belongs to another project returns 404.

Request Body

Every field is optional. Unknown keys are ignored, and an empty body returns the gate unchanged.

NameDescription
name:stringbody
1–200 characters. Leading and trailing whitespace is trimmed.
description:string | nullbody
Up to 2000 characters. null clears it.
pagePattern:stringbody
The paths the gate covers, e.g. api-reference/**. 1–500 characters.
requiredApprovers:integerbody
How many distinct people must approve, 1–20.
approverRoles:string[]body
1–3 of owner, admin, member. Each entry is a minimum role, so ["member"] admits everyone. Duplicates are removed. Any other value — viewer, for example — returns 400.
enabled:booleanbody
false switches the gate off. A disabled gate still appears in GET /approval-gates.

Response — 200 OK

The change is recorded in the audit log as approval_gate.update.

Error Responses

400 Bad Request

validation_error — the body failed schema validation: a field out of range, or an unknown approver role. details.issues lists each problem:

json
{
"error": {
"code": "validation_error",
"message": "approverRoles.0: Invalid enum value. Expected 'owner' | 'admin' | 'member', received 'viewer'",
"details": {
"issues": [
{ "path": ["approverRoles", 0], "code": "invalid_enum_value", "message": "Invalid enum value. Expected 'owner' | 'admin' | 'member', received 'viewer'" }
],
"target": "json",
"traceId": "6f1c2a9e-3b7d-4c11-9a0e-2d5f8b4c7e10"
}
}
}

401 Unauthorized

No session JWT, an expired one, or an API key.

403 Forbidden

forbidden — your role is below admin (details.requiredRole, details.currentRole), or you are not a member of the organization that owns the project.

404 Not Found

not_found — the project does not exist or was deleted, or the gate is not one of this project's.

Was this page helpful? Yes No
Request
cURLJavaScriptPythonGoRubyPHPJavaC#cURL
curl -X PATCH https://api.syntext.dev/v1/projects/3f2a9c1e-8b4d-4e7a-9c21-5d6e7f8a9b0c/approval-gates/7c1e2f4a-9b3d-4e8a-a1c2-5d6f7e8a9b0c \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
-H "Content-Type: application/json" \
-d '{
"requiredApprovers": 2,
"approverRoles": ["admin"],
"enabled": false
}'
Responseapplication/json
200OK
{
"data": {
"id": "7c1e2f4a-9b3d-4e8a-a1c2-5d6f7e8a9b0c",
"projectId": "3f2a9c1e-8b4d-4e7a-9c21-5d6e7f8a9b0c",
"name": "Pricing sign-off",
"description": null,
"pagePattern": "pricing/**",
"requiredApprovers": 2,
"approverRoles": ["admin"],
"autoApproveForRoles": [],
"enabled": false,
"createdAt": "2026-10-02T09:14:00.000Z",
"updatedAt": "2026-11-08T16:40:12.000Z"
}
}
Product
Resources
Company
© 2026 SyntextBuilt with Syntext