For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
SupportDashboard
Getting StartedAPI ReferenceRoadmapBlog
Getting StartedAPI ReferenceRoadmapBlog
    • Resources
    • Authentication
    • Pagination
    • Rate limiting
  • API Keys
    • GETList api keys
    • GETGet api key
    • POSTCreate api key
    • PUTUpdate api key
    • DELDelete api key
  • Environments
    • POSTCreate environment
    • PUTUpdate environment
    • DELDelete environment
  • Plans
    • The Plan object
    • GETList plans
    • GETGet plan
    • POSTCreate plan
    • PUTUpdate plan
    • DELDelete plan
  • Companies
    • The Company object
    • GETList companies
    • POSTUpsert company
    • GETLookup company
    • DELDelete company
    • POSTDelete company by keys
    • GETList company memberships
    • POSTGet or create company membership
    • DELDelete company membership
    • POSTUpsert company trait
  • Users
    • The User object
    • GETList users
    • GETLookup user
    • POSTUpsert user
    • DELDelete user
    • POSTDelete user by keys
    • POSTUpsert user trait
  • Events
    • The Event object
    • GETList events
    • POSTCreate event
    • POSTCreate event batch
    • GETGet event
  • Features
    • The Feature object
    • GETList features
    • GETGet feature
    • POSTCreate feature
    • PUTUpdate feature
    • DELDelete feature
  • Flags
    • The Flag object
    • GETList flags
    • GETGet flag
    • POSTCreate flag
    • PUTUpdate flag
    • DELDelete flag
    • PUTUpdate flag rules
    • POSTCheck flag
    • POSTCheck flags
  • Entitlements
    • GETList company overrides
    • GETGet company override
    • POSTCreate company override
    • PUTUpdate company override
    • DELDelete company override
    • GETList plan entitlements
    • GETGet plan entitlement
    • POSTCreate plan entitlement
    • PUTUpdate plan entitlement
    • DELDelete plan entitlement
  • Feature Usage
    • GETList feature usage
  • Billing Credits
    • GETList credits
    • POSTCreate credit
    • GETGet credit
    • PUTUpdate credit
    • DELDelete credit
    • GETList credit bundles
    • POSTCreate credit bundle
    • GETGet credit bundle
    • PUTUpdate credit bundle
    • DELDelete credit bundle
    • POSTGrant credits to company
    • GETList company credit grants
    • GETList credit grants
    • PUTZero out credit grant
    • GETList plan credit grants
    • POSTCreate plan credit grant
    • DELDelete plan credit grant
    • GETGet credit ledger
  • Account Members
    • GETList account members
    • GETGet account member
LogoLogo
SupportDashboard
Flags

Update flag

PUT
https://api.schematichq.com/flags/:flag_id
PUT
/flags/:flag_id
1import { SchematicClient } from "@schematichq/schematic-typescript-node";
2
3async function main() {
4 const client = new SchematicClient({
5 apiKey: "YOUR_API_KEY_HERE",
6 });
7 await client.features.updateFlag("flag_id", {
8 defaultValue: true,
9 description: "Enable the new user onboarding feature",
10 flagType: "boolean",
11 key: "user_onboarding_enabled",
12 name: "User Onboarding Feature Flag",
13 });
14}
15main();
1{
2 "data": {
3 "created_at": "2024-01-15T09:30:00Z",
4 "default_value": true,
5 "description": "Enable the new user onboarding feature",
6 "flag_type": "boolean",
7 "id": "flag_abcdef1234567890",
8 "key": "user_onboarding_enabled",
9 "name": "User Onboarding Feature Flag",
10 "rules": [
11 {
12 "condition_groups": [
13 {
14 "conditions": [
15 {
16 "condition_type": "base_plan",
17 "created_at": "2024-01-10T11:00:00Z",
18 "environment_id": "env_prod_001",
19 "id": "cond_001",
20 "operator": "eq",
21 "resource_ids": [
22 "res_001"
23 ],
24 "resources": [
25 {
26 "id": "res_001",
27 "name": "Premium Plan",
28 "description": "Premium Plan Subscription",
29 "image_url": "https://example.com/images/premium_plan.png"
30 }
31 ],
32 "rule_id": "rule_001",
33 "trait_value": "true",
34 "updated_at": "2024-01-10T11:00:00Z",
35 "comparison_trait": {
36 "created_at": "2023-10-01T10:00:00Z",
37 "display_name": "Is Premium Customer",
38 "entity_type": "company",
39 "hierarchy": [
40 "subscription",
41 "customer_status"
42 ],
43 "id": "trait_premium_customer_001",
44 "trait_type": "boolean",
45 "updated_at": "2024-01-01T09:00:00Z"
46 },
47 "comparison_trait_id": "trait_premium_customer_001",
48 "condition_group_id": "condgrp_001",
49 "event_subtype": "subscription_change",
50 "flag_id": "flag_abcdef1234567890",
51 "metric_period": "all_time",
52 "metric_period_month_reset": "billing_cycle",
53 "metric_value": 1,
54 "trait": {
55 "created_at": "2023-10-01T10:00:00Z",
56 "display_name": "Is Premium Customer",
57 "entity_type": "company",
58 "hierarchy": [
59 "subscription",
60 "customer_status"
61 ],
62 "id": "trait_premium_customer_001",
63 "trait_type": "boolean",
64 "updated_at": "2024-01-01T09:00:00Z"
65 },
66 "trait_entity_type": "company",
67 "trait_id": "trait_premium_customer_001"
68 }
69 ],
70 "created_at": "2024-01-10T11:00:00Z",
71 "environment_id": "env_prod_001",
72 "id": "condgrp_001",
73 "rule_id": "rule_001",
74 "updated_at": "2024-01-10T11:00:00Z",
75 "flag_id": "flag_abcdef1234567890"
76 }
77 ],
78 "conditions": [
79 {
80 "condition_type": "base_plan",
81 "created_at": "2024-01-10T11:00:00Z",
82 "environment_id": "env_prod_001",
83 "id": "cond_001",
84 "operator": "eq",
85 "resource_ids": [
86 "res_001"
87 ],
88 "resources": [
89 {
90 "id": "res_001",
91 "name": "Premium Plan",
92 "description": "Premium Plan Subscription",
93 "image_url": "https://example.com/images/premium_plan.png"
94 }
95 ],
96 "rule_id": "rule_001",
97 "trait_value": "true",
98 "updated_at": "2024-01-10T11:00:00Z",
99 "comparison_trait": {
100 "created_at": "2023-10-01T10:00:00Z",
101 "display_name": "Is Premium Customer",
102 "entity_type": "company",
103 "hierarchy": [
104 "subscription",
105 "customer_status"
106 ],
107 "id": "trait_premium_customer_001",
108 "trait_type": "boolean",
109 "updated_at": "2024-01-01T09:00:00Z"
110 },
111 "comparison_trait_id": "trait_premium_customer_001",
112 "condition_group_id": "condgrp_001",
113 "event_subtype": "subscription_change",
114 "flag_id": "flag_abcdef1234567890",
115 "metric_period": "all_time",
116 "metric_period_month_reset": "billing_cycle",
117 "metric_value": 1,
118 "trait": {
119 "created_at": "2023-10-01T10:00:00Z",
120 "display_name": "Is Premium Customer",
121 "entity_type": "company",
122 "hierarchy": [
123 "subscription",
124 "customer_status"
125 ],
126 "id": "trait_premium_customer_001",
127 "trait_type": "boolean",
128 "updated_at": "2024-01-01T09:00:00Z"
129 },
130 "trait_entity_type": "company",
131 "trait_id": "trait_premium_customer_001"
132 }
133 ],
134 "created_at": "2024-01-10T11:00:00Z",
135 "environment_id": "env_prod_001",
136 "id": "rule_001",
137 "name": "Premium Customer Override",
138 "priority": 1,
139 "rule_type": "company_override",
140 "updated_at": "2024-01-10T11:00:00Z",
141 "value": true,
142 "flag_id": "flag_abcdef1234567890"
143 }
144 ],
145 "updated_at": "2024-01-15T09:30:00Z",
146 "feature": {
147 "created_at": "2023-12-01T08:00:00Z",
148 "description": "Controls the rollout of the new onboarding process",
149 "feature_type": "boolean",
150 "icon": "onboarding_icon.png",
151 "id": "feat_1234567890abcdef",
152 "name": "User Onboarding",
153 "updated_at": "2024-01-10T12:00:00Z",
154 "event_subtype": "user_signup",
155 "lifecycle_phase": "beta",
156 "maintainer_account_member_id": "member_9876543210fedcba",
157 "plural_name": "User Onboardings",
158 "singular_name": "User Onboarding",
159 "trait_id": "trait_abcdef1234567890"
160 },
161 "feature_id": "feat_1234567890abcdef",
162 "last_checked_at": "2024-01-15T09:30:00Z",
163 "maintainer": {
164 "created_at": "2023-11-20T07:45:00Z",
165 "id": "member_9876543210fedcba",
166 "permissions": {},
167 "updated_at": "2024-01-14T16:00:00Z",
168 "email": "jane.doe@example.com",
169 "image_url": "https://example.com/images/jane_doe.png",
170 "name": "Jane Doe",
171 "role": "admin"
172 },
173 "maintainer_account_member_id": "member_9876543210fedcba"
174 },
175 "params": {}
176}
Was this page helpful?
Previous

Delete flag

Next
Built with

Authentication

X-Schematic-Api-Keystring
API Key authentication via header

Path parameters

flag_idstringRequired

flag_id

Request

This endpoint expects an object.
default_valuebooleanRequired
descriptionstringRequired<=1024 characters
flag_typeenumRequired
Allowed values:
keystringRequired<=512 characters
namestringRequired<=512 characters
feature_idstring or nullOptional
maintainer_account_member_idstring or nullOptional

Response

OK
dataobject
paramsobject
Input parameters

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
500
Internal Server Error