Shipeasy
Flags experimentsApiOperations

Update a feature gate

Partial update — only supplied fields change. Array fields (rules, stack) replace wholesale; there is no merge or append.

Partial update — only supplied fields change. Array fields (rules, stack) replace wholesale; there is no merge or append.

name and the gate id are immutable. The response carries only { id } — re-fetch via GET /api/admin/gates for the new row.

Use cases
  • Ramp rollout{ "rollout_pct": 5000 } for 50%. Basis points (0–10000); 100 = 1%.
  • Kill switch{ "enabled": false }. Forces evaluation to false for every caller regardless of rules/rollout. Re-enable with POST /{id}/enable or { "enabled": true }.
  • Modify a rule's in set — send the full new rules array. To add 'GB' to ['US','CA']: { "rules": [{ "attr": "country", "op": "in", "value": ["US","CA","GB"] }] }. No per-rule patch endpoint.
  • Add targeting from scratch{ "rules": [{ "attr": "email", "op": "regex", "value": "@acme\\.com$" }] }.
  • Switch to gatekeeper stack — send a non-null stack. To revert to flat eval, send { "stack": null }.
  • Update metadata — any subset of title, description, folder, group, owner_email.
PATCH
/api/admin/gates/{id}

Authorization

bearerSdkKey
AuthorizationBearer <token>

Pass an admin SDK key as Authorization: Bearer sdk_admin_…. Mint via POST /api/admin/keys with type: "admin".

In: header

Path Parameters

id*string

Stable opaque gate id (gat_…) or the gate's name.

Length1 <= length <= 128

Header Parameters

X-Project-Id?string

Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://shipeasy.ai/api/admin/gates/string" \  -H "Content-Type: application/json" \  -d '{    "rollout_pct": 5000  }'
{
  "id": "gat_01j7w7m9q4hxbf6npe6s9zr3vc"
}
{
  "error": "Malformed request (bad JSON, missing project scope).",
  "code": "BAD_REQUEST"
}
{
  "error": "Missing or invalid admin SDK key.",
  "code": "UNAUTHORIZED"
}

{
  "error": "Key is valid but not allowed to act on this project.",
  "code": "FORBIDDEN"
}

{
  "error": "The resource does not exist or is not visible to the caller.",
  "code": "NOT_FOUND"
}

{
  "error": "A resource with this name already exists in the project.",
  "code": "ALREADY_EXISTS"
}

{
  "error": "The request body failed structural (schema) validation.",
  "code": "VALIDATION"
}

Was this page helpful?
✎ Edit this page