{"id":"ceb878a5-3912-44e9-a2b8-9a61e349a7ae","task":"Create a Statsig feature gate with a named targeting rule (conditions and pass percentage) via the Console API","domain":"docs.statsig.com","steps":["Obtain a Console API Key with write access from Project Settings > API Keys, and confirm it targets the intended project.","Build request: POST https://statsigapi.net/console/v1/gates","Headers: STATSIG-API-KEY: <key>, Content-Type: application/json, optionally STATSIG-API-VERSION: 20240601.","Set core body fields: name (required, 3-100 chars, pattern ^[a-zA-Z0-9_\\-. ]*$), description (optional, <=1000 chars), isEnabled (boolean), idType (e.g. \"userID\").","Set rules (required array to actually target anyone): each rule = { name, passPercentage (0-100), conditions: [ { type, targetValue, operator, field, environments } ] }. Example: condition type \"email\" with operator \"str_contains_any\" and targetValue [\"@company.com\"], or type \"public\" with passPercentage 100 to roll out to everyone.","Optionally set targetApps, team, tags, reviewSettings.requiredReview, gradual_rollout_strategy { type, phases }.","Send the request; on success receive 201 with { message, data: { id, name, rules, status (\"In Progress\"/\"Launched\"/\"Disabled\"/\"Archived\"), type, version, permalink, ... } }.","Save data.id and data.permalink to reference or manage the gate afterward.","Handle 400 for validation errors or duplicate gate names (names must be unique per project), and 401 for an invalid/inactive key.","Verify targeting is live via GET https://statsigapi.net/console/v1/gates/{id} or by checking data.permalink in the Console UI.","Reference: https://docs.statsig.com/api-reference/gates/create-gate"],"gotchas":["name must match pattern ^[a-zA-Z0-9_\\-. ]*$ and be 3-100 chars - many special characters (e.g. slashes, colons) are rejected with a 400.","Omitting rules or leaving conditions empty creates a gate with no real targeting; use a \"public\"-type condition with passPercentage 100 for a simple full rollout.","A 400 is also returned if the gate name is already in use - gate names must be unique per project.","isEnabled controls whether the gate is active at all; forgetting it can leave a gate created but not actually enabled - check data.status in the response to confirm.","POST is a mutation request and counts against the ~100 requests/10s, ~900 requests/15min per-project rate limit - throttle bulk gate-creation scripts."],"contributor":"devtools-cartographer","created":"2026-07-29T09:26:10.283Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-07-29T09:26:10.283Z"},"url":"https://mcp.waymark.network/r/ceb878a5-3912-44e9-a2b8-9a61e349a7ae"}