openapi: 3.0.0 info: title: Schematic accesstokens features API version: '0.1' description: Schematic API x-rules-engine-schema-version: v97288f60 servers: - url: https://api.schematichq.com security: - ApiKeyAuth: [] tags: - name: features paths: /features: get: operationId: listFeatures summary: List features tags: - features parameters: - name: boolean_require_event in: query description: Only return boolean features if there is an associated event. Automatically includes boolean in the feature types filter. schema: type: boolean description: Only return boolean features if there is an associated event. Automatically includes boolean in the feature types filter. - name: feature_type in: query description: Filter by one or more feature types (boolean, event, trait) schema: type: array description: Filter by one or more feature types (boolean, event, trait) items: $ref: '#/components/schemas/FeatureType' maxItems: 100 - name: ids in: query schema: type: array items: type: string maxItems: 100 - name: plan_version_id in: query description: Filter by plan version ID when used with without_plan_entitlement_for; if not provided, the latest published version is used schema: type: string description: Filter by plan version ID when used with without_plan_entitlement_for; if not provided, the latest published version is used - name: q in: query description: Search by feature name or ID schema: type: string description: Search by feature name or ID maxLength: 512 - name: without_company_override_for in: query description: Filter out features that already have a company override for the specified company ID schema: type: string description: Filter out features that already have a company override for the specified company ID - name: without_plan_entitlement_for in: query description: Filter out features that already have a plan entitlement for the specified plan ID schema: type: string description: Filter out features that already have a plan entitlement for the specified plan ID - name: limit in: query description: Page limit (default 100) schema: type: integer description: Page limit (default 100) format: int64 example: '100' - name: offset in: query description: Page offset (default 0) schema: type: integer description: Page offset (default 0) format: int64 example: '0' responses: '200': description: OK content: application/json: schema: type: object properties: data: type: array items: $ref: '#/components/schemas/FeatureDetailResponseData' title: ListFeaturesResponseData maxItems: 250 params: type: object description: Input parameters properties: boolean_require_event: type: boolean description: Only return boolean features if there is an associated event. Automatically includes boolean in the feature types filter. feature_type: type: array description: Filter by one or more feature types (boolean, event, trait) items: $ref: '#/components/schemas/FeatureType' maxItems: 100 ids: type: array items: type: string maxItems: 100 limit: type: integer description: Page limit (default 100) format: int64 example: '100' offset: type: integer description: Page offset (default 0) format: int64 example: '0' plan_version_id: type: string description: Filter by plan version ID when used with without_plan_entitlement_for; if not provided, the latest published version is used q: type: string description: Search by feature name or ID maxLength: 512 without_company_override_for: type: string description: Filter out features that already have a company override for the specified company ID without_plan_entitlement_for: type: string description: Filter out features that already have a plan entitlement for the specified plan ID title: ListFeaturesParams required: - data - params title: ListFeaturesResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' post: operationId: createFeature summary: Create feature tags: - features requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateFeatureRequestBody' required: true responses: '201': description: Created content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/FeatureDetailResponseData' params: type: object description: Input parameters title: CreateFeatureParams required: - data - params title: CreateFeatureResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /features/{feature_id}: get: operationId: getFeature summary: Get feature tags: - features parameters: - name: feature_id in: path description: feature_id required: true schema: type: string responses: '200': description: OK content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/FeatureDetailResponseData' params: type: object description: Input parameters title: GetFeatureParams required: - data - params title: GetFeatureResponse '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' put: operationId: updateFeature summary: Update feature tags: - features parameters: - name: feature_id in: path description: feature_id required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/UpdateFeatureRequestBody' required: true responses: '200': description: OK content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/FeatureDetailResponseData' params: type: object description: Input parameters title: UpdateFeatureParams required: - data - params title: UpdateFeatureResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' delete: operationId: deleteFeature summary: Delete feature tags: - features parameters: - name: feature_id in: path description: feature_id required: true schema: type: string responses: '200': description: OK content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/DeleteResponse' params: type: object description: Input parameters title: DeleteFeatureParams required: - data - params title: DeleteFeatureResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /features/billing-linked: post: operationId: upsertFeatureForBillingProduct summary: Upsert feature for billing product tags: - features requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateBillingLinkedFeatureRequestBody' required: true responses: '201': description: Created content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/FeatureDetailResponseData' params: type: object description: Input parameters title: UpsertFeatureForBillingProductParams required: - data - params title: UpsertFeatureForBillingProductResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /features/count: get: operationId: countFeatures summary: Count features tags: - features parameters: - name: boolean_require_event in: query description: Only return boolean features if there is an associated event. Automatically includes boolean in the feature types filter. schema: type: boolean description: Only return boolean features if there is an associated event. Automatically includes boolean in the feature types filter. - name: feature_type in: query description: Filter by one or more feature types (boolean, event, trait) schema: type: array description: Filter by one or more feature types (boolean, event, trait) items: $ref: '#/components/schemas/FeatureType' maxItems: 100 - name: ids in: query schema: type: array items: type: string maxItems: 100 - name: plan_version_id in: query description: Filter by plan version ID when used with without_plan_entitlement_for; if not provided, the latest published version is used schema: type: string description: Filter by plan version ID when used with without_plan_entitlement_for; if not provided, the latest published version is used - name: q in: query description: Search by feature name or ID schema: type: string description: Search by feature name or ID maxLength: 512 - name: without_company_override_for in: query description: Filter out features that already have a company override for the specified company ID schema: type: string description: Filter out features that already have a company override for the specified company ID - name: without_plan_entitlement_for in: query description: Filter out features that already have a plan entitlement for the specified plan ID schema: type: string description: Filter out features that already have a plan entitlement for the specified plan ID - name: limit in: query description: Page limit (default 100) schema: type: integer description: Page limit (default 100) format: int64 example: '100' - name: offset in: query description: Page offset (default 0) schema: type: integer description: Page offset (default 0) format: int64 example: '0' responses: '200': description: OK content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/CountResponse' params: type: object description: Input parameters properties: boolean_require_event: type: boolean description: Only return boolean features if there is an associated event. Automatically includes boolean in the feature types filter. feature_type: type: array description: Filter by one or more feature types (boolean, event, trait) items: $ref: '#/components/schemas/FeatureType' maxItems: 100 ids: type: array items: type: string maxItems: 100 limit: type: integer description: Page limit (default 100) format: int64 example: '100' offset: type: integer description: Page offset (default 0) format: int64 example: '0' plan_version_id: type: string description: Filter by plan version ID when used with without_plan_entitlement_for; if not provided, the latest published version is used q: type: string description: Search by feature name or ID maxLength: 512 without_company_override_for: type: string description: Filter out features that already have a company override for the specified company ID without_plan_entitlement_for: type: string description: Filter out features that already have a plan entitlement for the specified plan ID title: CountFeaturesParams required: - data - params title: CountFeaturesResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /flags: get: operationId: listFlags summary: List flags tags: - features parameters: - name: feature_id in: query schema: type: string - name: ids in: query schema: type: array items: type: string maxItems: 100 - name: q in: query description: Search by flag name, key, or ID schema: type: string description: Search by flag name, key, or ID maxLength: 512 - name: limit in: query description: Page limit (default 100) schema: type: integer description: Page limit (default 100) format: int64 example: '100' - name: offset in: query description: Page offset (default 0) schema: type: integer description: Page offset (default 0) format: int64 example: '0' responses: '200': description: OK content: application/json: schema: type: object properties: data: type: array items: $ref: '#/components/schemas/FlagDetailResponseData' title: ListFlagsResponseData maxItems: 250 params: type: object description: Input parameters properties: feature_id: type: string ids: type: array items: type: string maxItems: 100 limit: type: integer description: Page limit (default 100) format: int64 example: '100' offset: type: integer description: Page offset (default 0) format: int64 example: '0' q: type: string description: Search by flag name, key, or ID maxLength: 512 title: ListFlagsParams required: - data - params title: ListFlagsResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' post: operationId: createFlag summary: Create flag tags: - features requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateFlagRequestBody' required: true responses: '201': description: Created content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/FlagDetailResponseData' params: type: object description: Input parameters title: CreateFlagParams required: - data - params title: CreateFlagResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /flags/{flag_id}: get: operationId: getFlag summary: Get flag tags: - features parameters: - name: flag_id in: path description: flag_id required: true schema: type: string responses: '200': description: OK content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/FlagDetailResponseData' params: type: object description: Input parameters title: GetFlagParams required: - data - params title: GetFlagResponse '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' put: operationId: updateFlag summary: Update flag tags: - features parameters: - name: flag_id in: path description: flag_id required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateFlagRequestBody' required: true responses: '200': description: OK content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/FlagDetailResponseData' params: type: object description: Input parameters title: UpdateFlagParams required: - data - params title: UpdateFlagResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' delete: operationId: deleteFlag summary: Delete flag tags: - features parameters: - name: flag_id in: path description: flag_id required: true schema: type: string responses: '200': description: OK content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/DeleteResponse' params: type: object description: Input parameters title: DeleteFlagParams required: - data - params title: DeleteFlagResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /flags/{flag_id}/rules: put: operationId: updateFlagRules summary: Update flag rules tags: - features parameters: - name: flag_id in: path description: flag_id required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/UpdateFlagRulesRequestBody' required: true responses: '200': description: OK content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/RulesDetailResponseData' params: type: object description: Input parameters title: UpdateFlagRulesParams required: - data - params title: UpdateFlagRulesResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /flags/{key}/check: post: operationId: checkFlag summary: Check flag tags: - features parameters: - name: key in: path description: key required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/CheckFlagRequestBody' required: true responses: '200': description: OK content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/CheckFlagResponseData' params: type: object description: Input parameters title: CheckFlagParams required: - data - params title: CheckFlagResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /flags/check: post: operationId: checkFlags summary: Check flags tags: - features requestBody: content: application/json: schema: $ref: '#/components/schemas/CheckFlagRequestBody' required: true responses: '201': description: Created content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/CheckFlagsResponseData' params: type: object description: Input parameters title: CheckFlagsParams required: - data - params title: CheckFlagsResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /flags/check-bulk: post: operationId: checkFlagsBulk summary: Check flags bulk tags: - features requestBody: content: application/json: schema: $ref: '#/components/schemas/CheckFlagsBulkRequestBody' required: true responses: '201': description: Created content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/CheckFlagsBulkResponseData' params: type: object description: Input parameters title: CheckFlagsBulkParams required: - data - params title: CheckFlagsBulkResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /flags/count: get: operationId: countFlags summary: Count flags tags: - features parameters: - name: feature_id in: query schema: type: string - name: ids in: query schema: type: array items: type: string maxItems: 100 - name: q in: query description: Search by flag name, key, or ID schema: type: string description: Search by flag name, key, or ID maxLength: 512 - name: limit in: query description: Page limit (default 100) schema: type: integer description: Page limit (default 100) format: int64 example: '100' - name: offset in: query description: Page offset (default 0) schema: type: integer description: Page offset (default 0) format: int64 example: '0' responses: '200': description: OK content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/CountResponse' params: type: object description: Input parameters properties: feature_id: type: string ids: type: array items: type: string maxItems: 100 limit: type: integer description: Page limit (default 100) format: int64 example: '100' offset: type: integer description: Page offset (default 0) format: int64 example: '0' q: type: string description: Search by flag name, key, or ID maxLength: 512 title: CountFlagsParams required: - data - params title: CountFlagsResponse '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' components: schemas: MetricPeriod: type: string enum: - all_time - current_day - current_month - current_week FeatureDetailResponseData: type: object properties: billing_linked_resource: $ref: '#/components/schemas/BillingLinkedResourceResponseData' created_at: type: string format: date-time description: type: string event_subtype: type: string nullable: true event_summary: $ref: '#/components/schemas/EventSummaryResponseData' feature_type: $ref: '#/components/schemas/FeatureType' flags: type: array items: $ref: '#/components/schemas/FlagDetailResponseData' maxItems: 1000 icon: type: string id: type: string lifecycle_phase: allOf: - $ref: '#/components/schemas/FeatureLifecyclePhase' nullable: true maintainer: $ref: '#/components/schemas/AccountMemberResponseData' maintainer_account_member_id: type: string nullable: true name: type: string plans: type: array items: $ref: '#/components/schemas/PreviewObject' maxItems: 1000 plural_name: type: string nullable: true singular_name: type: string nullable: true trait: $ref: '#/components/schemas/EntityTraitDefinitionResponseData' trait_id: type: string nullable: true updated_at: type: string format: date-time required: - id - name - description - feature_type - icon - created_at - updated_at - flags - plans title: FeatureDetailResponseData CreateOrUpdateFlagRequestBody: type: object properties: default_value: type: boolean description: type: string maxLength: 1024 feature_id: type: string nullable: true flag_type: $ref: '#/components/schemas/FlagType' id: type: string nullable: true key: type: string maxLength: 512 maintainer_account_member_id: type: string nullable: true name: type: string maxLength: 512 required: - default_value - description - flag_type - key - name title: CreateOrUpdateFlagRequestBody EntitlementValueType: type: string enum: - boolean - credit - numeric - trait - unknown - unlimited CreateBillingLinkedFeatureRequestBody: type: object properties: billing_provider: $ref: '#/components/schemas/BillingProviderType' description: type: string maxLength: 1024 event_subtype: type: string nullable: true external_resource_id: type: string maxLength: 255 feature_type: $ref: '#/components/schemas/FeatureType' flag: $ref: '#/components/schemas/CreateOrUpdateFlagRequestBody' icon: type: string nullable: true lifecycle_phase: allOf: - $ref: '#/components/schemas/FeatureLifecyclePhase' nullable: true maintainer_account_member_id: type: string nullable: true name: type: string maxLength: 512 plural_name: type: string nullable: true singular_name: type: string nullable: true trait_id: type: string nullable: true required: - description - feature_type - name - billing_provider - external_resource_id title: CreateBillingLinkedFeatureRequestBody FeatureType: type: string enum: - boolean - event - trait FeatureResponseData: type: object properties: created_at: type: string format: date-time description: type: string event_subtype: type: string nullable: true feature_type: $ref: '#/components/schemas/FeatureType' icon: type: string id: type: string lifecycle_phase: allOf: - $ref: '#/components/schemas/FeatureLifecyclePhase' nullable: true maintainer_account_member_id: type: string nullable: true name: type: string plural_name: type: string nullable: true singular_name: type: string nullable: true trait_id: type: string nullable: true updated_at: type: string format: date-time required: - id - name - description - feature_type - icon - created_at - updated_at title: FeatureResponseData BillingLinkedResourceResponseData: type: object properties: billing_provider: $ref: '#/components/schemas/BillingProviderType' external_resource_id: type: string originator: $ref: '#/components/schemas/BillingProviderType' required: - billing_provider - external_resource_id - originator title: BillingLinkedResourceResponseData ApiError: type: object properties: error: type: string description: Error message required: - error CreateFlagRequestBody: type: object properties: default_value: type: boolean description: type: string maxLength: 1024 feature_id: type: string nullable: true flag_type: $ref: '#/components/schemas/FlagType' key: type: string maxLength: 512 maintainer_account_member_id: type: string nullable: true name: type: string maxLength: 512 required: - default_value - description - flag_type - key - name title: CreateFlagRequestBody CheckFlagResponseData: type: object properties: company_id: type: string description: If company keys were provided and matched a company, its ID nullable: true entitlement: allOf: - $ref: '#/components/schemas/FeatureEntitlement' description: If a feature entitlement rule was matched, its entitlement details error: type: string description: If an error occurred while checking the flag, the error message nullable: true feature_allocation: type: integer description: 'Deprecated: Use Entitlement.Allocation instead.' format: int64 nullable: true deprecated: true feature_usage: type: integer description: 'Deprecated: Use Entitlement.Usage instead.' format: int64 nullable: true deprecated: true feature_usage_event: type: string description: 'Deprecated: Use Entitlement.EventName instead.' nullable: true deprecated: true feature_usage_period: allOf: - $ref: '#/components/schemas/MetricPeriod' description: 'Deprecated: Use Entitlement.MetricPeriod instead.' nullable: true deprecated: true feature_usage_reset_at: type: string description: 'Deprecated: Use Entitlement.MetricResetAt instead.' format: date-time nullable: true deprecated: true flag: type: string description: The key used to check the flag flag_id: type: string description: If a flag was found, its ID nullable: true reason: type: string description: A human-readable explanation of the result rule_id: type: string description: If a rule was found, its ID nullable: true rule_type: allOf: - $ref: '#/components/schemas/RuleType' description: If a rule was found, its type nullable: true user_id: type: string description: If user keys were provided and matched a user, its ID nullable: true value: type: boolean description: A boolean flag check result; for feature entitlements, this represents whether further consumption of the feature is permitted required: - flag - reason - value title: CheckFlagResponseData EntityType: type: string enum: - company - user MetricPeriodMonthReset: type: string enum: - billing_cycle - first_of_month RuleDetailResponseData: type: object properties: condition_groups: type: array items: $ref: '#/components/schemas/RuleConditionGroupDetailResponseData' maxItems: 1000 conditions: type: array items: $ref: '#/components/schemas/RuleConditionDetailResponseData' maxItems: 1000 created_at: type: string format: date-time environment_id: type: string flag_id: type: string nullable: true id: type: string name: type: string priority: type: integer format: int64 rule_type: $ref: '#/components/schemas/RuleType' updated_at: type: string format: date-time value: type: boolean required: - id - environment_id - priority - name - rule_type - value - created_at - updated_at - conditions - condition_groups title: RuleDetailResponseData RuleType: type: string enum: - company_override - company_override_usage_exceeded - default - global_override - plan_entitlement - plan_entitlement_usage_exceeded - standard AccountMemberResponseData: type: object properties: created_at: type: string format: date-time email: type: string nullable: true id: type: string image_url: type: string nullable: true name: type: string nullable: true permissions: additionalProperties: type: array items: $ref: '#/components/schemas/AccountMemberPermission' maxItems: 64 type: object role: allOf: - $ref: '#/components/schemas/AccountMemberRole' nullable: true updated_at: type: string format: date-time required: - created_at - id - permissions - updated_at title: AccountMemberResponseData EntityTraitDefinitionResponseData: type: object properties: created_at: type: string format: date-time display_name: type: string entity_type: $ref: '#/components/schemas/EntityType' hierarchy: type: array items: type: string maxItems: 1000 id: type: string trait_type: $ref: '#/components/schemas/TraitType' updated_at: type: string format: date-time required: - created_at - display_name - entity_type - hierarchy - id - trait_type - updated_at title: EntityTraitDefinitionResponseData BillingProviderType: type: string enum: - orb - schematic - stripe EventSummaryResponseData: type: object properties: company_count: type: integer format: int64 environment_id: type: string event_count: type: integer format: int64 event_subtype: type: string last_seen_at: type: string format: date-time nullable: true user_count: type: integer format: int64 required: - company_count - environment_id - event_count - event_subtype - user_count title: EventSummaryResponseData CreateOrUpdateConditionGroupRequestBody: type: object properties: conditions: type: array items: $ref: '#/components/schemas/CreateOrUpdateConditionRequestBody' maxItems: 100 flag_id: type: string nullable: true id: type: string nullable: true required: - conditions title: CreateOrUpdateConditionGroupRequestBody TrialStatus: type: string enum: - active - converted - expired CheckFlagsBulkRequestBody: type: object properties: contexts: type: array items: $ref: '#/components/schemas/CheckFlagRequestBody' maxItems: 100 minItems: 1 required: - contexts title: CheckFlagsBulkRequestBody CheckFlagRequestBody: type: object properties: company: additionalProperties: type: string maxLength: 255 type: object nullable: true user: additionalProperties: type: string maxLength: 255 type: object nullable: true title: CheckFlagRequestBody DatastreamCompanyPlan: type: object properties: id: type: string name: type: string trial_end_date: type: string format: date-time nullable: true trial_status: allOf: - $ref: '#/components/schemas/TrialStatus' nullable: true required: - id - name title: DatastreamCompanyPlan FlagDetailResponseData: type: object properties: created_at: type: string format: date-time default_value: type: boolean description: type: string feature: $ref: '#/components/schemas/FeatureResponseData' feature_id: type: string nullable: true flag_type: $ref: '#/components/schemas/FlagType' id: type: string key: type: string last_checked_at: type: string format: date-time nullable: true maintainer: $ref: '#/components/schemas/AccountMemberResponseData' maintainer_account_member_id: type: string nullable: true name: type: string rules: type: array items: $ref: '#/components/schemas/RuleDetailResponseData' maxItems: 1000 updated_at: type: string format: date-time required: - created_at - default_value - description - flag_type - id - key - name - updated_at - rules title: FlagDetailResponseData ComparableOperator: type: string enum: - eq - gt - gte - is_empty - lt - lte - not_empty - ne ConditionType: type: string enum: - base_plan - billing_product - company - credit - metric - plan - plan_version - trait - user DeleteResponse: type: object properties: deleted: type: boolean description: Whether the delete was successful RulesDetailResponseData: type: object properties: flag: $ref: '#/components/schemas/FlagResponseData' rules: type: array items: $ref: '#/components/schemas/RuleDetailResponseData' maxItems: 1000 required: - rules title: RulesDetailResponseData FlagResponseData: type: object properties: created_at: type: string format: date-time default_value: type: boolean description: type: string feature_id: type: string nullable: true flag_type: $ref: '#/components/schemas/FlagType' id: type: string key: type: string maintainer_account_member_id: type: string nullable: true name: type: string updated_at: type: string format: date-time required: - created_at - default_value - description - flag_type - id - key - name - updated_at title: FlagResponseData FeatureEntitlement: type: object properties: allocation: type: integer description: If the company has a numeric entitlement for this feature, the allocated amount format: int64 nullable: true credit_id: type: string description: If the company has a credit-based entitlement for this feature, the ID of the credit nullable: true credit_remaining: type: number description: If the company has a credit-based entitlement for this feature, the remaining credit amount nullable: true credit_total: type: number description: If the company has a credit-based entitlement for this feature, the total credit amount nullable: true credit_used: type: number description: If the company has a credit-based entitlement for this feature, the amount of credit used nullable: true event_name: type: string description: If the feature is event-based, the name of the event tracked for usage nullable: true feature_id: type: string description: The ID of the feature feature_key: type: string description: The key of the flag associated with the feature metric_period: allOf: - $ref: '#/components/schemas/MetricPeriod' description: For event-based feature entitlements, the period over which usage is tracked nullable: true metric_reset_at: type: string description: For event-based feature entitlements, when the usage period will reset format: date-time nullable: true month_reset: allOf: - $ref: '#/components/schemas/MetricPeriodMonthReset' description: For event-based feature entitlements that have a monthly period, whether that monthly reset is based on the calendar month or a billing cycle nullable: true soft_limit: type: integer description: For usage-based pricing, the soft limit for overage charges or the next tier boundary format: int64 nullable: true usage: type: integer description: If the company has a numeric entitlement for this feature, the current usage amount format: int64 nullable: true value_type: allOf: - $ref: '#/components/schemas/EntitlementValueType' description: The type of the entitlement value required: - feature_id - feature_key - value_type title: FeatureEntitlement AccountMemberPermission: type: string enum: - billing_credits_edit - companies_edit - company_users_edit - components_edit - data_exports_edit - features_edit - flag_rules_edit - flags_edit - overrides_edit - plan_billing_edit - plan_entitlements_edit - plan_versions_edit - plans_edit - webhooks_edit - webhooks_reveal_secret PreviewObject: type: object properties: description: type: string nullable: true id: type: string image_url: type: string nullable: true name: type: string required: - id - name title: PreviewObject FlagType: type: string enum: - boolean CheckFlagsResponseData: type: object properties: flags: type: array items: $ref: '#/components/schemas/CheckFlagResponseData' maxItems: 1000 plan: $ref: '#/components/schemas/DatastreamCompanyPlan' required: - flags title: CheckFlagsResponseData CreateOrUpdateRuleRequestBody: type: object properties: condition_groups: type: array items: $ref: '#/components/schemas/CreateOrUpdateConditionGroupRequestBody' maxItems: 100 conditions: type: array items: $ref: '#/components/schemas/CreateOrUpdateConditionRequestBody' maxItems: 100 id: type: string nullable: true name: type: string maxLength: 512 priority: type: integer format: int64 rule_type: allOf: - $ref: '#/components/schemas/RuleType' nullable: true value: type: boolean required: - condition_groups - conditions - name - priority - value title: CreateOrUpdateRuleRequestBody CheckFlagsBulkResponseData: type: object properties: data: type: array items: $ref: '#/components/schemas/CheckFlagsResponseData' maxItems: 1000 required: - data title: CheckFlagsBulkResponseData CreateOrUpdateConditionRequestBody: type: object properties: comparison_trait_id: type: string description: Optionally provide a trait ID to compare a metric or trait value against instead of a value nullable: true condition_type: $ref: '#/components/schemas/ConditionType' credit_cost: type: number description: Cost of credit to use to measure this condition nullable: true credit_id: type: string description: ID of credit to use to measure this condition nullable: true event_subtype: type: string description: Name of track event type used to measure this condition nullable: true id: type: string nullable: true metric_period: allOf: - $ref: '#/components/schemas/MetricPeriod' description: Period of time over which to measure the track event metric nullable: true metric_period_month_reset: allOf: - $ref: '#/components/schemas/MetricPeriodMonthReset' description: When metric_period=current_month, specify whether the month restarts based on the calendar month or the billing period nullable: true metric_value: type: integer description: Value to compare the track event metric against format: int64 nullable: true operator: $ref: '#/components/schemas/ComparableOperator' resource_ids: type: array description: List of resource IDs (companies, users, or plans) targeted by this condition items: type: string maxItems: 1000 trait_id: type: string description: ID of trait to use to measure this condition nullable: true trait_value: type: string description: Value to compare the trait value against nullable: true required: - condition_type - operator - resource_ids title: CreateOrUpdateConditionRequestBody UpdateFlagRulesRequestBody: type: object properties: rules: type: array items: $ref: '#/components/schemas/CreateOrUpdateRuleRequestBody' maxItems: 100 required: - rules title: UpdateFlagRulesRequestBody RuleConditionDetailResponseData: type: object properties: comparison_trait: $ref: '#/components/schemas/EntityTraitDefinitionResponseData' comparison_trait_id: type: string nullable: true condition_group_id: type: string nullable: true condition_type: $ref: '#/components/schemas/ConditionType' created_at: type: string format: date-time environment_id: type: string event_subtype: type: string nullable: true flag_id: type: string nullable: true id: type: string metric_period: allOf: - $ref: '#/components/schemas/MetricPeriod' nullable: true metric_period_month_reset: allOf: - $ref: '#/components/schemas/MetricPeriodMonthReset' nullable: true metric_value: type: integer format: int64 nullable: true operator: $ref: '#/components/schemas/ComparableOperator' resource_ids: type: array items: type: string maxItems: 1000 resources: type: array items: $ref: '#/components/schemas/PreviewObjectResponseData' maxItems: 1000 rule_id: type: string trait: $ref: '#/components/schemas/EntityTraitDefinitionResponseData' trait_entity_type: allOf: - $ref: '#/components/schemas/EntityType' nullable: true trait_id: type: string nullable: true trait_value: type: string updated_at: type: string format: date-time required: - id - environment_id - rule_id - condition_type - operator - created_at - updated_at - resource_ids - trait_value - resources title: RuleConditionDetailResponseData CreateFeatureRequestBody: type: object properties: description: type: string maxLength: 1024 event_subtype: type: string nullable: true feature_type: $ref: '#/components/schemas/FeatureType' flag: $ref: '#/components/schemas/CreateOrUpdateFlagRequestBody' icon: type: string nullable: true lifecycle_phase: allOf: - $ref: '#/components/schemas/FeatureLifecyclePhase' nullable: true maintainer_account_member_id: type: string nullable: true name: type: string maxLength: 512 plural_name: type: string nullable: true singular_name: type: string nullable: true trait_id: type: string nullable: true required: - description - feature_type - name title: CreateFeatureRequestBody TraitType: type: string enum: - boolean - currency - date - number - string - url PreviewObjectResponseData: type: object properties: description: type: string nullable: true id: type: string image_url: type: string nullable: true name: type: string required: - id - name title: PreviewObjectResponseData CountResponse: type: object properties: count: type: integer description: The number of resources UpdateFeatureRequestBody: type: object properties: description: type: string nullable: true maxLength: 1024 event_subtype: type: string nullable: true feature_type: allOf: - $ref: '#/components/schemas/FeatureType' nullable: true flag: $ref: '#/components/schemas/CreateOrUpdateFlagRequestBody' icon: type: string nullable: true lifecycle_phase: allOf: - $ref: '#/components/schemas/FeatureLifecyclePhase' nullable: true maintainer_account_member_id: type: string nullable: true name: type: string nullable: true maxLength: 512 plural_name: type: string nullable: true singular_name: type: string nullable: true trait_id: type: string nullable: true title: UpdateFeatureRequestBody AccountMemberRole: type: string enum: - admin - member RuleConditionGroupDetailResponseData: type: object properties: conditions: type: array items: $ref: '#/components/schemas/RuleConditionDetailResponseData' maxItems: 1000 created_at: type: string format: date-time environment_id: type: string flag_id: type: string nullable: true id: type: string rule_id: type: string updated_at: type: string format: date-time required: - id - environment_id - rule_id - created_at - updated_at - conditions title: RuleConditionGroupDetailResponseData FeatureLifecyclePhase: type: string enum: - add_on - alpha - beta - deprecated - ga - inactive - in_plan - internal_testing - legacy responses: Forbidden: description: Forbidden content: application/json: schema: $ref: '#/components/schemas/ApiError' ServerError: description: Server error content: application/json: schema: $ref: '#/components/schemas/ApiError' NotFound: description: Not found content: application/json: schema: $ref: '#/components/schemas/ApiError' Unauthorized: description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/ApiError' BadRequest: description: Bad request content: application/json: schema: $ref: '#/components/schemas/ApiError' securitySchemes: ApiKeyAuth: type: apiKey in: header name: X-Schematic-Api-Key