{"openapi":"3.1.0","info":{"title":"API Reference","version":"1.0.0"},"paths":{"/api-keys":{"get":{"operationId":"accounts_listApiKeys","summary":"List api keys","tags":["accounts"],"parameters":[{"name":"environment_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"require_environment","in":"query","required":true,"schema":{"type":"boolean"}},{"name":"limit","in":"query","description":"Page limit (default 100)","required":false,"schema":{"type":"integer","format":"int64","minimum":0,"maximum":250}},{"name":"offset","in":"query","description":"Page offset (default 0)","required":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/accounts_listApiKeys_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]},"post":{"operationId":"postApiKeys","summary":"Post Api Keys","responses":{"200":{"description":"Successful response"}},"security":[{"ApiKeyAuth":[]}]}},"/api-keys/{api_key_id}":{"get":{"operationId":"accounts_getApiKey","summary":"Get api key","tags":["accounts"],"parameters":[{"name":"api_key_id","in":"path","description":"api_key_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/accounts_getApiKey_Response_200"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]},"put":{"operationId":"putApiKeysApiKeyId","summary":"Put Api Keys Api Key Id","parameters":[{"name":"api_key_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response"}},"security":[{"ApiKeyAuth":[]}]},"delete":{"operationId":"deleteApiKeysApiKeyId","summary":"Delete Api Keys Api Key Id","parameters":[{"name":"api_key_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response"}},"security":[{"ApiKeyAuth":[]}]}},"/environments":{"post":{"operationId":"postEnvironments","summary":"Post Environments","responses":{"200":{"description":"Successful response"}},"security":[{"ApiKeyAuth":[]}]}},"/environments/{environment_id}":{"put":{"operationId":"putEnvironmentsEnvironmentId","summary":"Put Environments Environment Id","parameters":[{"name":"environment_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response"}},"security":[{"ApiKeyAuth":[]}]},"delete":{"operationId":"deleteEnvironmentsEnvironmentId","summary":"Delete Environments Environment Id","parameters":[{"name":"environment_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response"}},"security":[{"ApiKeyAuth":[]}]}},"/plans":{"get":{"operationId":"plans_listPlans","summary":"List plans","tags":["plans"],"parameters":[{"name":"company_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"company_scoped_only","in":"query","description":"Only return plans that are scoped to a company (custom plans assigned to a company)","required":false,"schema":{"type":"boolean"}},{"name":"exclude_company_scoped","in":"query","description":"Exclude plans that are scoped to a company (custom plans assigned to a company)","required":false,"schema":{"type":"boolean"}},{"name":"exclude_unused","in":"query","description":"Exclude plans that nothing is using: no company is on the plan and it has no draft version","required":false,"schema":{"type":"boolean"}},{"name":"for_fallback_plan","in":"query","description":"Filter for plans valid as fallback plans (not linked to billing)","required":false,"schema":{"type":"boolean"}},{"name":"for_initial_plan","in":"query","description":"Filter for plans valid as initial plans (not linked to billing, free, or auto-cancelling trial)","required":false,"schema":{"type":"boolean"}},{"name":"for_trial_expiry_plan","in":"query","description":"Filter for plans valid as trial expiry plans (not linked to billing or free)","required":false,"schema":{"type":"boolean"}},{"name":"has_product_id","in":"query","description":"Filter out plans that do not have a billing product ID","required":false,"schema":{"type":"boolean"}},{"name":"ids","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"include_draft_versions","in":"query","description":"Include billing settings from draft versions for plans which have draft version","required":false,"schema":{"type":"boolean"}},{"name":"plan_type","in":"query","description":"Filter by plan type","required":false,"schema":{"$ref":"#/components/schemas/PlanType"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"scoped_to_company_id","in":"query","description":"Filter plans scoped to a specific company (custom plans)","required":false,"schema":{"type":"string"}},{"name":"with_entitlements","in":"query","description":"Include each plan's entitlements in the response","required":false,"schema":{"type":"boolean"}},{"name":"with_published_version","in":"query","description":"Only return plans that have a published version","required":false,"schema":{"type":"boolean"}},{"name":"without_entitlement_for_include_drafts","in":"query","description":"With without_entitlement_for, also treat an entitlement on a plan's draft version as existing","required":false,"schema":{"type":"boolean"}},{"name":"without_entitlement_for","in":"query","description":"Filter out plans that already have a plan entitlement for the specified feature ID","required":false,"schema":{"type":"string"}},{"name":"without_paid_product_id","in":"query","description":"Filter out plans that have a paid billing product ID","required":false,"schema":{"type":"boolean"}},{"name":"limit","in":"query","description":"Page limit (default 100)","required":false,"schema":{"type":"integer","format":"int64","minimum":0,"maximum":250}},{"name":"offset","in":"query","description":"Page offset (default 0)","required":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/plans_listPlans_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]},"post":{"operationId":"plans_createPlan","summary":"Create plan","tags":["plans"],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/plans_createPlan_Response_201"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePlanRequestBody"}}}},"security":[{"ApiKeyAuth":[]}]}},"/plans/{plan_id}":{"get":{"operationId":"plans_getPlan","summary":"Get plan","tags":["plans"],"parameters":[{"name":"plan_id","in":"path","description":"plan_id","required":true,"schema":{"type":"string"}},{"name":"plan_version_id","in":"query","description":"Fetch billing settings for a specific plan version","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/plans_getPlan_Response_200"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]},"put":{"operationId":"plans_updatePlan","summary":"Update plan","tags":["plans"],"parameters":[{"name":"plan_id","in":"path","description":"plan_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/plans_updatePlan_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePlanRequestBody"}}}},"security":[{"ApiKeyAuth":[]}]},"delete":{"operationId":"plans_deletePlan","summary":"Delete plan","tags":["plans"],"parameters":[{"name":"plan_id","in":"path","description":"plan_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/plans_deletePlan_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/companies":{"get":{"operationId":"companies_listCompanies","summary":"List companies","tags":["companies"],"parameters":[{"name":"cancel_at_period_end","in":"query","description":"If true, filter companies with an active subscription that is set to cancel at the end of the current period; if false, filter companies without one","required":false,"schema":{"type":"boolean"}},{"name":"credit_type_ids","in":"query","description":"Filter companies by one or more credit type IDs (each ID starts with bcrd_)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"has_scheduled_downgrade","in":"query","description":"If true, filter companies that have a pending scheduled downgrade; if false, filter companies that do not","required":false,"schema":{"type":"boolean"}},{"name":"ids","in":"query","description":"Filter companies by multiple company IDs (starts with comp_)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"monetized_subscriptions","in":"query","description":"Filter companies that have monetized subscriptions","required":false,"schema":{"type":"boolean"}},{"name":"plan_id","in":"query","description":"Filter companies by plan ID (starts with plan_)","required":false,"schema":{"type":"string"}},{"name":"plan_ids","in":"query","description":"Filter companies by one or more plan IDs (each ID starts with plan_)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"plan_version_id","in":"query","description":"Filter companies by plan version ID (starts with plvr_)","required":false,"schema":{"type":"string"}},{"name":"plan_version_ids","in":"query","description":"Filter companies by one or more plan version IDs (each ID starts with plvr_). Takes precedence over plan_version_id when set.","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"plan_version_unpublished","in":"query","description":"Filter companies assigned to a plan version that is no longer published, meaning the plan has since moved on to a newer version","required":false,"schema":{"type":"boolean"}},{"name":"q","in":"query","description":"Search for companies by name, keys or string traits","required":false,"schema":{"type":"string","maxLength":512}},{"name":"sort_order_column","in":"query","description":"Column to sort by (e.g. name, created_at, last_seen_at)","required":false,"schema":{"type":"string","maxLength":255}},{"name":"sort_order_direction","in":"query","description":"Direction to sort by (asc or desc)","required":false,"schema":{"$ref":"#/components/schemas/SortDirection"}},{"name":"subscription_statuses","in":"query","description":"Filter companies by one or more subscription statuses","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionStatus"}}},{"name":"subscription_types","in":"query","description":"Filter companies by one or more subscription types","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionType"}}},{"name":"with_entitlement_for","in":"query","description":"Filter companies that have an entitlement (plan entitlement or company override) for the specified feature ID","required":false,"schema":{"type":"string"}},{"name":"without_feature_override_for","in":"query","description":"Filter out companies that have an unexpired company override for the specified feature ID","required":false,"schema":{"type":"string"}},{"name":"without_plan","in":"query","description":"Filter out companies that have a plan","required":false,"schema":{"type":"boolean"}},{"name":"without_subscription","in":"query","description":"Filter out companies that have a subscription","required":false,"schema":{"type":"boolean"}},{"name":"with_subscription","in":"query","description":"Filter companies that have a subscription","required":false,"schema":{"type":"boolean"}},{"name":"limit","in":"query","description":"Page limit (default 100)","required":false,"schema":{"type":"integer","format":"int64","minimum":0,"maximum":250}},{"name":"offset","in":"query","description":"Page offset (default 0)","required":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/companies_listCompanies_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]},"post":{"operationId":"companies_upsertCompany","summary":"Upsert company","tags":["companies"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/companies_upsertCompany_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertCompanyRequestBody"}}}},"security":[{"ApiKeyAuth":[]}]}},"/companies/lookup":{"get":{"operationId":"companies_lookupCompany","summary":"Lookup company","description":"Company lookup is determined to resolve a company from its keys, similar to how many of our other apis work. \nThe following approaches will all work to resolve a company and any of them are appropriate:\n1. `/companies/lookup?keys={\"foo\": \"bar\", \"fizz\": \"buzz\"}`\n2. `/companies/lookup?keys[foo]=bar&keys[fizz]=buzz`\n2. `/companies/lookup?foo=bar&fizz=buzz`\n","tags":["companies"],"parameters":[{"name":"keys","in":"query","description":"Key/value pairs","required":true,"schema":{"type":"object","additionalProperties":{"type":"string"}}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/companies_lookupCompany_Response_200"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/companies/{company_id}":{"delete":{"operationId":"companies_deleteCompany","summary":"Delete company","tags":["companies"],"parameters":[{"name":"company_id","in":"path","description":"company_id","required":true,"schema":{"type":"string"}},{"name":"cancel_subscription","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"prorate","in":"query","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/companies_deleteCompany_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/companies/delete":{"post":{"operationId":"companies_deleteCompanyByKeys","summary":"Delete company by keys","tags":["companies"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/companies_deleteCompanyByKeys_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeysRequestBody"}}}},"security":[{"ApiKeyAuth":[]}]}},"/company-memberships":{"get":{"operationId":"companies_listCompanyMemberships","summary":"List company memberships","tags":["companies"],"parameters":[{"name":"company_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"user_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Page limit (default 100)","required":false,"schema":{"type":"integer","format":"int64","minimum":0,"maximum":250}},{"name":"offset","in":"query","description":"Page offset (default 0)","required":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/companies_listCompanyMemberships_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]},"post":{"operationId":"companies_getOrCreateCompanyMembership","summary":"Get or create company membership","tags":["companies"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/companies_getOrCreateCompanyMembership_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetOrCreateCompanyMembershipRequestBody"}}}},"security":[{"ApiKeyAuth":[]}]}},"/company-memberships/{company_membership_id}":{"delete":{"operationId":"companies_deleteCompanyMembership","summary":"Delete company membership","tags":["companies"],"parameters":[{"name":"company_membership_id","in":"path","description":"company_membership_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/companies_deleteCompanyMembership_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/company-traits":{"post":{"operationId":"companies_upsertCompanyTrait","summary":"Upsert company trait","tags":["companies"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/companies_upsertCompanyTrait_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertTraitRequestBody"}}}},"security":[{"ApiKeyAuth":[]}]}},"/users":{"get":{"operationId":"companies_listUsers","summary":"List users","tags":["companies"],"parameters":[{"name":"company_id","in":"query","description":"Filter users by company ID (starts with comp_)","required":false,"schema":{"type":"string"}},{"name":"ids","in":"query","description":"Filter users by multiple user IDs (starts with user_)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"plan_id","in":"query","description":"Filter users by plan ID (starts with plan_)","required":false,"schema":{"type":"string"}},{"name":"q","in":"query","description":"Search for users by name, keys or string traits","required":false,"schema":{"type":"string","maxLength":512}},{"name":"limit","in":"query","description":"Page limit (default 100)","required":false,"schema":{"type":"integer","format":"int64","minimum":0,"maximum":250}},{"name":"offset","in":"query","description":"Page offset (default 0)","required":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/companies_listUsers_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]},"post":{"operationId":"companies_upsertUser","summary":"Upsert user","tags":["companies"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/companies_upsertUser_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertUserRequestBody"}}}},"security":[{"ApiKeyAuth":[]}]}},"/users/lookup":{"get":{"operationId":"companies_lookupUser","summary":"Lookup user","tags":["companies"],"parameters":[{"name":"keys","in":"query","description":"Key/value pairs","required":true,"schema":{"type":"object","additionalProperties":{"type":"string"}}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/companies_lookupUser_Response_200"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/users/{user_id}":{"delete":{"operationId":"companies_deleteUser","summary":"Delete user","tags":["companies"],"parameters":[{"name":"user_id","in":"path","description":"user_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/companies_deleteUser_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/users/delete":{"post":{"operationId":"companies_deleteUserByKeys","summary":"Delete user by keys","tags":["companies"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/companies_deleteUserByKeys_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeysRequestBody"}}}},"security":[{"ApiKeyAuth":[]}]}},"/user-traits":{"post":{"operationId":"companies_upsertUserTrait","summary":"Upsert user trait","tags":["companies"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/companies_upsertUserTrait_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertTraitRequestBody"}}}},"security":[{"ApiKeyAuth":[]}]}},"/events":{"get":{"operationId":"events_listEvents","summary":"List events","tags":["events"],"parameters":[{"name":"company_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"event_subtype","in":"query","required":false,"schema":{"type":"string","maxLength":255}},{"name":"event_types","in":"query","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/EventType"}}},{"name":"flag_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"idempotency_key","in":"query","required":false,"schema":{"type":"string","maxLength":255}},{"name":"user_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Page limit (default 100)","required":false,"schema":{"type":"integer","format":"int64","minimum":0,"maximum":250}},{"name":"offset","in":"query","description":"Page offset (default 0)","required":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/events_listEvents_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]},"post":{"operationId":"events_createEvent","summary":"Create event","tags":["events"],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/events_createEvent_Response_201"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEventRequestBody"}}}},"security":[{"ApiKeyAuth":[]}]}},"/event-batch":{"post":{"operationId":"events_createEventBatch","summary":"Create event batch","tags":["events"],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/events_createEventBatch_Response_201"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEventBatchRequestBody"}}}},"security":[{"ApiKeyAuth":[]}]}},"/events/{event_id}":{"get":{"operationId":"events_getEvent","summary":"Get event","tags":["events"],"parameters":[{"name":"event_id","in":"path","description":"event_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/events_getEvent_Response_200"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/features":{"get":{"operationId":"features_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.","required":false,"schema":{"type":"boolean"}},{"name":"feature_type","in":"query","description":"Filter by one or more feature types (boolean, event, trait)","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/FeatureType"}}},{"name":"ids","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"managed_by","in":"query","description":"Filter for features managed by a billing provider, or by Schematic (no billing provider)","required":false,"schema":{"$ref":"#/components/schemas/BillingProviderType"}},{"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","required":false,"schema":{"type":"string"}},{"name":"q","in":"query","description":"Search by feature name or ID","required":false,"schema":{"type":"string","maxLength":512}},{"name":"without_company_override_for","in":"query","description":"Filter out features that have an unexpired company override for the specified company ID","required":false,"schema":{"type":"string"}},{"name":"without_plan_entitlement_for","in":"query","description":"Filter out features that already have a plan entitlement for the specified plan ID","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Page limit (default 100)","required":false,"schema":{"type":"integer","format":"int64","minimum":0,"maximum":250}},{"name":"offset","in":"query","description":"Page offset (default 0)","required":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/features_listFeatures_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]},"post":{"operationId":"features_createFeature","summary":"Create feature","tags":["features"],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/features_createFeature_Response_201"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFeatureRequestBody"}}}},"security":[{"ApiKeyAuth":[]}]}},"/features/{feature_id}":{"get":{"operationId":"features_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":{"$ref":"#/components/schemas/features_getFeature_Response_200"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]},"put":{"operationId":"features_updateFeature","summary":"Update 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":{"$ref":"#/components/schemas/features_updateFeature_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFeatureRequestBody"}}}},"security":[{"ApiKeyAuth":[]}]},"delete":{"operationId":"features_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":{"$ref":"#/components/schemas/features_deleteFeature_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/flags":{"get":{"operationId":"features_listFlags","summary":"List flags","tags":["features"],"parameters":[{"name":"feature_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"ids","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"q","in":"query","description":"Search by flag name, key, or ID","required":false,"schema":{"type":"string","maxLength":512}},{"name":"limit","in":"query","description":"Page limit (default 100)","required":false,"schema":{"type":"integer","format":"int64","minimum":0,"maximum":250}},{"name":"offset","in":"query","description":"Page offset (default 0)","required":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/features_listFlags_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]},"post":{"operationId":"features_createFlag","summary":"Create flag","tags":["features"],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/features_createFlag_Response_201"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFlagRequestBody"}}}},"security":[{"ApiKeyAuth":[]}]}},"/flags/{flag_id}":{"get":{"operationId":"features_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":{"$ref":"#/components/schemas/features_getFlag_Response_200"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]},"put":{"operationId":"features_updateFlag","summary":"Update 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":{"$ref":"#/components/schemas/features_updateFlag_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFlagRequestBody"}}}},"security":[{"ApiKeyAuth":[]}]},"delete":{"operationId":"features_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":{"$ref":"#/components/schemas/features_deleteFlag_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/flags/{flag_id}/rules":{"put":{"operationId":"features_updateFlagRules","summary":"Update flag rules","tags":["features"],"parameters":[{"name":"flag_id","in":"path","description":"flag_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/features_updateFlagRules_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFlagRulesRequestBody"}}}},"security":[{"ApiKeyAuth":[]}]}},"/flags/{key}/check":{"post":{"operationId":"features_checkFlag","summary":"Check flag","tags":["features"],"parameters":[{"name":"key","in":"path","description":"key","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/features_checkFlag_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckFlagRequestBody"}}}},"security":[{"ApiKeyAuth":[]}]}},"/flags/check":{"post":{"operationId":"features_checkFlags","summary":"Check flags","tags":["features"],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/features_checkFlags_Response_201"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckFlagRequestBody"}}}},"security":[{"ApiKeyAuth":[]}]}},"/company-overrides":{"get":{"operationId":"entitlements_listCompanyOverrides","summary":"List company overrides","tags":["entitlements"],"parameters":[{"name":"company_id","in":"query","description":"Filter company overrides by a single company ID (starting with comp_)","required":false,"schema":{"type":"string"}},{"name":"company_ids","in":"query","description":"Filter company overrides by multiple company IDs (starting with comp_)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"feature_id","in":"query","description":"Filter company overrides by a single feature ID (starting with feat_)","required":false,"schema":{"type":"string"}},{"name":"feature_ids","in":"query","description":"Filter company overrides by multiple feature IDs (starting with feat_)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"ids","in":"query","description":"Filter company overrides by multiple company override IDs (starting with cmov_)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"without_expired","in":"query","description":"Filter company overrides by whether they have not expired","required":false,"schema":{"type":"boolean"}},{"name":"q","in":"query","description":"Search for company overrides by feature or company name","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Page limit (default 100)","required":false,"schema":{"type":"integer","format":"int64","minimum":0,"maximum":250}},{"name":"offset","in":"query","description":"Page offset (default 0)","required":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/entitlements_listCompanyOverrides_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]},"post":{"operationId":"entitlements_createCompanyOverride","summary":"Create company override","tags":["entitlements"],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/entitlements_createCompanyOverride_Response_201"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCompanyOverrideRequestBody"}}}},"security":[{"ApiKeyAuth":[]}]}},"/company-overrides/{company_override_id}":{"get":{"operationId":"entitlements_getCompanyOverride","summary":"Get company override","tags":["entitlements"],"parameters":[{"name":"company_override_id","in":"path","description":"company_override_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/entitlements_getCompanyOverride_Response_200"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]},"put":{"operationId":"entitlements_updateCompanyOverride","summary":"Update company override","tags":["entitlements"],"parameters":[{"name":"company_override_id","in":"path","description":"company_override_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/entitlements_updateCompanyOverride_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCompanyOverrideRequestBody"}}}},"security":[{"ApiKeyAuth":[]}]},"delete":{"operationId":"entitlements_deleteCompanyOverride","summary":"Delete company override","tags":["entitlements"],"parameters":[{"name":"company_override_id","in":"path","description":"company_override_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/entitlements_deleteCompanyOverride_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/plan-entitlements":{"get":{"operationId":"entitlements_listPlanEntitlements","summary":"List plan entitlements","tags":["entitlements"],"parameters":[{"name":"feature_id","in":"query","description":"Filter plan entitlements by a single feature ID (starting with feat_)","required":false,"schema":{"type":"string"}},{"name":"feature_ids","in":"query","description":"Filter plan entitlements by multiple feature IDs (starting with feat_)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"ids","in":"query","description":"Filter plan entitlements by multiple plan entitlement IDs (starting with pltl_)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"plan_id","in":"query","description":"Filter plan entitlements by a single plan ID (starting with plan_)","required":false,"schema":{"type":"string"}},{"name":"plan_ids","in":"query","description":"Filter plan entitlements by multiple plan IDs (starting with plan_)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"plan_version_id","in":"query","description":"Filter plan entitlements by a single plan version ID (starting with plvr_)","required":false,"schema":{"type":"string"}},{"name":"plan_version_ids","in":"query","description":"Filter plan entitlements by multiple plan version IDs (starting with plvr_)","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"q","in":"query","description":"Search for plan entitlements by feature or company name","required":false,"schema":{"type":"string"}},{"name":"with_metered_products","in":"query","description":"Filter plan entitlements only with metered products","required":false,"schema":{"type":"boolean"}},{"name":"limit","in":"query","description":"Page limit (default 100)","required":false,"schema":{"type":"integer","format":"int64","minimum":0,"maximum":250}},{"name":"offset","in":"query","description":"Page offset (default 0)","required":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/entitlements_listPlanEntitlements_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]},"post":{"operationId":"entitlements_createPlanEntitlement","summary":"Create plan entitlement","tags":["entitlements"],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/entitlements_createPlanEntitlement_Response_201"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePlanEntitlementRequestBody"}}}},"security":[{"ApiKeyAuth":[]}]}},"/plan-entitlements/{plan_entitlement_id}":{"get":{"operationId":"entitlements_getPlanEntitlement","summary":"Get plan entitlement","tags":["entitlements"],"parameters":[{"name":"plan_entitlement_id","in":"path","description":"plan_entitlement_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/entitlements_getPlanEntitlement_Response_200"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]},"put":{"operationId":"entitlements_updatePlanEntitlement","summary":"Update plan entitlement","tags":["entitlements"],"parameters":[{"name":"plan_entitlement_id","in":"path","description":"plan_entitlement_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/entitlements_updatePlanEntitlement_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePlanEntitlementRequestBody"}}}},"security":[{"ApiKeyAuth":[]}]},"delete":{"operationId":"entitlements_deletePlanEntitlement","summary":"Delete plan entitlement","tags":["entitlements"],"parameters":[{"name":"plan_entitlement_id","in":"path","description":"plan_entitlement_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/entitlements_deletePlanEntitlement_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/feature-usage":{"get":{"operationId":"entitlements_listFeatureUsage","summary":"List feature usage","tags":["entitlements"],"parameters":[{"name":"company_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"company_keys","in":"query","required":false,"schema":{"type":"object","additionalProperties":{"type":"string"}}},{"name":"feature_ids","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"include_usage_aggregation","in":"query","description":"Include time-bucketed usage aggregation (today, this week, this month, billing period) for credit-based entitlements. Defaults to false for performance.","required":false,"schema":{"type":"boolean"}},{"name":"managed_by","in":"query","description":"Filter for features managed by a billing provider, or by Schematic (no billing provider)","required":false,"schema":{"$ref":"#/components/schemas/BillingProviderType"}},{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"without_negative_entitlements","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"limit","in":"query","description":"Page limit (default 100)","required":false,"schema":{"type":"integer","format":"int64","minimum":0,"maximum":250}},{"name":"offset","in":"query","description":"Page offset (default 0)","required":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/entitlements_listFeatureUsage_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/billing/credits":{"get":{"operationId":"credits_listBillingCredits","summary":"List credits","tags":["credits"],"parameters":[{"name":"ids","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"name","in":"query","required":false,"schema":{"type":"string","maxLength":255}},{"name":"limit","in":"query","description":"Page limit (default 100)","required":false,"schema":{"type":"integer","format":"int64","minimum":0,"maximum":250}},{"name":"offset","in":"query","description":"Page offset (default 0)","required":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/credits_listBillingCredits_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]},"post":{"operationId":"credits_createBillingCredit","summary":"Create credit","tags":["credits"],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/credits_createBillingCredit_Response_201"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBillingCreditRequestBody"}}}},"security":[{"ApiKeyAuth":[]}]}},"/billing/credits/{credit_id}":{"get":{"operationId":"credits_getSingleBillingCredit","summary":"Get credit","tags":["credits"],"parameters":[{"name":"credit_id","in":"path","description":"credit_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/credits_getSingleBillingCredit_Response_200"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]},"put":{"operationId":"credits_updateBillingCredit","summary":"Update credit","tags":["credits"],"parameters":[{"name":"credit_id","in":"path","description":"credit_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/credits_updateBillingCredit_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBillingCreditRequestBody"}}}},"security":[{"ApiKeyAuth":[]}]},"delete":{"operationId":"credits_softDeleteBillingCredit","summary":"Delete credit","tags":["credits"],"parameters":[{"name":"credit_id","in":"path","description":"credit_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/credits_softDeleteBillingCredit_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/billing/credits/bundles":{"get":{"operationId":"credits_listCreditBundles","summary":"List credit bundles","tags":["credits"],"parameters":[{"name":"ids","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"credit_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"$ref":"#/components/schemas/BillingCreditBundleStatus"}},{"name":"bundle_type","in":"query","required":false,"schema":{"$ref":"#/components/schemas/BillingCreditBundleType"}},{"name":"limit","in":"query","description":"Page limit (default 100)","required":false,"schema":{"type":"integer","format":"int64","minimum":0,"maximum":250}},{"name":"offset","in":"query","description":"Page offset (default 0)","required":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/credits_listCreditBundles_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]},"post":{"operationId":"credits_createCreditBundle","summary":"Create credit bundle","tags":["credits"],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/credits_createCreditBundle_Response_201"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCreditBundleRequestBody"}}}},"security":[{"ApiKeyAuth":[]}]}},"/billing/credits/bundles/{bundle_id}":{"get":{"operationId":"credits_getCreditBundle","summary":"Get credit bundle","tags":["credits"],"parameters":[{"name":"bundle_id","in":"path","description":"bundle_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/credits_getCreditBundle_Response_200"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]},"put":{"operationId":"credits_updateCreditBundleDetails","summary":"Update credit bundle","tags":["credits"],"parameters":[{"name":"bundle_id","in":"path","description":"bundle_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/credits_updateCreditBundleDetails_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCreditBundleDetailsRequestBody"}}}},"security":[{"ApiKeyAuth":[]}]},"delete":{"operationId":"credits_deleteCreditBundle","summary":"Delete credit bundle","tags":["credits"],"parameters":[{"name":"bundle_id","in":"path","description":"bundle_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/credits_deleteCreditBundle_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/billing/credits/grants/company":{"post":{"operationId":"credits_grantBillingCreditsToCompany","summary":"Grant credits to company","tags":["credits"],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/credits_grantBillingCreditsToCompany_Response_201"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCompanyCreditGrant"}}}},"security":[{"ApiKeyAuth":[]}]}},"/billing/credits/grants/company/list":{"get":{"operationId":"credits_listCompanyGrants","summary":"List company credit grants","tags":["credits"],"parameters":[{"name":"company_id","in":"query","required":true,"schema":{"type":"string"}},{"name":"order","in":"query","required":false,"schema":{"$ref":"#/components/schemas/CreditGrantSortOrder"}},{"name":"dir","in":"query","required":false,"schema":{"$ref":"#/components/schemas/SortDirection"}},{"name":"limit","in":"query","description":"Page limit (default 100)","required":false,"schema":{"type":"integer","format":"int64","minimum":0,"maximum":250}},{"name":"offset","in":"query","description":"Page offset (default 0)","required":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/credits_listCompanyGrants_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/billing/credits/grants/list":{"get":{"operationId":"credits_listGrantsForCredit","summary":"List credit grants","tags":["credits"],"parameters":[{"name":"credit_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"ids","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"limit","in":"query","description":"Page limit (default 100)","required":false,"schema":{"type":"integer","format":"int64","minimum":0,"maximum":250}},{"name":"offset","in":"query","description":"Page offset (default 0)","required":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/credits_listGrantsForCredit_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/billing/credits/grants/{grant_id}/zero-out":{"put":{"operationId":"credits_zeroOutGrant","summary":"Zero out credit grant","tags":["credits"],"parameters":[{"name":"grant_id","in":"path","description":"grant_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/credits_zeroOutGrant_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ZeroOutGrantRequestBody"}}}},"security":[{"ApiKeyAuth":[]}]}},"/billing/credits/plan-grants":{"get":{"operationId":"credits_listBillingPlanCreditGrants","summary":"List plan credit grants","tags":["credits"],"parameters":[{"name":"credit_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"ids","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"plan_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"plan_ids","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"plan_version_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"plan_version_ids","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"limit","in":"query","description":"Page limit (default 100)","required":false,"schema":{"type":"integer","format":"int64","minimum":0,"maximum":250}},{"name":"offset","in":"query","description":"Page offset (default 0)","required":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/credits_listBillingPlanCreditGrants_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]},"post":{"operationId":"credits_createBillingPlanCreditGrant","summary":"Create plan credit grant","tags":["credits"],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/credits_createBillingPlanCreditGrant_Response_201"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBillingPlanCreditGrantRequestBody"}}}},"security":[{"ApiKeyAuth":[]}]}},"/billing/credits/plan-grants/{plan_grant_id}":{"delete":{"operationId":"credits_deleteBillingPlanCreditGrant","summary":"Delete plan credit grant","tags":["credits"],"parameters":[{"name":"plan_grant_id","in":"path","description":"plan_grant_id","required":true,"schema":{"type":"string"}},{"name":"apply_to_existing","in":"query","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/credits_deleteBillingPlanCreditGrant_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/billing/credits/ledger":{"get":{"operationId":"getCreditLedger","summary":"Get credit ledger","responses":{"200":{"description":"Successful response"}},"security":[{"ApiKeyAuth":[]}]}},"/billing/credits/lease":{"post":{"operationId":"credits_acquireCreditLease","summary":"Acquire credit lease","tags":["credits"],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/credits_acquireCreditLease_Response_201"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Payment required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcquireCreditLeaseRequestBody"}}}},"security":[{"ApiKeyAuth":[]}]}},"/billing/credits/lease/{lease_id}/extend":{"put":{"operationId":"credits_extendCreditLease","summary":"Extend credit lease","tags":["credits"],"parameters":[{"name":"lease_id","in":"path","description":"lease_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/credits_extendCreditLease_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Payment required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtendCreditLeaseRequestBody"}}}},"security":[{"ApiKeyAuth":[]}]}},"/billing/credits/lease/{lease_id}/release":{"put":{"operationId":"credits_releaseCreditLease","summary":"Release credit lease","tags":["credits"],"parameters":[{"name":"lease_id","in":"path","description":"lease_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/credits_releaseCreditLease_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/account-members":{"get":{"operationId":"accounts_listAccountMembers","summary":"List account members","tags":["accounts"],"parameters":[{"name":"ids","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"q","in":"query","description":"Search filter","required":false,"schema":{"type":"string","maxLength":512}},{"name":"role","in":"query","description":"Filter by member role","required":false,"schema":{"$ref":"#/components/schemas/AccountMemberRole"}},{"name":"limit","in":"query","description":"Page limit (default 100)","required":false,"schema":{"type":"integer","format":"int64","minimum":0,"maximum":250}},{"name":"offset","in":"query","description":"Page offset (default 0)","required":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/accounts_listAccountMembers_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/account-members/{account_member_id}":{"get":{"operationId":"accounts_getAccountMember","summary":"Get account member","tags":["accounts"],"parameters":[{"name":"account_member_id","in":"path","description":"account_member_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/accounts_getAccountMember_Response_200"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/feature-usage-history":{"get":{"operationId":"entitlements_listFeatureUsageHistory","summary":"List feature usage history","tags":["entitlements"],"parameters":[{"name":"company_ids","in":"query","description":"Restrict to these company IDs; omit for every company in the environment","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"end_time","in":"query","description":"Exclusive end of the window; must fall on an hour boundary","required":true,"schema":{"type":"string","format":"date-time"}},{"name":"feature_ids","in":"query","description":"Restrict to these event features; omit for every event feature in the environment. Where several features measure the same event, each is reported separately and a page may carry more rows than the requested limit","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"granularity","in":"query","description":"Bucket the window; omit for a single total per company and feature","required":false,"schema":{"$ref":"#/components/schemas/TimeSeriesGranularity"}},{"name":"start_time","in":"query","description":"Inclusive start of the window; must fall on an hour boundary","required":true,"schema":{"type":"string","format":"date-time"}},{"name":"limit","in":"query","description":"Page limit (default 100)","required":false,"schema":{"type":"integer","format":"int64","minimum":0,"maximum":250}},{"name":"offset","in":"query","description":"Page offset (default 0)","required":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/entitlements_listFeatureUsageHistory_Response_200"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"ApiKeyAuth":[]}]}}},"tags":[{"name":"accounts"},{"name":"plans"},{"name":"companies"},{"name":"events"},{"name":"features"},{"name":"entitlements"},{"name":"credits"}],"servers":[{"url":"https://api.schematichq.com","description":"https://api.schematichq.com"}],"components":{"schemas":{"EnvironmentType":{"type":"string","enum":["development","production","staging"],"title":"EnvironmentType"},"EnvironmentResponseData":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time"},"environment_type":{"$ref":"#/components/schemas/EnvironmentType"},"id":{"type":"string"},"name":{"type":"string"},"require_context_signature":{"type":"boolean"},"updated_at":{"type":"string","format":"date-time"}},"required":["created_at","environment_type","id","name","require_context_signature","updated_at"],"title":"EnvironmentResponseData"},"IntegrationState":{"type":"string","enum":["active","created","pending"],"title":"IntegrationState"},"IntegrationType":{"type":"string","enum":["clerk","metronome","orb","stripe","unknown","workos"],"title":"IntegrationType"},"ApiKeyIntegrationResponseData":{"type":"object","properties":{"id":{"type":"string"},"state":{"$ref":"#/components/schemas/IntegrationState"},"type":{"$ref":"#/components/schemas/IntegrationType"}},"required":["id","state","type"],"title":"ApiKeyIntegrationResponseData"},"ApiKeyScope":{"type":"string","enum":["admin","capture","read","write"],"title":"ApiKeyScope"},"ApiKeyResponseData":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time"},"description":{"type":["string","null"]},"environment":{"$ref":"#/components/schemas/EnvironmentResponseData"},"environment_id":{"type":["string","null"]},"id":{"type":"string"},"integration":{"$ref":"#/components/schemas/ApiKeyIntegrationResponseData"},"last_used_at":{"type":["string","null"],"format":"date-time"},"name":{"type":"string"},"rate_limit_percent":{"type":["integer","null"],"format":"int64"},"readonly":{"type":"boolean"},"scopes":{"type":"array","items":{"$ref":"#/components/schemas/ApiKeyScope"}},"updated_at":{"type":"string","format":"date-time"}},"required":["created_at","id","name","readonly","scopes","updated_at"],"title":"ApiKeyResponseData"},"ApiKeysGetResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{"environment_id":{"type":"string"},"limit":{"type":"integer","format":"int64","minimum":0,"maximum":250,"description":"Page limit (default 100)"},"offset":{"type":"integer","format":"int64","description":"Page offset (default 0)"},"require_environment":{"type":"boolean"}},"description":"Input parameters","title":"ApiKeysGetResponsesContentApplicationJsonSchemaParams"},"accounts_listApiKeys_Response_200":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ApiKeyResponseData"}},"params":{"$ref":"#/components/schemas/ApiKeysGetResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"accounts_listApiKeys_Response_200"},"ApiError":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}},"required":["error"],"title":"ApiError"},"ApiKeysApiKeyIdGetResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"ApiKeysApiKeyIdGetResponsesContentApplicationJsonSchemaParams"},"accounts_getApiKey_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ApiKeyResponseData"},"params":{"$ref":"#/components/schemas/ApiKeysApiKeyIdGetResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"accounts_getApiKey_Response_200"},"PlanType":{"type":"string","enum":["plan","add_on"],"title":"PlanType"},"PlanIcon":{"type":"string","enum":["amber","blue","blueGray","blueGreen","cyan","emerald","fuchsia","gray","green","indigo","lightBlue","lime","orange","pink","purple","red","redOrange","rose","sky","slate","teal","trueGray","violet","warmGray","yellow"],"title":"PlanIcon"},"RenewalPolicy":{"type":"string","enum":["auto_renew","expire_to_default","hold_with_grace"],"title":"RenewalPolicy"},"PlanVersionStatus":{"type":"string","enum":["published","draft","archived"],"title":"PlanVersionStatus"},"PlanVersionResponseData":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time"},"description":{"type":"string"},"environment_id":{"type":"string"},"icon":{"$ref":"#/components/schemas/PlanIcon"},"id":{"type":"string"},"name":{"type":"string"},"original_plan_id":{"type":["string","null"]},"plan_type":{"$ref":"#/components/schemas/PlanType"},"renewal_policy":{"$ref":"#/components/schemas/RenewalPolicy"},"status":{"$ref":"#/components/schemas/PlanVersionStatus"},"updated_at":{"type":"string","format":"date-time"},"version":{"type":"integer","format":"int64"}},"required":["created_at","description","environment_id","icon","id","name","plan_type","renewal_policy","status","updated_at","version"],"title":"PlanVersionResponseData"},"BillingProviderType":{"type":"string","enum":["metronome","orb","schematic","stripe"],"title":"BillingProviderType"},"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"},"Currency":{"type":"string","enum":["aed","afn","all","amd","ang","aoa","ars","aud","awg","azn","bam","bbd","bdt","bif","bmd","bnd","bob","brl","bsd","bwp","byn","bzd","cad","cdf","chf","clp","cny","cop","crc","cve","czk","djf","dkk","dop","dzd","egp","etb","eur","fjd","fkp","gbp","gel","gip","gmd","gnf","gtq","gyd","hkd","hnl","htg","huf","idr","ils","inr","isk","jmd","jpy","kes","kgs","khr","kmf","krw","kyd","kzt","lak","lbp","lkr","lrd","lsl","mad","mdl","mga","mkd","mmk","mnt","mop","mur","mvr","mwk","mxn","myr","mzn","nad","ngn","nio","nok","npr","nzd","pab","pen","pgk","php","pkr","pln","pyg","qar","ron","rsd","rub","rwf","sar","sbd","scr","sek","sgd","shp","sle","sos","srd","std","szl","thb","tjs","top","try","ttd","twd","tzs","uah","ugx","usd","uyu","uzs","vnd","vuv","wst","xaf","xcd","xcg","xof","xpf","yer","zar","zmw"],"title":"Currency"},"BillingProductPriceInterval":{"type":"string","enum":["day","month","one-time","year"],"title":"BillingProductPriceInterval"},"BillingPriceScheme":{"type":"string","enum":["per_unit","tiered"],"title":"BillingPriceScheme"},"BillingPriceResponseData":{"type":"object","properties":{"currency":{"$ref":"#/components/schemas/Currency"},"external_price_id":{"type":"string"},"id":{"type":"string"},"interval":{"$ref":"#/components/schemas/BillingProductPriceInterval"},"interval_count":{"type":"integer","format":"int64"},"nickname":{"type":["string","null"]},"price":{"type":"integer","format":"int64"},"price_decimal":{"type":["string","null"]},"provider_type":{"$ref":"#/components/schemas/BillingProviderType"},"scheme":{"$ref":"#/components/schemas/BillingPriceScheme"}},"required":["currency","external_price_id","id","interval","interval_count","price","provider_type","scheme"],"title":"BillingPriceResponseData"},"BillingProductDetailResponseData":{"type":"object","properties":{"account_id":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"currency":{"type":["string","null"],"description":"Deprecated; currencies are associated with prices, not products","deprecated":true},"environment_id":{"type":"string"},"external_id":{"type":"string"},"is_active":{"type":"boolean"},"name":{"type":"string"},"price":{"type":"number","format":"double"},"price_decimal":{"type":["string","null"]},"prices":{"type":"array","items":{"$ref":"#/components/schemas/BillingPriceResponseData"}},"product_id":{"type":"string"},"provider_type":{"$ref":"#/components/schemas/BillingProviderType"},"quantity":{"type":"number","format":"double"},"subscription_count":{"type":"integer","format":"int64"},"updated_at":{"type":"string","format":"date-time"}},"required":["account_id","created_at","environment_id","external_id","is_active","name","price","prices","product_id","provider_type","quantity","subscription_count","updated_at"],"title":"BillingProductDetailResponseData"},"BillingStrategy":{"type":"string","enum":["schematic_managed","provider_managed","no_billing"],"title":"BillingStrategy"},"PlanCatalogMembershipResponseData":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"title":"PlanCatalogMembershipResponseData"},"ChargeType":{"type":"string","enum":["free","none","one_time","recurring"],"title":"ChargeType"},"BillingCreditBurnStrategy":{"type":"string","enum":["expiration_priority","first_in_first_out","last_in_first_out","plan_first_then_credit_bundles_first_in_first_out"],"title":"BillingCreditBurnStrategy"},"CreditCurrencyPriceResponseData":{"type":"object","properties":{"currency":{"$ref":"#/components/schemas/Currency"},"price":{"$ref":"#/components/schemas/BillingPriceResponseData"}},"required":["currency"],"title":"CreditCurrencyPriceResponseData"},"BillingCreditExpiryUnit":{"type":"string","enum":["billing_periods","days"],"title":"BillingCreditExpiryUnit"},"BillingCreditRolloverPolicy":{"type":"string","enum":["expire","none","rollover"],"title":"BillingCreditRolloverPolicy"},"BillingCreditLedgerAuthority":{"type":"string","enum":["schematic_authoritative","external_mirror","external_rated"],"title":"BillingCreditLedgerAuthority"},"BillingProductResponseData":{"type":"object","properties":{"account_id":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"currency":{"type":["string","null"],"description":"Deprecated; currencies are associated with prices, not products","deprecated":true},"environment_id":{"type":"string"},"external_id":{"type":"string"},"is_active":{"type":"boolean"},"name":{"type":"string"},"price":{"type":"number","format":"double"},"price_decimal":{"type":["string","null"]},"product_id":{"type":"string"},"provider_type":{"$ref":"#/components/schemas/BillingProviderType"},"quantity":{"type":"number","format":"double"},"updated_at":{"type":"string","format":"date-time"}},"required":["account_id","created_at","environment_id","external_id","is_active","name","price","product_id","provider_type","quantity","updated_at"],"title":"BillingProductResponseData"},"BillingCreditResponseData":{"type":"object","properties":{"burn_strategy":{"$ref":"#/components/schemas/BillingCreditBurnStrategy"},"cost_editable":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"currency_prices":{"type":"array","items":{"$ref":"#/components/schemas/CreditCurrencyPriceResponseData"}},"default_expiry_unit":{"$ref":"#/components/schemas/BillingCreditExpiryUnit"},"default_expiry_unit_count":{"type":["integer","null"],"format":"int64"},"default_rollover_policy":{"$ref":"#/components/schemas/BillingCreditRolloverPolicy"},"description":{"type":"string"},"icon":{"type":["string","null"]},"id":{"type":"string"},"ledger_authority":{"$ref":"#/components/schemas/BillingCreditLedgerAuthority"},"name":{"type":"string"},"plural_name":{"type":["string","null"]},"price":{"$ref":"#/components/schemas/BillingPriceResponseData"},"product":{"$ref":"#/components/schemas/BillingProductResponseData"},"singular_name":{"type":["string","null"]},"updated_at":{"type":"string","format":"date-time"}},"required":["burn_strategy","cost_editable","created_at","currency_prices","default_expiry_unit","default_rollover_policy","description","id","ledger_authority","name","updated_at"],"title":"BillingCreditResponseData"},"PlanCurrencyPricesResponseData":{"type":"object","properties":{"currency":{"$ref":"#/components/schemas/Currency"},"monthly_price":{"$ref":"#/components/schemas/BillingPriceResponseData"},"one_time_price":{"$ref":"#/components/schemas/BillingPriceResponseData"},"quarterly_price":{"$ref":"#/components/schemas/BillingPriceResponseData"},"yearly_price":{"$ref":"#/components/schemas/BillingPriceResponseData"}},"required":["currency"],"title":"PlanCurrencyPricesResponseData"},"BillingProductPriceTierResponseData":{"type":"object","properties":{"flat_amount":{"type":["integer","null"],"format":"int64"},"per_unit_price":{"type":["integer","null"],"format":"int64"},"per_unit_price_decimal":{"type":["string","null"]},"up_to":{"type":["integer","null"],"format":"int64"}},"title":"BillingProductPriceTierResponseData"},"BillingTiersMode":{"type":"string","enum":["graduated","volume"],"title":"BillingTiersMode"},"BillingPriceUsageType":{"type":"string","enum":["licensed","metered"],"title":"BillingPriceUsageType"},"BillingPriceView":{"type":"object","properties":{"billing_scheme":{"$ref":"#/components/schemas/BillingPriceScheme"},"created_at":{"type":"string","format":"date-time"},"currency":{"$ref":"#/components/schemas/Currency"},"id":{"type":"string"},"interval":{"$ref":"#/components/schemas/BillingProductPriceInterval"},"interval_count":{"type":"integer","format":"int64"},"is_active":{"type":"boolean"},"meter_event_name":{"type":["string","null"]},"meter_event_payload_key":{"type":["string","null"]},"meter_id":{"type":["string","null"]},"nickname":{"type":["string","null"]},"package_size":{"type":"integer","format":"int64"},"price":{"type":"integer","format":"int64"},"price_decimal":{"type":["string","null"]},"price_external_id":{"type":"string"},"price_id":{"type":"string"},"price_tier":{"type":"array","items":{"$ref":"#/components/schemas/BillingProductPriceTierResponseData"}},"product_external_id":{"type":"string"},"product_id":{"type":"string"},"product_name":{"type":"string"},"provider_type":{"$ref":"#/components/schemas/BillingProviderType"},"tiers_mode":{"oneOf":[{"$ref":"#/components/schemas/BillingTiersMode"},{"type":"null"}]},"updated_at":{"type":"string","format":"date-time"},"usage_type":{"$ref":"#/components/schemas/BillingPriceUsageType"}},"required":["billing_scheme","created_at","currency","id","interval","interval_count","is_active","package_size","price","price_external_id","price_id","price_tier","product_external_id","product_id","product_name","provider_type","updated_at","usage_type"],"title":"BillingPriceView"},"EntitlementCurrencyPricesResponseData":{"type":"object","properties":{"currency":{"$ref":"#/components/schemas/Currency"},"monthly_price":{"$ref":"#/components/schemas/BillingPriceView"},"quarterly_price":{"$ref":"#/components/schemas/BillingPriceView"},"yearly_price":{"$ref":"#/components/schemas/BillingPriceView"}},"required":["currency"],"title":"EntitlementCurrencyPricesResponseData"},"FeatureEventSource":{"type":"string","enum":["inference","track"],"title":"FeatureEventSource"},"FeatureType":{"type":"string","enum":["boolean","event","license","trait"],"title":"FeatureType"},"FeatureLifecyclePhase":{"type":"string","enum":["add_on","alpha","beta","deprecated","ga","inactive","in_plan","internal_testing","legacy"],"title":"FeatureLifecyclePhase"},"FeatureResponseData":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time"},"description":{"type":"string"},"event_source":{"$ref":"#/components/schemas/FeatureEventSource","description":"Which event stream meters this feature. Track features are metered by track events; inference features are metered by inference events whose event label matches event_subtype, and meter through credits only."},"event_subtype":{"type":["string","null"]},"feature_type":{"$ref":"#/components/schemas/FeatureType"},"icon":{"type":"string"},"id":{"type":"string"},"license_id":{"type":["string","null"],"description":"The license sold through this feature. Set only on features of type license, and created automatically with them."},"lifecycle_phase":{"oneOf":[{"$ref":"#/components/schemas/FeatureLifecyclePhase"},{"type":"null"}]},"maintainer_account_member_id":{"type":["string","null"]},"name":{"type":"string"},"plural_name":{"type":["string","null"]},"singular_name":{"type":["string","null"]},"trait_id":{"type":["string","null"]},"updated_at":{"type":"string","format":"date-time"},"usage_limit_trait_id":{"type":["string","null"],"description":"Set when the feature carries a pay-in-advance quantity. Provisioned lazily for other feature types, and at creation for license features."}},"required":["created_at","description","event_source","feature_type","icon","id","name","updated_at"],"title":"FeatureResponseData"},"MetricPeriod":{"type":"string","enum":["all_time","current_day","current_month","current_week"],"title":"MetricPeriod"},"MetricPeriodMonthReset":{"type":"string","enum":["billing_cycle","first_of_month"],"title":"MetricPeriodMonthReset"},"CreditModelRate":{"type":"object","properties":{"consumption_rate":{"type":"number","format":"double"},"model":{"type":"string"},"provider":{"type":"string"},"quantity_rates":{"type":"object","additionalProperties":{"type":"number","format":"double"}}},"required":["consumption_rate","model","provider"],"title":"CreditModelRate"},"BillingArrearsCadence":{"type":"string","enum":["end_of_billing_period","monthly","quarterly"],"title":"BillingArrearsCadence"},"BillingArrearsAnchor":{"type":"string","enum":["billing_period_start","month_end"],"title":"BillingArrearsAnchor"},"PlanResponseData":{"type":"object","properties":{"audience_type":{"type":["string","null"],"deprecated":true},"company_id":{"type":["string","null"]},"copied_from_plan_id":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"description":{"type":"string"},"icon":{"$ref":"#/components/schemas/PlanIcon"},"id":{"type":"string"},"name":{"type":"string"},"plan_type":{"$ref":"#/components/schemas/PlanType"},"updated_at":{"type":"string","format":"date-time"}},"required":["created_at","description","icon","id","name","plan_type","updated_at"],"title":"PlanResponseData"},"EntitlementPriceBehavior":{"type":"string","enum":["credit_burndown","overage","pay_as_you_go","pay_in_advance","tier"],"title":"EntitlementPriceBehavior"},"EntityType":{"type":"string","enum":["company","user"],"title":"EntityType"},"TraitType":{"type":"string","enum":["boolean","currency","date","number","string","url"],"title":"TraitType"},"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"}},"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"},"EntitlementValueType":{"type":"string","enum":["boolean","credit","numeric","trait","unknown","unlimited"],"title":"EntitlementValueType"},"WarningTierResponseData":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"value":{"type":"integer","format":"int64"}},"required":["id","key","value"],"title":"WarningTierResponseData"},"PlanEntitlementResponseData":{"type":"object","properties":{"billing_linked_resource":{"$ref":"#/components/schemas/BillingLinkedResourceResponseData"},"billing_threshold":{"type":["integer","null"],"format":"int64"},"consumption_rate":{"type":["number","null"],"format":"double"},"created_at":{"type":"string","format":"date-time"},"currency_prices":{"type":"array","items":{"$ref":"#/components/schemas/EntitlementCurrencyPricesResponseData"}},"environment_id":{"type":"string"},"feature":{"$ref":"#/components/schemas/FeatureResponseData"},"feature_id":{"type":"string"},"id":{"type":"string"},"metered_monthly_price":{"$ref":"#/components/schemas/BillingPriceView"},"metered_quarterly_price":{"$ref":"#/components/schemas/BillingPriceView"},"metered_yearly_price":{"$ref":"#/components/schemas/BillingPriceView"},"metric_period":{"oneOf":[{"$ref":"#/components/schemas/MetricPeriod"},{"type":"null"}]},"metric_period_month_reset":{"oneOf":[{"$ref":"#/components/schemas/MetricPeriodMonthReset"},{"type":"null"}]},"model_rates":{"type":"array","items":{"$ref":"#/components/schemas/CreditModelRate"},"description":"Per-model rate overrides for inference features, keyed by provider and model. Each entry replaces consumption_rate and quantity_rates for events from that model. Absent when every model burns at the entitlement's own rates."},"overage_billing_cadence":{"oneOf":[{"$ref":"#/components/schemas/BillingArrearsCadence"},{"type":"null"}],"description":"How often overage charges are assessed and invoiced. Null or end_of_billing_period means the billing provider aggregates usage over the subscription's own period and bills it at period end. Monthly and quarterly mean Schematic assesses the overage each month or quarter and bills it on its own invoice. Only applies to overage price behavior."},"overage_invoice_anchor":{"oneOf":[{"$ref":"#/components/schemas/BillingArrearsAnchor"},{"type":"null"}],"description":"Which boundary closes a monthly or quarterly overage window: the subscription's own recurrence (billing_period_start) or the calendar month (month_end), which for a quarterly window means calendar quarters. Only meaningful when overage_billing_cadence is monthly or quarterly."},"plan":{"$ref":"#/components/schemas/PlanResponseData"},"plan_id":{"type":"string"},"price_behavior":{"oneOf":[{"$ref":"#/components/schemas/EntitlementPriceBehavior"},{"type":"null"}]},"quantity_rates":{"type":"object","additionalProperties":{"type":"number","format":"double"},"description":"Credits per unit of the quantity (per token for inference features), keyed by quantity key. Absent when the entitlement prices requests only."},"rule_id":{"type":"string"},"rule_id_usage_exceeded":{"type":["string","null"]},"soft_limit":{"type":["integer","null"],"format":"int64"},"updated_at":{"type":"string","format":"date-time"},"usage_based_product":{"$ref":"#/components/schemas/BillingProductResponseData"},"usage_quantity":{"type":["integer","null"],"format":"int64","description":"The committed unit quantity for this entitlement. For custom plans this is the minimum the company is contractually committed to: the company can buy more, and finalizing a new plan version sets the subscription quantity to the larger of this value and what the subscription already holds. For standard plans it is the quantity pre-filled when subscribing. Only applies to pay-in-advance entitlements."},"value_bool":{"type":["boolean","null"]},"value_credit":{"$ref":"#/components/schemas/BillingCreditResponseData"},"value_numeric":{"type":["integer","null"],"format":"int64"},"value_trait":{"$ref":"#/components/schemas/EntityTraitDefinitionResponseData"},"value_trait_id":{"type":["string","null"]},"value_type":{"$ref":"#/components/schemas/EntitlementValueType"},"warning_tiers":{"type":"array","items":{"$ref":"#/components/schemas/WarningTierResponseData"}}},"required":["created_at","currency_prices","environment_id","feature_id","id","plan_id","rule_id","updated_at","value_type","warning_tiers"],"title":"PlanEntitlementResponseData"},"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","null"],"format":"date-time"},"user_count":{"type":"integer","format":"int64"}},"required":["company_count","environment_id","event_count","event_subtype","user_count"],"title":"EventSummaryResponseData"},"FlagType":{"type":"string","enum":["boolean"],"title":"FlagType"},"ConditionType":{"type":"string","enum":["base_plan","billing_product","company","credit","metric","plan","plan_version","trait","user"],"title":"ConditionType"},"ComparableOperator":{"type":"string","enum":["eq","gt","gte","is_empty","lt","lte","not_empty","ne"],"title":"ComparableOperator"},"RuleConditionPlanVersionResponseData":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"$ref":"#/components/schemas/PlanVersionStatus"},"version":{"type":"integer","format":"int64"}},"required":["id","name","status","version"],"title":"RuleConditionPlanVersionResponseData"},"PreviewObjectResponseData":{"type":"object","properties":{"description":{"type":["string","null"]},"id":{"type":"string"},"image_url":{"type":["string","null"]},"name":{"type":"string"}},"required":["id","name"],"title":"PreviewObjectResponseData"},"RuleConditionDetailResponseData":{"type":"object","properties":{"comparison_trait":{"$ref":"#/components/schemas/EntityTraitDefinitionResponseData"},"comparison_trait_id":{"type":["string","null"]},"condition_group_id":{"type":["string","null"]},"condition_type":{"$ref":"#/components/schemas/ConditionType"},"created_at":{"type":"string","format":"date-time"},"environment_id":{"type":"string"},"event_subtype":{"type":["string","null"]},"flag_id":{"type":["string","null"]},"id":{"type":"string"},"metric_period":{"oneOf":[{"$ref":"#/components/schemas/MetricPeriod"},{"type":"null"}]},"metric_period_month_reset":{"oneOf":[{"$ref":"#/components/schemas/MetricPeriodMonthReset"},{"type":"null"}]},"metric_value":{"type":["integer","null"],"format":"int64"},"operator":{"$ref":"#/components/schemas/ComparableOperator"},"plan_versions":{"type":"array","items":{"$ref":"#/components/schemas/RuleConditionPlanVersionResponseData"}},"resource_ids":{"type":"array","items":{"type":"string"}},"resources":{"type":"array","items":{"$ref":"#/components/schemas/PreviewObjectResponseData"}},"rule_id":{"type":"string"},"trait":{"$ref":"#/components/schemas/EntityTraitDefinitionResponseData"},"trait_entity_type":{"oneOf":[{"$ref":"#/components/schemas/EntityType"},{"type":"null"}]},"trait_id":{"type":["string","null"]},"trait_value":{"type":"string"},"updated_at":{"type":"string","format":"date-time"}},"required":["condition_type","created_at","environment_id","id","operator","resource_ids","resources","rule_id","trait_value","updated_at"],"title":"RuleConditionDetailResponseData"},"RuleConditionGroupDetailResponseData":{"type":"object","properties":{"conditions":{"type":"array","items":{"$ref":"#/components/schemas/RuleConditionDetailResponseData"}},"created_at":{"type":"string","format":"date-time"},"environment_id":{"type":"string"},"flag_id":{"type":["string","null"]},"id":{"type":"string"},"rule_id":{"type":"string"},"updated_at":{"type":"string","format":"date-time"}},"required":["conditions","created_at","environment_id","id","rule_id","updated_at"],"title":"RuleConditionGroupDetailResponseData"},"RuleType":{"type":"string","enum":["company_override","company_override_usage_exceeded","default","global_override","plan_entitlement","plan_entitlement_usage_exceeded","standard"],"title":"RuleType"},"RuleDetailResponseData":{"type":"object","properties":{"condition_groups":{"type":"array","items":{"$ref":"#/components/schemas/RuleConditionGroupDetailResponseData"}},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/RuleConditionDetailResponseData"}},"created_at":{"type":"string","format":"date-time"},"environment_id":{"type":"string"},"flag_id":{"type":["string","null"]},"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":["condition_groups","conditions","created_at","environment_id","id","name","priority","rule_type","updated_at","value"],"title":"RuleDetailResponseData"},"FlagInPlanResponseData":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time"},"default_value":{"type":["boolean","null"],"description":"Deprecated. The value a check returns in the requesting environment when no other rule matches: its default rule, or the flag's seed value while it has none. Read the default rule instead","deprecated":true},"description":{"type":"string"},"feature":{"$ref":"#/components/schemas/FeatureResponseData"},"feature_id":{"type":["string","null"]},"flag_type":{"$ref":"#/components/schemas/FlagType"},"id":{"type":"string"},"key":{"type":"string"},"last_checked_at":{"type":["string","null"],"format":"date-time"},"maintainer_account_member_id":{"type":["string","null"]},"name":{"type":"string"},"rules":{"type":"array","items":{"$ref":"#/components/schemas/RuleDetailResponseData"}},"updated_at":{"type":"string","format":"date-time"}},"required":["created_at","description","flag_type","id","key","name","rules","updated_at"],"title":"FlagInPlanResponseData"},"PreviewObject":{"type":"object","properties":{"description":{"type":["string","null"]},"id":{"type":"string"},"image_url":{"type":["string","null"]},"name":{"type":"string"}},"required":["id","name"],"title":"PreviewObject"},"FeatureInPlanResponseData":{"type":"object","properties":{"billing_linked_resource":{"$ref":"#/components/schemas/BillingLinkedResourceResponseData"},"created_at":{"type":"string","format":"date-time"},"description":{"type":"string"},"event_source":{"$ref":"#/components/schemas/FeatureEventSource","description":"Which event stream meters this feature. Track features are metered by track events; inference features are metered by inference events whose event label matches event_subtype, and meter through credits only."},"event_subtype":{"type":["string","null"]},"event_summary":{"$ref":"#/components/schemas/EventSummaryResponseData"},"feature_type":{"$ref":"#/components/schemas/FeatureType"},"flags":{"type":"array","items":{"$ref":"#/components/schemas/FlagInPlanResponseData"}},"icon":{"type":"string"},"id":{"type":"string"},"license_id":{"type":["string","null"],"description":"The license sold through this feature. Set only on features of type license, and created automatically with them."},"lifecycle_phase":{"oneOf":[{"$ref":"#/components/schemas/FeatureLifecyclePhase"},{"type":"null"}]},"maintainer_account_member_id":{"type":["string","null"]},"name":{"type":"string"},"plans":{"type":"array","items":{"$ref":"#/components/schemas/PreviewObject"}},"plural_name":{"type":["string","null"]},"singular_name":{"type":["string","null"]},"trait":{"$ref":"#/components/schemas/EntityTraitDefinitionResponseData"},"trait_id":{"type":["string","null"]},"updated_at":{"type":"string","format":"date-time"},"usage_limit_trait_id":{"type":["string","null"],"description":"Set when the feature carries a pay-in-advance quantity. Provisioned lazily for other feature types, and at creation for license features."}},"required":["created_at","description","event_source","feature_type","flags","icon","id","name","plans","updated_at"],"title":"FeatureInPlanResponseData"},"BillingCreditAutoTopupAvailability":{"type":"string","enum":["off","automatic","user_controlled"],"title":"BillingCreditAutoTopupAvailability"},"BillingCreditExpiryType":{"type":"string","enum":["duration","end_of_billing_period","end_of_next_billing_period","end_of_trial","no_expiry"],"title":"BillingCreditExpiryType"},"BillingPlanCreditGrantBillingMode":{"type":"string","enum":["granted","billed"],"title":"BillingPlanCreditGrantBillingMode"},"BillingPlanCreditGrantPriceTierResponseData":{"type":"object","properties":{"from":{"type":"integer","format":"int64","description":"Lower bound of the tier, in credits per invoice (inclusive)."},"per_unit_price":{"type":["integer","null"],"format":"int64","description":"Price per credit in this tier, in the plan currency's smallest unit."},"per_unit_price_decimal":{"type":["string","null"],"description":"Price per credit in this tier as a decimal, for rates below one cent."},"to":{"type":["integer","null"],"format":"int64","description":"Upper bound of the tier, in credits per invoice (inclusive). Null marks the final, unbounded tier."}},"required":["from"],"title":"BillingPlanCreditGrantPriceTierResponseData"},"BillingPlanCreditGrantResetCadence":{"type":"string","enum":["daily","every_6_months","monthly","quarterly","weekly","yearly"],"title":"BillingPlanCreditGrantResetCadence"},"BillingPlanCreditGrantResetStart":{"type":"string","enum":["billing_period","first_of_month"],"title":"BillingPlanCreditGrantResetStart"},"BillingPlanCreditGrantResetType":{"type":"string","enum":["no_reset","plan_period"],"title":"BillingPlanCreditGrantResetType"},"PlanCreditGrantScaling":{"type":"string","enum":["fixed","per_license"],"title":"PlanCreditGrantScaling"},"BillingPlanCreditGrantWarningTierResponseData":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"value":{"type":"integer","format":"int64","description":"Credits remaining in the company's balance at which this warning is reached."}},"required":["id","key","value"],"title":"BillingPlanCreditGrantWarningTierResponseData"},"BillingPlanCreditGrantResponseData":{"type":"object","properties":{"arrears_anchor":{"oneOf":[{"$ref":"#/components/schemas/BillingArrearsAnchor"},{"type":"null"}],"description":"Which boundary closes a monthly arrears window. Only meaningful when arrears_cadence is monthly."},"arrears_cadence":{"oneOf":[{"$ref":"#/components/schemas/BillingArrearsCadence"},{"type":"null"}],"description":"How often postpaid charges are closed and invoiced. Defaults to end_of_billing_period."},"auto_topup_amount":{"type":["integer","null"],"format":"int64"},"auto_topup_amount_type":{"type":["string","null"]},"auto_topup_availability":{"$ref":"#/components/schemas/BillingCreditAutoTopupAvailability"},"auto_topup_enabled":{"type":"boolean","description":"Derived from auto_topup_availability; use that instead.","deprecated":true},"auto_topup_expiry_type":{"oneOf":[{"$ref":"#/components/schemas/BillingCreditExpiryType"},{"type":"null"}]},"auto_topup_expiry_unit":{"oneOf":[{"$ref":"#/components/schemas/BillingCreditExpiryUnit"},{"type":"null"}]},"auto_topup_expiry_unit_count":{"type":["integer","null"],"format":"int64"},"auto_topup_self_service":{"type":"boolean","description":"Derived from auto_topup_availability; use that instead.","deprecated":true},"auto_topup_threshold_credits":{"type":["integer","null"],"format":"int64"},"auto_topup_threshold_percent":{"type":["integer","null"],"format":"int64"},"billing_mode":{"$ref":"#/components/schemas/BillingPlanCreditGrantBillingMode","description":"Whether the credits are included in the plan price (granted) or billed as their own subscription line at a price per credit (billed)."},"can_buy_bundles":{"type":"boolean","description":"Deprecated: bundle availability is a per-bundle plan compatibility set now; use compatible_plan_ids on credit bundles instead.","deprecated":true},"company_credit_amount":{"type":"integer","format":"int64","description":"Credits granted once per company on top of the per-license amount. Always 0 when scaling is fixed."},"created_at":{"type":"string","format":"date-time"},"credit":{"$ref":"#/components/schemas/BillingCreditResponseData"},"credit_amount":{"type":"integer","format":"int64"},"credit_id":{"type":"string"},"credit_name":{"type":"string","description":"Use credit.name from the nested credit object instead","deprecated":true},"credit_plural_name":{"type":["string","null"],"description":"Use plural_name from the nested credit object instead","deprecated":true},"credit_singular_name":{"type":["string","null"],"description":"Use singular_name from the nested credit object instead","deprecated":true},"expiry_type":{"oneOf":[{"$ref":"#/components/schemas/BillingCreditExpiryType"},{"type":"null"}]},"expiry_unit":{"oneOf":[{"$ref":"#/components/schemas/BillingCreditExpiryUnit"},{"type":"null"}]},"expiry_unit_count":{"type":["integer","null"],"format":"int64"},"id":{"type":"string"},"license_id":{"type":["string","null"],"description":"The license whose quantity scales this grant. Set only when scaling is per_license."},"overdraft_limit":{"type":["number","null"],"format":"double","description":"Optional limit on how far the balance may go below zero, in credits. A floor on the balance, not an allowance per invoice window: consumption is denied once the balance would fall below minus this figure, and stays denied until a new grant lands or the negative balance is settled. Absent means no limit."},"plan":{"$ref":"#/components/schemas/PreviewObjectResponseData"},"plan_id":{"type":"string"},"plan_name":{"type":"string","description":"Use plan.name from the nested plan object instead","deprecated":true},"plan_version_id":{"type":["string","null"]},"postpaid_enabled":{"type":"boolean","description":"Whether consumption may continue past a zero balance, accruing at postpaid_rate_per_unit rather than being denied."},"postpaid_rate_per_unit":{"type":["integer","null"],"format":"int64","description":"Amount charged per credit consumed past zero, in the currency's minor unit. Defaults to the credit's own cost basis when postpaid is enabled without one."},"postpaid_rate_per_unit_decimal":{"type":["string","null"],"description":"Decimal form of postpaid_rate_per_unit, for rates finer than one minor unit."},"price":{"oneOf":[{"$ref":"#/components/schemas/BillingPriceResponseData"},{"type":"null"}],"description":"The Stripe price a billed grant bills through. Minted when the plan version is published."},"price_tiers":{"type":"array","items":{"$ref":"#/components/schemas/BillingPlanCreditGrantPriceTierResponseData"},"description":"Tier table pricing the credits, cheapest bound first. Empty unless billing_mode is billed and the credits are priced on tiers."},"reset_cadence":{"oneOf":[{"$ref":"#/components/schemas/BillingPlanCreditGrantResetCadence"},{"type":"null"}]},"reset_start":{"oneOf":[{"$ref":"#/components/schemas/BillingPlanCreditGrantResetStart"},{"type":"null"}]},"reset_type":{"oneOf":[{"$ref":"#/components/schemas/BillingPlanCreditGrantResetType"},{"type":"null"}]},"rollover_percentage":{"type":"integer","format":"int64","description":"Percentage of unused credits that carry over when this grant resets. Only meaningful when reset_type is plan_period."},"scaling":{"$ref":"#/components/schemas/PlanCreditGrantScaling","description":"Whether the grant is a fixed amount per company, or issued once per license the company holds."},"tier_mode":{"oneOf":[{"$ref":"#/components/schemas/BillingTiersMode"},{"type":"null"}],"description":"How price_tiers apply: volume prices every credit at the rate of the tier the total lands in, graduated prices each tier's own credits at its own rate. Set only when price_tiers is non-empty."},"unit_price":{"type":["integer","null"],"format":"int64","description":"Price per credit in the plan currency's smallest unit. Set only when billing_mode is billed and the credits are priced at one rate."},"unit_price_decimal":{"type":["string","null"],"description":"Price per credit as a decimal in the plan currency's smallest unit. Set only when billing_mode is billed and the rate is below one cent."},"updated_at":{"type":"string","format":"date-time"},"warning_tiers":{"type":"array","items":{"$ref":"#/components/schemas/BillingPlanCreditGrantWarningTierResponseData"},"description":"Usage-warning thresholds, in credits remaining in the company's balance, highest first. Schematic sends a credit.usage_warning_reached webhook when the balance drops to each one. Empty when none are set."}},"required":["auto_topup_availability","auto_topup_enabled","auto_topup_self_service","billing_mode","can_buy_bundles","company_credit_amount","created_at","credit_amount","credit_id","credit_name","id","plan_id","plan_name","postpaid_enabled","price_tiers","rollover_percentage","scaling","updated_at","warning_tiers"],"title":"BillingPlanCreditGrantResponseData"},"PlanDetailResponseData":{"type":"object","properties":{"active_version":{"$ref":"#/components/schemas/PlanVersionResponseData"},"audience_type":{"type":["string","null"],"deprecated":true},"billing_linked_resource":{"$ref":"#/components/schemas/BillingLinkedResourceResponseData"},"billing_product":{"$ref":"#/components/schemas/BillingProductDetailResponseData"},"billing_strategy":{"$ref":"#/components/schemas/BillingStrategy"},"catalogs":{"type":"array","items":{"$ref":"#/components/schemas/PlanCatalogMembershipResponseData"}},"charge_type":{"$ref":"#/components/schemas/ChargeType"},"company_count":{"type":"integer","format":"int64"},"company_id":{"type":["string","null"]},"company_logo_url":{"type":["string","null"]},"company_name":{"type":["string","null"]},"controlled_by":{"$ref":"#/components/schemas/BillingProviderType"},"copied_from_plan_id":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"credits":{"type":"array","items":{"$ref":"#/components/schemas/BillingCreditResponseData"}},"currency_prices":{"type":"array","items":{"$ref":"#/components/schemas/PlanCurrencyPricesResponseData"}},"description":{"type":"string"},"draft_version":{"$ref":"#/components/schemas/PlanVersionResponseData"},"entitlements":{"type":["array","null"],"items":{"$ref":"#/components/schemas/PlanEntitlementResponseData"}},"features":{"type":"array","items":{"$ref":"#/components/schemas/FeatureInPlanResponseData"}},"icon":{"$ref":"#/components/schemas/PlanIcon"},"id":{"type":"string"},"included_credit_grants":{"type":"array","items":{"$ref":"#/components/schemas/BillingPlanCreditGrantResponseData"}},"is_default":{"type":"boolean","deprecated":true},"is_free":{"type":["boolean","null"],"description":"Deprecated: reports the plan's charge type, not its price. Read the plan's prices to tell whether it costs anything, or billing_strategy to tell how it is billed.","deprecated":true},"is_trialable":{"type":"boolean"},"monthly_price":{"$ref":"#/components/schemas/BillingPriceResponseData"},"name":{"type":"string"},"one_time_price":{"$ref":"#/components/schemas/BillingPriceResponseData"},"plan_type":{"$ref":"#/components/schemas/PlanType"},"quarterly_price":{"$ref":"#/components/schemas/BillingPriceResponseData"},"trial_days":{"type":["integer","null"],"format":"int64"},"updated_at":{"type":"string","format":"date-time"},"versions":{"type":"array","items":{"$ref":"#/components/schemas/PlanVersionResponseData"}},"yearly_price":{"$ref":"#/components/schemas/BillingPriceResponseData"}},"required":["billing_strategy","charge_type","company_count","controlled_by","created_at","credits","currency_prices","description","features","icon","id","is_default","is_trialable","name","plan_type","updated_at","versions"],"title":"PlanDetailResponseData"},"PlansGetResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{"company_id":{"type":"string"},"company_scoped_only":{"type":"boolean","description":"Only return plans that are scoped to a company (custom plans assigned to a company)"},"exclude_company_scoped":{"type":"boolean","description":"Exclude plans that are scoped to a company (custom plans assigned to a company)"},"exclude_unused":{"type":"boolean","description":"Exclude plans that nothing is using: no company is on the plan and it has no draft version"},"for_fallback_plan":{"type":"boolean","description":"Filter for plans valid as fallback plans (not linked to billing)"},"for_initial_plan":{"type":"boolean","description":"Filter for plans valid as initial plans (not linked to billing, free, or auto-cancelling trial)"},"for_trial_expiry_plan":{"type":"boolean","description":"Filter for plans valid as trial expiry plans (not linked to billing or free)"},"has_product_id":{"type":"boolean","description":"Filter out plans that do not have a billing product ID"},"ids":{"type":"array","items":{"type":"string"}},"include_draft_versions":{"type":"boolean","description":"Include billing settings from draft versions for plans which have draft version"},"limit":{"type":"integer","format":"int64","minimum":0,"maximum":250,"description":"Page limit (default 100)"},"offset":{"type":"integer","format":"int64","description":"Page offset (default 0)"},"plan_type":{"$ref":"#/components/schemas/PlanType","description":"Filter by plan type"},"q":{"type":"string","maxLength":512},"scoped_to_company_id":{"type":"string","description":"Filter plans scoped to a specific company (custom plans)"},"with_entitlements":{"type":"boolean","description":"Include each plan's entitlements in the response"},"with_published_version":{"type":"boolean","description":"Only return plans that have a published version"},"without_entitlement_for":{"type":"string","description":"Filter out plans that already have a plan entitlement for the specified feature ID"},"without_entitlement_for_include_drafts":{"type":"boolean","description":"With without_entitlement_for, also treat an entitlement on a plan's draft version as existing"},"without_paid_product_id":{"type":"boolean","description":"Filter out plans that have a paid billing product ID"}},"description":"Input parameters","title":"PlansGetResponsesContentApplicationJsonSchemaParams"},"plans_listPlans_Response_200":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PlanDetailResponseData"}},"params":{"$ref":"#/components/schemas/PlansGetResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"plans_listPlans_Response_200"},"PlansPlanIdGetResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{"plan_version_id":{"type":"string","description":"Fetch billing settings for a specific plan version"}},"description":"Input parameters","title":"PlansPlanIdGetResponsesContentApplicationJsonSchemaParams"},"plans_getPlan_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PlanDetailResponseData"},"params":{"$ref":"#/components/schemas/PlansPlanIdGetResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"plans_getPlan_Response_200"},"CreatePlanRequestBody":{"type":"object","properties":{"description":{"type":"string","maxLength":1024},"icon":{"oneOf":[{"$ref":"#/components/schemas/PlanIcon"},{"type":"null"}]},"name":{"type":"string","minLength":1,"maxLength":256},"plan_type":{"$ref":"#/components/schemas/PlanType"}},"required":["name","plan_type"],"title":"CreatePlanRequestBody"},"PlansPostResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"PlansPostResponsesContentApplicationJsonSchemaParams"},"plans_createPlan_Response_201":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PlanDetailResponseData"},"params":{"$ref":"#/components/schemas/PlansPostResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"plans_createPlan_Response_201"},"UpdatePlanRequestBody":{"type":"object","properties":{"description":{"type":["string","null"],"maxLength":1024},"icon":{"oneOf":[{"$ref":"#/components/schemas/PlanIcon"},{"type":"null"}]},"name":{"type":"string","minLength":1,"maxLength":256}},"required":["name"],"title":"UpdatePlanRequestBody"},"PlansPlanIdPutResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"PlansPlanIdPutResponsesContentApplicationJsonSchemaParams"},"plans_updatePlan_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PlanDetailResponseData"},"params":{"$ref":"#/components/schemas/PlansPlanIdPutResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"plans_updatePlan_Response_200"},"DeleteResponse":{"type":"object","properties":{"deleted":{"type":"boolean","description":"Whether the delete was successful"}},"title":"DeleteResponse"},"PlansPlanIdDeleteResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"PlansPlanIdDeleteResponsesContentApplicationJsonSchemaParams"},"plans_deletePlan_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DeleteResponse"},"params":{"$ref":"#/components/schemas/PlansPlanIdDeleteResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"plans_deletePlan_Response_200"},"SortDirection":{"type":"string","enum":["asc","desc"],"title":"SortDirection"},"SubscriptionStatus":{"type":"string","enum":["active","canceled","expired","incomplete","incomplete_expired","past_due","paused","trialing","unpaid"],"title":"SubscriptionStatus"},"SubscriptionType":{"type":"string","enum":["free","one_time","paid","trial"],"title":"SubscriptionType"},"CreditCurrencyPrice":{"type":"object","properties":{"currency":{"$ref":"#/components/schemas/Currency"},"price":{"$ref":"#/components/schemas/BillingPriceView"}},"required":["currency"],"title":"CreditCurrencyPrice"},"BillingProductRecordResponseData":{"type":"object","properties":{"account_id":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"environment_id":{"type":"string"},"external_id":{"type":"string"},"id":{"type":"string"},"is_active":{"type":"boolean"},"name":{"type":"string"},"provider_type":{"$ref":"#/components/schemas/BillingProviderType"},"updated_at":{"type":"string","format":"date-time"}},"required":["account_id","created_at","environment_id","external_id","id","is_active","name","provider_type","updated_at"],"title":"BillingProductRecordResponseData"},"BillingCreditView":{"type":"object","properties":{"account_id":{"type":"string"},"burn_strategy":{"$ref":"#/components/schemas/BillingCreditBurnStrategy"},"cost_editable":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"currency_prices":{"type":"array","items":{"$ref":"#/components/schemas/CreditCurrencyPrice"}},"default_expiry_unit":{"$ref":"#/components/schemas/BillingCreditExpiryUnit"},"default_expiry_unit_count":{"type":["integer","null"],"format":"int64"},"default_rollover_policy":{"$ref":"#/components/schemas/BillingCreditRolloverPolicy"},"description":{"type":"string"},"environment_id":{"type":"string"},"icon":{"type":["string","null"]},"id":{"type":"string"},"ledger_authority":{"$ref":"#/components/schemas/BillingCreditLedgerAuthority"},"name":{"type":"string"},"plural_name":{"type":["string","null"]},"price":{"$ref":"#/components/schemas/BillingPriceView"},"price_per_unit":{"type":["integer","null"],"format":"int64"},"price_per_unit_decimal":{"type":["string","null"]},"product":{"$ref":"#/components/schemas/BillingProductRecordResponseData"},"singular_name":{"type":["string","null"]},"updated_at":{"type":"string","format":"date-time"}},"required":["account_id","burn_strategy","cost_editable","created_at","currency_prices","default_expiry_unit","default_rollover_policy","description","environment_id","id","ledger_authority","name","updated_at"],"title":"BillingCreditView"},"GenericPreviewObject":{"type":"object","properties":{"description":{"type":["string","null"]},"id":{"type":"string"},"image_url":{"type":["string","null"]},"name":{"type":"string"}},"required":["id","name"],"title":"GenericPreviewObject"},"CompanyPlanCreditGrantView":{"type":"object","properties":{"billing_credit_arrears_anchor":{"oneOf":[{"$ref":"#/components/schemas/BillingArrearsAnchor"},{"type":"null"}]},"billing_credit_arrears_cadence":{"oneOf":[{"$ref":"#/components/schemas/BillingArrearsCadence"},{"type":"null"}]},"billing_credit_auto_topup_amount":{"type":["integer","null"],"format":"int64"},"billing_credit_auto_topup_amount_type":{"type":["string","null"]},"billing_credit_auto_topup_availability":{"oneOf":[{"$ref":"#/components/schemas/BillingCreditAutoTopupAvailability"},{"type":"null"}]},"billing_credit_auto_topup_enabled":{"type":"boolean"},"billing_credit_auto_topup_expiry_type":{"oneOf":[{"$ref":"#/components/schemas/BillingCreditExpiryType"},{"type":"null"}]},"billing_credit_auto_topup_expiry_unit":{"oneOf":[{"$ref":"#/components/schemas/BillingCreditExpiryUnit"},{"type":"null"}]},"billing_credit_auto_topup_expiry_unit_count":{"type":["integer","null"],"format":"int64"},"billing_credit_auto_topup_self_service":{"type":"boolean"},"billing_credit_auto_topup_threshold_credits":{"type":["integer","null"],"format":"int64"},"billing_credit_auto_topup_threshold_percent":{"type":["integer","null"],"format":"int64"},"billing_credit_can_buy_bundles":{"type":"boolean"},"billing_credit_overdraft_limit":{"type":["number","null"],"format":"double"},"billing_credit_postpaid_enabled":{"type":"boolean"},"billing_credit_postpaid_rate_per_unit":{"type":["integer","null"],"format":"int64"},"billing_credit_postpaid_rate_per_unit_decimal":{"type":["string","null"]},"billing_mode":{"$ref":"#/components/schemas/BillingPlanCreditGrantBillingMode"},"billing_product_price_id":{"type":["string","null"]},"company_auto_topup_amount":{"type":["integer","null"],"format":"int64"},"company_auto_topup_enabled":{"type":["boolean","null"]},"company_auto_topup_threshold_credits":{"type":["integer","null"],"format":"int64"},"company_credit_amount":{"type":"integer","format":"int64"},"created_at":{"type":"string","format":"date-time"},"credit":{"$ref":"#/components/schemas/BillingCreditView"},"credit_amount":{"type":"integer","format":"int64"},"credit_description":{"type":"string","description":"Deprecated field, will be removed in the future. Use Credit.Description instead.","deprecated":true},"credit_icon":{"type":["string","null"],"description":"Deprecated field, will be removed in the future. Use Credit.Icon instead.","deprecated":true},"credit_id":{"type":"string"},"credit_name":{"type":"string","description":"Deprecated field, will be removed in the future. Use Credit.Name instead.","deprecated":true},"expiry_type":{"oneOf":[{"$ref":"#/components/schemas/BillingCreditExpiryType"},{"type":"null"}]},"expiry_unit":{"oneOf":[{"$ref":"#/components/schemas/BillingCreditExpiryUnit"},{"type":"null"}]},"expiry_unit_count":{"type":["integer","null"],"format":"int64"},"id":{"type":"string"},"license_id":{"type":["string","null"]},"plan":{"$ref":"#/components/schemas/GenericPreviewObject"},"plan_id":{"type":"string"},"plan_version_id":{"type":["string","null"]},"plural_name":{"type":["string","null"],"description":"Deprecated field, will be removed in the future. Use Credit.PluralName instead.","deprecated":true},"price":{"$ref":"#/components/schemas/BillingPriceView"},"reset_cadence":{"oneOf":[{"$ref":"#/components/schemas/BillingPlanCreditGrantResetCadence"},{"type":"null"}]},"reset_start":{"oneOf":[{"$ref":"#/components/schemas/BillingPlanCreditGrantResetStart"},{"type":"null"}]},"reset_type":{"$ref":"#/components/schemas/BillingPlanCreditGrantResetType"},"rollover_percentage":{"type":"integer","format":"int64"},"scaling":{"$ref":"#/components/schemas/PlanCreditGrantScaling"},"singular_name":{"type":["string","null"],"description":"Deprecated field, will be removed in the future. Use Credit.SingularName instead.","deprecated":true},"updated_at":{"type":"string","format":"date-time"}},"required":["billing_credit_auto_topup_enabled","billing_credit_auto_topup_self_service","billing_credit_can_buy_bundles","billing_credit_postpaid_enabled","billing_mode","company_credit_amount","created_at","credit_amount","credit_description","credit_id","credit_name","id","plan_id","reset_type","rollover_percentage","scaling","updated_at"],"title":"CompanyPlanCreditGrantView"},"CompanyPlanWithBillingSubView":{"type":"object","properties":{"added_on":{"type":["string","null"],"format":"date-time"},"billing_product_external_id":{"type":["string","null"]},"billing_product_id":{"type":["string","null"]},"description":{"type":["string","null"]},"id":{"type":"string"},"image_url":{"type":["string","null"]},"included_credit_grants":{"type":"array","items":{"$ref":"#/components/schemas/CompanyPlanCreditGrantView"}},"name":{"type":"string"},"plan_period":{"type":["string","null"]},"plan_price":{"type":["integer","null"],"format":"int64"},"plan_version_id":{"type":["string","null"]}},"required":["id","included_credit_grants","name"],"title":"CompanyPlanWithBillingSubView"},"BillingCollectionMethod":{"type":"string","enum":["charge_automatically","send_invoice"],"title":"BillingCollectionMethod"},"Collector":{"type":"string","enum":["external","stripe_invoice","stripe_payments"],"title":"Collector"},"PaymentGating":{"type":"string","enum":["keep_serving","revoke_after"],"title":"PaymentGating"},"ProrationBehavior":{"type":"string","enum":["create_prorations","invoice_immediately"],"title":"ProrationBehavior"},"CompanyBillingProfileResponseData":{"type":"object","properties":{"account_id":{"type":"string"},"billing_customer_id":{"type":["string","null"]},"collection_method":{"$ref":"#/components/schemas/BillingCollectionMethod"},"collector":{"oneOf":[{"$ref":"#/components/schemas/Collector"},{"type":"null"}]},"company_id":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"currency":{"oneOf":[{"$ref":"#/components/schemas/Currency"},{"type":"null"}]},"days_until_due":{"type":["integer","null"],"format":"int64"},"environment_id":{"type":"string"},"gating_days":{"type":"integer","format":"int64"},"id":{"type":"string"},"is_default":{"type":"boolean"},"name":{"type":["string","null"]},"overdraft_limit":{"type":["integer","null"],"format":"int64"},"payment_gating":{"$ref":"#/components/schemas/PaymentGating"},"payment_method_id":{"type":["string","null"]},"proration_behavior":{"oneOf":[{"$ref":"#/components/schemas/ProrationBehavior"},{"type":"null"}]},"provider_type":{"$ref":"#/components/schemas/BillingProviderType"},"purchase_order":{"type":["string","null"]},"updated_at":{"type":"string","format":"date-time"}},"required":["account_id","collection_method","company_id","created_at","environment_id","gating_days","id","is_default","payment_gating","provider_type","updated_at"],"title":"CompanyBillingProfileResponseData"},"BillingSubscriptionDiscountView":{"type":"object","properties":{"amount_off":{"type":["integer","null"],"format":"int64"},"coupon_id":{"type":"string"},"coupon_name":{"type":"string"},"currency":{"oneOf":[{"$ref":"#/components/schemas/Currency"},{"type":"null"}]},"customer_facing_code":{"type":["string","null"]},"discount_external_id":{"type":"string"},"duration":{"type":"string"},"duration_in_months":{"type":["integer","null"],"format":"int64"},"ended_at":{"type":["string","null"],"format":"date-time"},"is_active":{"type":"boolean"},"percent_off":{"type":["number","null"],"format":"double"},"promo_code_external_id":{"type":["string","null"]},"started_at":{"type":"string","format":"date-time"},"subscription_external_id":{"type":"string"}},"required":["coupon_id","coupon_name","discount_external_id","duration","is_active","started_at","subscription_external_id"],"title":"BillingSubscriptionDiscountView"},"InvoiceStatus":{"type":"string","enum":["draft","open","paid","uncollectible","void"],"title":"InvoiceStatus"},"InvoiceResponseData":{"type":"object","properties":{"amount_due":{"type":"integer","format":"int64"},"amount_paid":{"type":"integer","format":"int64"},"amount_remaining":{"type":"integer","format":"int64"},"collection_method":{"type":"string"},"company_id":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"currency":{"$ref":"#/components/schemas/Currency"},"customer_external_id":{"type":"string"},"due_date":{"type":["string","null"],"format":"date-time"},"ending_balance":{"type":"integer","format":"int64"},"environment_id":{"type":"string"},"external_id":{"type":["string","null"]},"id":{"type":"string"},"payment_method_external_id":{"type":["string","null"]},"provider_type":{"$ref":"#/components/schemas/BillingProviderType"},"starting_balance":{"type":"integer","format":"int64"},"status":{"oneOf":[{"$ref":"#/components/schemas/InvoiceStatus"},{"type":"null"}]},"subscription_external_id":{"type":["string","null"]},"subtotal":{"type":"integer","format":"int64"},"total":{"type":["integer","null"],"format":"int64","description":"Amount after discounts and tax, before applying the customer balance. Null when the provider has not reported it: rows synced before the column existed, or pushed without one."},"updated_at":{"type":"string","format":"date-time"},"url":{"type":["string","null"]}},"required":["amount_due","amount_paid","amount_remaining","collection_method","created_at","currency","customer_external_id","ending_balance","environment_id","id","provider_type","starting_balance","subtotal","updated_at"],"title":"InvoiceResponseData"},"BillingSubscriptionViewMetadata":{"type":"object","properties":{},"title":"BillingSubscriptionViewMetadata"},"BillingSubscriptionPauseBehavior":{"type":"string","enum":["keep_as_draft","mark_uncollectible","void"],"title":"BillingSubscriptionPauseBehavior"},"PaymentMethodResponseData":{"type":"object","properties":{"account_last4":{"type":["string","null"]},"account_name":{"type":["string","null"]},"bank_name":{"type":["string","null"]},"billing_email":{"type":["string","null"]},"billing_name":{"type":["string","null"]},"card_brand":{"type":["string","null"]},"card_exp_month":{"type":["integer","null"],"format":"int64"},"card_exp_year":{"type":["integer","null"],"format":"int64"},"card_last4":{"type":["string","null"]},"company_id":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"customer_external_id":{"type":"string"},"environment_id":{"type":"string"},"external_id":{"type":"string"},"id":{"type":"string"},"payment_method_type":{"type":"string"},"provider_type":{"$ref":"#/components/schemas/BillingProviderType"},"updated_at":{"type":"string","format":"date-time"}},"required":["created_at","customer_external_id","environment_id","external_id","id","payment_method_type","provider_type","updated_at"],"title":"PaymentMethodResponseData"},"BillingProductForSubscriptionResponseData":{"type":"object","properties":{"billing_scheme":{"$ref":"#/components/schemas/BillingPriceScheme"},"billing_threshold":{"type":["integer","null"],"format":"int64"},"created_at":{"type":"string","format":"date-time"},"currency":{"$ref":"#/components/schemas/Currency"},"environment_id":{"type":"string"},"external_id":{"type":"string"},"id":{"type":"string"},"interval":{"type":"string"},"interval_count":{"type":["integer","null"],"format":"int64"},"meter_id":{"type":["string","null"]},"name":{"type":"string"},"package_size":{"type":"integer","format":"int64"},"price":{"type":"integer","format":"int64"},"price_decimal":{"type":["string","null"]},"price_external_id":{"type":"string"},"price_id":{"type":"string"},"price_tier":{"type":"array","items":{"$ref":"#/components/schemas/BillingProductPriceTierResponseData"}},"provider_type":{"$ref":"#/components/schemas/BillingProviderType"},"quantity":{"type":"number","format":"double"},"subscription_id":{"type":"string"},"subscription_item_external_id":{"type":["string","null"]},"updated_at":{"type":"string","format":"date-time"},"usage_type":{"$ref":"#/components/schemas/BillingPriceUsageType"}},"required":["billing_scheme","created_at","currency","environment_id","external_id","id","interval","name","package_size","price","price_external_id","price_id","price_tier","provider_type","quantity","subscription_id","updated_at","usage_type"],"title":"BillingProductForSubscriptionResponseData"},"BillingSubscriptionTrialEndSetting":{"type":"string","enum":["cancel","subscribe"],"title":"BillingSubscriptionTrialEndSetting"},"BillingSubscriptionView":{"type":"object","properties":{"access_revoked_at":{"type":["string","null"],"format":"date-time"},"application_id":{"type":["string","null"]},"cancel_at":{"type":["integer","null"],"format":"int64"},"cancel_at_period_end":{"type":"boolean"},"company_id":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"currency":{"$ref":"#/components/schemas/Currency"},"customer_external_id":{"type":"string"},"default_payment_method_id":{"type":["string","null"]},"discounts":{"type":"array","items":{"$ref":"#/components/schemas/BillingSubscriptionDiscountView"}},"expired_at":{"type":["string","null"],"format":"date-time"},"id":{"type":"string"},"interval":{"type":"string"},"latest_invoice":{"$ref":"#/components/schemas/InvoiceResponseData"},"metadata":{"$ref":"#/components/schemas/BillingSubscriptionViewMetadata"},"pause_behavior":{"oneOf":[{"$ref":"#/components/schemas/BillingSubscriptionPauseBehavior"},{"type":"null"}]},"pause_resumes_at":{"type":["integer","null"],"format":"int64"},"paused_at":{"type":["string","null"],"format":"date-time"},"payment_method":{"$ref":"#/components/schemas/PaymentMethodResponseData"},"period_end":{"type":"integer","format":"int64"},"period_start":{"type":"integer","format":"int64"},"products":{"type":"array","items":{"$ref":"#/components/schemas/BillingProductForSubscriptionResponseData"}},"provider_type":{"$ref":"#/components/schemas/BillingProviderType"},"status":{"type":"string"},"subscription_external_id":{"type":"string"},"total_price":{"type":"integer","format":"int64"},"trial_end":{"type":["integer","null"],"format":"int64"},"trial_end_setting":{"oneOf":[{"$ref":"#/components/schemas/BillingSubscriptionTrialEndSetting"},{"type":"null"}]}},"required":["cancel_at_period_end","created_at","currency","customer_external_id","discounts","id","interval","period_end","period_start","products","provider_type","status","subscription_external_id","total_price"],"title":"BillingSubscriptionView"},"CustomPlanActivationStrategy":{"type":"string","enum":["on_payment","on_publish"],"title":"CustomPlanActivationStrategy"},"PlanBillingSource":{"type":"string","enum":["amendment","custom_plan","manage_plan"],"title":"PlanBillingSource"},"CheckoutProblemCode":{"type":"string","enum":["add_on_conflicts_with_plan","add_on_interval_mismatch","add_on_requires_billed_plan","add_on_unavailable","billing_cycle_anchor_conflicts_with_trial","billing_cycle_anchor_must_be_future","billing_cycle_anchor_needs_new_subscription","billing_cycle_anchor_without_plan","billing_start_date_must_be_past","billing_start_date_needs_new_subscription","billing_start_date_needs_renewal_date","billing_start_date_not_before_renewal_date","billing_start_date_too_far_in_past","checkout_superseded","credit_bundle_incompatible","credit_bundle_unavailable","credit_bundles_activate_on_payment","currency_mismatch","custom_field_required","discount_ineligible","downgrade_not_permitted","end_date_must_be_future","end_date_needs_new_subscription","end_date_not_after_renewal_date","free_first_period_activates_on_payment","invoice_email_required","invoiced_subscription_conflicts_with_trial","invoiced_subscription_needs_new_subscription","invoiced_subscription_requires_plan","opt_in_required","pay_in_advance_price_invalid","pay_in_advance_required","payment_method_required","plan_not_trialable","plan_unavailable","price_unavailable","prorate_first_period_without_anchor","provider_rejected","scheduled_change_blocks_purchase","scheduled_change_pending","selection_invalid","subscription_currency_change","trial_end_must_be_future","trial_end_too_far","trial_excludes_add_ons","trial_excludes_usage_based","usage_price_missing_for_interval","usage_over_limit"],"title":"CheckoutProblemCode"},"CheckoutProblemSource":{"type":"string","enum":["provider","requirement","validation"],"title":"CheckoutProblemSource"},"CheckoutProblemResponseData":{"type":"object","properties":{"blocking":{"type":"boolean","description":"Whether completing the checkout would be refused while this stands."},"bundle_id":{"type":["string","null"]},"code":{"$ref":"#/components/schemas/CheckoutProblemCode"},"currency":{"$ref":"#/components/schemas/Currency","description":"The currency this problem is about, when it is about one."},"detail":{"type":"string","description":"Diagnostic detail for operators, including what the billing provider said. Never shown to a customer."},"feature_id":{"type":["string","null"]},"field_id":{"type":["string","null"]},"message":{"type":"string","description":"What is wrong, in words safe for anyone allowed to read the checkout."},"payment_method_id":{"type":["string","null"]},"plan_id":{"type":["string","null"]},"price_id":{"type":["string","null"]},"source":{"$ref":"#/components/schemas/CheckoutProblemSource"}},"required":["blocking","code","message","source"],"title":"CheckoutProblemResponseData"},"CustomPlanBillingStatus":{"type":"string","enum":["active","expired","paid","pending"],"title":"CustomPlanBillingStatus"},"CustomPlanBillingResponseData":{"type":"object","properties":{"activation_strategy":{"$ref":"#/components/schemas/CustomPlanActivationStrategy"},"billing_cycle_anchor":{"type":["string","null"],"format":"date-time","description":"The billing period renewal date pinned when the subscription started, when one was set. When no invoice exists yet, the first invoice is raised on this date."},"billing_entity_id":{"type":["string","null"],"description":"The company that pays for the subscription, when it isn't the plan's company. Null when the company pays for itself."},"billing_start_date":{"type":["string","null"],"format":"date-time","description":"The date the contract term starts, when the operator pinned one. A past date was backdated onto the subscription so the first period runs from the contract date rather than from finalization."},"checkout_id":{"type":["string","null"],"description":"The checkout this billing record was created from, when it was created from one."},"company_id":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"days_until_due":{"type":"integer","format":"int64"},"end_date":{"type":["string","null"],"format":"date-time","description":"When a custom plan that doesn't renew ends: the renewal the subscription stops on and the company moves to the default plan. Null for a plan that renews."},"external_invoice_id":{"type":["string","null"]},"id":{"type":"string"},"migration_id":{"type":["string","null"],"description":"The plan version migration this amendment invoice belongs to. Null for a first publish or a plan assigned through Manage Plan."},"paid_at":{"type":["string","null"],"format":"date-time"},"plan_billing_source":{"$ref":"#/components/schemas/PlanBillingSource","description":"The flow that created this billing record: a custom plan's first publish, an amendment of a live custom plan, or a standard plan assigned by invoice through Manage Plan."},"plan_id":{"type":"string"},"problems":{"type":"array","items":{"$ref":"#/components/schemas/CheckoutProblemResponseData"},"description":"What the linked checkout still reports wrong, in the order found. Empty when there is no linked checkout or it completed cleanly."},"prorate_first_period":{"type":["boolean","null"],"description":"Whether the shortened period the renewal date created was billed pro rata when the subscription started. False means that period is free and the first invoice is the one raised on the renewal date."},"published_at":{"type":["string","null"],"format":"date-time"},"send_invoice":{"type":"boolean"},"status":{"$ref":"#/components/schemas/CustomPlanBillingStatus"},"stripe_invoice_url":{"type":["string","null"]},"updated_at":{"type":"string","format":"date-time"}},"required":["activation_strategy","company_id","created_at","days_until_due","id","plan_billing_source","plan_id","problems","send_invoice","status","updated_at"],"title":"CustomPlanBillingResponseData"},"WarningTier":{"type":"object","properties":{"key":{"type":"string","description":"A customer-defined identifier for the warning tier"},"value":{"type":"integer","format":"int64","description":"The warning threshold, in the entitlement's usage units"}},"required":["key","value"],"title":"WarningTier"},"FeatureEntitlement":{"type":"object","properties":{"allocation":{"type":["integer","null"],"format":"int64","description":"If the company has a numeric entitlement for this feature, the allocated amount"},"consumption_rate":{"type":["number","null"],"format":"double","description":"If the company has a credit-based entitlement for this feature, the credit cost per unit of usage"},"credit_id":{"type":["string","null"],"description":"If the company has a credit-based entitlement for this feature, the ID of the credit"},"credit_remaining":{"type":["number","null"],"format":"double","description":"If the company has a credit-based entitlement for this feature, the credit available to fund new consumption or a new lease hold — open lease holds are excluded. Clients that hold a lease should gate on this plus their own unspent hold; clients with no lease awareness should use credit_settled instead"},"credit_reserved":{"type":["number","null"],"format":"double","description":"If the company has a credit-based entitlement for this feature, the unspent amount held by an open credit lease. Returns to credit_remaining when the lease is released"},"credit_settled":{"type":["number","null"],"format":"double","description":"If the company has a credit-based entitlement for this feature, the balance net of actual consumption, unaffected by open lease holds (credit_remaining plus credit_reserved). The number to display to end users"},"credit_total":{"type":["number","null"],"format":"double","description":"If the company has a credit-based entitlement for this feature, the total credit amount"},"credit_used":{"type":["number","null"],"format":"double","description":"If the company has a credit-based entitlement for this feature, the amount of credit used"},"event_name":{"type":["string","null"],"description":"If the feature is event-based, the name of the event tracked for usage"},"event_subtype":{"type":["string","null"],"description":"For event-based or credit-metered feature entitlements, the event subtype whose usage is tracked"},"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":{"oneOf":[{"$ref":"#/components/schemas/MetricPeriod"},{"type":"null"}],"description":"For event-based feature entitlements, the period over which usage is tracked"},"metric_reset_at":{"type":["string","null"],"format":"date-time","description":"For event-based feature entitlements, when the usage period will reset"},"month_reset":{"oneOf":[{"$ref":"#/components/schemas/MetricPeriodMonthReset"},{"type":"null"}],"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"},"quantity_rates":{"type":"object","additionalProperties":{"type":"number","format":"double"},"description":"If the company has a credit-based entitlement for this feature, the credit cost per unit of each quantity an event carries, keyed by quantity key (per token for inference features). Absent when the entitlement prices requests only"},"soft_limit":{"type":["integer","null"],"format":"int64","description":"For usage-based pricing, the soft limit for overage charges or the next tier boundary"},"usage":{"type":["integer","null"],"format":"int64","description":"If the company has a numeric entitlement for this feature, the current usage amount"},"value_type":{"$ref":"#/components/schemas/EntitlementValueType","description":"The type of the entitlement value"},"warning_tiers":{"type":"array","items":{"$ref":"#/components/schemas/WarningTier"},"description":"Customer-defined usage warning thresholds configured on this entitlement"}},"required":["feature_id","feature_key","value_type"],"title":"FeatureEntitlement"},"EntityTraitDetailResponseData":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time"},"definition":{"$ref":"#/components/schemas/EntityTraitDefinitionResponseData"},"definition_id":{"type":"string"},"environment_id":{"type":"string"},"id":{"type":"string"},"updated_at":{"type":"string","format":"date-time"},"value":{"type":"string"}},"required":["created_at","definition_id","environment_id","id","updated_at","value"],"title":"EntityTraitDetailResponseData"},"EntityKeyDefinitionResponseData":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time"},"entity_type":{"$ref":"#/components/schemas/EntityType"},"id":{"type":"string"},"key":{"type":"string"},"updated_at":{"type":"string","format":"date-time"}},"required":["created_at","entity_type","id","key","updated_at"],"title":"EntityKeyDefinitionResponseData"},"EntityKeyDetailResponseData":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time"},"definition":{"$ref":"#/components/schemas/EntityKeyDefinitionResponseData"},"definition_id":{"type":"string"},"entity_id":{"type":"string"},"entity_type":{"$ref":"#/components/schemas/EntityType"},"environment_id":{"type":"string"},"id":{"type":"string"},"key":{"type":"string"},"updated_at":{"type":"string","format":"date-time"},"value":{"type":"string"}},"required":["created_at","definition_id","entity_id","entity_type","environment_id","id","key","updated_at","value"],"title":"EntityKeyDetailResponseData"},"CompanyEventPeriodMetricsResponseData":{"type":"object","properties":{"account_id":{"type":"string"},"captured_at_max":{"type":"string","format":"date-time"},"captured_at_min":{"type":"string","format":"date-time"},"company_id":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"environment_id":{"type":"string"},"event_subtype":{"type":"string"},"month_reset":{"$ref":"#/components/schemas/MetricPeriodMonthReset"},"period":{"$ref":"#/components/schemas/MetricPeriod"},"valid_until":{"type":["string","null"],"format":"date-time"},"value":{"type":"integer","format":"int64"}},"required":["account_id","captured_at_max","captured_at_min","company_id","created_at","environment_id","event_subtype","month_reset","period","value"],"title":"CompanyEventPeriodMetricsResponseData"},"MigrationProrationBehavior":{"type":"string","enum":["always_invoice","create_prorations","none"],"title":"MigrationProrationBehavior"},"PlanVersionMigrationStrategy":{"type":"string","enum":["end_of_billing_period","immediate","leave","scheduled"],"title":"PlanVersionMigrationStrategy"},"PendingMigrationResponseData":{"type":"object","properties":{"effective_at":{"type":["string","null"],"format":"date-time","description":"When the company moves to the new version: the migration's date for a scheduled migration, or the end of the company's current billing period. Null when no date can be named yet, for example when the company's only subscription is past due or set to cancel; the company then moves at the next opportunity."},"migration_id":{"type":"string"},"proration_behavior":{"oneOf":[{"$ref":"#/components/schemas/MigrationProrationBehavior"},{"type":"null"}],"description":"How the price difference is billed when the company moves. Always none for an end-of-billing-period migration."},"scheduled_for":{"type":["string","null"],"format":"date-time","description":"Deprecated; use effective_at, which carries the same value.","deprecated":true},"strategy":{"$ref":"#/components/schemas/PlanVersionMigrationStrategy","description":"Whether the company moves at the end of its billing period (end_of_billing_period) or on a specific date (scheduled). The type is shared with plan version migrations, but only those two values appear here: this view lists deferred migrations only, so an immediate migration is never shown, even while it is pending."},"to_plan_id":{"type":"string"},"to_plan_name":{"type":"string"},"to_plan_version_id":{"type":"string"},"to_plan_version_number":{"type":["integer","null"],"format":"int64"}},"required":["migration_id","strategy","to_plan_id","to_plan_name","to_plan_version_id"],"title":"PendingMigrationResponseData"},"TraitDefinitionComparableType":{"type":"string","enum":["bool","date","int","string"],"title":"TraitDefinitionComparableType"},"TraitDefinition":{"type":"object","properties":{"comparable_type":{"$ref":"#/components/schemas/TraitDefinitionComparableType"},"entity_type":{"$ref":"#/components/schemas/EntityType"},"id":{"type":"string"}},"required":["comparable_type","entity_type","id"],"title":"TraitDefinition"},"Condition":{"type":"object","properties":{"account_id":{"type":"string"},"comparison_trait_definition":{"$ref":"#/components/schemas/TraitDefinition"},"condition_type":{"$ref":"#/components/schemas/ConditionType"},"consumption_rate":{"type":["number","null"],"format":"double"},"credit_id":{"type":["string","null"]},"environment_id":{"type":"string"},"event_subtype":{"type":["string","null"]},"id":{"type":"string"},"metric_period":{"oneOf":[{"$ref":"#/components/schemas/MetricPeriod"},{"type":"null"}]},"metric_period_month_reset":{"oneOf":[{"$ref":"#/components/schemas/MetricPeriodMonthReset"},{"type":"null"}]},"metric_value":{"type":["integer","null"],"format":"int64"},"operator":{"$ref":"#/components/schemas/ComparableOperator"},"quantity_rates":{"type":"object","additionalProperties":{"type":"number","format":"double"}},"resource_ids":{"type":"array","items":{"type":"string"}},"trait_definition":{"$ref":"#/components/schemas/TraitDefinition"},"trait_value":{"type":"string"}},"required":["account_id","condition_type","environment_id","id","operator","resource_ids","trait_value"],"title":"Condition"},"ConditionGroup":{"type":"object","properties":{"conditions":{"type":"array","items":{"$ref":"#/components/schemas/Condition"}}},"required":["conditions"],"title":"ConditionGroup"},"Rule":{"type":"object","properties":{"account_id":{"type":"string"},"condition_groups":{"type":"array","items":{"$ref":"#/components/schemas/ConditionGroup"}},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/Condition"}},"environment_id":{"type":"string"},"flag_id":{"type":["string","null"]},"id":{"type":"string"},"name":{"type":"string"},"priority":{"type":"integer","format":"int64"},"rule_type":{"$ref":"#/components/schemas/RuleType"},"value":{"type":"boolean"}},"required":["account_id","condition_groups","conditions","environment_id","id","name","priority","rule_type","value"],"title":"Rule"},"ScheduledDowngradeResponseData":{"type":"object","properties":{"currency":{"$ref":"#/components/schemas/Currency"},"effective_after":{"type":"string","format":"date-time"},"from_plan_id":{"type":"string"},"from_plan_name":{"type":"string"},"from_subscription_price":{"type":"integer","format":"int64"},"id":{"type":"string"},"interval":{"type":"string"},"scheduled_interval":{"type":["string","null"]},"scheduled_price":{"type":["integer","null"],"format":"int64"},"to_plan_id":{"type":"string"},"to_plan_name":{"type":"string"}},"required":["currency","effective_after","from_plan_id","from_plan_name","from_subscription_price","id","interval","to_plan_id","to_plan_name"],"title":"ScheduledDowngradeResponseData"},"CompanyDetailResponseDataTraits":{"type":"object","properties":{},"description":"A map of trait names to trait values","title":"CompanyDetailResponseDataTraits"},"CompanyDetailResponseData":{"type":"object","properties":{"add_ons":{"type":"array","items":{"$ref":"#/components/schemas/CompanyPlanWithBillingSubView"}},"billing_credit_balances":{"type":["object","null"],"additionalProperties":{"type":"number","format":"double"}},"billing_email":{"type":["string","null"]},"billing_profile":{"$ref":"#/components/schemas/CompanyBillingProfileResponseData"},"billing_profiles":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CompanyBillingProfileResponseData"}},"billing_subscription":{"$ref":"#/components/schemas/BillingSubscriptionView"},"billing_subscriptions":{"type":"array","items":{"$ref":"#/components/schemas/BillingSubscriptionView"}},"created_at":{"type":"string","format":"date-time"},"custom_plan_billings":{"type":"array","items":{"$ref":"#/components/schemas/CustomPlanBillingResponseData"}},"default_payment_method":{"$ref":"#/components/schemas/PaymentMethodResponseData"},"entitlements":{"type":"array","items":{"$ref":"#/components/schemas/FeatureEntitlement"}},"entity_traits":{"type":"array","items":{"$ref":"#/components/schemas/EntityTraitDetailResponseData"}},"environment_id":{"type":"string"},"id":{"type":"string"},"keys":{"type":"array","items":{"$ref":"#/components/schemas/EntityKeyDetailResponseData"}},"last_seen_at":{"type":["string","null"],"format":"date-time"},"logo_url":{"type":["string","null"]},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/CompanyEventPeriodMetricsResponseData"}},"name":{"type":"string"},"payment_methods":{"type":"array","items":{"$ref":"#/components/schemas/PaymentMethodResponseData"}},"pending_migration":{"$ref":"#/components/schemas/PendingMigrationResponseData"},"plan":{"$ref":"#/components/schemas/CompanyPlanWithBillingSubView"},"plans":{"type":"array","items":{"$ref":"#/components/schemas/GenericPreviewObject"}},"rules":{"type":"array","items":{"$ref":"#/components/schemas/Rule"}},"scheduled_downgrade":{"$ref":"#/components/schemas/ScheduledDowngradeResponseData"},"traits":{"$ref":"#/components/schemas/CompanyDetailResponseDataTraits","description":"A map of trait names to trait values"},"updated_at":{"type":"string","format":"date-time"},"user_count":{"type":"integer","format":"int64"}},"required":["add_ons","billing_subscriptions","created_at","custom_plan_billings","entitlements","entity_traits","environment_id","id","keys","metrics","name","payment_methods","plans","rules","updated_at","user_count"],"title":"CompanyDetailResponseData"},"CompaniesGetResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{"cancel_at_period_end":{"type":"boolean","description":"If true, filter companies with an active subscription that is set to cancel at the end of the current period; if false, filter companies without one"},"credit_type_ids":{"type":"array","items":{"type":"string"},"description":"Filter companies by one or more credit type IDs (each ID starts with bcrd_)"},"has_scheduled_downgrade":{"type":"boolean","description":"If true, filter companies that have a pending scheduled downgrade; if false, filter companies that do not"},"ids":{"type":"array","items":{"type":"string"},"description":"Filter companies by multiple company IDs (starts with comp_)"},"limit":{"type":"integer","format":"int64","minimum":0,"maximum":250,"description":"Page limit (default 100)"},"monetized_subscriptions":{"type":"boolean","description":"Filter companies that have monetized subscriptions"},"offset":{"type":"integer","format":"int64","description":"Page offset (default 0)"},"plan_id":{"type":"string","description":"Filter companies by plan ID (starts with plan_)"},"plan_ids":{"type":"array","items":{"type":"string"},"description":"Filter companies by one or more plan IDs (each ID starts with plan_)"},"plan_version_id":{"type":"string","description":"Filter companies by plan version ID (starts with plvr_)"},"plan_version_ids":{"type":"array","items":{"type":"string"},"description":"Filter companies by one or more plan version IDs (each ID starts with plvr_). Takes precedence over plan_version_id when set."},"plan_version_unpublished":{"type":"boolean","description":"Filter companies assigned to a plan version that is no longer published, meaning the plan has since moved on to a newer version"},"q":{"type":"string","maxLength":512,"description":"Search for companies by name, keys or string traits"},"sort_order_column":{"type":"string","maxLength":255,"description":"Column to sort by (e.g. name, created_at, last_seen_at)"},"sort_order_direction":{"$ref":"#/components/schemas/SortDirection","description":"Direction to sort by (asc or desc)"},"subscription_statuses":{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionStatus"},"description":"Filter companies by one or more subscription statuses"},"subscription_types":{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionType"},"description":"Filter companies by one or more subscription types"},"with_entitlement_for":{"type":"string","description":"Filter companies that have an entitlement (plan entitlement or company override) for the specified feature ID"},"with_subscription":{"type":"boolean","description":"Filter companies that have a subscription"},"without_feature_override_for":{"type":"string","description":"Filter out companies that have an unexpired company override for the specified feature ID"},"without_plan":{"type":"boolean","description":"Filter out companies that have a plan"},"without_subscription":{"type":"boolean","description":"Filter out companies that have a subscription"}},"description":"Input parameters","title":"CompaniesGetResponsesContentApplicationJsonSchemaParams"},"companies_listCompanies_Response_200":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CompanyDetailResponseData"}},"params":{"$ref":"#/components/schemas/CompaniesGetResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"companies_listCompanies_Response_200"},"UpsertCompanyRequestBodyTraits":{"type":"object","properties":{},"description":"A map of trait names to trait values","title":"UpsertCompanyRequestBodyTraits"},"UpsertCompanyRequestBody":{"type":"object","properties":{"base_plan_id":{"type":["string","null"],"description":"Assign this base plan when creating the company (starts with plan_). Takes precedence over the environment's initial plan and must be provisionable without a payment method."},"base_plan_price_id":{"type":["string","null"],"description":"The Schematic price to provision for base_plan_id (starts with bilpp_). Required and must be $0 for a billing-linked plan; omit for a plan that is not billing-linked."},"id":{"type":["string","null"],"description":"If you know the Schematic ID, you can use that here instead of keys"},"keys":{"type":"object","additionalProperties":{"type":"string"},"description":"See [Key Management](https://docs.schematichq.com/developer_resources/key_management) for more information"},"last_seen_at":{"type":["string","null"],"format":"date-time"},"name":{"type":["string","null"],"maxLength":256},"prevent_key_remap":{"type":["boolean","null"]},"remove_keys":{"type":"array","items":{"type":"string"},"description":"Names of keys to remove from the company. Removing a key the company does not have does nothing, and a company must keep at least one key."},"traits":{"$ref":"#/components/schemas/UpsertCompanyRequestBodyTraits","description":"A map of trait names to trait values"},"update_only":{"type":["boolean","null"]}},"required":["keys"],"title":"UpsertCompanyRequestBody"},"CompaniesPostResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"CompaniesPostResponsesContentApplicationJsonSchemaParams"},"companies_upsertCompany_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CompanyDetailResponseData"},"params":{"$ref":"#/components/schemas/CompaniesPostResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"companies_upsertCompany_Response_200"},"CompaniesLookupGetResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{"keys":{"type":"object","additionalProperties":{"type":"string"}}},"description":"Input parameters","title":"CompaniesLookupGetResponsesContentApplicationJsonSchemaParams"},"companies_lookupCompany_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CompanyDetailResponseData"},"params":{"$ref":"#/components/schemas/CompaniesLookupGetResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"companies_lookupCompany_Response_200"},"CompaniesCompanyIdDeleteResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{"cancel_subscription":{"type":"boolean"},"prorate":{"type":"boolean"}},"description":"Input parameters","title":"CompaniesCompanyIdDeleteResponsesContentApplicationJsonSchemaParams"},"companies_deleteCompany_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DeleteResponse"},"params":{"$ref":"#/components/schemas/CompaniesCompanyIdDeleteResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"companies_deleteCompany_Response_200"},"KeysRequestBody":{"type":"object","properties":{"keys":{"type":"object","additionalProperties":{"type":"string"}}},"required":["keys"],"title":"KeysRequestBody"},"CompanyResponseData":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time"},"environment_id":{"type":"string"},"id":{"type":"string"},"last_seen_at":{"type":["string","null"],"format":"date-time"},"logo_url":{"type":["string","null"]},"name":{"type":"string"},"updated_at":{"type":"string","format":"date-time"}},"required":["created_at","environment_id","id","name","updated_at"],"title":"CompanyResponseData"},"CompaniesDeletePostResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"CompaniesDeletePostResponsesContentApplicationJsonSchemaParams"},"companies_deleteCompanyByKeys_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CompanyResponseData"},"params":{"$ref":"#/components/schemas/CompaniesDeletePostResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"companies_deleteCompanyByKeys_Response_200"},"CompanyMembershipDetailResponseData":{"type":"object","properties":{"company":{"$ref":"#/components/schemas/CompanyResponseData"},"company_id":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"id":{"type":"string"},"updated_at":{"type":"string","format":"date-time"},"user_id":{"type":"string"}},"required":["company_id","created_at","id","updated_at","user_id"],"title":"CompanyMembershipDetailResponseData"},"CompanyMembershipsGetResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{"company_id":{"type":"string"},"limit":{"type":"integer","format":"int64","minimum":0,"maximum":250,"description":"Page limit (default 100)"},"offset":{"type":"integer","format":"int64","description":"Page offset (default 0)"},"user_id":{"type":"string"}},"description":"Input parameters","title":"CompanyMembershipsGetResponsesContentApplicationJsonSchemaParams"},"companies_listCompanyMemberships_Response_200":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CompanyMembershipDetailResponseData"}},"params":{"$ref":"#/components/schemas/CompanyMembershipsGetResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"companies_listCompanyMemberships_Response_200"},"GetOrCreateCompanyMembershipRequestBody":{"type":"object","properties":{"company_id":{"type":"string"},"user_id":{"type":"string"}},"required":["company_id","user_id"],"title":"GetOrCreateCompanyMembershipRequestBody"},"CompanyMembershipsPostResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"CompanyMembershipsPostResponsesContentApplicationJsonSchemaParams"},"companies_getOrCreateCompanyMembership_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CompanyMembershipDetailResponseData"},"params":{"$ref":"#/components/schemas/CompanyMembershipsPostResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"companies_getOrCreateCompanyMembership_Response_200"},"CompanyMembershipsCompanyMembershipIdDeleteResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"CompanyMembershipsCompanyMembershipIdDeleteResponsesContentApplicationJsonSchemaParams"},"companies_deleteCompanyMembership_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DeleteResponse"},"params":{"$ref":"#/components/schemas/CompanyMembershipsCompanyMembershipIdDeleteResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"companies_deleteCompanyMembership_Response_200"},"UpsertTraitRequestBody":{"type":"object","properties":{"incr":{"type":["integer","null"],"format":"int64","description":"Amount to increment the trait by (positive or negative)"},"keys":{"type":"object","additionalProperties":{"type":"string"},"description":"Key/value pairs to identify a company or user"},"set":{"type":["string","null"],"maxLength":1024,"description":"Value to set the trait to"},"trait":{"type":"string","maxLength":255,"description":"Name of the trait to update"},"update_only":{"type":["boolean","null"],"description":"Unless this is set, the company or user will be created if it does not already exist"}},"required":["keys","trait"],"title":"UpsertTraitRequestBody"},"CompanyTraitsPostResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"CompanyTraitsPostResponsesContentApplicationJsonSchemaParams"},"companies_upsertCompanyTrait_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CompanyDetailResponseData"},"params":{"$ref":"#/components/schemas/CompanyTraitsPostResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"companies_upsertCompanyTrait_Response_200"},"UserDetailResponseDataTraits":{"type":"object","properties":{},"description":"A map of trait names to trait values","title":"UserDetailResponseDataTraits"},"UserDetailResponseData":{"type":"object","properties":{"company_memberships":{"type":"array","items":{"$ref":"#/components/schemas/CompanyMembershipDetailResponseData"}},"created_at":{"type":"string","format":"date-time"},"entity_traits":{"type":"array","items":{"$ref":"#/components/schemas/EntityTraitDetailResponseData"}},"environment_id":{"type":"string"},"id":{"type":"string"},"keys":{"type":"array","items":{"$ref":"#/components/schemas/EntityKeyDetailResponseData"}},"last_seen_at":{"type":["string","null"],"format":"date-time"},"name":{"type":"string"},"traits":{"$ref":"#/components/schemas/UserDetailResponseDataTraits","description":"A map of trait names to trait values"},"updated_at":{"type":"string","format":"date-time"}},"required":["company_memberships","created_at","entity_traits","environment_id","id","keys","name","updated_at"],"title":"UserDetailResponseData"},"UsersGetResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{"company_id":{"type":"string","description":"Filter users by company ID (starts with comp_)"},"ids":{"type":"array","items":{"type":"string"},"description":"Filter users by multiple user IDs (starts with user_)"},"limit":{"type":"integer","format":"int64","minimum":0,"maximum":250,"description":"Page limit (default 100)"},"offset":{"type":"integer","format":"int64","description":"Page offset (default 0)"},"plan_id":{"type":"string","description":"Filter users by plan ID (starts with plan_)"},"q":{"type":"string","maxLength":512,"description":"Search for users by name, keys or string traits"}},"description":"Input parameters","title":"UsersGetResponsesContentApplicationJsonSchemaParams"},"companies_listUsers_Response_200":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/UserDetailResponseData"}},"params":{"$ref":"#/components/schemas/UsersGetResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"companies_listUsers_Response_200"},"UsersLookupGetResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{"keys":{"type":"object","additionalProperties":{"type":"string"}}},"description":"Input parameters","title":"UsersLookupGetResponsesContentApplicationJsonSchemaParams"},"companies_lookupUser_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/UserDetailResponseData"},"params":{"$ref":"#/components/schemas/UsersLookupGetResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"companies_lookupUser_Response_200"},"UpsertUserRequestBodyTraits":{"type":"object","properties":{},"description":"A map of trait names to trait values","title":"UpsertUserRequestBodyTraits"},"UpsertUserRequestBody":{"type":"object","properties":{"companies":{"type":["array","null"],"items":{"type":"object","additionalProperties":{"type":"string"}},"description":"Optionally specify companies using array of key/value pairs"},"company":{"type":["object","null"],"additionalProperties":{"type":"string"},"description":"Add user to this company. Takes priority over companies. For exhaustive list of companies, use companies"},"company_id":{"type":["string","null"],"description":"Add user to this company. Takes priority over company_ids. For exhaustive list of companies, use company_ids"},"company_ids":{"type":["array","null"],"items":{"type":"string"},"description":"Optionally specify companies using Schematic company ID"},"id":{"type":["string","null"],"description":"If you know the Schematic ID, you can use that here instead of keys"},"keys":{"type":"object","additionalProperties":{"type":"string"},"description":"See [Key Management](https://docs.schematichq.com/developer_resources/key_management) for more information"},"last_seen_at":{"type":["string","null"],"format":"date-time"},"name":{"type":["string","null"],"maxLength":255},"remove_keys":{"type":"array","items":{"type":"string"},"description":"Names of keys to remove from the user. Removing a key the user does not have does nothing, and a user must keep at least one key."},"traits":{"$ref":"#/components/schemas/UpsertUserRequestBodyTraits","description":"A map of trait names to trait values"},"update_only":{"type":["boolean","null"]}},"required":["keys"],"title":"UpsertUserRequestBody"},"UsersPostResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"UsersPostResponsesContentApplicationJsonSchemaParams"},"companies_upsertUser_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/UserDetailResponseData"},"params":{"$ref":"#/components/schemas/UsersPostResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"companies_upsertUser_Response_200"},"UsersUserIdDeleteResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"UsersUserIdDeleteResponsesContentApplicationJsonSchemaParams"},"companies_deleteUser_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DeleteResponse"},"params":{"$ref":"#/components/schemas/UsersUserIdDeleteResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"companies_deleteUser_Response_200"},"UserResponseData":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time"},"environment_id":{"type":"string"},"id":{"type":"string"},"last_seen_at":{"type":["string","null"],"format":"date-time"},"name":{"type":"string"},"updated_at":{"type":"string","format":"date-time"}},"required":["created_at","environment_id","id","name","updated_at"],"title":"UserResponseData"},"UsersDeletePostResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"UsersDeletePostResponsesContentApplicationJsonSchemaParams"},"companies_deleteUserByKeys_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/UserResponseData"},"params":{"$ref":"#/components/schemas/UsersDeletePostResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"companies_deleteUserByKeys_Response_200"},"UserTraitsPostResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"UserTraitsPostResponsesContentApplicationJsonSchemaParams"},"companies_upsertUserTrait_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/UserDetailResponseData"},"params":{"$ref":"#/components/schemas/UserTraitsPostResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"companies_upsertUserTrait_Response_200"},"EventType":{"type":"string","enum":["flag_check","identify","inference","track"],"title":"EventType"},"EventDetailResponseDataBody":{"type":"object","properties":{},"title":"EventDetailResponseDataBody"},"InferenceCostSource":{"type":"string","enum":["list_price","provided","unpriced"],"title":"InferenceCostSource"},"EventStatus":{"type":"string","enum":["enriched","failed","pending","processed","unknown"],"title":"EventStatus"},"EventDetailResponseData":{"type":"object","properties":{"api_key":{"type":["string","null"]},"api_key_view":{"$ref":"#/components/schemas/ApiKeyResponseData"},"body":{"$ref":"#/components/schemas/EventDetailResponseDataBody"},"body_preview":{"type":"string"},"captured_at":{"type":"string","format":"date-time"},"company":{"$ref":"#/components/schemas/PreviewObject"},"company_id":{"type":["string","null"]},"cost":{"type":["string","null"],"description":"What the inference call cost, as a decimal amount in currency (dollars, not cents, for usd). Absent when the call has no price, for other event types, and when listing events."},"cost_source":{"oneOf":[{"$ref":"#/components/schemas/InferenceCostSource"},{"type":"null"}],"description":"Where the inference call's cost came from: provided when the request reported it, list_price when Schematic priced it from the model's list price, unpriced when neither applied. Absent for other event types and when listing events."},"currency":{"type":["string","null"],"description":"Lowercase ISO currency code for cost. Absent for other event types and when listing events."},"enriched_at":{"type":["string","null"],"format":"date-time","deprecated":true},"environment_id":{"type":["string","null"]},"error_message":{"type":["string","null"]},"feature_ids":{"type":"array","items":{"type":"string"}},"features":{"type":"array","items":{"$ref":"#/components/schemas/PreviewObject"}},"id":{"type":"string"},"idempotency_key":{"type":["string","null"]},"lease_id":{"type":["string","null"]},"loaded_at":{"type":["string","null"],"format":"date-time"},"processed_at":{"type":["string","null"],"format":"date-time","deprecated":true},"quantity":{"type":"integer","format":"int64"},"reservation_id":{"type":["string","null"]},"sent_at":{"type":["string","null"],"format":"date-time"},"status":{"$ref":"#/components/schemas/EventStatus"},"subtype":{"type":["string","null"]},"type":{"$ref":"#/components/schemas/EventType"},"updated_at":{"type":["string","null"],"format":"date-time","deprecated":true},"user":{"$ref":"#/components/schemas/PreviewObject"},"user_id":{"type":["string","null"]}},"required":["body","body_preview","captured_at","feature_ids","features","id","quantity","status","type"],"title":"EventDetailResponseData"},"EventsGetResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{"company_id":{"type":"string"},"event_subtype":{"type":"string","maxLength":255},"event_types":{"type":"array","items":{"$ref":"#/components/schemas/EventType"}},"flag_id":{"type":"string"},"idempotency_key":{"type":"string","maxLength":255},"limit":{"type":"integer","format":"int64","minimum":0,"maximum":250,"description":"Page limit (default 100)"},"offset":{"type":"integer","format":"int64","description":"Page offset (default 0)"},"user_id":{"type":"string"}},"description":"Input parameters","title":"EventsGetResponsesContentApplicationJsonSchemaParams"},"events_listEvents_Response_200":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/EventDetailResponseData"}},"params":{"$ref":"#/components/schemas/EventsGetResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"events_listEvents_Response_200"},"EventBodyInference":{"type":"object","properties":{"cache_creation_input_tokens":{"type":"integer","format":"int64","description":"Number of input tokens written to a prompt cache; a subset of input_tokens"},"cached_input_tokens":{"type":"integer","format":"int64","description":"Number of input tokens served from cache; a subset of input_tokens"},"company":{"type":"object","additionalProperties":{"type":"string"},"description":"Key-value pairs to identify the company associated with the inference event"},"cost":{"type":"string","description":"Provided cost of the inference request as a decimal string; derived from model pricing when omitted"},"currency":{"type":"string","description":"ISO 4217 currency code for the provided cost; defaults to 'usd'"},"event":{"type":"string","description":"Optional track event name to fan out for usage-based billing"},"input_tokens":{"type":"integer","format":"int64","description":"Total number of input tokens for the inference request, including those served from and written to a prompt cache"},"lease_id":{"type":"string","description":"Credit lease ID this inference event's credit burn is redeeming against"},"operation":{"type":"string","description":"The inference operation; defaults to 'chat'"},"output_tokens":{"type":"integer","format":"int64","description":"Number of output tokens for the inference request"},"provider":{"type":"string","description":"The inference provider (e.g. 'anthropic', 'openai')"},"reasoning_tokens":{"type":"integer","format":"int64","description":"Number of reasoning tokens for the inference request"},"request_model":{"type":"string","description":"The model requested for the inference request"},"requests":{"type":"integer","format":"int64","description":"Number of requests represented by this event; defaults to 1"},"reservation_id":{"type":"string","description":"Credit reservation ID this inference event's credit burn settles. lease_id takes precedence when both are set"},"response_model":{"type":"string","description":"The model that served the inference response"},"user":{"type":"object","additionalProperties":{"type":"string"},"description":"Key-value pairs to identify the user associated with the inference event"}},"required":["company","input_tokens","output_tokens","provider","response_model"],"title":"EventBodyInference"},"EventBodyFlagCheck":{"type":"object","properties":{"company_id":{"type":["string","null"],"description":"Schematic company ID (starting with 'comp_') of the company evaluated, if any"},"error":{"type":["string","null"],"description":"Report an error that occurred during the flag check"},"flag_id":{"type":["string","null"],"description":"Schematic flag ID (starting with 'flag_') for the flag matching the key, if any"},"flag_key":{"type":"string","description":"The key of the flag being checked"},"preflight":{"type":"boolean","description":"Whether the check was a preflight, asking whether an action would be allowed rather than reporting one that happened. Absent on ordinary checks"},"reason":{"type":"string","description":"The reason why the value was returned"},"req_company":{"type":["object","null"],"additionalProperties":{"type":"string"},"description":"Key-value pairs used to to identify company for which the flag was checked"},"req_user":{"type":["object","null"],"additionalProperties":{"type":"string"},"description":"Key-value pairs used to to identify user for which the flag was checked"},"rule_id":{"type":["string","null"],"description":"Schematic rule ID (starting with 'rule_') of the rule that matched for the flag, if any"},"user_id":{"type":["string","null"],"description":"Schematic user ID (starting with 'user_') of the user evaluated, if any"},"value":{"type":"boolean","description":"The value of the flag for the given company and/or user"}},"required":["flag_key","reason","value"],"title":"EventBodyFlagCheck"},"EventBodyTrackTraits":{"type":"object","properties":{},"description":"A map of trait names to trait values","title":"EventBodyTrackTraits"},"EventBodyTrack":{"type":"object","properties":{"company":{"type":"object","additionalProperties":{"type":"string"},"description":"Key-value pairs to identify company associated with track event"},"event":{"type":"string","description":"The name of the type of track event"},"lease_id":{"type":"string","description":"Credit lease ID this track event is redeeming against"},"quantity":{"type":"integer","format":"int64","description":"Optionally specify the quantity of the event"},"reservation_id":{"type":"string","description":"Credit reservation ID this track event settles. lease_id takes precedence when both are set"},"traits":{"$ref":"#/components/schemas/EventBodyTrackTraits","description":"A map of trait names to trait values"},"user":{"type":"object","additionalProperties":{"type":"string"},"description":"Key-value pairs to identify user associated with track event"}},"required":["event"],"title":"EventBodyTrack"},"EventBodyIdentifyCompanyTraits":{"type":"object","properties":{},"description":"A map of trait names to trait values","title":"EventBodyIdentifyCompanyTraits"},"EventBodyIdentifyCompany":{"type":"object","properties":{"keys":{"type":"object","additionalProperties":{"type":"string"},"description":"Key-value pairs to identify the company"},"name":{"type":"string","description":"The display name of the company; required only if it is a new company"},"traits":{"$ref":"#/components/schemas/EventBodyIdentifyCompanyTraits","description":"A map of trait names to trait values"}},"required":["keys"],"description":"Information about the company associated with the user; required only if it is a new user","title":"EventBodyIdentifyCompany"},"EventBodyIdentifyTraits":{"type":"object","properties":{},"description":"A map of trait names to trait values","title":"EventBodyIdentifyTraits"},"EventBodyIdentify":{"type":"object","properties":{"company":{"$ref":"#/components/schemas/EventBodyIdentifyCompany","description":"Information about the company associated with the user; required only if it is a new user"},"keys":{"type":"object","additionalProperties":{"type":"string"},"description":"Key-value pairs to identify the user"},"name":{"type":"string","description":"The display name of the user being identified; required only if it is a new user"},"traits":{"$ref":"#/components/schemas/EventBodyIdentifyTraits","description":"A map of trait names to trait values"}},"required":["keys"],"title":"EventBodyIdentify"},"EventBody":{"oneOf":[{"$ref":"#/components/schemas/EventBodyInference"},{"$ref":"#/components/schemas/EventBodyFlagCheck"},{"$ref":"#/components/schemas/EventBodyTrack"},{"$ref":"#/components/schemas/EventBodyIdentify"}],"title":"EventBody"},"CreateEventRequestBody":{"type":"object","properties":{"backfill":{"type":["boolean","null"],"description":"Requires a secret API key, and trusted_client_clock. Import historical data without affecting billing."},"body":{"$ref":"#/components/schemas/EventBody"},"event_type":{"$ref":"#/components/schemas/EventType","description":"Either 'identify' or 'track'"},"idempotency_key":{"type":["string","null"],"maxLength":255,"description":"Optional client-supplied key. Duplicate events with the same key (scoped to the environment) are dropped for 24h."},"sent_at":{"type":["string","null"],"format":"date-time","description":"Optionally provide a timestamp at which the event was sent to Schematic"},"trusted_client_clock":{"type":["boolean","null"],"description":"Requires a secret API key and sent_at. Use sent_at as the effective timestamp."}},"required":["event_type"],"title":"CreateEventRequestBody"},"RawEventResponseData":{"type":"object","properties":{"captured_at":{"type":"string","format":"date-time"},"event_id":{"type":["string","null"]},"remote_addr":{"type":["string","null"]},"remote_ip":{"type":"string"},"user_agent":{"type":"string"}},"required":["captured_at","remote_ip","user_agent"],"title":"RawEventResponseData"},"EventsPostResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"EventsPostResponsesContentApplicationJsonSchemaParams"},"events_createEvent_Response_201":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RawEventResponseData"},"params":{"$ref":"#/components/schemas/EventsPostResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"events_createEvent_Response_201"},"CreateEventBatchRequestBody":{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/CreateEventRequestBody"}}},"required":["events"],"title":"CreateEventBatchRequestBody"},"RawEventBatchResponseData":{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/RawEventResponseData"}}},"required":["events"],"title":"RawEventBatchResponseData"},"EventBatchPostResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"EventBatchPostResponsesContentApplicationJsonSchemaParams"},"events_createEventBatch_Response_201":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RawEventBatchResponseData"},"params":{"$ref":"#/components/schemas/EventBatchPostResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"events_createEventBatch_Response_201"},"EventsEventIdGetResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"EventsEventIdGetResponsesContentApplicationJsonSchemaParams"},"events_getEvent_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EventDetailResponseData"},"params":{"$ref":"#/components/schemas/EventsEventIdGetResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"events_getEvent_Response_200"},"AccountMemberPermission":{"type":"string","enum":["companies_edit","company_users_edit","components_edit","custom_plans_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"],"title":"AccountMemberPermission"},"AccountMemberRole":{"type":"string","enum":["admin","member"],"title":"AccountMemberRole"},"AccountMemberResponseData":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time"},"email":{"type":["string","null"]},"first_name":{"type":["string","null"]},"id":{"type":"string"},"image_url":{"type":["string","null"]},"last_name":{"type":["string","null"]},"name":{"type":["string","null"]},"permissions":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/AccountMemberPermission"}}},"role":{"oneOf":[{"$ref":"#/components/schemas/AccountMemberRole"},{"type":"null"}]},"updated_at":{"type":"string","format":"date-time"}},"required":["created_at","id","permissions","updated_at"],"title":"AccountMemberResponseData"},"FlagDetailResponseData":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time"},"default_value":{"type":["boolean","null"],"description":"Deprecated. The value a check returns in the requesting environment when no other rule matches: its default rule, or the flag's seed value while it has none. Read the default rule instead","deprecated":true},"description":{"type":"string"},"feature":{"$ref":"#/components/schemas/FeatureResponseData"},"feature_id":{"type":["string","null"]},"flag_type":{"$ref":"#/components/schemas/FlagType"},"id":{"type":"string"},"key":{"type":"string"},"last_checked_at":{"type":["string","null"],"format":"date-time"},"maintainer":{"$ref":"#/components/schemas/AccountMemberResponseData"},"maintainer_account_member_id":{"type":["string","null"]},"name":{"type":"string"},"rules":{"type":"array","items":{"$ref":"#/components/schemas/RuleDetailResponseData"}},"updated_at":{"type":"string","format":"date-time"}},"required":["created_at","description","flag_type","id","key","name","rules","updated_at"],"title":"FlagDetailResponseData"},"FeatureDetailResponseData":{"type":"object","properties":{"billing_linked_resource":{"$ref":"#/components/schemas/BillingLinkedResourceResponseData"},"billing_product":{"oneOf":[{"$ref":"#/components/schemas/BillingProductResponseData"},{"type":"null"}],"description":"The billing provider product that sells this feature in the current environment. Set for license features once they have been priced in a plan; a feature priced in several environments has a different product in each."},"created_at":{"type":"string","format":"date-time"},"description":{"type":"string"},"event_source":{"$ref":"#/components/schemas/FeatureEventSource","description":"Which event stream meters this feature. Track features are metered by track events; inference features are metered by inference events whose event label matches event_subtype, and meter through credits only."},"event_subtype":{"type":["string","null"]},"event_summary":{"$ref":"#/components/schemas/EventSummaryResponseData"},"feature_type":{"$ref":"#/components/schemas/FeatureType"},"flags":{"type":"array","items":{"$ref":"#/components/schemas/FlagDetailResponseData"}},"icon":{"type":"string"},"id":{"type":"string"},"license_id":{"type":["string","null"],"description":"The license sold through this feature. Set only on features of type license, and created automatically with them."},"lifecycle_phase":{"oneOf":[{"$ref":"#/components/schemas/FeatureLifecyclePhase"},{"type":"null"}]},"maintainer":{"$ref":"#/components/schemas/AccountMemberResponseData"},"maintainer_account_member_id":{"type":["string","null"]},"name":{"type":"string"},"plans":{"type":"array","items":{"$ref":"#/components/schemas/PreviewObject"}},"plural_name":{"type":["string","null"]},"singular_name":{"type":["string","null"]},"trait":{"$ref":"#/components/schemas/EntityTraitDefinitionResponseData"},"trait_id":{"type":["string","null"]},"updated_at":{"type":"string","format":"date-time"},"usage_limit_trait_id":{"type":["string","null"],"description":"Set when the feature carries a pay-in-advance quantity. Provisioned lazily for other feature types, and at creation for license features."}},"required":["created_at","description","event_source","feature_type","flags","icon","id","name","plans","updated_at"],"title":"FeatureDetailResponseData"},"FeaturesGetResponsesContentApplicationJsonSchemaParams":{"type":"object","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","items":{"$ref":"#/components/schemas/FeatureType"},"description":"Filter by one or more feature types (boolean, event, trait)"},"ids":{"type":"array","items":{"type":"string"}},"limit":{"type":"integer","format":"int64","minimum":0,"maximum":250,"description":"Page limit (default 100)"},"managed_by":{"$ref":"#/components/schemas/BillingProviderType","description":"Filter for features managed by a billing provider, or by Schematic (no billing provider)"},"offset":{"type":"integer","format":"int64","description":"Page offset (default 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","maxLength":512,"description":"Search by feature name or ID"},"without_company_override_for":{"type":"string","description":"Filter out features that have an unexpired 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"}},"description":"Input parameters","title":"FeaturesGetResponsesContentApplicationJsonSchemaParams"},"features_listFeatures_Response_200":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/FeatureDetailResponseData"}},"params":{"$ref":"#/components/schemas/FeaturesGetResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"features_listFeatures_Response_200"},"FeaturesFeatureIdGetResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"FeaturesFeatureIdGetResponsesContentApplicationJsonSchemaParams"},"features_getFeature_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FeatureDetailResponseData"},"params":{"$ref":"#/components/schemas/FeaturesFeatureIdGetResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"features_getFeature_Response_200"},"CreateOrUpdateFlagRequestBody":{"type":"object","properties":{"default_value":{"type":["boolean","null"],"description":"Deprecated. On create, the value a check returns in every environment until that environment has a default rule. Ignored on update: flags are account-wide and rules are per environment, so set an environment's default through its default rule via the flag rules endpoint","deprecated":true},"description":{"type":"string","maxLength":1024},"feature_id":{"type":["string","null"]},"flag_type":{"$ref":"#/components/schemas/FlagType"},"id":{"type":["string","null"]},"key":{"type":"string","maxLength":512},"maintainer_account_member_id":{"type":["string","null"]},"name":{"type":"string","maxLength":512}},"required":["description","flag_type","key","name"],"title":"CreateOrUpdateFlagRequestBody"},"CreateFeatureRequestBody":{"type":"object","properties":{"description":{"type":"string","maxLength":1024},"event_source":{"oneOf":[{"$ref":"#/components/schemas/FeatureEventSource"},{"type":"null"}],"description":"Which event stream meters this feature; defaults to track, and cannot change after creation. Inference is only valid on event features: their event_subtype matches the event label on inference events, and they meter through credits only."},"event_subtype":{"type":["string","null"]},"feature_type":{"$ref":"#/components/schemas/FeatureType"},"flag":{"$ref":"#/components/schemas/CreateOrUpdateFlagRequestBody"},"icon":{"type":["string","null"]},"lifecycle_phase":{"oneOf":[{"$ref":"#/components/schemas/FeatureLifecyclePhase"},{"type":"null"}]},"maintainer_account_member_id":{"type":["string","null"]},"name":{"type":"string","maxLength":512},"plural_name":{"type":["string","null"]},"singular_name":{"type":["string","null"]},"trait_id":{"type":["string","null"]}},"required":["description","feature_type","name"],"title":"CreateFeatureRequestBody"},"FeaturesPostResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"FeaturesPostResponsesContentApplicationJsonSchemaParams"},"features_createFeature_Response_201":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FeatureDetailResponseData"},"params":{"$ref":"#/components/schemas/FeaturesPostResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"features_createFeature_Response_201"},"UpdateFeatureRequestBody":{"type":"object","properties":{"description":{"type":["string","null"],"maxLength":1024},"event_source":{"oneOf":[{"$ref":"#/components/schemas/FeatureEventSource"},{"type":"null"}],"description":"Which event stream meters this feature. It is fixed at creation: an update that changes it is rejected."},"event_subtype":{"type":["string","null"]},"feature_type":{"oneOf":[{"$ref":"#/components/schemas/FeatureType"},{"type":"null"}]},"flag":{"$ref":"#/components/schemas/CreateOrUpdateFlagRequestBody"},"icon":{"type":["string","null"]},"lifecycle_phase":{"oneOf":[{"$ref":"#/components/schemas/FeatureLifecyclePhase"},{"type":"null"}]},"maintainer_account_member_id":{"type":["string","null"]},"name":{"type":["string","null"],"maxLength":512},"plural_name":{"type":["string","null"]},"singular_name":{"type":["string","null"]},"trait_id":{"type":["string","null"]}},"title":"UpdateFeatureRequestBody"},"FeaturesFeatureIdPutResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"FeaturesFeatureIdPutResponsesContentApplicationJsonSchemaParams"},"features_updateFeature_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FeatureDetailResponseData"},"params":{"$ref":"#/components/schemas/FeaturesFeatureIdPutResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"features_updateFeature_Response_200"},"FeaturesFeatureIdDeleteResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"FeaturesFeatureIdDeleteResponsesContentApplicationJsonSchemaParams"},"features_deleteFeature_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DeleteResponse"},"params":{"$ref":"#/components/schemas/FeaturesFeatureIdDeleteResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"features_deleteFeature_Response_200"},"FlagsGetResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{"feature_id":{"type":"string"},"ids":{"type":"array","items":{"type":"string"}},"limit":{"type":"integer","format":"int64","minimum":0,"maximum":250,"description":"Page limit (default 100)"},"offset":{"type":"integer","format":"int64","description":"Page offset (default 0)"},"q":{"type":"string","maxLength":512,"description":"Search by flag name, key, or ID"}},"description":"Input parameters","title":"FlagsGetResponsesContentApplicationJsonSchemaParams"},"features_listFlags_Response_200":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/FlagDetailResponseData"}},"params":{"$ref":"#/components/schemas/FlagsGetResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"features_listFlags_Response_200"},"FlagsFlagIdGetResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"FlagsFlagIdGetResponsesContentApplicationJsonSchemaParams"},"features_getFlag_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FlagDetailResponseData"},"params":{"$ref":"#/components/schemas/FlagsFlagIdGetResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"features_getFlag_Response_200"},"CreateFlagRequestBody":{"type":"object","properties":{"default_value":{"type":["boolean","null"],"description":"Deprecated. On create, the value a check returns in every environment until that environment has a default rule. Ignored on update: flags are account-wide and rules are per environment, so set an environment's default through its default rule via the flag rules endpoint","deprecated":true},"description":{"type":"string","maxLength":1024},"feature_id":{"type":["string","null"]},"flag_type":{"$ref":"#/components/schemas/FlagType"},"key":{"type":"string","maxLength":512},"maintainer_account_member_id":{"type":["string","null"]},"name":{"type":"string","maxLength":512}},"required":["description","flag_type","key","name"],"title":"CreateFlagRequestBody"},"FlagsPostResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"FlagsPostResponsesContentApplicationJsonSchemaParams"},"features_createFlag_Response_201":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FlagDetailResponseData"},"params":{"$ref":"#/components/schemas/FlagsPostResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"features_createFlag_Response_201"},"FlagsFlagIdPutResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"FlagsFlagIdPutResponsesContentApplicationJsonSchemaParams"},"features_updateFlag_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FlagDetailResponseData"},"params":{"$ref":"#/components/schemas/FlagsFlagIdPutResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"features_updateFlag_Response_200"},"FlagsFlagIdDeleteResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"FlagsFlagIdDeleteResponsesContentApplicationJsonSchemaParams"},"features_deleteFlag_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DeleteResponse"},"params":{"$ref":"#/components/schemas/FlagsFlagIdDeleteResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"features_deleteFlag_Response_200"},"CreateOrUpdateConditionRequestBody":{"type":"object","properties":{"comparison_trait_id":{"type":["string","null"],"description":"Optionally provide a trait ID to compare a metric or trait value against instead of a value"},"condition_type":{"$ref":"#/components/schemas/ConditionType"},"credit_cost":{"type":["number","null"],"format":"double","description":"Cost of credit to use to measure this condition"},"credit_id":{"type":["string","null"],"description":"ID of credit to use to measure this condition"},"event_subtype":{"type":["string","null"],"description":"Name of track event type used to measure this condition"},"id":{"type":["string","null"]},"metric_period":{"oneOf":[{"$ref":"#/components/schemas/MetricPeriod"},{"type":"null"}],"description":"Period of time over which to measure the track event metric"},"metric_period_month_reset":{"oneOf":[{"$ref":"#/components/schemas/MetricPeriodMonthReset"},{"type":"null"}],"description":"When metric_period=current_month, specify whether the month restarts based on the calendar month or the billing period"},"metric_value":{"type":["integer","null"],"format":"int64","description":"Value to compare the track event metric against"},"operator":{"$ref":"#/components/schemas/ComparableOperator"},"resource_ids":{"type":"array","items":{"type":"string"},"description":"List of resource IDs (companies, users, or plans) targeted by this condition"},"trait_id":{"type":["string","null"],"description":"ID of trait to use to measure this condition"},"trait_value":{"type":["string","null"],"description":"Value to compare the trait value against"}},"required":["condition_type","operator","resource_ids"],"title":"CreateOrUpdateConditionRequestBody"},"CreateOrUpdateConditionGroupRequestBody":{"type":"object","properties":{"conditions":{"type":"array","items":{"$ref":"#/components/schemas/CreateOrUpdateConditionRequestBody"}},"flag_id":{"type":["string","null"]},"id":{"type":["string","null"]}},"required":["conditions"],"title":"CreateOrUpdateConditionGroupRequestBody"},"CreateOrUpdateRuleRequestBody":{"type":"object","properties":{"condition_groups":{"type":"array","items":{"$ref":"#/components/schemas/CreateOrUpdateConditionGroupRequestBody"}},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/CreateOrUpdateConditionRequestBody"}},"id":{"type":["string","null"]},"name":{"type":"string","maxLength":512},"priority":{"type":"integer","format":"int64"},"rule_type":{"oneOf":[{"$ref":"#/components/schemas/RuleType"},{"type":"null"}]},"value":{"type":"boolean"}},"required":["condition_groups","conditions","name","priority","value"],"title":"CreateOrUpdateRuleRequestBody"},"UpdateFlagRulesRequestBody":{"type":"object","properties":{"rules":{"type":"array","items":{"$ref":"#/components/schemas/CreateOrUpdateRuleRequestBody"}}},"required":["rules"],"title":"UpdateFlagRulesRequestBody"},"FlagResponseData":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time"},"default_value":{"type":["boolean","null"],"description":"Deprecated. The value a check returns in the requesting environment when no other rule matches: its default rule, or the flag's seed value while it has none. Read the default rule instead","deprecated":true},"description":{"type":"string"},"feature_id":{"type":["string","null"]},"flag_type":{"$ref":"#/components/schemas/FlagType"},"id":{"type":"string"},"key":{"type":"string"},"maintainer_account_member_id":{"type":["string","null"]},"name":{"type":"string"},"updated_at":{"type":"string","format":"date-time"}},"required":["created_at","description","flag_type","id","key","name","updated_at"],"title":"FlagResponseData"},"RulesDetailResponseData":{"type":"object","properties":{"flag":{"$ref":"#/components/schemas/FlagResponseData"},"rules":{"type":"array","items":{"$ref":"#/components/schemas/RuleDetailResponseData"}}},"required":["rules"],"title":"RulesDetailResponseData"},"FlagsFlagIdRulesPutResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"FlagsFlagIdRulesPutResponsesContentApplicationJsonSchemaParams"},"features_updateFlagRules_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RulesDetailResponseData"},"params":{"$ref":"#/components/schemas/FlagsFlagIdRulesPutResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"features_updateFlagRules_Response_200"},"PreflightEventQuantitiesRequestBody":{"type":"object","properties":{"event_subtype":{"type":"string","maxLength":128,"description":"The event subtype the event would be recorded under"},"quantities":{"type":"object","additionalProperties":{"type":"number","format":"double","minimum":0},"description":"Named quantities the event would carry, keyed by quantity key, each priced at its rate in the entitlement's quantity rates. For an inference call these are the token counts as the provider reports them: input_tokens includes the cached_input_tokens and cache_creation_input_tokens subsets. Keys the entitlement does not rate cost nothing"},"quantity":{"type":["number","null"],"format":"double","minimum":0,"description":"Base units of the event, priced at the entitlement's consumption rate; the request count for an inference call. Absent or zero means one"}},"required":["event_subtype"],"title":"PreflightEventQuantitiesRequestBody"},"PreflightEventUsageRequestBody":{"type":"object","properties":{"event_subtype":{"type":"string","maxLength":128,"description":"The event subtype the usage would be recorded under"},"quantity":{"type":"integer","format":"int64","minimum":0,"description":"How many units of the event subtype the action would record. Zero has no effect"}},"required":["event_subtype","quantity"],"title":"PreflightEventUsageRequestBody"},"PreflightRequestBody":{"type":"object","properties":{"credit_cost":{"type":"object","additionalProperties":{"type":"number","format":"double","minimum":0},"description":"Cost in credits of the action, keyed by credit ID, for callers that have already computed it. Takes precedence over event_quantities, event_usage and usage on credit balance conditions for the same credit. A cost of zero means the action is free, not that the input is absent"},"event_quantities":{"oneOf":[{"$ref":"#/components/schemas/PreflightEventQuantitiesRequestBody"},{"type":"null"}],"description":"An event of a specific subtype, priced the way it would burn credits: quantity at the entitlement's consumption rate, plus each of quantities at its rate in the entitlement's quantity rates. Use it to preflight an inference call by its request and token counts. Applies only to credit balance conditions whose event subtype matches, where it takes precedence over event_usage and usage; credit_cost for the same credit still wins"},"event_usage":{"oneOf":[{"$ref":"#/components/schemas/PreflightEventUsageRequestBody"},{"type":"null"}],"description":"Usage of a specific event subtype. Preferred over usage when the subtype is known, since it only affects conditions measuring that subtype"},"usage":{"type":["integer","null"],"format":"int64","minimum":0,"description":"Quantity of usage to simulate against any numeric condition encountered while evaluating the flag. Zero has no effect"}},"title":"PreflightRequestBody"},"CheckFlagRequestBody":{"type":"object","properties":{"company":{"type":["object","null"],"additionalProperties":{"type":"string","maxLength":255}},"preflight":{"oneOf":[{"$ref":"#/components/schemas/PreflightRequestBody"},{"type":"null"}],"description":"Hypothetical usage to evaluate the flag against, for answering \"would this action be allowed?\" before performing it. Only supported when checking a single flag. Values are caller-asserted and can widen a verdict as well as narrow it, so do not forward untrusted input here when the result gates access. Only the flag value reflects the preflight; the entitlement and usage figures in the response are the company's current, unsimulated ones"},"user":{"type":["object","null"],"additionalProperties":{"type":"string","maxLength":255}}},"title":"CheckFlagRequestBody"},"CheckFlagResponseData":{"type":"object","properties":{"company_id":{"type":["string","null"],"description":"If company keys were provided and matched a company, its ID"},"entitlement":{"oneOf":[{"$ref":"#/components/schemas/FeatureEntitlement"},{"type":"null"}],"description":"If a feature entitlement rule was matched, its entitlement details"},"error":{"type":["string","null"],"description":"If an error occurred while checking the flag, the error message"},"feature_allocation":{"type":["integer","null"],"format":"int64","description":"Deprecated: Use Entitlement.Allocation instead.","deprecated":true},"feature_usage":{"type":["integer","null"],"format":"int64","description":"Deprecated: Use Entitlement.Usage instead.","deprecated":true},"feature_usage_event":{"type":["string","null"],"description":"Deprecated: Use Entitlement.EventName instead.","deprecated":true},"feature_usage_period":{"oneOf":[{"$ref":"#/components/schemas/MetricPeriod"},{"type":"null"}],"description":"Deprecated: Use Entitlement.MetricPeriod instead."},"feature_usage_reset_at":{"type":["string","null"],"format":"date-time","description":"Deprecated: Use Entitlement.MetricResetAt instead.","deprecated":true},"flag":{"type":"string","description":"The key used to check the flag"},"flag_id":{"type":["string","null"],"description":"If a flag was found, its ID"},"reason":{"type":"string","description":"A human-readable explanation of the result"},"rule_id":{"type":["string","null"],"description":"If a rule was found, its ID"},"rule_type":{"oneOf":[{"$ref":"#/components/schemas/RuleType"},{"type":"null"}],"description":"If a rule was found, its type"},"user_id":{"type":["string","null"],"description":"If user keys were provided and matched a user, its ID"},"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"},"FlagsKeyCheckPostResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"FlagsKeyCheckPostResponsesContentApplicationJsonSchemaParams"},"features_checkFlag_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CheckFlagResponseData"},"params":{"$ref":"#/components/schemas/FlagsKeyCheckPostResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"features_checkFlag_Response_200"},"CompanyCreditBalance":{"type":"object","properties":{"overdraft_limit":{"type":["number","null"],"format":"double","description":"For a postpaid credit, how far below zero the balance may run. Absent when the credit is not postpaid or postpaid has no limit"},"postpaid":{"type":"boolean","description":"Whether consumption may continue past a zero balance. When true and overdraft_limit is absent, the balance has no floor"},"remaining":{"type":"number","format":"double","description":"Remaining credit, excluding any open lease hold (the value SDKs gate on)"},"reserved":{"type":"number","format":"double","description":"Amount held by the company's open credit lease, 0 when none is open"},"settled":{"type":"number","format":"double","description":"Spendable balance including the open lease hold (remaining + reserved)"}},"required":["postpaid","remaining","reserved","settled"],"title":"CompanyCreditBalance"},"CreditSpendPolicyScope":{"type":"string","enum":["company","user","group"],"title":"CreditSpendPolicyScope"},"CreditSpendWindow":{"type":"object","properties":{"count":{"type":"integer","format":"int64","description":"How many units make up one period"},"unit":{"type":"string","description":"The period the limit accumulates over"}},"required":["count","unit"],"title":"CreditSpendWindow"},"CreditSpendPolicy":{"type":"object","properties":{"company_id":{"type":["string","null"],"description":"For a user policy, the company it applies in"},"consumed":{"type":"number","format":"double","description":"How much of the limit is already spent in the current period"},"credit_id":{"type":"string","description":"The credit the policy limits"},"id":{"type":"string","description":"The ID of the policy"},"kind":{"type":"string","description":"How the limit is applied"},"label":{"type":["string","null"],"description":"The name the account gave the policy"},"limit":{"type":"number","format":"double","description":"The ceiling, in credits"},"resets_at":{"type":["string","null"],"format":"date-time","description":"For a windowed limit, when the current period ends and consumed no longer applies"},"scope":{"$ref":"#/components/schemas/CreditSpendPolicyScope","description":"Whether the policy limits the company or one user"},"window":{"oneOf":[{"$ref":"#/components/schemas/CreditSpendWindow"},{"type":"null"}],"description":"For a windowed limit, the period it accumulates over"}},"required":["credit_id","id","kind","limit","scope"],"title":"CreditSpendPolicy"},"TrialStatus":{"type":"string","enum":["active","converted","expired"],"title":"TrialStatus"},"DatastreamCompanyPlan":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"trial_end_date":{"type":["string","null"],"format":"date-time"},"trial_status":{"oneOf":[{"$ref":"#/components/schemas/TrialStatus"},{"type":"null"}]}},"required":["id","name"],"title":"DatastreamCompanyPlan"},"CheckFlagsResponseData":{"type":"object","properties":{"credit_balances":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/CompanyCreditBalance"},"description":"Lease-aware credit balances keyed by credit ID, covering every credit type the company holds a balance in"},"credit_spend_policies":{"type":"array","items":{"$ref":"#/components/schemas/CreditSpendPolicy"},"description":"Credit spend policies binding the evaluated company and user; empty when none bind. Each response carries the whole set, so replace any previously received set with it. Advisory: the flag values do not reflect them, since a check names no draw amount"},"flags":{"type":"array","items":{"$ref":"#/components/schemas/CheckFlagResponseData"}},"plan":{"$ref":"#/components/schemas/DatastreamCompanyPlan"}},"required":["credit_spend_policies","flags"],"title":"CheckFlagsResponseData"},"FlagsCheckPostResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"FlagsCheckPostResponsesContentApplicationJsonSchemaParams"},"features_checkFlags_Response_201":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CheckFlagsResponseData"},"params":{"$ref":"#/components/schemas/FlagsCheckPostResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"features_checkFlags_Response_201"},"CompanyOverrideNoteResponseData":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time"},"external_user_id":{"type":"string"},"external_user_name":{"type":"string"},"id":{"type":"string"},"note":{"type":"string"},"updated_at":{"type":"string","format":"date-time"}},"required":["created_at","external_user_id","external_user_name","id","note","updated_at"],"title":"CompanyOverrideNoteResponseData"},"CompanyOverrideResponseData":{"type":"object","properties":{"company":{"$ref":"#/components/schemas/CompanyDetailResponseData"},"company_id":{"type":"string"},"consumption_rate":{"type":["number","null"],"format":"double"},"created_at":{"type":"string","format":"date-time"},"environment_id":{"type":"string"},"expiration_date":{"type":["string","null"],"format":"date-time"},"feature":{"$ref":"#/components/schemas/FeatureResponseData"},"feature_id":{"type":"string"},"id":{"type":"string"},"metric_period":{"oneOf":[{"$ref":"#/components/schemas/MetricPeriod"},{"type":"null"}]},"metric_period_month_reset":{"oneOf":[{"$ref":"#/components/schemas/MetricPeriodMonthReset"},{"type":"null"}]},"model_rates":{"type":"array","items":{"$ref":"#/components/schemas/CreditModelRate"},"description":"Per-model rate overrides for inference features, keyed by provider and model. Each entry replaces consumption_rate and quantity_rates for events from that model. Absent when every model burns at the entitlement's own rates."},"notes":{"type":"array","items":{"$ref":"#/components/schemas/CompanyOverrideNoteResponseData"}},"quantity_rates":{"type":"object","additionalProperties":{"type":"number","format":"double"},"description":"Credits per unit of the quantity (per token for inference features), keyed by quantity key. Absent when the entitlement prices requests only."},"rule_id":{"type":["string","null"]},"rule_id_usage_exceeded":{"type":["string","null"]},"updated_at":{"type":"string","format":"date-time"},"value_bool":{"type":["boolean","null"]},"value_credit":{"$ref":"#/components/schemas/BillingCreditResponseData"},"value_credit_id":{"type":["string","null"]},"value_numeric":{"type":["integer","null"],"format":"int64"},"value_trait":{"$ref":"#/components/schemas/EntityTraitDefinitionResponseData"},"value_trait_id":{"type":["string","null"]},"value_type":{"$ref":"#/components/schemas/EntitlementValueType"}},"required":["company_id","created_at","environment_id","feature_id","id","notes","updated_at","value_type"],"title":"CompanyOverrideResponseData"},"CompanyOverridesGetResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{"company_id":{"type":"string","description":"Filter company overrides by a single company ID (starting with comp_)"},"company_ids":{"type":"array","items":{"type":"string"},"description":"Filter company overrides by multiple company IDs (starting with comp_)"},"feature_id":{"type":"string","description":"Filter company overrides by a single feature ID (starting with feat_)"},"feature_ids":{"type":"array","items":{"type":"string"},"description":"Filter company overrides by multiple feature IDs (starting with feat_)"},"ids":{"type":"array","items":{"type":"string"},"description":"Filter company overrides by multiple company override IDs (starting with cmov_)"},"limit":{"type":"integer","format":"int64","minimum":0,"maximum":250,"description":"Page limit (default 100)"},"offset":{"type":"integer","format":"int64","description":"Page offset (default 0)"},"q":{"type":"string","description":"Search for company overrides by feature or company name"},"without_expired":{"type":"boolean","description":"Filter company overrides by whether they have not expired"}},"description":"Input parameters","title":"CompanyOverridesGetResponsesContentApplicationJsonSchemaParams"},"entitlements_listCompanyOverrides_Response_200":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CompanyOverrideResponseData"}},"params":{"$ref":"#/components/schemas/CompanyOverridesGetResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"entitlements_listCompanyOverrides_Response_200"},"CompanyOverridesCompanyOverrideIdGetResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"CompanyOverridesCompanyOverrideIdGetResponsesContentApplicationJsonSchemaParams"},"entitlements_getCompanyOverride_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CompanyOverrideResponseData"},"params":{"$ref":"#/components/schemas/CompanyOverridesCompanyOverrideIdGetResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"entitlements_getCompanyOverride_Response_200"},"CreateCompanyOverrideRequestBody":{"type":"object","properties":{"company_id":{"type":"string"},"credit_consumption_rate":{"type":["number","null"],"format":"double"},"expiration_date":{"type":["string","null"],"format":"date-time"},"feature_id":{"type":"string"},"metric_period":{"oneOf":[{"$ref":"#/components/schemas/MetricPeriod"},{"type":"null"}]},"metric_period_month_reset":{"oneOf":[{"$ref":"#/components/schemas/MetricPeriodMonthReset"},{"type":"null"}]},"model_rates":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CreditModelRate"},"description":"Per-model rate overrides for inference features, keyed by provider and model. Each entry is a complete rate card: its consumption_rate and quantity_rates replace the entitlement's credit_consumption_rate and quantity_rates for events from that provider and model. An event matches an entry by exact model name first, then by its model name without a trailing snapshot date (claude-sonnet-4-5-20250929 matches claude-sonnet-4-5). Models with no entry burn at the entitlement's own rates. Omit to leave the overrides as they are; send null to clear them."},"note":{"type":["string","null"]},"quantity_rates":{"type":["object","null"],"additionalProperties":{"type":"number","format":"double"},"description":"Credits per unit of the quantity (per token for inference features), keyed by quantity key. Inference features may price input_tokens, output_tokens, cached_input_tokens, cache_creation_input_tokens and reasoning_tokens; reasoning_tokens is priced on top of output_tokens, so leave its rate at zero for providers that count reasoning inside output. Omit to leave the schedule as it is; send null to clear it."},"value_bool":{"type":["boolean","null"]},"value_credit_id":{"type":["string","null"]},"value_numeric":{"type":["integer","null"],"format":"int64"},"value_trait_id":{"type":["string","null"]},"value_type":{"$ref":"#/components/schemas/EntitlementValueType"}},"required":["company_id","feature_id","value_type"],"title":"CreateCompanyOverrideRequestBody"},"CompanyOverridesPostResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"CompanyOverridesPostResponsesContentApplicationJsonSchemaParams"},"entitlements_createCompanyOverride_Response_201":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CompanyOverrideResponseData"},"params":{"$ref":"#/components/schemas/CompanyOverridesPostResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"entitlements_createCompanyOverride_Response_201"},"UpdateCompanyOverrideRequestBody":{"type":"object","properties":{"credit_consumption_rate":{"type":["number","null"],"format":"double"},"expiration_date":{"type":["string","null"],"format":"date-time"},"metric_period":{"oneOf":[{"$ref":"#/components/schemas/MetricPeriod"},{"type":"null"}]},"metric_period_month_reset":{"oneOf":[{"$ref":"#/components/schemas/MetricPeriodMonthReset"},{"type":"null"}]},"model_rates":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CreditModelRate"},"description":"Per-model rate overrides for inference features, keyed by provider and model. Each entry is a complete rate card: its consumption_rate and quantity_rates replace the entitlement's credit_consumption_rate and quantity_rates for events from that provider and model. An event matches an entry by exact model name first, then by its model name without a trailing snapshot date (claude-sonnet-4-5-20250929 matches claude-sonnet-4-5). Models with no entry burn at the entitlement's own rates. Omit to leave the overrides as they are; send null to clear them."},"note":{"type":["string","null"]},"quantity_rates":{"type":["object","null"],"additionalProperties":{"type":"number","format":"double"},"description":"Credits per unit of the quantity (per token for inference features), keyed by quantity key. Inference features may price input_tokens, output_tokens, cached_input_tokens, cache_creation_input_tokens and reasoning_tokens; reasoning_tokens is priced on top of output_tokens, so leave its rate at zero for providers that count reasoning inside output. Omit to leave the schedule as it is; send null to clear it."},"value_bool":{"type":["boolean","null"]},"value_credit_id":{"type":["string","null"]},"value_numeric":{"type":["integer","null"],"format":"int64"},"value_trait_id":{"type":["string","null"]},"value_type":{"$ref":"#/components/schemas/EntitlementValueType"}},"required":["value_type"],"title":"UpdateCompanyOverrideRequestBody"},"CompanyOverridesCompanyOverrideIdPutResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"CompanyOverridesCompanyOverrideIdPutResponsesContentApplicationJsonSchemaParams"},"entitlements_updateCompanyOverride_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CompanyOverrideResponseData"},"params":{"$ref":"#/components/schemas/CompanyOverridesCompanyOverrideIdPutResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"entitlements_updateCompanyOverride_Response_200"},"CompanyOverridesCompanyOverrideIdDeleteResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"CompanyOverridesCompanyOverrideIdDeleteResponsesContentApplicationJsonSchemaParams"},"entitlements_deleteCompanyOverride_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DeleteResponse"},"params":{"$ref":"#/components/schemas/CompanyOverridesCompanyOverrideIdDeleteResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"entitlements_deleteCompanyOverride_Response_200"},"PlanEntitlementsGetResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{"feature_id":{"type":"string","description":"Filter plan entitlements by a single feature ID (starting with feat_)"},"feature_ids":{"type":"array","items":{"type":"string"},"description":"Filter plan entitlements by multiple feature IDs (starting with feat_)"},"ids":{"type":"array","items":{"type":"string"},"description":"Filter plan entitlements by multiple plan entitlement IDs (starting with pltl_)"},"limit":{"type":"integer","format":"int64","minimum":0,"maximum":250,"description":"Page limit (default 100)"},"offset":{"type":"integer","format":"int64","description":"Page offset (default 0)"},"plan_id":{"type":"string","description":"Filter plan entitlements by a single plan ID (starting with plan_)"},"plan_ids":{"type":"array","items":{"type":"string"},"description":"Filter plan entitlements by multiple plan IDs (starting with plan_)"},"plan_version_id":{"type":"string","description":"Filter plan entitlements by a single plan version ID (starting with plvr_)"},"plan_version_ids":{"type":"array","items":{"type":"string"},"description":"Filter plan entitlements by multiple plan version IDs (starting with plvr_)"},"q":{"type":"string","description":"Search for plan entitlements by feature or company name"},"with_metered_products":{"type":"boolean","description":"Filter plan entitlements only with metered products"}},"description":"Input parameters","title":"PlanEntitlementsGetResponsesContentApplicationJsonSchemaParams"},"entitlements_listPlanEntitlements_Response_200":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PlanEntitlementResponseData"}},"params":{"$ref":"#/components/schemas/PlanEntitlementsGetResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"entitlements_listPlanEntitlements_Response_200"},"PlanEntitlementsPlanEntitlementIdGetResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"PlanEntitlementsPlanEntitlementIdGetResponsesContentApplicationJsonSchemaParams"},"entitlements_getPlanEntitlement_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PlanEntitlementResponseData"},"params":{"$ref":"#/components/schemas/PlanEntitlementsPlanEntitlementIdGetResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"entitlements_getPlanEntitlement_Response_200"},"CreatePriceTierRequestBody":{"type":"object","properties":{"flat_amount":{"type":["integer","null"],"format":"int64","minimum":0},"per_unit_price":{"type":["integer","null"],"format":"int64","minimum":0},"per_unit_price_decimal":{"type":["string","null"]},"up_to":{"type":["integer","null"],"format":"int64"}},"title":"CreatePriceTierRequestBody"},"CurrencyPriceRequestBody":{"type":"object","properties":{"currency":{"$ref":"#/components/schemas/Currency"},"monthly_price_tiers":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CreatePriceTierRequestBody"}},"monthly_unit_price":{"type":["integer","null"],"format":"int64","minimum":0},"monthly_unit_price_decimal":{"type":["string","null"]},"quarterly_price_tiers":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CreatePriceTierRequestBody"}},"quarterly_unit_price":{"type":["integer","null"],"format":"int64","minimum":0},"quarterly_unit_price_decimal":{"type":["string","null"]},"yearly_price_tiers":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CreatePriceTierRequestBody"}},"yearly_unit_price":{"type":["integer","null"],"format":"int64","minimum":0},"yearly_unit_price_decimal":{"type":["string","null"]}},"required":["currency"],"title":"CurrencyPriceRequestBody"},"WarningTierRequestBody":{"type":"object","properties":{"key":{"type":"string","maxLength":255},"value":{"type":"integer","format":"int64","minimum":1,"maximum":9999999999999}},"required":["key","value"],"title":"WarningTierRequestBody"},"CreatePlanEntitlementRequestBody":{"type":"object","properties":{"billing_product_id":{"type":["string","null"]},"billing_threshold":{"type":["integer","null"],"format":"int64","minimum":50,"maximum":9999999999999},"credit_consumption_rate":{"type":["number","null"],"format":"double"},"currency":{"oneOf":[{"$ref":"#/components/schemas/Currency"},{"type":"null"}]},"currency_prices":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CurrencyPriceRequestBody"}},"feature_id":{"type":"string"},"metric_period":{"oneOf":[{"$ref":"#/components/schemas/MetricPeriod"},{"type":"null"}]},"metric_period_month_reset":{"oneOf":[{"$ref":"#/components/schemas/MetricPeriodMonthReset"},{"type":"null"}]},"model_rates":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CreditModelRate"},"description":"Per-model rate overrides for inference features, keyed by provider and model. Each entry is a complete rate card: its consumption_rate and quantity_rates replace the entitlement's credit_consumption_rate and quantity_rates for events from that provider and model. An event matches an entry by exact model name first, then by its model name without a trailing snapshot date (claude-sonnet-4-5-20250929 matches claude-sonnet-4-5). Models with no entry burn at the entitlement's own rates. Omit to leave the overrides as they are; send null to clear them."},"monthly_metered_price_id":{"type":["string","null"],"deprecated":true},"monthly_price_tiers":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CreatePriceTierRequestBody"}},"monthly_unit_price":{"type":["integer","null"],"format":"int64","minimum":0},"monthly_unit_price_decimal":{"type":["string","null"]},"overage_billing_cadence":{"oneOf":[{"$ref":"#/components/schemas/BillingArrearsCadence"},{"type":"null"}],"description":"How often overage charges are assessed and invoiced. Defaults to end_of_billing_period, where the billing provider aggregates usage over the subscription's own period and bills it at period end. Set to monthly or quarterly to have overage assessed each month or quarter and billed on its own invoice, which is the point of the setting on annual plans. A quarter charges each month's usage against that month's allowance. Only applies to overage price behavior."},"overage_billing_product_id":{"type":["string","null"],"deprecated":true},"overage_invoice_anchor":{"oneOf":[{"$ref":"#/components/schemas/BillingArrearsAnchor"},{"type":"null"}],"description":"Which boundary closes a monthly or quarterly overage window: the subscription's own recurrence (billing_period_start) or the calendar month (month_end). Quarterly windows run in three-month blocks from the billing period start, held to the subscription's own period, or in calendar quarters at month_end. Only applies when overage_billing_cadence is monthly or quarterly, and must match metric_period_month_reset so each window closes when the allowance resets: billing_period_start for billing_cycle, month_end for first_of_month. Defaults to the anchor that matches the reset."},"plan_id":{"type":"string"},"plan_version_id":{"type":["string","null"]},"price_behavior":{"oneOf":[{"$ref":"#/components/schemas/EntitlementPriceBehavior"},{"type":"null"}]},"price_tiers":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CreatePriceTierRequestBody"},"description":"Use MonthlyPriceTiers or YearlyPriceTiers instead","deprecated":true},"quantity_rates":{"type":["object","null"],"additionalProperties":{"type":"number","format":"double"},"description":"Credits per unit of the quantity (per token for inference features), keyed by quantity key. Inference features may price input_tokens, output_tokens, cached_input_tokens, cache_creation_input_tokens and reasoning_tokens; reasoning_tokens is priced on top of output_tokens, so leave its rate at zero for providers that count reasoning inside output. Omit to leave the schedule as it is; send null to clear it."},"quarterly_metered_price_id":{"type":["string","null"],"deprecated":true},"quarterly_price_tiers":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CreatePriceTierRequestBody"}},"quarterly_unit_price":{"type":["integer","null"],"format":"int64","minimum":0},"quarterly_unit_price_decimal":{"type":["string","null"]},"soft_limit":{"type":["integer","null"],"format":"int64"},"tier_mode":{"oneOf":[{"$ref":"#/components/schemas/BillingTiersMode"},{"type":"null"}]},"usage_quantity":{"type":["integer","null"],"format":"int64","minimum":0,"description":"The committed unit quantity for this entitlement. For custom plans this is the minimum the company is contractually committed to: the company can buy more, and finalizing a new plan version sets the subscription quantity to the larger of this value and what the subscription already holds. For standard plans it is the quantity pre-filled when subscribing. Only applies to pay-in-advance entitlements."},"value_bool":{"type":["boolean","null"]},"value_credit_id":{"type":["string","null"]},"value_numeric":{"type":["integer","null"],"format":"int64"},"value_trait_id":{"type":["string","null"]},"value_type":{"$ref":"#/components/schemas/EntitlementValueType"},"warning_tiers":{"type":["array","null"],"items":{"$ref":"#/components/schemas/WarningTierRequestBody"}},"yearly_metered_price_id":{"type":["string","null"],"deprecated":true},"yearly_price_tiers":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CreatePriceTierRequestBody"}},"yearly_unit_price":{"type":["integer","null"],"format":"int64","minimum":0},"yearly_unit_price_decimal":{"type":["string","null"]}},"required":["feature_id","plan_id","value_type"],"title":"CreatePlanEntitlementRequestBody"},"PlanEntitlementsPostResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"PlanEntitlementsPostResponsesContentApplicationJsonSchemaParams"},"entitlements_createPlanEntitlement_Response_201":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PlanEntitlementResponseData"},"params":{"$ref":"#/components/schemas/PlanEntitlementsPostResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"entitlements_createPlanEntitlement_Response_201"},"UpdatePlanEntitlementRequestBody":{"type":"object","properties":{"billing_product_id":{"type":["string","null"]},"billing_threshold":{"type":["integer","null"],"format":"int64","minimum":50,"maximum":9999999999999},"credit_consumption_rate":{"type":["number","null"],"format":"double"},"currency":{"oneOf":[{"$ref":"#/components/schemas/Currency"},{"type":"null"}]},"currency_prices":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CurrencyPriceRequestBody"}},"metric_period":{"oneOf":[{"$ref":"#/components/schemas/MetricPeriod"},{"type":"null"}]},"metric_period_month_reset":{"oneOf":[{"$ref":"#/components/schemas/MetricPeriodMonthReset"},{"type":"null"}]},"model_rates":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CreditModelRate"},"description":"Per-model rate overrides for inference features, keyed by provider and model. Each entry is a complete rate card: its consumption_rate and quantity_rates replace the entitlement's credit_consumption_rate and quantity_rates for events from that provider and model. An event matches an entry by exact model name first, then by its model name without a trailing snapshot date (claude-sonnet-4-5-20250929 matches claude-sonnet-4-5). Models with no entry burn at the entitlement's own rates. Omit to leave the overrides as they are; send null to clear them."},"monthly_metered_price_id":{"type":["string","null"],"deprecated":true},"monthly_price_tiers":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CreatePriceTierRequestBody"}},"monthly_unit_price":{"type":["integer","null"],"format":"int64","minimum":0},"monthly_unit_price_decimal":{"type":["string","null"]},"overage_billing_cadence":{"oneOf":[{"$ref":"#/components/schemas/BillingArrearsCadence"},{"type":"null"}],"description":"How often overage charges are assessed and invoiced. Defaults to end_of_billing_period, where the billing provider aggregates usage over the subscription's own period and bills it at period end. Set to monthly or quarterly to have overage assessed each month or quarter and billed on its own invoice, which is the point of the setting on annual plans. A quarter charges each month's usage against that month's allowance. Only applies to overage price behavior."},"overage_billing_product_id":{"type":["string","null"],"deprecated":true},"overage_invoice_anchor":{"oneOf":[{"$ref":"#/components/schemas/BillingArrearsAnchor"},{"type":"null"}],"description":"Which boundary closes a monthly or quarterly overage window: the subscription's own recurrence (billing_period_start) or the calendar month (month_end). Quarterly windows run in three-month blocks from the billing period start, held to the subscription's own period, or in calendar quarters at month_end. Only applies when overage_billing_cadence is monthly or quarterly, and must match metric_period_month_reset so each window closes when the allowance resets: billing_period_start for billing_cycle, month_end for first_of_month. Defaults to the anchor that matches the reset."},"price_behavior":{"oneOf":[{"$ref":"#/components/schemas/EntitlementPriceBehavior"},{"type":"null"}]},"price_tiers":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CreatePriceTierRequestBody"},"description":"Use MonthlyPriceTiers or YearlyPriceTiers instead","deprecated":true},"quantity_rates":{"type":["object","null"],"additionalProperties":{"type":"number","format":"double"},"description":"Credits per unit of the quantity (per token for inference features), keyed by quantity key. Inference features may price input_tokens, output_tokens, cached_input_tokens, cache_creation_input_tokens and reasoning_tokens; reasoning_tokens is priced on top of output_tokens, so leave its rate at zero for providers that count reasoning inside output. Omit to leave the schedule as it is; send null to clear it."},"quarterly_metered_price_id":{"type":["string","null"],"deprecated":true},"quarterly_price_tiers":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CreatePriceTierRequestBody"}},"quarterly_unit_price":{"type":["integer","null"],"format":"int64","minimum":0},"quarterly_unit_price_decimal":{"type":["string","null"]},"soft_limit":{"type":["integer","null"],"format":"int64"},"tier_mode":{"oneOf":[{"$ref":"#/components/schemas/BillingTiersMode"},{"type":"null"}]},"usage_quantity":{"type":["integer","null"],"format":"int64","minimum":0,"description":"The committed unit quantity for this entitlement. For custom plans this is the minimum the company is contractually committed to: the company can buy more, and finalizing a new plan version sets the subscription quantity to the larger of this value and what the subscription already holds. For standard plans it is the quantity pre-filled when subscribing. Only applies to pay-in-advance entitlements."},"value_bool":{"type":["boolean","null"]},"value_credit_id":{"type":["string","null"]},"value_numeric":{"type":["integer","null"],"format":"int64"},"value_trait_id":{"type":["string","null"]},"value_type":{"$ref":"#/components/schemas/EntitlementValueType"},"warning_tiers":{"type":["array","null"],"items":{"$ref":"#/components/schemas/WarningTierRequestBody"}},"yearly_metered_price_id":{"type":["string","null"],"deprecated":true},"yearly_price_tiers":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CreatePriceTierRequestBody"}},"yearly_unit_price":{"type":["integer","null"],"format":"int64","minimum":0},"yearly_unit_price_decimal":{"type":["string","null"]}},"required":["value_type"],"title":"UpdatePlanEntitlementRequestBody"},"PlanEntitlementsPlanEntitlementIdPutResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"PlanEntitlementsPlanEntitlementIdPutResponsesContentApplicationJsonSchemaParams"},"entitlements_updatePlanEntitlement_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PlanEntitlementResponseData"},"params":{"$ref":"#/components/schemas/PlanEntitlementsPlanEntitlementIdPutResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"entitlements_updatePlanEntitlement_Response_200"},"PlanEntitlementsPlanEntitlementIdDeleteResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"PlanEntitlementsPlanEntitlementIdDeleteResponsesContentApplicationJsonSchemaParams"},"entitlements_deletePlanEntitlement_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DeleteResponse"},"params":{"$ref":"#/components/schemas/PlanEntitlementsPlanEntitlementIdDeleteResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"entitlements_deletePlanEntitlement_Response_200"},"BillingCreditGrantReason":{"type":"string","enum":["adjustment","billing_credit_auto_topup","free","plan","postpaid_forgiven","postpaid_overdraft","postpaid_settlement","purchased","rollover"],"title":"BillingCreditGrantReason"},"CreditGrantDetail":{"type":"object","properties":{"credit_type_icon":{"type":["string","null"]},"expires_at":{"type":["string","null"],"format":"date-time"},"grant_reason":{"$ref":"#/components/schemas/BillingCreditGrantReason"},"quantity":{"type":"number","format":"double"}},"required":["grant_reason","quantity"],"title":"CreditGrantDetail"},"CreditUsageAggregation":{"type":"object","properties":{"usage_this_billing_period":{"type":["number","null"],"format":"double","description":"Credit usage within the current billing period"},"usage_this_calendar_month":{"type":["number","null"],"format":"double","description":"Credit usage within the current calendar month"},"usage_this_week":{"type":["number","null"],"format":"double","description":"Credit usage within the current calendar week (Monday to Sunday)"},"usage_today":{"type":["number","null"],"format":"double","description":"Credit usage for the current day"}},"title":"CreditUsageAggregation"},"EntitlementType":{"type":"string","enum":["company_override","plan_credit_grant","plan_entitlement","unknown"],"title":"EntitlementType"},"FeatureUsageResponseData":{"type":"object","properties":{"access":{"type":"boolean","description":"Whether further usage is permitted."},"allocation":{"type":["integer","null"],"format":"int64","description":"The maximum amount of usage that is permitted; a null value indicates that unlimited usage is permitted or that this is a credit-based entitlement (use credit_remaining instead)."},"allocation_type":{"$ref":"#/components/schemas/EntitlementValueType","description":"The type of allocation that is being used."},"company_override":{"$ref":"#/components/schemas/CompanyOverrideResponseData"},"credit_consumption_rate":{"type":["number","null"],"format":"double","description":"The rate at which credits are consumed per unit of usage"},"credit_grant_counts":{"type":"object","additionalProperties":{"type":"number","format":"double"}},"credit_grant_details":{"type":"array","items":{"$ref":"#/components/schemas/CreditGrantDetail"}},"credit_grant_reason":{"oneOf":[{"$ref":"#/components/schemas/BillingCreditGrantReason"},{"type":"null"}],"description":"Reason for the credit grant"},"credit_remaining":{"type":["number","null"],"format":"double"},"credit_total":{"type":["number","null"],"format":"double","description":"Deprecated: Use credit_remaining instead.","deprecated":true},"credit_type_icon":{"type":["string","null"],"description":"Icon identifier for the credit type"},"credit_usage_aggregation":{"oneOf":[{"$ref":"#/components/schemas/CreditUsageAggregation"},{"type":"null"}],"description":"Aggregated credit usage by time period (day, week, month, billing period)"},"credit_used":{"type":["number","null"],"format":"double"},"effective_limit":{"type":["integer","null"],"format":"int64","description":"Effective limit for usage calculations. For overage pricing, this is the soft limit where overage charges begin. For tiered pricing, this is the first tier boundary. For other pricing models, this is the base allocation. Used to calculate usage percentages and determine access thresholds."},"effective_price":{"type":["number","null"],"format":"double","description":"Per-unit price for current usage scenario"},"entitlement_expiration_date":{"type":["string","null"],"format":"date-time"},"entitlement_id":{"type":"string"},"entitlement_source":{"type":["string","null"],"description":"Source of the entitlement (plan or company_override)"},"entitlement_type":{"$ref":"#/components/schemas/EntitlementType"},"feature":{"$ref":"#/components/schemas/FeatureInPlanResponseData"},"has_valid_allocation":{"type":["boolean","null"],"description":"Whether a valid allocation exists"},"is_unlimited":{"type":["boolean","null"],"description":"Whether this is an unlimited allocation"},"metric_reset_at":{"type":["string","null"],"format":"date-time","description":"The time at which the metric will reset."},"month_reset":{"oneOf":[{"$ref":"#/components/schemas/MetricPeriodMonthReset"},{"type":"null"}],"description":"If the period is current_month, when the month resets."},"monthly_usage_based_price":{"$ref":"#/components/schemas/BillingPriceView"},"overuse":{"type":["integer","null"],"format":"int64","description":"Amount of usage exceeding soft limit (overage pricing only)"},"percent_used":{"type":["number","null"],"format":"double","description":"Percentage of allocation consumed (0-100+)"},"period":{"oneOf":[{"$ref":"#/components/schemas/MetricPeriod"},{"type":"null"}],"description":"The period over which usage is measured."},"plan":{"$ref":"#/components/schemas/PlanResponseData"},"plan_entitlement":{"$ref":"#/components/schemas/PlanEntitlementResponseData"},"price_behavior":{"oneOf":[{"$ref":"#/components/schemas/EntitlementPriceBehavior"},{"type":"null"}]},"quarterly_usage_based_price":{"$ref":"#/components/schemas/BillingPriceView"},"soft_limit":{"type":["integer","null"],"format":"int64","description":"The soft limit for the feature usage. Available only for overage price behavior"},"usage":{"type":["integer","null"],"format":"int64","description":"The amount of usage that has been consumed; a null value indicates that usage is not being measured or that this is a credit-based entitlement (use credit_used instead)."},"yearly_usage_based_price":{"$ref":"#/components/schemas/BillingPriceView"}},"required":["access","allocation_type","entitlement_id","entitlement_type"],"title":"FeatureUsageResponseData"},"FeatureUsageGetResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{"company_id":{"type":"string"},"company_keys":{"type":"object","additionalProperties":{"type":"string"}},"feature_ids":{"type":"array","items":{"type":"string"}},"include_usage_aggregation":{"type":"boolean","description":"Include time-bucketed usage aggregation (today, this week, this month, billing period) for credit-based entitlements. Defaults to false for performance."},"limit":{"type":"integer","format":"int64","minimum":0,"maximum":250,"description":"Page limit (default 100)"},"managed_by":{"$ref":"#/components/schemas/BillingProviderType","description":"Filter for features managed by a billing provider, or by Schematic (no billing provider)"},"offset":{"type":"integer","format":"int64","description":"Page offset (default 0)"},"q":{"type":"string"},"without_negative_entitlements":{"type":"boolean"}},"description":"Input parameters","title":"FeatureUsageGetResponsesContentApplicationJsonSchemaParams"},"entitlements_listFeatureUsage_Response_200":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/FeatureUsageResponseData"}},"params":{"$ref":"#/components/schemas/FeatureUsageGetResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"entitlements_listFeatureUsage_Response_200"},"BillingCreditsGetResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"}},"limit":{"type":"integer","format":"int64","minimum":0,"maximum":250,"description":"Page limit (default 100)"},"name":{"type":"string","maxLength":255},"offset":{"type":"integer","format":"int64","description":"Page offset (default 0)"}},"description":"Input parameters","title":"BillingCreditsGetResponsesContentApplicationJsonSchemaParams"},"credits_listBillingCredits_Response_200":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/BillingCreditResponseData"}},"params":{"$ref":"#/components/schemas/BillingCreditsGetResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"credits_listBillingCredits_Response_200"},"CreditCurrencyPriceRequestBody":{"type":"object","properties":{"currency":{"$ref":"#/components/schemas/Currency"},"price_per_unit":{"type":["integer","null"],"format":"int64","minimum":0},"price_per_unit_decimal":{"type":["string","null"]}},"required":["currency"],"title":"CreditCurrencyPriceRequestBody"},"CreateBillingCreditRequestBody":{"type":"object","properties":{"burn_strategy":{"oneOf":[{"$ref":"#/components/schemas/BillingCreditBurnStrategy"},{"type":"null"}]},"currency":{"$ref":"#/components/schemas/Currency"},"currency_prices":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CreditCurrencyPriceRequestBody"}},"default_expiry_unit":{"oneOf":[{"$ref":"#/components/schemas/BillingCreditExpiryUnit"},{"type":"null"}]},"default_expiry_unit_count":{"type":["integer","null"],"format":"int64","minimum":1},"default_rollover_policy":{"oneOf":[{"$ref":"#/components/schemas/BillingCreditRolloverPolicy"},{"type":"null"}]},"description":{"type":"string","maxLength":1024},"icon":{"type":["string","null"],"maxLength":64},"name":{"type":"string","maxLength":255},"per_unit_price":{"type":["integer","null"],"format":"int64"},"per_unit_price_decimal":{"type":["string","null"]},"plural_name":{"type":["string","null"],"maxLength":512},"singular_name":{"type":["string","null"],"maxLength":512}},"required":["currency","description","name"],"title":"CreateBillingCreditRequestBody"},"BillingCreditsPostResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"BillingCreditsPostResponsesContentApplicationJsonSchemaParams"},"credits_createBillingCredit_Response_201":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BillingCreditResponseData"},"params":{"$ref":"#/components/schemas/BillingCreditsPostResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"credits_createBillingCredit_Response_201"},"BillingCreditsCreditIdGetResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"BillingCreditsCreditIdGetResponsesContentApplicationJsonSchemaParams"},"credits_getSingleBillingCredit_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BillingCreditResponseData"},"params":{"$ref":"#/components/schemas/BillingCreditsCreditIdGetResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"credits_getSingleBillingCredit_Response_200"},"UpdateBillingCreditRequestBody":{"type":"object","properties":{"burn_strategy":{"oneOf":[{"$ref":"#/components/schemas/BillingCreditBurnStrategy"},{"type":"null"}]},"currency_prices":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CreditCurrencyPriceRequestBody"}},"default_expiry_unit":{"oneOf":[{"$ref":"#/components/schemas/BillingCreditExpiryUnit"},{"type":"null"}]},"default_expiry_unit_count":{"type":["integer","null"],"format":"int64","minimum":1},"default_rollover_policy":{"oneOf":[{"$ref":"#/components/schemas/BillingCreditRolloverPolicy"},{"type":"null"}]},"description":{"type":"string","maxLength":1024},"icon":{"type":["string","null"],"maxLength":64},"name":{"type":"string","maxLength":255},"per_unit_price":{"type":["integer","null"],"format":"int64","minimum":1},"per_unit_price_decimal":{"type":["string","null"]},"plural_name":{"type":["string","null"],"maxLength":512},"singular_name":{"type":["string","null"],"maxLength":512}},"required":["description","name"],"title":"UpdateBillingCreditRequestBody"},"BillingCreditsCreditIdPutResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"BillingCreditsCreditIdPutResponsesContentApplicationJsonSchemaParams"},"credits_updateBillingCredit_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BillingCreditResponseData"},"params":{"$ref":"#/components/schemas/BillingCreditsCreditIdPutResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"credits_updateBillingCredit_Response_200"},"BillingCreditsCreditIdDeleteResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"BillingCreditsCreditIdDeleteResponsesContentApplicationJsonSchemaParams"},"credits_softDeleteBillingCredit_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DeleteResponse"},"params":{"$ref":"#/components/schemas/BillingCreditsCreditIdDeleteResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"credits_softDeleteBillingCredit_Response_200"},"BillingCreditBundleStatus":{"type":"string","enum":["active","inactive"],"title":"BillingCreditBundleStatus"},"BillingCreditBundleType":{"type":"string","enum":["fixed"],"title":"BillingCreditBundleType"},"CreditBundleCurrencyPriceResponseData":{"type":"object","properties":{"currency":{"$ref":"#/components/schemas/Currency"},"price":{"$ref":"#/components/schemas/BillingPriceResponseData"}},"required":["currency"],"title":"CreditBundleCurrencyPriceResponseData"},"BillingCreditBundleResponseData":{"type":"object","properties":{"billing_invoice_id":{"type":["string","null"]},"bundle_type":{"$ref":"#/components/schemas/BillingCreditBundleType"},"compatible_plan_ids":{"type":"array","items":{"type":"string"},"description":"Plans whose companies may purchase this bundle. Empty means the bundle is purchasable on every plan."},"created_at":{"type":"string","format":"date-time"},"credit_description":{"type":"string"},"credit_icon":{"type":["string","null"]},"credit_id":{"type":"string"},"credit_name":{"type":"string"},"currency_prices":{"type":"array","items":{"$ref":"#/components/schemas/CreditBundleCurrencyPriceResponseData"}},"expiry_type":{"$ref":"#/components/schemas/BillingCreditExpiryType"},"expiry_unit":{"$ref":"#/components/schemas/BillingCreditExpiryUnit"},"expiry_unit_count":{"type":["integer","null"],"format":"int64"},"has_grants":{"type":"boolean"},"id":{"type":"string"},"name":{"type":"string"},"plural_name":{"type":["string","null"]},"price":{"$ref":"#/components/schemas/BillingPriceResponseData"},"quantity":{"type":["integer","null"],"format":"int64"},"singular_name":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/BillingCreditBundleStatus"},"unit_price":{"$ref":"#/components/schemas/BillingPriceResponseData"},"updated_at":{"type":"string","format":"date-time"}},"required":["bundle_type","compatible_plan_ids","created_at","credit_id","credit_name","currency_prices","expiry_type","expiry_unit","has_grants","id","name","status","updated_at"],"title":"BillingCreditBundleResponseData"},"BillingCreditsBundlesGetResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{"bundle_type":{"$ref":"#/components/schemas/BillingCreditBundleType"},"credit_id":{"type":"string"},"ids":{"type":"array","items":{"type":"string"}},"limit":{"type":"integer","format":"int64","minimum":0,"maximum":250,"description":"Page limit (default 100)"},"offset":{"type":"integer","format":"int64","description":"Page offset (default 0)"},"status":{"$ref":"#/components/schemas/BillingCreditBundleStatus"}},"description":"Input parameters","title":"BillingCreditsBundlesGetResponsesContentApplicationJsonSchemaParams"},"credits_listCreditBundles_Response_200":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/BillingCreditBundleResponseData"}},"params":{"$ref":"#/components/schemas/BillingCreditsBundlesGetResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"credits_listCreditBundles_Response_200"},"CreditBundleCurrencyPriceRequestBody":{"type":"object","properties":{"currency":{"$ref":"#/components/schemas/Currency"},"price_per_unit":{"type":["integer","null"],"format":"int64","minimum":0},"price_per_unit_decimal":{"type":["string","null"]}},"required":["currency"],"title":"CreditBundleCurrencyPriceRequestBody"},"CreateCreditBundleRequestBody":{"type":"object","properties":{"bundle_name":{"type":"string","maxLength":255},"bundle_type":{"oneOf":[{"$ref":"#/components/schemas/BillingCreditBundleType"},{"type":"null"}]},"compatible_plan_ids":{"type":["array","null"],"items":{"type":"string"},"description":"Plans whose companies may purchase this bundle. Omitted or empty means the bundle is purchasable on every plan."},"credit_id":{"type":"string"},"currency":{"$ref":"#/components/schemas/Currency"},"currency_prices":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CreditBundleCurrencyPriceRequestBody"}},"expiry_type":{"oneOf":[{"$ref":"#/components/schemas/BillingCreditExpiryType"},{"type":"null"}]},"expiry_unit":{"oneOf":[{"$ref":"#/components/schemas/BillingCreditExpiryUnit"},{"type":"null"}]},"expiry_unit_count":{"type":["integer","null"],"format":"int64","minimum":1},"price_per_unit":{"type":"integer","format":"int64","minimum":0},"price_per_unit_decimal":{"type":["string","null"]},"quantity":{"type":["integer","null"],"format":"int64","minimum":1},"status":{"oneOf":[{"$ref":"#/components/schemas/BillingCreditBundleStatus"},{"type":"null"}]}},"required":["bundle_name","credit_id","currency","price_per_unit"],"title":"CreateCreditBundleRequestBody"},"BillingCreditsBundlesPostResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"BillingCreditsBundlesPostResponsesContentApplicationJsonSchemaParams"},"credits_createCreditBundle_Response_201":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BillingCreditBundleResponseData"},"params":{"$ref":"#/components/schemas/BillingCreditsBundlesPostResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"credits_createCreditBundle_Response_201"},"BillingCreditsBundlesBundleIdGetResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"BillingCreditsBundlesBundleIdGetResponsesContentApplicationJsonSchemaParams"},"credits_getCreditBundle_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BillingCreditBundleResponseData"},"params":{"$ref":"#/components/schemas/BillingCreditsBundlesBundleIdGetResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"credits_getCreditBundle_Response_200"},"UpdateCreditBundleDetailsRequestBody":{"type":"object","properties":{"bundle_name":{"type":"string","maxLength":255},"compatible_plan_ids":{"type":["array","null"],"items":{"type":"string"},"description":"Plans whose companies may purchase this bundle. Omitted leaves compatibility unchanged; empty resets the bundle to purchasable on every plan."},"currency_prices":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CreditBundleCurrencyPriceRequestBody"}},"expiry_type":{"oneOf":[{"$ref":"#/components/schemas/BillingCreditExpiryType"},{"type":"null"}]},"expiry_unit":{"oneOf":[{"$ref":"#/components/schemas/BillingCreditExpiryUnit"},{"type":"null"}]},"expiry_unit_count":{"type":["integer","null"],"format":"int64","minimum":1},"price_per_unit":{"type":"integer","format":"int64","minimum":0},"price_per_unit_decimal":{"type":["string","null"]},"quantity":{"type":["integer","null"],"format":"int64","minimum":1},"status":{"oneOf":[{"$ref":"#/components/schemas/BillingCreditBundleStatus"},{"type":"null"}]}},"required":["bundle_name","price_per_unit"],"title":"UpdateCreditBundleDetailsRequestBody"},"BillingCreditsBundlesBundleIdPutResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"BillingCreditsBundlesBundleIdPutResponsesContentApplicationJsonSchemaParams"},"credits_updateCreditBundleDetails_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BillingCreditBundleResponseData"},"params":{"$ref":"#/components/schemas/BillingCreditsBundlesBundleIdPutResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"credits_updateCreditBundleDetails_Response_200"},"BillingCreditsBundlesBundleIdDeleteResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"BillingCreditsBundlesBundleIdDeleteResponsesContentApplicationJsonSchemaParams"},"credits_deleteCreditBundle_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DeleteResponse"},"params":{"$ref":"#/components/schemas/BillingCreditsBundlesBundleIdDeleteResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"credits_deleteCreditBundle_Response_200"},"CreateCompanyCreditGrant":{"type":"object","properties":{"billing_periods_count":{"type":["integer","null"],"format":"int64","minimum":1},"company_id":{"type":"string"},"credit_bundle_id":{"type":["string","null"]},"credit_id":{"type":"string"},"currency":{"oneOf":[{"$ref":"#/components/schemas/Currency"},{"type":"null"}]},"expires_at":{"type":["string","null"],"format":"date-time"},"expiry_type":{"oneOf":[{"$ref":"#/components/schemas/BillingCreditExpiryType"},{"type":"null"}]},"expiry_unit":{"oneOf":[{"$ref":"#/components/schemas/BillingCreditExpiryUnit"},{"type":"null"}]},"expiry_unit_count":{"type":["integer","null"],"format":"int64","minimum":1},"quantity":{"type":"integer","format":"int64","minimum":1},"reason":{"$ref":"#/components/schemas/BillingCreditGrantReason"},"renewal_enabled":{"type":["boolean","null"]},"renewal_period":{"oneOf":[{"$ref":"#/components/schemas/BillingPlanCreditGrantResetStart"},{"type":"null"}]}},"required":["company_id","credit_id","quantity","reason"],"title":"CreateCompanyCreditGrant"},"CreditTransferResponseData":{"type":"object","properties":{"amount":{"type":"number","format":"double"},"created_at":{"type":"string","format":"date-time"},"direction":{"type":"string"},"id":{"type":"string"},"reason":{"type":"string"},"related_grant_id":{"type":"string"}},"required":["amount","created_at","direction","id","reason","related_grant_id"],"title":"CreditTransferResponseData"},"BillingCreditGrantZeroedOutReason":{"type":"string","enum":["customer_archived","expired","integration_uninstalled","license_retired","manual","plan_change","plan_period_reset","reconciled"],"title":"BillingCreditGrantZeroedOutReason"},"BillingCreditGrantResponseData":{"type":"object","properties":{"company_id":{"type":"string"},"company_license_id":{"type":["string","null"],"description":"The license instance this grant was issued for. Set only when a per-license plan grant issued it; null on a plan's own grant."},"company_name":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"credit_bundle_id":{"type":["string","null"],"description":"The catalog bundle this grant was issued from, when the company bought one."},"credit_icon":{"type":["string","null"]},"credit_id":{"type":"string"},"credit_name":{"type":"string"},"currency":{"oneOf":[{"$ref":"#/components/schemas/Currency"},{"type":"null"}]},"expires_at":{"type":["string","null"],"format":"date-time"},"grant_reason":{"$ref":"#/components/schemas/BillingCreditGrantReason"},"id":{"type":"string"},"license_name":{"type":["string","null"],"description":"Name of the license this grant was issued for, when it came from a per-license plan grant."},"plan_id":{"type":["string","null"]},"plan_name":{"type":["string","null"]},"postpaid_charge_amount":{"type":["integer","null"],"format":"int64","description":"What the postpaid charges costs, in the currency's minor unit."},"postpaid_charge_currency":{"oneOf":[{"$ref":"#/components/schemas/Currency"},{"type":"null"}]},"postpaid_charged_credits":{"type":["number","null"],"format":"double","description":"Credits consumed past a zero balance in the window still open."},"price":{"$ref":"#/components/schemas/BillingPriceResponseData"},"quantity":{"type":"number","format":"double"},"quantity_remaining":{"type":"number","format":"double"},"quantity_used":{"type":"number","format":"double"},"renewal_enabled":{"type":"boolean"},"renewal_period":{"oneOf":[{"$ref":"#/components/schemas/BillingPlanCreditGrantResetCadence"},{"type":"null"}]},"reserved":{"type":["number","null"],"format":"double"},"settled":{"type":["number","null"],"format":"double"},"source_grant_id":{"type":["string","null"],"description":"For rollover grants, the ID of the source grant that this grant rolled from."},"source_label":{"type":"string"},"transfers":{"type":"array","items":{"$ref":"#/components/schemas/CreditTransferResponseData"}},"updated_at":{"type":"string","format":"date-time"},"valid_from":{"type":["string","null"],"format":"date-time"},"zeroed_out_date":{"type":["string","null"],"format":"date-time"},"zeroed_out_reason":{"oneOf":[{"$ref":"#/components/schemas/BillingCreditGrantZeroedOutReason"},{"type":"null"}]}},"required":["company_id","company_name","created_at","credit_id","credit_name","grant_reason","id","quantity","quantity_remaining","quantity_used","renewal_enabled","source_label","updated_at"],"title":"BillingCreditGrantResponseData"},"BillingCreditsGrantsCompanyPostResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"BillingCreditsGrantsCompanyPostResponsesContentApplicationJsonSchemaParams"},"credits_grantBillingCreditsToCompany_Response_201":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BillingCreditGrantResponseData"},"params":{"$ref":"#/components/schemas/BillingCreditsGrantsCompanyPostResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"credits_grantBillingCreditsToCompany_Response_201"},"CreditGrantSortOrder":{"type":"string","enum":["created_at","expires_at","quantity","quantity_remaining"],"title":"CreditGrantSortOrder"},"BillingCreditsGrantsCompanyListGetResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{"company_id":{"type":"string"},"dir":{"$ref":"#/components/schemas/SortDirection"},"limit":{"type":"integer","format":"int64","minimum":0,"maximum":250,"description":"Page limit (default 100)"},"offset":{"type":"integer","format":"int64","description":"Page offset (default 0)"},"order":{"$ref":"#/components/schemas/CreditGrantSortOrder"}},"description":"Input parameters","title":"BillingCreditsGrantsCompanyListGetResponsesContentApplicationJsonSchemaParams"},"credits_listCompanyGrants_Response_200":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/BillingCreditGrantResponseData"}},"params":{"$ref":"#/components/schemas/BillingCreditsGrantsCompanyListGetResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"credits_listCompanyGrants_Response_200"},"BillingCreditsGrantsListGetResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{"credit_id":{"type":"string"},"ids":{"type":"array","items":{"type":"string"}},"limit":{"type":"integer","format":"int64","minimum":0,"maximum":250,"description":"Page limit (default 100)"},"offset":{"type":"integer","format":"int64","description":"Page offset (default 0)"}},"description":"Input parameters","title":"BillingCreditsGrantsListGetResponsesContentApplicationJsonSchemaParams"},"credits_listGrantsForCredit_Response_200":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/BillingCreditGrantResponseData"}},"params":{"$ref":"#/components/schemas/BillingCreditsGrantsListGetResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"credits_listGrantsForCredit_Response_200"},"ZeroOutGrantRequestBody":{"type":"object","properties":{"reason":{"oneOf":[{"$ref":"#/components/schemas/BillingCreditGrantZeroedOutReason"},{"type":"null"}]}},"title":"ZeroOutGrantRequestBody"},"BillingCreditsGrantsGrantIdZeroOutPutResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"BillingCreditsGrantsGrantIdZeroOutPutResponsesContentApplicationJsonSchemaParams"},"credits_zeroOutGrant_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BillingCreditGrantResponseData"},"params":{"$ref":"#/components/schemas/BillingCreditsGrantsGrantIdZeroOutPutResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"credits_zeroOutGrant_Response_200"},"BillingCreditsPlanGrantsGetResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{"credit_id":{"type":"string"},"ids":{"type":"array","items":{"type":"string"}},"limit":{"type":"integer","format":"int64","minimum":0,"maximum":250,"description":"Page limit (default 100)"},"offset":{"type":"integer","format":"int64","description":"Page offset (default 0)"},"plan_id":{"type":"string"},"plan_ids":{"type":"array","items":{"type":"string"}},"plan_version_id":{"type":"string"},"plan_version_ids":{"type":"array","items":{"type":"string"}}},"description":"Input parameters","title":"BillingCreditsPlanGrantsGetResponsesContentApplicationJsonSchemaParams"},"credits_listBillingPlanCreditGrants_Response_200":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/BillingPlanCreditGrantResponseData"}},"params":{"$ref":"#/components/schemas/BillingCreditsPlanGrantsGetResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"credits_listBillingPlanCreditGrants_Response_200"},"CreditAutoTopupAmountType":{"type":"string","enum":["credit"],"title":"CreditAutoTopupAmountType"},"CreditGrantPriceTierRequestBody":{"type":"object","properties":{"per_unit_price":{"type":["integer","null"],"format":"int64","minimum":0,"description":"Price per credit in this tier, in the plan currency's smallest unit."},"per_unit_price_decimal":{"type":["string","null"],"description":"Price per credit in this tier as a decimal in the plan currency's smallest unit, for prices below one cent."},"up_to":{"type":["integer","null"],"format":"int64","minimum":1,"description":"Inclusive upper bound of this tier, counted in credits per invoice. Null marks the final, unbounded tier."}},"title":"CreditGrantPriceTierRequestBody"},"PlanCreditGrantWarningTierRequestBody":{"type":"object","properties":{"key":{"type":"string","maxLength":255,"description":"Identifier for the threshold, unique within the grant."},"value":{"type":"integer","format":"int64","minimum":1,"maximum":9999999999,"description":"Credits remaining in the company's balance at which the warning is reached."}},"required":["key","value"],"title":"PlanCreditGrantWarningTierRequestBody"},"CreateBillingPlanCreditGrantRequestBody":{"type":"object","properties":{"apply_to_existing":{"type":["boolean","null"]},"arrears_anchor":{"oneOf":[{"$ref":"#/components/schemas/BillingArrearsAnchor"},{"type":"null"}],"description":"Which boundary closes a monthly arrears window: the subscription's own recurrence (billing_period_start) or the calendar month (month_end). Only applies when arrears_cadence is monthly; defaults to billing_period_start."},"arrears_cadence":{"oneOf":[{"$ref":"#/components/schemas/BillingArrearsCadence"},{"type":"null"}],"description":"How often postpaid charges are closed and invoiced: end_of_billing_period (the default) or monthly. Quarterly is not available for postpaid charges."},"auto_topup_amount":{"type":["integer","null"],"format":"int64","minimum":1},"auto_topup_amount_type":{"oneOf":[{"$ref":"#/components/schemas/CreditAutoTopupAmountType"},{"type":"null"}]},"auto_topup_availability":{"oneOf":[{"$ref":"#/components/schemas/BillingCreditAutoTopupAvailability"},{"type":"null"}]},"auto_topup_enabled":{"type":["boolean","null"]},"auto_topup_expiry_type":{"oneOf":[{"$ref":"#/components/schemas/BillingCreditExpiryType"},{"type":"null"}]},"auto_topup_expiry_unit":{"oneOf":[{"$ref":"#/components/schemas/BillingCreditExpiryUnit"},{"type":"null"}]},"auto_topup_expiry_unit_count":{"type":["integer","null"],"format":"int64","minimum":1},"auto_topup_self_service":{"type":["boolean","null"]},"auto_topup_threshold_credits":{"type":["integer","null"],"format":"int64","minimum":0},"auto_topup_threshold_percent":{"type":["integer","null"],"format":"int64","minimum":1,"maximum":100},"billing_mode":{"oneOf":[{"$ref":"#/components/schemas/BillingPlanCreditGrantBillingMode"},{"type":"null"}],"description":"Whether the credits are included in the plan price (granted) or billed as their own subscription line at a price per credit (billed). Billed is only available on custom plans. Defaults to granted."},"can_buy_bundles":{"type":["boolean","null"],"description":"Deprecated: use compatible_plan_ids on credit bundles instead. Still accepted; writes through to the credit's bundle compatibility.","deprecated":true},"company_credit_amount":{"type":["integer","null"],"format":"int64","minimum":0,"maximum":9999999999,"description":"Credits granted once per company on top of the per-license amount. Only valid when scaling is per_license. Defaults to 0."},"credit_amount":{"type":"integer","format":"int64","minimum":0,"maximum":9999999999},"credit_id":{"type":"string"},"expiry_type":{"oneOf":[{"$ref":"#/components/schemas/BillingCreditExpiryType"},{"type":"null"}]},"expiry_unit":{"oneOf":[{"$ref":"#/components/schemas/BillingCreditExpiryUnit"},{"type":"null"}]},"expiry_unit_count":{"type":["integer","null"],"format":"int64","minimum":1},"license_id":{"type":["string","null"],"description":"The license whose quantity scales this grant. Required when scaling is per_license."},"overdraft_limit":{"type":["number","null"],"format":"double","description":"Optional limit on how far the balance may go below zero, in credits. It is a floor on the balance rather than an allowance per invoice window: the balance may run down to minus this figure, and beyond it the flag check denies the same way an exhausted balance does with postpaid off. Nothing resets when an invoice window rolls, so a company that reaches the limit stays denied until a new grant lands or the negative balance is settled. Omit for no limit."},"plan_id":{"type":"string"},"plan_version_id":{"type":["string","null"]},"postpaid_enabled":{"type":["boolean","null"],"description":"Whether consumption may continue past a zero balance. When false (the default) the flag check denies once the balance is exhausted, which is the existing behavior. When true, consumption continues and accrues at postpaid_rate_per_unit, settled on arrears_cadence. Intended for invoice-billed customers on net terms, who have no card for auto top-up to charge."},"postpaid_rate_per_unit":{"type":["integer","null"],"format":"int64","minimum":0,"description":"Amount charged per credit consumed past a zero balance, in the currency's minor unit. Optional: defaults to the credit's own cost basis (price_per_unit) when postpaid_enabled is true."},"postpaid_rate_per_unit_decimal":{"type":["string","null"],"description":"Decimal string form of postpaid_rate_per_unit, for rates finer than one minor unit (for example 0.0002). Takes precedence over postpaid_rate_per_unit when both are set, matching how the credit's own price_per_unit_decimal behaves."},"price_tiers":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CreditGrantPriceTierRequestBody"},"description":"Tier table pricing the credits on this grant, cheapest bound first, the last tier unbounded. Give this instead of unit_price to charge a rate that changes with the number of credits on the invoice. Requires tier_mode."},"reset_cadence":{"$ref":"#/components/schemas/BillingPlanCreditGrantResetCadence"},"reset_start":{"$ref":"#/components/schemas/BillingPlanCreditGrantResetStart"},"reset_type":{"oneOf":[{"$ref":"#/components/schemas/BillingPlanCreditGrantResetType"},{"type":"null"}]},"rollover_percentage":{"type":["integer","null"],"format":"int64","minimum":0,"maximum":100,"description":"Percentage of unused credits that carry over when this grant resets. Only applies when reset_type is plan_period. Rolled-over credits expire at the next reset and are not rolled again. Defaults to 0."},"scaling":{"oneOf":[{"$ref":"#/components/schemas/PlanCreditGrantScaling"},{"type":"null"}],"description":"Whether the grant is a fixed amount per company, or issued once per license the company holds. Defaults to fixed."},"tier_mode":{"oneOf":[{"$ref":"#/components/schemas/BillingTiersMode"},{"type":"null"}],"description":"How price_tiers apply: volume prices every credit at the rate of the tier the total lands in, graduated prices each tier's own credits at its own rate. Required with price_tiers."},"unit_price":{"type":["integer","null"],"format":"int64","minimum":0,"description":"Price per credit in the plan currency's smallest unit. Required when billing_mode is billed, unless unit_price_decimal or price_tiers is set."},"unit_price_decimal":{"type":["string","null"],"description":"Price per credit as a decimal in the plan currency's smallest unit, for prices below one cent."},"warning_tiers":{"type":["array","null"],"items":{"$ref":"#/components/schemas/PlanCreditGrantWarningTierRequestBody"},"description":"Usage-warning thresholds, in credits remaining in the company's balance (grant, rollover, top-ups and bundles together). Each value must be below the grant amount, and values must be unique. Schematic sends a credit.usage_warning_reached webhook once when the balance drops to each threshold, and again after the balance rises back above it. Omit to leave the thresholds as they are; send an empty list to remove them. At most 5."}},"required":["credit_amount","credit_id","plan_id","reset_cadence","reset_start"],"title":"CreateBillingPlanCreditGrantRequestBody"},"BillingCreditsPlanGrantsPostResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"BillingCreditsPlanGrantsPostResponsesContentApplicationJsonSchemaParams"},"credits_createBillingPlanCreditGrant_Response_201":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BillingPlanCreditGrantResponseData"},"params":{"$ref":"#/components/schemas/BillingCreditsPlanGrantsPostResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"credits_createBillingPlanCreditGrant_Response_201"},"BillingCreditsPlanGrantsPlanGrantIdDeleteResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{"apply_to_existing":{"type":"boolean"}},"description":"Input parameters","title":"BillingCreditsPlanGrantsPlanGrantIdDeleteResponsesContentApplicationJsonSchemaParams"},"credits_deleteBillingPlanCreditGrant_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DeleteResponse"},"params":{"$ref":"#/components/schemas/BillingCreditsPlanGrantsPlanGrantIdDeleteResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"credits_deleteBillingPlanCreditGrant_Response_200"},"AcquireCreditLeaseRequestBody":{"type":"object","properties":{"company_id":{"type":"string"},"credit_type_id":{"type":"string"},"expires_at":{"type":["string","null"],"format":"date-time","description":"When the hold lapses if the lease is never released; defaults to five minutes from now and may be at most one hour out. The unspent hold is refunded on expiry"},"requested_amount":{"type":"number","format":"double","maximum":9999999999},"user_id":{"type":["string","null"],"description":"The user drawing the hold, so a user-scope spend policy applies to it"}},"required":["company_id","credit_type_id","requested_amount"],"title":"AcquireCreditLeaseRequestBody"},"CreditLeaseResponseData":{"type":"object","properties":{"company_id":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"credit_type_id":{"type":"string"},"expires_at":{"type":"string","format":"date-time"},"granted_amount":{"type":"number","format":"double"},"id":{"type":"string"},"released_at":{"type":["string","null"],"format":"date-time"},"tracked_amount":{"type":"number","format":"double"},"updated_at":{"type":"string","format":"date-time"}},"required":["company_id","created_at","credit_type_id","expires_at","granted_amount","id","tracked_amount","updated_at"],"title":"CreditLeaseResponseData"},"BillingCreditsLeasePostResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"BillingCreditsLeasePostResponsesContentApplicationJsonSchemaParams"},"credits_acquireCreditLease_Response_201":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CreditLeaseResponseData"},"params":{"$ref":"#/components/schemas/BillingCreditsLeasePostResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"credits_acquireCreditLease_Response_201"},"ExtendCreditLeaseRequestBody":{"type":"object","properties":{"additional_amount":{"type":"number","format":"double","maximum":9999999999},"expires_at":{"type":["string","null"],"format":"date-time","description":"Pushes the lease's expiry out; may be at most one hour from now. Leave unset to keep the expiry the lease already has"},"idempotency_key":{"type":["string","null"],"maxLength":255,"description":"A caller-chosen key for safe retries: a second request with the same key returns the lease as it stands instead of growing it again. Keys are unique per environment across every extend"},"user_id":{"type":["string","null"],"description":"The user drawing the top-up, so a user-scope spend policy applies to it"}},"required":["additional_amount"],"title":"ExtendCreditLeaseRequestBody"},"BillingCreditsLeaseLeaseIdExtendPutResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"BillingCreditsLeaseLeaseIdExtendPutResponsesContentApplicationJsonSchemaParams"},"credits_extendCreditLease_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CreditLeaseResponseData"},"params":{"$ref":"#/components/schemas/BillingCreditsLeaseLeaseIdExtendPutResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"credits_extendCreditLease_Response_200"},"BillingCreditsLeaseLeaseIdReleasePutResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"BillingCreditsLeaseLeaseIdReleasePutResponsesContentApplicationJsonSchemaParams"},"credits_releaseCreditLease_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CreditLeaseResponseData"},"params":{"$ref":"#/components/schemas/BillingCreditsLeaseLeaseIdReleasePutResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"credits_releaseCreditLease_Response_200"},"AccountMembersGetResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"}},"limit":{"type":"integer","format":"int64","minimum":0,"maximum":250,"description":"Page limit (default 100)"},"offset":{"type":"integer","format":"int64","description":"Page offset (default 0)"},"q":{"type":"string","maxLength":512,"description":"Search filter"},"role":{"$ref":"#/components/schemas/AccountMemberRole","description":"Filter by member role"}},"description":"Input parameters","title":"AccountMembersGetResponsesContentApplicationJsonSchemaParams"},"accounts_listAccountMembers_Response_200":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AccountMemberResponseData"}},"params":{"$ref":"#/components/schemas/AccountMembersGetResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"accounts_listAccountMembers_Response_200"},"AccountMembersAccountMemberIdGetResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{},"description":"Input parameters","title":"AccountMembersAccountMemberIdGetResponsesContentApplicationJsonSchemaParams"},"accounts_getAccountMember_Response_200":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AccountMemberResponseData"},"params":{"$ref":"#/components/schemas/AccountMembersAccountMemberIdGetResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"accounts_getAccountMember_Response_200"},"TimeSeriesGranularity":{"type":"string","enum":["daily","hourly","monthly","weekly"],"title":"TimeSeriesGranularity"},"FeatureUsageHistoryResponseData":{"type":"object","properties":{"company_id":{"type":"string","description":"Companies are identified by ID only. To report against your own identifiers, resolve them once via the companies API and cache the mapping; keys are not repeated on every row."},"event_subtype":{"type":"string"},"feature_id":{"type":"string"},"period_end":{"type":"string","format":"date-time","description":"Exclusive end of the period this usage covers"},"period_start":{"type":"string","format":"date-time","description":"Inclusive start of the period this usage covers"},"usage":{"type":"integer","format":"int64","description":"Usage recorded within this period; an incremental total, not a running one"}},"required":["company_id","event_subtype","feature_id","period_end","period_start","usage"],"title":"FeatureUsageHistoryResponseData"},"FeatureUsageHistoryGetResponsesContentApplicationJsonSchemaParams":{"type":"object","properties":{"company_ids":{"type":"array","items":{"type":"string"},"description":"Restrict to these company IDs; omit for every company in the environment"},"end_time":{"type":"string","format":"date-time","description":"Exclusive end of the window; must fall on an hour boundary"},"feature_ids":{"type":"array","items":{"type":"string"},"description":"Restrict to these event features; omit for every event feature in the environment. Where several features measure the same event, each is reported separately and a page may carry more rows than the requested limit"},"granularity":{"$ref":"#/components/schemas/TimeSeriesGranularity","description":"Bucket the window; omit for a single total per company and feature"},"limit":{"type":"integer","format":"int64","minimum":0,"maximum":250,"description":"Page limit (default 100)"},"offset":{"type":"integer","format":"int64","description":"Page offset (default 0)"},"start_time":{"type":"string","format":"date-time","description":"Inclusive start of the window; must fall on an hour boundary"}},"description":"Input parameters","title":"FeatureUsageHistoryGetResponsesContentApplicationJsonSchemaParams"},"entitlements_listFeatureUsageHistory_Response_200":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/FeatureUsageHistoryResponseData"}},"params":{"$ref":"#/components/schemas/FeatureUsageHistoryGetResponsesContentApplicationJsonSchemaParams","description":"Input parameters"}},"required":["data","params"],"title":"entitlements_listFeatureUsageHistory_Response_200"}},"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-Schematic-Api-Key"}}}}