{"openapi":"3.1.0","paths":{"/v1/api-tokens":{"get":{"operationId":"apiTokens.list","parameters":[{"name":"limit","required":false,"in":"query","schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"description":"Page size (1 to 200)."},{"name":"cursor","required":false,"in":"query","schema":{"type":"string","maxLength":512},"description":"Opaque cursor from the previous page's `next_cursor`. Omit for the first page."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiTokenList"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"List API tokens (own, or all for Owner/Admin)","tags":["API tokens"],"description":"List API tokens (own, or all for Owner/Admin).\n\nRequires permission `api_token:manage`. Session only: this permission cannot be granted to API tokens.","x-required-scope":"api_token:manage","x-api-token":false},"post":{"operationId":"apiTokens.create","parameters":[{"$ref":"#/components/parameters/DarkshipOrgId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiTokenCreate"},"example":{"name":"CI deploy","scopes":["flag:read","flag:write"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiTokenWithSecret"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Unprocessable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Create a scoped API token. The secret is returned once.","tags":["API tokens"],"description":"Create a scoped API token. The secret is returned once.\n\nA token never holds more permissions than its creator and stops working if the creator leaves the organization.\n\nRequires permission `api_token:manage`. Session only: this permission cannot be granted to API tokens.","x-required-scope":"api_token:manage","x-api-token":false}},"/v1/api-tokens/{tokenId}":{"delete":{"operationId":"apiTokens.revoke","parameters":[{"name":"tokenId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"API token id."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"204":{"description":"Success"},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Revoke an API token","tags":["API tokens"],"description":"Revoke an API token.\n\nRequires permission `api_token:manage`. Session only: this permission cannot be granted to API tokens.","x-required-scope":"api_token:manage","x-api-token":false}},"/v1/audit-log":{"get":{"operationId":"auditLog.list","parameters":[{"name":"limit","required":false,"in":"query","schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"description":"Page size (1 to 200)."},{"name":"cursor","required":false,"in":"query","schema":{"type":"string","maxLength":512},"description":"Opaque cursor from the previous page's `next_cursor`. Omit for the first page."},{"name":"actor_id","required":false,"in":"query","schema":{"type":"string","maxLength":200},"description":"Only entries made by this user or token."},{"name":"actor_type","required":false,"in":"query","schema":{"type":"string","enum":["USER","API_TOKEN","SYSTEM"]},"description":"Only entries made by this kind of actor."},{"name":"action","required":false,"in":"query","schema":{"type":"string","maxLength":100},"description":"Only entries with this action, e.g. `flag.updated`."},{"name":"resource_type","required":false,"in":"query","schema":{"type":"string","maxLength":100},"description":"Only entries about this kind of resource."},{"name":"resource_id","required":false,"in":"query","schema":{"type":"string","maxLength":200},"description":"Only entries about this resource."},{"name":"project_id","required":false,"in":"query","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Only items of this project."},{"name":"environment_id","required":false,"in":"query","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Only items of this environment."},{"name":"from","required":false,"in":"query","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"description":"Start of the time range (ISO-8601, inclusive)."},{"name":"to","required":false,"in":"query","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"description":"End of the time range (ISO-8601, exclusive)."},{"name":"q","required":false,"in":"query","schema":{"type":"string","minLength":2,"maxLength":100},"description":"Case-insensitive text search."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditLogPage"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Query the audit log (newest first, cursor pagination)","tags":["Audit log"],"description":"Query the audit log (newest first, cursor pagination).\n\nFilter by actor, action, resource and time range. Pagination is by cursor, newest first.\n\nRequires permission `audit:read` (role of the member, or scope of the API token).","x-required-scope":"audit:read","x-api-token":true}},"/v1/orgs/{orgId}/billing":{"get":{"operationId":"billing.get","parameters":[{"name":"orgId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Organization id."}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingGetResponse"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Plan, subscription status, usage against limits and invoices","tags":["Billing"],"description":"Plan, subscription status, usage against limits and invoices.\n\nRequires permission `billing:manage`. Session only: this permission cannot be granted to API tokens.","x-required-scope":"billing:manage","x-api-token":false}},"/v1/orgs/{orgId}/billing/checkout":{"post":{"operationId":"billing.checkout","parameters":[{"name":"orgId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Organization id."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingCheckoutRequest"},"example":{"plan":"pro","interval":"month"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingCheckoutResponse"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Service unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Start a Stripe Checkout Session (subscription)","tags":["Billing"],"description":"Start a Stripe Checkout Session (subscription).\n\nRequires permission `billing:manage`. Session only: this permission cannot be granted to API tokens.","x-required-scope":"billing:manage","x-api-token":false}},"/v1/orgs/{orgId}/billing/portal":{"post":{"operationId":"billing.portal","parameters":[{"name":"orgId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Organization id."}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingCheckoutResponse"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Service unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Open the Stripe Customer Portal (payment method, invoices, plan change, cancellation)","tags":["Billing"],"description":"Open the Stripe Customer Portal (payment method, invoices, plan change, cancellation).\n\nRequires permission `billing:manage`. Session only: this permission cannot be granted to API tokens.","x-required-scope":"billing:manage","x-api-token":false}},"/v1/plans":{"get":{"operationId":"plans.list","parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlansListResponse"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"summary":"Public plan catalogue (prices and limits are placeholders until `pricing_is_placeholder` is false)","tags":["Billing"],"description":"Public plan catalogue (prices and limits are placeholders until `pricing_is_placeholder` is false).\n\nNo authentication."}},"/v1/webhooks/stripe":{"post":{"operationId":"stripeWebhook.receive","parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StripeWebhookReceiveResponse"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Service unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"summary":"Stripe webhook receiver (signature verified, idempotent by event id)","tags":["Billing"],"description":"Stripe webhook receiver (signature verified, idempotent by event id).\n\nNo authentication."}},"/v1/projects/{projectId}/environments":{"get":{"operationId":"environments.list","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnvironmentList"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"List a project's environments in order","tags":["Environments"],"description":"List a project's environments in order.\n\nRequires permission `environment:read` (role of the member, or scope of the API token).","x-required-scope":"environment:read","x-api-token":true},"post":{"operationId":"environments.create","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnvironmentCreate"},"example":{"name":"QA","key":"qa","color":"#7c3aed","require_confirm":false,"require_reason":false}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Environment"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"Plan limit or payment required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Create an environment","tags":["Environments"],"description":"Create an environment.\n\nRequires permission `environment:manage` (role of the member, or scope of the API token).","x-required-scope":"environment:manage","x-api-token":true}},"/v1/projects/{projectId}/environments/order":{"put":{"operationId":"environments.reorder","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnvironmentsReorderRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnvironmentList"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Unprocessable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Set the display order of the environments","tags":["Environments"],"description":"Set the display order of the environments.\n\nRequires permission `environment:manage` (role of the member, or scope of the API token).","x-required-scope":"environment:manage","x-api-token":true}},"/v1/projects/{projectId}/environments/{envId}":{"get":{"operationId":"environments.get","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"envId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Environment id."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Environment"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Get an environment","tags":["Environments"],"description":"Get an environment.\n\nRequires permission `environment:read` (role of the member, or scope of the API token).","x-required-scope":"environment:read","x-api-token":true},"patch":{"operationId":"environments.update","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"envId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Environment id."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnvironmentsUpdateRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Environment"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Update an environment's name or colour","tags":["Environments"],"description":"Update an environment's name or colour.\n\nRequires permission `environment:manage` (role of the member, or scope of the API token).","x-required-scope":"environment:manage","x-api-token":true},"delete":{"operationId":"environments.remove","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"envId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Environment id."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"204":{"description":"Success"},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Delete an environment","tags":["Environments"],"description":"Delete an environment.\n\nRequires permission `environment:manage` (role of the member, or scope of the API token).","x-required-scope":"environment:manage","x-api-token":true}},"/v1/projects/{projectId}/flags":{"get":{"operationId":"flags.list","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"limit","required":false,"in":"query","schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"description":"Page size (1 to 200)."},{"name":"cursor","required":false,"in":"query","schema":{"type":"string","maxLength":512},"description":"Opaque cursor from the previous page's `next_cursor`. Omit for the first page."},{"name":"q","required":false,"in":"query","schema":{"type":"string","maxLength":120},"description":"Case-insensitive text search."},{"name":"tag","required":false,"in":"query","schema":{"type":"string","maxLength":40},"description":"Only items carrying this tag."},{"name":"type","required":false,"in":"query","schema":{"type":"string","enum":["boolean","string","int","float","json","date"]},"description":"Only flags of this type."},{"name":"archived","required":false,"in":"query","schema":{"default":"false","type":"string","enum":["true","false","all"]},"description":"`false` (default) hides archived flags, `true` lists only archived ones, `all` lists both."},{"name":"include","required":false,"in":"query","schema":{"type":"string","maxLength":60},"description":"Comma-separated expansions, e.g. `environments` to embed the per-environment state."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagPage"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"List flags of a project","tags":["Flags"],"description":"List flags of a project.\n\nRequires permission `flag:read` (role of the member, or scope of the API token).","x-required-scope":"flag:read","x-api-token":true},"post":{"operationId":"flags.create","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"Idempotency-Key","in":"header","description":"Up to 255 printable ASCII characters. A replay within 24 h returns the original response; the same key with a different request answers 409 `idempotency_key_conflict`.","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/DarkshipOrgId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagCreate"},"example":{"key":"new-checkout-flow","name":"New checkout flow","type":"boolean","description":"Single-page checkout","tags":["checkout"],"temporary":true,"client_side":false}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Flag"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"Plan limit or payment required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Create a flag (type is fixed at creation). Supports Idempotency-Key.","tags":["Flags"],"description":"Create a flag (type is fixed at creation). Supports Idempotency-Key.\n\nCreates the flag in every environment of the project, switched off and serving its off variation. Boolean flags get `true`/`false` variations when none are given. Send an `Idempotency-Key` to retry safely.\n\nRequires permission `flag:write` (role of the member, or scope of the API token).","x-required-scope":"flag:write","x-api-token":true}},"/v1/projects/{projectId}/flags/{flagKey}":{"get":{"operationId":"flags.get","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"flagKey","required":true,"in":"path","schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},"description":"Flag key (unique within the project, fixed at creation)."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Flag"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Get a flag. Returns an ETag.","tags":["Flags"],"description":"Get a flag. Returns an ETag.\n\nRequires permission `flag:read` (role of the member, or scope of the API token).","x-required-scope":"flag:read","x-api-token":true},"patch":{"operationId":"flags.update","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"flagKey","required":true,"in":"path","schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},"description":"Flag key (unique within the project, fixed at creation)."},{"name":"If-Match","in":"header","description":"ETag of the version being changed. A stale value answers 412 `precondition_failed`.","required":false,"schema":{"type":"string"}},{"name":"Darkship-Confirm-Production","in":"header","description":"`true` confirms a change to a production environment (also accepted as `?confirm=true`). Required for Developers; Owners and Admins are not asked.","required":false,"schema":{"type":"string","enum":["true"]}},{"$ref":"#/components/parameters/DarkshipOrgId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagUpdate"},"example":{"name":"New checkout flow (v2)","tags":["checkout","q4"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Flag"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"412":{"description":"Precondition failed (stale ETag)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Unprocessable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"428":{"description":"Production confirmation required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Update flag metadata and variations. If-Match is honoured (412). Variation or client-side changes by a Developer need production confirmation.","tags":["Flags"],"description":"Update flag metadata and variations. If-Match is honoured (412). Variation or client-side changes by a Developer need production confirmation.\n\nSend only the fields you change. Variations in use by a rule or target cannot be removed (409 `variation_in_use`).\n\nRequires permission `flag:write` (role of the member, or scope of the API token).","x-required-scope":"flag:write","x-api-token":true},"delete":{"operationId":"flags.remove","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"flagKey","required":true,"in":"path","schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},"description":"Flag key (unique within the project, fixed at creation)."},{"name":"reason","required":false,"in":"query","schema":{"type":"string","minLength":5,"maxLength":500},"description":"Why the change is made (5 to 500 characters). Recorded in the audit log; required where the environment demands a reason."},{"name":"Darkship-Confirm-Production","in":"header","description":"`true` confirms a change to a production environment (also accepted as `?confirm=true`). Required for Developers; Owners and Admins are not asked.","required":false,"schema":{"type":"string","enum":["true"]}},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"204":{"description":"Success"},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"428":{"description":"Production confirmation required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Delete a flag. Flags are soft-deleted (same as archive) so history and audit stay intact. Optional `reason` query.","tags":["Flags"],"description":"Delete a flag. Flags are soft-deleted (same as archive) so history and audit stay intact. Optional `reason` query.\n\nA soft delete: the flag leaves every snapshot, its history stays, and it can be restored.\n\nRequires permission `flag:delete` (role of the member, or scope of the API token).","x-required-scope":"flag:delete","x-api-token":true}},"/v1/projects/{projectId}/flags/{flagKey}/archive":{"post":{"operationId":"flags.archive","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"flagKey","required":true,"in":"path","schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},"description":"Flag key (unique within the project, fixed at creation)."},{"name":"Darkship-Confirm-Production","in":"header","description":"`true` confirms a change to a production environment (also accepted as `?confirm=true`). Required for Developers; Owners and Admins are not asked.","required":false,"schema":{"type":"string","enum":["true"]}},{"$ref":"#/components/parameters/DarkshipOrgId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagsArchiveRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Flag"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"428":{"description":"Production confirmation required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Archive a flag: it leaves every snapshot and can be restored","tags":["Flags"],"description":"Archive a flag: it leaves every snapshot and can be restored.\n\nRequires permission `flag:delete` (role of the member, or scope of the API token).","x-required-scope":"flag:delete","x-api-token":true}},"/v1/projects/{projectId}/flags/{flagKey}/restore":{"post":{"operationId":"flags.restore","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"flagKey","required":true,"in":"path","schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},"description":"Flag key (unique within the project, fixed at creation)."},{"name":"Darkship-Confirm-Production","in":"header","description":"`true` confirms a change to a production environment (also accepted as `?confirm=true`). Required for Developers; Owners and Admins are not asked.","required":false,"schema":{"type":"string","enum":["true"]}},{"$ref":"#/components/parameters/DarkshipOrgId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagsArchiveRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Flag"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"428":{"description":"Production confirmation required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Restore an archived flag","tags":["Flags"],"description":"Restore an archived flag.\n\nRequires permission `flag:delete` (role of the member, or scope of the API token).","x-required-scope":"flag:delete","x-api-token":true}},"/v1/projects/{projectId}/flags/{flagKey}/history":{"get":{"operationId":"flags.listHistory","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"flagKey","required":true,"in":"path","schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},"description":"Flag key (unique within the project, fixed at creation)."},{"name":"limit","required":false,"in":"query","schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"description":"Page size (1 to 200)."},{"name":"cursor","required":false,"in":"query","schema":{"type":"string","maxLength":512},"description":"Opaque cursor from the previous page's `next_cursor`. Omit for the first page."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagsListHistoryResponse"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Revision history of a flag (flag-level and per-environment), newest first","tags":["Flags"],"description":"Revision history of a flag (flag-level and per-environment), newest first.\n\nRequires permission `flag:read` (role of the member, or scope of the API token).","x-required-scope":"flag:read","x-api-token":true}},"/v1/projects/{projectId}/flags/{flagKey}/history/{historyId}":{"get":{"operationId":"flags.getHistory","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"flagKey","required":true,"in":"path","schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},"description":"Flag key (unique within the project, fixed at creation)."},{"name":"historyId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Revision id from the history list."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagsGetHistoryResponse"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"One revision with its stored state","tags":["Flags"],"description":"One revision with its stored state.\n\nRequires permission `flag:read` (role of the member, or scope of the API token).","x-required-scope":"flag:read","x-api-token":true}},"/v1/projects/{projectId}/flags/{flagKey}/history/{historyId}/restore":{"post":{"operationId":"flags.restoreHistory","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"flagKey","required":true,"in":"path","schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},"description":"Flag key (unique within the project, fixed at creation)."},{"name":"historyId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Revision id from the history list."},{"name":"If-Match","in":"header","description":"ETag of the version being changed. A stale value answers 412 `precondition_failed`.","required":false,"schema":{"type":"string"}},{"name":"Darkship-Confirm-Production","in":"header","description":"`true` confirms a change to a production environment (also accepted as `?confirm=true`). Required for Developers; Owners and Admins are not asked.","required":false,"schema":{"type":"string","enum":["true"]}},{"$ref":"#/components/parameters/DarkshipOrgId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagsArchiveRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Flag"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"412":{"description":"Precondition failed (stale ETag)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"428":{"description":"Production confirmation required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Restore the descriptive fields of a flag-level revision as a new revision","tags":["Flags"],"description":"Restore the descriptive fields of a flag-level revision as a new revision.\n\nRequires permission `flag:write` (role of the member, or scope of the API token).","x-required-scope":"flag:write","x-api-token":true}},"/v1/projects/{projectId}/flags/{flagKey}/environments/{envId}":{"get":{"operationId":"flagConfig.get","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"flagKey","required":true,"in":"path","schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},"description":"Flag key (unique within the project, fixed at creation)."},{"name":"envId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Environment id."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagEnvironmentConfig"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"State of a flag in one environment: toggle, targets, rules, rollout. Returns an ETag.","tags":["Flag environments"],"description":"State of a flag in one environment: toggle, targets, rules, rollout. Returns an ETag.\n\nRequires permission `flag:read` (role of the member, or scope of the API token).","x-required-scope":"flag:read","x-api-token":true},"put":{"operationId":"flagConfig.replace","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"flagKey","required":true,"in":"path","schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},"description":"Flag key (unique within the project, fixed at creation)."},{"name":"envId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Environment id."},{"name":"If-Match","in":"header","description":"ETag of the version being changed. A stale value answers 412 `precondition_failed`.","required":false,"schema":{"type":"string"}},{"name":"Darkship-Confirm-Production","in":"header","description":"`true` confirms a change to a production environment (also accepted as `?confirm=true`). Required for Developers; Owners and Admins are not asked.","required":false,"schema":{"type":"string","enum":["true"]}},{"$ref":"#/components/parameters/DarkshipOrgId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagEnvironmentConfigInput"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagEnvironmentConfig"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"412":{"description":"Precondition failed (stale ETag)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Unprocessable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"428":{"description":"Production confirmation required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Replace the environment configuration. If-Match is honoured (412); production edits by a Developer need confirmation (428).","tags":["Flag environments"],"description":"Replace the environment configuration. If-Match is honoured (412); production edits by a Developer need confirmation (428).\n\nReplaces targets, rules, fallthrough and off variation in one revision. Send the `ETag` from the GET as `If-Match`.\n\nRequires permission `flag:write` (role of the member, or scope of the API token).","x-required-scope":"flag:write","x-api-token":true},"patch":{"operationId":"flagConfig.patch","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"flagKey","required":true,"in":"path","schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},"description":"Flag key (unique within the project, fixed at creation)."},{"name":"envId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Environment id."},{"name":"If-Match","in":"header","description":"ETag of the version being changed. A stale value answers 412 `precondition_failed`.","required":false,"schema":{"type":"string"}},{"name":"Darkship-Confirm-Production","in":"header","description":"`true` confirms a change to a production environment (also accepted as `?confirm=true`). Required for Developers; Owners and Admins are not asked.","required":false,"schema":{"type":"string","enum":["true"]}},{"$ref":"#/components/parameters/DarkshipOrgId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagEnvironmentConfigPatch"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagEnvironmentConfig"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"412":{"description":"Precondition failed (stale ETag)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Unprocessable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"428":{"description":"Production confirmation required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Partially update the environment configuration (only the given fields change)","tags":["Flag environments"],"description":"Partially update the environment configuration (only the given fields change).\n\nRequires permission `flag:write` (role of the member, or scope of the API token).","x-required-scope":"flag:write","x-api-token":true}},"/v1/projects/{projectId}/flags/{flagKey}/environments/{envId}/toggle":{"post":{"operationId":"flagConfig.toggle","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"flagKey","required":true,"in":"path","schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},"description":"Flag key (unique within the project, fixed at creation)."},{"name":"envId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Environment id."},{"name":"If-Match","in":"header","description":"ETag of the version being changed. A stale value answers 412 `precondition_failed`.","required":false,"schema":{"type":"string"}},{"name":"Darkship-Confirm-Production","in":"header","description":"`true` confirms a change to a production environment (also accepted as `?confirm=true`). Required for Developers; Owners and Admins are not asked.","required":false,"schema":{"type":"string","enum":["true"]}},{"$ref":"#/components/parameters/DarkshipOrgId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagToggle"},"example":{"enabled":true,"reason":"Launch to everyone"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagEnvironmentConfig"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"412":{"description":"Precondition failed (stale ETag)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"428":{"description":"Production confirmation required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Turn the flag on or off in this environment","tags":["Flag environments"],"description":"Turn the flag on or off in this environment.\n\nThe change reaches server SDKs over their stream within seconds. On production a Developer must confirm the change.\n\nRequires permission `flag:write` (role of the member, or scope of the API token).","x-required-scope":"flag:write","x-api-token":true}},"/v1/projects/{projectId}/flags/{flagKey}/environments/{envId}/evaluate-preview":{"post":{"operationId":"flagConfig.evaluatePreview","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"flagKey","required":true,"in":"path","schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},"description":"Flag key (unique within the project, fixed at creation)."},{"name":"envId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Environment id."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluationPreviewRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluationPreview"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Unprocessable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Evaluate a context against the saved configuration or a draft, with the shared evaluator. Nothing is stored.","tags":["Flag environments"],"description":"Evaluate a context against the saved configuration or a draft, with the shared evaluator. Nothing is stored.\n\nUses the same evaluator as the SDKs and the eval service. The context is not stored or logged.\n\nRequires permission `flag:read` (role of the member, or scope of the API token).","x-required-scope":"flag:read","x-api-token":true}},"/v1/projects/{projectId}/flags/{flagKey}/environments/{envId}/targets/import/preview":{"post":{"operationId":"flagConfig.importPreview","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"flagKey","required":true,"in":"path","schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},"description":"Flag key (unique within the project, fixed at creation)."},{"name":"envId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Environment id."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagConfigImportPreviewRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagConfigImportPreviewResponse"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Preview a paste/CSV import into a target list: added, duplicates, invalid, over limit","tags":["Flag environments"],"description":"Preview a paste/CSV import into a target list: added, duplicates, invalid, over limit.\n\nRequires permission `flag:write` (role of the member, or scope of the API token).","x-required-scope":"flag:write","x-api-token":true}},"/v1/projects/{projectId}/flags/{flagKey}/environments/{envId}/targets/import":{"post":{"operationId":"flagConfig.importApply","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"flagKey","required":true,"in":"path","schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},"description":"Flag key (unique within the project, fixed at creation)."},{"name":"envId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Environment id."},{"name":"If-Match","in":"header","description":"ETag of the version being changed. A stale value answers 412 `precondition_failed`.","required":false,"schema":{"type":"string"}},{"name":"Darkship-Confirm-Production","in":"header","description":"`true` confirms a change to a production environment (also accepted as `?confirm=true`). Required for Developers; Owners and Admins are not asked.","required":false,"schema":{"type":"string","enum":["true"]}},{"name":"Idempotency-Key","in":"header","description":"Up to 255 printable ASCII characters. A replay within 24 h returns the original response; the same key with a different request answers 409 `idempotency_key_conflict`.","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/DarkshipOrgId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagConfigImportPreviewRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagConfigImportPreviewResponse"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"412":{"description":"Precondition failed (stale ETag)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Unprocessable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"428":{"description":"Production confirmation required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Apply a paste/CSV import. Refused (422) when it exceeds the plan limit; entries are never truncated. Supports Idempotency-Key.","tags":["Flag environments"],"description":"Apply a paste/CSV import. Refused (422) when it exceeds the plan limit; entries are never truncated. Supports Idempotency-Key.\n\nRequires permission `flag:write` (role of the member, or scope of the API token).","x-required-scope":"flag:write","x-api-token":true}},"/v1/projects/{projectId}/flags/{flagKey}/environments/{envId}/history":{"get":{"operationId":"flagConfig.listHistory","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"flagKey","required":true,"in":"path","schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},"description":"Flag key (unique within the project, fixed at creation)."},{"name":"envId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Environment id."},{"name":"limit","required":false,"in":"query","schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"description":"Page size (1 to 200)."},{"name":"cursor","required":false,"in":"query","schema":{"type":"string","maxLength":512},"description":"Opaque cursor from the previous page's `next_cursor`. Omit for the first page."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagsListHistoryResponse"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Configuration revisions of this flag in this environment","tags":["Flag environments"],"description":"Configuration revisions of this flag in this environment.\n\nRequires permission `flag:read` (role of the member, or scope of the API token).","x-required-scope":"flag:read","x-api-token":true}},"/v1/projects/{projectId}/flags/{flagKey}/environments/{envId}/history/{historyId}/restore":{"post":{"operationId":"flagConfig.restore","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"flagKey","required":true,"in":"path","schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},"description":"Flag key (unique within the project, fixed at creation)."},{"name":"envId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Environment id."},{"name":"historyId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Revision id from the history list."},{"name":"If-Match","in":"header","description":"ETag of the version being changed. A stale value answers 412 `precondition_failed`.","required":false,"schema":{"type":"string"}},{"name":"Darkship-Confirm-Production","in":"header","description":"`true` confirms a change to a production environment (also accepted as `?confirm=true`). Required for Developers; Owners and Admins are not asked.","required":false,"schema":{"type":"string","enum":["true"]}},{"$ref":"#/components/parameters/DarkshipOrgId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagsArchiveRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagEnvironmentConfig"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"412":{"description":"Precondition failed (stale ETag)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Unprocessable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"428":{"description":"Production confirmation required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Restore a stored configuration revision as a new revision","tags":["Flag environments"],"description":"Restore a stored configuration revision as a new revision.\n\nRequires permission `flag:write` (role of the member, or scope of the API token).","x-required-scope":"flag:write","x-api-token":true}},"/v1/invitations":{"get":{"operationId":"invitations.list","parameters":[{"name":"limit","required":false,"in":"query","schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"description":"Page size (1 to 200)."},{"name":"cursor","required":false,"in":"query","schema":{"type":"string","maxLength":512},"description":"Opaque cursor from the previous page's `next_cursor`. Omit for the first page."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationsListResponse"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"List invitations","tags":["Invitations"],"description":"List invitations.\n\nRequires permission `member:manage`. Session only: this permission cannot be granted to API tokens.","x-required-scope":"member:manage","x-api-token":false},"post":{"operationId":"invitations.create","parameters":[{"$ref":"#/components/parameters/DarkshipOrgId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationCreate"},"example":{"email":"ana@example.com","role":"DEVELOPER"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationsCreateResponse"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"Plan limit or payment required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Unprocessable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Invite someone by email","tags":["Invitations"],"description":"Invite someone by email.\n\nRequires permission `member:manage`. Session only: this permission cannot be granted to API tokens.","x-required-scope":"member:manage","x-api-token":false}},"/v1/invitations/accept":{"post":{"operationId":"invitations.accept","parameters":[{"$ref":"#/components/parameters/DarkshipOrgId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationsAcceptRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationsAcceptResponse"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Accept an invitation","tags":["Invitations"],"description":"Accept an invitation.\n\nSession only: any signed-in user (API tokens are not accepted).","x-api-token":false}},"/v1/invitations/{invitationId}":{"delete":{"operationId":"invitations.revoke","parameters":[{"name":"invitationId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Invitation id."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"204":{"description":"Success"},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Revoke a pending invitation","tags":["Invitations"],"description":"Revoke a pending invitation.\n\nRequires permission `member:manage`. Session only: this permission cannot be granted to API tokens.","x-required-scope":"member:manage","x-api-token":false}},"/v1/members":{"get":{"operationId":"members.list","parameters":[{"name":"limit","required":false,"in":"query","schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"description":"Page size (1 to 200)."},{"name":"cursor","required":false,"in":"query","schema":{"type":"string","maxLength":512},"description":"Opaque cursor from the previous page's `next_cursor`. Omit for the first page."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberPage"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"List organization members","tags":["Members"],"description":"List organization members.\n\nRequires permission `member:read`. Session only: this permission cannot be granted to API tokens.","x-required-scope":"member:read","x-api-token":false}},"/v1/members/{memberId}":{"patch":{"operationId":"members.update","parameters":[{"name":"memberId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Member id."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MembersUpdateRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MembersUpdateResponse"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Unprocessable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Change a member's role or scope","tags":["Members"],"description":"Change a member's role or scope.\n\nRequires permission `member:manage`. Session only: this permission cannot be granted to API tokens.","x-required-scope":"member:manage","x-api-token":false},"delete":{"operationId":"members.remove","parameters":[{"name":"memberId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Member id."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"204":{"description":"Success"},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Remove a member","tags":["Members"],"description":"Remove a member.\n\nRequires permission `member:manage`. Session only: this permission cannot be granted to API tokens.","x-required-scope":"member:manage","x-api-token":false}},"/v1/roles":{"get":{"operationId":"roles.list","parameters":[{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleCatalogue"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Role catalogue: label, description, scopability and the permissions each role holds","tags":["Members"],"description":"Role catalogue: label, description, scopability and the permissions each role holds.\n\nThe permission strings listed here are the values of `x-required-scope` on each operation and of API token `scopes`.\n\nSession only: any signed-in user (API tokens are not accepted).","x-api-token":false}},"/v1/organizations":{"get":{"operationId":"organizations.list","parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationsListResponse"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"List the organizations you belong to","tags":["Organizations"],"description":"List the organizations you belong to.\n\nSession only: any signed-in user (API tokens are not accepted).","x-api-token":false},"post":{"operationId":"organizations.create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationsCreateRequest"},"example":{"name":"Acme","slug":"acme"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Unprocessable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Create an organization (you become its Owner)","tags":["Organizations"],"description":"Create an organization (you become its Owner).\n\nSession only: any signed-in user (API tokens are not accepted).","x-api-token":false}},"/v1/organizations/{orgId}":{"get":{"operationId":"organizations.get","parameters":[{"name":"orgId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Organization id."}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Get an organization","tags":["Organizations"],"description":"Get an organization.\n\nRequires permission `org:read` (role of the member, or scope of the API token).","x-required-scope":"org:read","x-api-token":true},"patch":{"operationId":"organizations.update","parameters":[{"name":"orgId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Organization id."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationsUpdateRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Rename an organization or change its slug","tags":["Organizations"],"description":"Rename an organization or change its slug.\n\nRequires permission `org:manage`. Session only: this permission cannot be granted to API tokens.","x-required-scope":"org:manage","x-api-token":false},"delete":{"operationId":"organizationDeletion.remove","parameters":[{"name":"orgId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Organization id."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationDeletionRemoveRequest"}}}},"responses":{"202":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Schedule the deletion of an organization (Owner only). Needs the typed organization name, your current password and, with MFA enabled, a recent MFA sign-in. The organization becomes read-only for 30 days (SDK keys keep serving), then it is erased.","tags":["Organizations"],"description":"Schedule the deletion of an organization (Owner only). Needs the typed organization name, your current password and, with MFA enabled, a recent MFA sign-in. The organization becomes read-only for 30 days (SDK keys keep serving), then it is erased.\n\nRequires permission `org:manage`. Session only: this permission cannot be granted to API tokens.","x-required-scope":"org:manage","x-api-token":false}},"/v1/organizations/{orgId}/transfer-ownership":{"post":{"operationId":"organizations.transfer","parameters":[{"name":"orgId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Organization id."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationsTransferRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationsTransferResponse"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Transfer ownership to an existing member (Owner only; you become Admin). Needs a recent MFA sign-in when MFA is enabled.","tags":["Organizations"],"description":"Transfer ownership to an existing member (Owner only; you become Admin). Needs a recent MFA sign-in when MFA is enabled.\n\nRequires permission `org:transfer`. Session only: this permission cannot be granted to API tokens.","x-required-scope":"org:transfer","x-api-token":false}},"/v1/organizations/{orgId}/deletion":{"post":{"operationId":"organizationDeletion.schedule","parameters":[{"name":"orgId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Organization id."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationDeletionRemoveRequest"}}}},"responses":{"202":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Schedule the deletion of an organization (Owner only). Needs the typed organization name, your current password and, with MFA enabled, a recent MFA sign-in. The organization becomes read-only for 30 days (SDK keys keep serving), then it is erased.","tags":["Organizations"],"description":"Schedule the deletion of an organization (Owner only). Needs the typed organization name, your current password and, with MFA enabled, a recent MFA sign-in. The organization becomes read-only for 30 days (SDK keys keep serving), then it is erased.\n\nRequires permission `org:manage`. Session only: this permission cannot be granted to API tokens.","x-required-scope":"org:manage","x-api-token":false}},"/v1/organizations/{orgId}/restore":{"post":{"operationId":"organizationDeletion.restore","parameters":[{"name":"orgId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Organization id."}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Restore an organization scheduled for deletion (Owner only, inside the 30-day regret window).","tags":["Organizations"],"description":"Restore an organization scheduled for deletion (Owner only, inside the 30-day regret window).\n\nRequires permission `org:manage`. Session only: this permission cannot be granted to API tokens.","x-required-scope":"org:manage","x-api-token":false}},"/v1/me":{"get":{"operationId":"me.get","parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"The signed-in user and their organizations","tags":["Account"],"description":"The signed-in user and their organizations.\n\nSession only: any signed-in user (API tokens are not accepted).","x-api-token":false}},"/v1/me/token":{"get":{"operationId":"me.token","parameters":[{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeTokenResponse"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"The API token making this call and its organization","tags":["Account"],"description":"The API token making this call and its organization.\n\nAPI token only (`Authorization: Bearer ds_pat_...`); no permission scope needed. Session callers get 403 `api_token_required`.","x-api-token":true}},"/v1/platform/status":{"get":{"operationId":"platformStatus.status","parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformStatusStatusResponse"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"summary":"Public platform status: maintenance banner, announcements, read-only mode and sign-up availability","tags":["Platform"],"description":"Public platform status: maintenance banner, announcements, read-only mode and sign-up availability.\n\nNo authentication."}},"/v1/projects":{"get":{"operationId":"projects.list","parameters":[{"name":"limit","required":false,"in":"query","schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"description":"Page size (1 to 200)."},{"name":"cursor","required":false,"in":"query","schema":{"type":"string","maxLength":512},"description":"Opaque cursor from the previous page's `next_cursor`. Omit for the first page."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectPage"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"List projects","tags":["Projects"],"description":"List projects.\n\nRequires permission `project:read` (role of the member, or scope of the API token).","x-required-scope":"project:read","x-api-token":true},"post":{"operationId":"projects.create","parameters":[{"$ref":"#/components/parameters/DarkshipOrgId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectCreate"},"example":{"name":"Web app","key":"web-app","description":"Customer-facing storefront"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"Plan limit or payment required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Create a project with the default dev/staging/prod environments","tags":["Projects"],"description":"Create a project with the default dev/staging/prod environments.\n\nRequires permission `project:manage` (role of the member, or scope of the API token).","x-required-scope":"project:manage","x-api-token":true}},"/v1/projects/{projectId}":{"get":{"operationId":"projects.get","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Get a project","tags":["Projects"],"description":"Get a project.\n\nRequires permission `project:read` (role of the member, or scope of the API token).","x-required-scope":"project:read","x-api-token":true},"patch":{"operationId":"projects.update","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectsUpdateRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Update a project","tags":["Projects"],"description":"Update a project.\n\nRequires permission `project:manage` (role of the member, or scope of the API token).","x-required-scope":"project:manage","x-api-token":true},"delete":{"operationId":"projects.remove","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"204":{"description":"Success"},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Delete a project and everything in it","tags":["Projects"],"description":"Delete a project and everything in it.\n\nRequires permission `project:manage` (role of the member, or scope of the API token).","x-required-scope":"project:manage","x-api-token":true}},"/v1/sdk-keys":{"get":{"operationId":"sdkKeys.listOrg","parameters":[{"name":"limit","required":false,"in":"query","schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"description":"Page size (1 to 200)."},{"name":"cursor","required":false,"in":"query","schema":{"type":"string","maxLength":512},"description":"Opaque cursor from the previous page's `next_cursor`. Omit for the first page."},{"name":"project_id","required":false,"in":"query","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Only items of this project."},{"name":"environment_id","required":false,"in":"query","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Only items of this environment."},{"name":"status","required":false,"in":"query","schema":{"type":"string","enum":["active","retiring","retired","revoked","expired"]},"description":"Only items with this status."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SdkKeysListOrgResponse"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"List SDK keys of the whole organization (metadata only) with project/environment keys and 7-day request counts","tags":["SDK keys"],"description":"List SDK keys of the whole organization (metadata only) with project/environment keys and 7-day request counts.\n\nRequires permission `sdk_key:read` (role of the member, or scope of the API token).","x-required-scope":"sdk_key:read","x-api-token":true}},"/v1/projects/{projectId}/environments/{envId}/sdk-keys":{"get":{"operationId":"sdkKeys.list","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"envId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Environment id."},{"name":"limit","required":false,"in":"query","schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"description":"Page size (1 to 200)."},{"name":"cursor","required":false,"in":"query","schema":{"type":"string","maxLength":512},"description":"Opaque cursor from the previous page's `next_cursor`. Omit for the first page."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SdkKeyList"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"List SDK keys of an environment (metadata only)","tags":["SDK keys"],"description":"List SDK keys of an environment (metadata only).\n\nRequires permission `sdk_key:read` (role of the member, or scope of the API token).","x-required-scope":"sdk_key:read","x-api-token":true},"post":{"operationId":"sdkKeys.create","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"envId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Environment id."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SdkKeyCreate"},"example":{"role":"server","name":"checkout-service"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SdkKeyWithSecret"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Create an SDK key. The secret is returned once.","tags":["SDK keys"],"description":"Create an SDK key. The secret is returned once.\n\nThe secret is in the response once and never again; store it in your secret manager.\n\nRequires permission `sdk_key:manage` (role of the member, or scope of the API token).","x-required-scope":"sdk_key:manage","x-api-token":true}},"/v1/sdk-keys/{keyId}/rotate":{"post":{"operationId":"sdkKeys.rotate","parameters":[{"name":"keyId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"SDK key id."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SdkKeyRotate"},"example":{"grace_period_hours":24}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SdkKeyRotation"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Rotate an SDK key; the old one stays valid for the grace period","tags":["SDK keys"],"description":"Rotate an SDK key; the old one stays valid for the grace period.\n\nReturns a new key. The previous key keeps working for `grace_period_hours` so you can roll it out.\n\nRequires permission `sdk_key:manage` (role of the member, or scope of the API token).","x-required-scope":"sdk_key:manage","x-api-token":true}},"/v1/sdk-keys/{keyId}":{"delete":{"operationId":"sdkKeys.revoke","parameters":[{"name":"keyId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"SDK key id."},{"name":"reason","required":false,"in":"query","schema":{"type":"string","maxLength":200},"description":"Why the change is made (5 to 500 characters). Recorded in the audit log; required where the environment demands a reason."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"204":{"description":"Success"},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Revoke an SDK key immediately","tags":["SDK keys"],"description":"Revoke an SDK key immediately.\n\nRequires permission `sdk_key:manage` (role of the member, or scope of the API token).","x-required-scope":"sdk_key:manage","x-api-token":true}},"/v1/projects/{projectId}/segments":{"get":{"operationId":"segments.list","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"limit","required":false,"in":"query","schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"description":"Page size (1 to 200)."},{"name":"cursor","required":false,"in":"query","schema":{"type":"string","maxLength":512},"description":"Opaque cursor from the previous page's `next_cursor`. Omit for the first page."},{"name":"q","required":false,"in":"query","schema":{"type":"string","maxLength":120},"description":"Case-insensitive text search."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentPage"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"List segments of a project","tags":["Segments"],"description":"List segments of a project.\n\nRequires permission `flag:read` (role of the member, or scope of the API token).","x-required-scope":"flag:read","x-api-token":true},"post":{"operationId":"segments.create","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"Idempotency-Key","in":"header","description":"Up to 255 printable ASCII characters. A replay within 24 h returns the original response; the same key with a different request answers 409 `idempotency_key_conflict`.","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/DarkshipOrgId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentCreate"},"example":{"key":"beta-testers","name":"Beta testers","description":"Opted in to early features","included":[{"match_by":"key","values":["usr_marta","usr_joao"]}]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Segment"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Unprocessable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Create a segment (project-wide; every environment snapshot embeds it). Supports Idempotency-Key.","tags":["Segments"],"description":"Create a segment (project-wide; every environment snapshot embeds it). Supports Idempotency-Key.\n\nRequires permission `segment:manage` (role of the member, or scope of the API token).","x-required-scope":"segment:manage","x-api-token":true}},"/v1/projects/{projectId}/segments/{segmentKey}":{"get":{"operationId":"segments.get","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"segmentKey","required":true,"in":"path","schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},"description":"Segment key (unique within the project)."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Segment"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Get a segment. Returns an ETag.","tags":["Segments"],"description":"Get a segment. Returns an ETag.\n\nRequires permission `flag:read` (role of the member, or scope of the API token).","x-required-scope":"flag:read","x-api-token":true},"patch":{"operationId":"segments.update","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"segmentKey","required":true,"in":"path","schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},"description":"Segment key (unique within the project)."},{"name":"If-Match","in":"header","description":"ETag of the version being changed. A stale value answers 412 `precondition_failed`.","required":false,"schema":{"type":"string"}},{"name":"Darkship-Confirm-Production","in":"header","description":"`true` confirms a change to a production environment (also accepted as `?confirm=true`). Required for Developers; Owners and Admins are not asked.","required":false,"schema":{"type":"string","enum":["true"]}},{"$ref":"#/components/parameters/DarkshipOrgId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentUpdate"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Segment"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"412":{"description":"Precondition failed (stale ETag)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Unprocessable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"428":{"description":"Production confirmation required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Update a segment. If-Match is honoured (412); a Developer needs production confirmation (428).","tags":["Segments"],"description":"Update a segment. If-Match is honoured (412); a Developer needs production confirmation (428).\n\nRequires permission `segment:manage` (role of the member, or scope of the API token).","x-required-scope":"segment:manage","x-api-token":true},"delete":{"operationId":"segments.remove","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"segmentKey","required":true,"in":"path","schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},"description":"Segment key (unique within the project)."},{"name":"reason","required":false,"in":"query","schema":{"type":"string","minLength":5,"maxLength":500},"description":"Why the change is made (5 to 500 characters). Recorded in the audit log; required where the environment demands a reason."},{"name":"Darkship-Confirm-Production","in":"header","description":"`true` confirms a change to a production environment (also accepted as `?confirm=true`). Required for Developers; Owners and Admins are not asked.","required":false,"schema":{"type":"string","enum":["true"]}},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"204":{"description":"Success"},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"428":{"description":"Production confirmation required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Delete a segment that no flag rule references. Optional `reason` query.","tags":["Segments"],"description":"Delete a segment that no flag rule references. Optional `reason` query.\n\nRequires permission `segment:manage` (role of the member, or scope of the API token).","x-required-scope":"segment:manage","x-api-token":true}},"/v1/projects/{projectId}/segments/{segmentKey}/usage":{"get":{"operationId":"segments.usage","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"segmentKey","required":true,"in":"path","schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},"description":"Segment key (unique within the project)."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentsUsageResponse"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Flags (per environment) whose rules reference the segment","tags":["Segments"],"description":"Flags (per environment) whose rules reference the segment.\n\nRequires permission `flag:read` (role of the member, or scope of the API token).","x-required-scope":"flag:read","x-api-token":true}},"/v1/projects/{projectId}/segments/{segmentKey}/import/preview":{"post":{"operationId":"segments.importPreview","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"segmentKey","required":true,"in":"path","schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},"description":"Segment key (unique within the project)."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentsImportPreviewRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagConfigImportPreviewResponse"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Preview a paste/CSV import into a segment list","tags":["Segments"],"description":"Preview a paste/CSV import into a segment list.\n\nRequires permission `segment:manage` (role of the member, or scope of the API token).","x-required-scope":"segment:manage","x-api-token":true}},"/v1/projects/{projectId}/segments/{segmentKey}/import":{"post":{"operationId":"segments.importApply","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"segmentKey","required":true,"in":"path","schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},"description":"Segment key (unique within the project)."},{"name":"If-Match","in":"header","description":"ETag of the version being changed. A stale value answers 412 `precondition_failed`.","required":false,"schema":{"type":"string"}},{"name":"Darkship-Confirm-Production","in":"header","description":"`true` confirms a change to a production environment (also accepted as `?confirm=true`). Required for Developers; Owners and Admins are not asked.","required":false,"schema":{"type":"string","enum":["true"]}},{"name":"Idempotency-Key","in":"header","description":"Up to 255 printable ASCII characters. A replay within 24 h returns the original response; the same key with a different request answers 409 `idempotency_key_conflict`.","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/DarkshipOrgId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentsImportPreviewRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagConfigImportPreviewResponse"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"412":{"description":"Precondition failed (stale ETag)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Unprocessable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"428":{"description":"Production confirmation required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Apply a paste/CSV import. Refused (422) beyond the plan limit; never truncates. Supports Idempotency-Key.","tags":["Segments"],"description":"Apply a paste/CSV import. Refused (422) beyond the plan limit; never truncates. Supports Idempotency-Key.\n\nRequires permission `segment:manage` (role of the member, or scope of the API token).","x-required-scope":"segment:manage","x-api-token":true}},"/v1/usage":{"get":{"operationId":"usage.organization","parameters":[{"name":"month","required":false,"in":"query","schema":{"type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"},"description":"Calendar month as `YYYY-MM` (UTC). Default: the current month."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageOrganizationResponse"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Organization request usage for a calendar month (fetches + remote evaluations)","tags":["Usage"],"description":"Organization request usage for a calendar month (fetches + remote evaluations).\n\nRequires permission `usage:read` (role of the member, or scope of the API token).","x-required-scope":"usage:read","x-api-token":true}},"/v1/projects/{projectId}/usage":{"get":{"operationId":"usage.project","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"environment_id","required":false,"in":"query","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Only items of this environment."},{"name":"from","required":false,"in":"query","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"description":"Start of the time range (ISO-8601, inclusive)."},{"name":"to","required":false,"in":"query","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"description":"End of the time range (ISO-8601, exclusive)."},{"name":"granularity","required":false,"in":"query","schema":{"default":"hour","type":"string","enum":["hour","day"]},"description":"Bucket size of the time series."},{"name":"top","required":false,"in":"query","schema":{"default":10,"type":"integer","minimum":1,"maximum":50},"description":"How many flags to list in the top-flags ranking."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageProjectResponse"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Requests and flag evaluations over time, plus the top flags","tags":["Usage"],"description":"Requests and flag evaluations over time, plus the top flags.\n\nRequires permission `usage:read` (role of the member, or scope of the API token).","x-required-scope":"usage:read","x-api-token":true}},"/v1/projects/{projectId}/flags/{flagKey}/usage":{"get":{"operationId":"usage.flag","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"flagKey","required":true,"in":"path","schema":{"type":"string","minLength":1,"maxLength":200},"description":"Flag key (unique within the project, fixed at creation)."},{"name":"environment_id","required":false,"in":"query","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Only items of this environment."},{"name":"from","required":false,"in":"query","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"description":"Start of the time range (ISO-8601, inclusive)."},{"name":"to","required":false,"in":"query","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"description":"End of the time range (ISO-8601, exclusive)."},{"name":"granularity","required":false,"in":"query","schema":{"default":"hour","type":"string","enum":["hour","day"]},"description":"Bucket size of the time series."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageFlagResponse"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Evaluations of one flag by variation over time","tags":["Usage"],"description":"Evaluations of one flag by variation over time.\n\nRequires permission `usage:read` (role of the member, or scope of the API token).","x-required-scope":"usage:read","x-api-token":true}},"/v1/webhooks/event-types":{"get":{"operationId":"webhooks.eventTypes","parameters":[{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhooksEventTypesResponse"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Event types you can subscribe to, the payload version and the signature tolerance","tags":["Webhooks"],"description":"Event types you can subscribe to, the payload version and the signature tolerance.\n\nRequires permission `webhook:manage` (role of the member, or scope of the API token).","x-required-scope":"webhook:manage","x-api-token":true}},"/v1/projects/{projectId}/webhooks":{"get":{"operationId":"webhooks.list","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"limit","required":false,"in":"query","schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"description":"Page size (1 to 200)."},{"name":"cursor","required":false,"in":"query","schema":{"type":"string","maxLength":512},"description":"Opaque cursor from the previous page's `next_cursor`. Omit for the first page."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhooksListResponse"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"List webhook endpoints of a project","tags":["Webhooks"],"description":"List webhook endpoints of a project.\n\nRequires permission `webhook:manage` (role of the member, or scope of the API token).","x-required-scope":"webhook:manage","x-api-token":true},"post":{"operationId":"webhooks.create","parameters":[{"name":"projectId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Project id."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointCreate"},"example":{"url":"https://hooks.example.com/darkship","description":"Deploy notifier","event_types":["flag.updated"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointWithSecret"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Create a webhook endpoint. The signing secret is returned once.","tags":["Webhooks"],"description":"Create a webhook endpoint. The signing secret is returned once.\n\nThe signing secret is in the response once. Verify the `Darkship-Signature` header on every delivery.\n\nRequires permission `webhook:manage` (role of the member, or scope of the API token).","x-required-scope":"webhook:manage","x-api-token":true}},"/v1/webhooks/{id}":{"get":{"operationId":"webhooks.get","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Webhook endpoint id."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointWithSecret"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Get a webhook endpoint with its health","tags":["Webhooks"],"description":"Get a webhook endpoint with its health.\n\nRequires permission `webhook:manage` (role of the member, or scope of the API token).","x-required-scope":"webhook:manage","x-api-token":true},"patch":{"operationId":"webhooks.update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Webhook endpoint id."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhooksUpdateRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointWithSecret"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Update URL, subscriptions or status (re-enabling resets the failure streak)","tags":["Webhooks"],"description":"Update URL, subscriptions or status (re-enabling resets the failure streak).\n\nRequires permission `webhook:manage` (role of the member, or scope of the API token).","x-required-scope":"webhook:manage","x-api-token":true},"delete":{"operationId":"webhooks.remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Webhook endpoint id."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"204":{"description":"Success"},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Delete a webhook endpoint and its delivery log","tags":["Webhooks"],"description":"Delete a webhook endpoint and its delivery log.\n\nRequires permission `webhook:manage` (role of the member, or scope of the API token).","x-required-scope":"webhook:manage","x-api-token":true}},"/v1/webhooks/{id}/rotate-secret":{"post":{"operationId":"webhooks.rotate","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Webhook endpoint id."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhooksRotateRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointWithSecret"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Rotate the signing secret; the old one signs too during the overlap window","tags":["Webhooks"],"description":"Rotate the signing secret; the old one signs too during the overlap window.\n\nRequires permission `webhook:manage` (role of the member, or scope of the API token).","x-required-scope":"webhook:manage","x-api-token":true}},"/v1/webhooks/{id}/test":{"post":{"operationId":"webhooks.test","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Webhook endpoint id."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhooksTestResponse"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Send a signed webhook.test event now and report the result (at most 3 in flight per organization)","tags":["Webhooks"],"description":"Send a signed webhook.test event now and report the result (at most 3 in flight per organization).\n\nRequires permission `webhook:manage` (role of the member, or scope of the API token).","x-required-scope":"webhook:manage","x-api-token":true}},"/v1/webhooks/{id}/deliveries":{"get":{"operationId":"webhooks.deliveries","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Webhook endpoint id."},{"name":"limit","required":false,"in":"query","schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"description":"Page size (1 to 200)."},{"name":"cursor","required":false,"in":"query","schema":{"type":"string","maxLength":512},"description":"Opaque cursor from the previous page's `next_cursor`. Omit for the first page."},{"name":"status","required":false,"in":"query","schema":{"type":"string","enum":["pending","succeeded","dead"]},"description":"Only items with this status."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhooksDeliveriesResponse"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Delivery log of an endpoint (status, attempts, last response status and latency)","tags":["Webhooks"],"description":"Delivery log of an endpoint (status, attempts, last response status and latency).\n\nRequires permission `webhook:manage` (role of the member, or scope of the API token).","x-required-scope":"webhook:manage","x-api-token":true}},"/v1/webhooks/{id}/deliveries/{deliveryId}":{"get":{"operationId":"webhooks.delivery","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Webhook endpoint id."},{"name":"deliveryId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Delivery id from the delivery log."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhooksDeliveryResponse"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"One delivery with every attempt and the event payload","tags":["Webhooks"],"description":"One delivery with every attempt and the event payload.\n\nRequires permission `webhook:manage` (role of the member, or scope of the API token).","x-required-scope":"webhook:manage","x-api-token":true}},"/v1/webhooks/{id}/deliveries/{deliveryId}/redeliver":{"post":{"operationId":"webhooks.redeliver","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Webhook endpoint id."},{"name":"deliveryId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"Delivery id from the delivery log."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"202":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhooksRedeliverResponse"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Queue a new delivery of the same event (same event id)","tags":["Webhooks"],"description":"Queue a new delivery of the same event (same event id).\n\nRequires permission `webhook:manage` (role of the member, or scope of the API token).","x-required-scope":"webhook:manage","x-api-token":true}},"/v1/me/deletion":{"get":{"operationId":"account.deletionStatus","parameters":[{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountDeletionStatusResponse"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Your account deletion request, if any","tags":["Account"],"description":"Your account deletion request, if any.\n\nSession only: any signed-in user (API tokens are not accepted).","x-api-token":false},"post":{"operationId":"account.requestDeletion","parameters":[{"$ref":"#/components/parameters/DarkshipOrgId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountRequestDeletionRequest"}}}},"responses":{"202":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountRequestDeletionResponse"}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Schedule the deletion of your account (30-day regret window). Needs your typed email, your current password and, with MFA, a recent MFA sign-in. Refused while you are the only Owner of an organization.","tags":["Account"],"description":"Schedule the deletion of your account (30-day regret window). Needs your typed email, your current password and, with MFA, a recent MFA sign-in. Refused while you are the only Owner of an organization.\n\nSession only: any signed-in user (API tokens are not accepted).","x-api-token":false},"delete":{"operationId":"account.cancelDeletion","parameters":[{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"204":{"description":"Success"},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Cancel the scheduled deletion of your account","tags":["Account"],"description":"Cancel the scheduled deletion of your account.\n\nSession only: any signed-in user (API tokens are not accepted).","x-api-token":false}},"/v1/me/exports":{"post":{"operationId":"account.requestExport","parameters":[{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"202":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountRequestExportResponse"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Request a personal data export (JSON). A single-use download link is emailed when it is ready.","tags":["Account"],"description":"Request a personal data export (JSON). A single-use download link is emailed when it is ready.\n\nSession only: any signed-in user (API tokens are not accepted).","x-api-token":false},"get":{"operationId":"account.listExports","parameters":[{"$ref":"#/components/parameters/DarkshipOrgId"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountListExportsResponse"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Your recent personal data exports","tags":["Account"],"description":"Your recent personal data exports.\n\nSession only: any signed-in user (API tokens are not accepted).","x-api-token":false}},"/v1/me/exports/{exportId}/download":{"post":{"operationId":"account.download","parameters":[{"name":"exportId","required":true,"in":"path","schema":{"type":"string","format":"uuid"},"description":"The `exportId` path parameter."},{"$ref":"#/components/parameters/DarkshipOrgId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountDownloadRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountDownloadResponse"}}}},"401":{"description":"Not authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"api-token":[]},{"session":[]}],"summary":"Download a personal data export with the single-use token from the email (signed-in owner only)","tags":["Account"],"description":"Download a personal data export with the single-use token from the email (signed-in owner only).\n\nSession only: any signed-in user (API tokens are not accepted).","x-api-token":false}},"/v1/sdk/snapshot":{"servers":[{"url":"https://sdk.darkship.tech","description":"Data plane (SDK evaluation service)"}],"get":{"operationId":"sdk.snapshot","tags":["SDK data plane"],"summary":"Download the ruleset snapshot of the key's environment (server keys)","description":"Returns every flag and segment of the environment so the SDK can evaluate locally with no network on the evaluation path. Send the last `ETag` as `If-None-Match`: an unchanged ruleset answers `304` with no body. Poll at most every 30 s when not streaming; bodies larger than 1 KiB are gzip-compressed when you send `Accept-Encoding: gzip`.","security":[{"sdk-server-key":[]}],"parameters":[{"name":"If-None-Match","in":"header","required":false,"description":"ETag of the snapshot you hold (its quoted `version`).","schema":{"type":"string"},"example":"\"9c1d5e0a3b7f4c2e8d6a1b0f9e8d7c6b5a4f3e2d1c0b9a8f7e6d5c4b3a2f1e0d\""},{"name":"Darkship-Sdk","in":"header","required":false,"description":"SDK name and version, e.g. `js/1.2.0` or `python/0.4.1`. Used for usage breakdowns and support; never for access decisions.","schema":{"type":"string","maxLength":64},"example":"js/0.1.0"}],"responses":{"200":{"description":"The current ruleset snapshot.","headers":{"ETag":{"description":"Quoted snapshot `version` (content hash).","schema":{"type":"string"}},"Darkship-Org-State":{"description":"Advisory organization state (`active`, `grace`, `suspended_soft`, ...). Only `suspended_hard` stops serving.","schema":{"type":"string"}},"Darkship-Stale":{"description":"`true` when the eval service is serving its last known snapshot because Redis is unavailable (fail-static).","schema":{"type":"string","enum":["true"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RulesetSnapshot"}}}},"304":{"description":"Unchanged since the `If-None-Match` version."},"401":{"description":"Missing, malformed, revoked or expired SDK key (`unauthenticated`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Wrong key kind for this route, or the organization is hard-suspended (`org_suspended`, also signalled by `Darkship-Org-State: suspended_hard`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"No snapshot could be served (cold start with Redis unavailable). Retry with backoff; keep your last ruleset.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/sdk/stream":{"servers":[{"url":"https://sdk.darkship.tech","description":"Data plane (SDK evaluation service)"}],"get":{"operationId":"sdk.stream","tags":["SDK data plane"],"summary":"Subscribe to ruleset changes over server-sent events (server keys)","description":"A long-lived `text/event-stream`. Any event other than `heartbeat` means the ruleset may have changed: fetch the snapshot again with `If-None-Match`. The payload carries the new `version` as a hint (skip the fetch when you already hold it). Reconnect with exponential backoff and keep polling the snapshot while disconnected. This is how SDKs reach a change within seconds.","security":[{"sdk-server-key":[]}],"parameters":[{"name":"Darkship-Sdk","in":"header","required":false,"description":"SDK name and version, e.g. `js/1.2.0` or `python/0.4.1`. Used for usage breakdowns and support; never for access decisions.","schema":{"type":"string","maxLength":64},"example":"js/0.1.0"}],"responses":{"200":{"description":"Event stream. Comments (`: ...`) and `heartbeat` events keep the connection alive.","headers":{"Darkship-Stale":{"description":"`true` when the eval service is serving its last known snapshot because Redis is unavailable (fail-static).","schema":{"type":"string","enum":["true"]}}},"content":{"text/event-stream":{"schema":{"type":"string"},"example":"event: snapshot\ndata: {\"version\":\"9c1d5e0a3b7f4c2e8d6a1b0f9e8d7c6b5a4f3e2d1c0b9a8f7e6d5c4b3a2f1e0d\"}\n\nevent: heartbeat\ndata: {}\n\n"}}},"401":{"description":"Missing, malformed, revoked or expired SDK key (`unauthenticated`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Wrong key kind for this route, or the organization is hard-suspended (`org_suspended`, also signalled by `Darkship-Org-State: suspended_hard`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"No snapshot could be served (cold start with Redis unavailable). Retry with backoff; keep your last ruleset.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/sdk/evaluate":{"servers":[{"url":"https://sdk.darkship.tech","description":"Data plane (SDK evaluation service)"}],"post":{"operationId":"sdk.evaluate","tags":["SDK data plane"],"summary":"Evaluate the client-visible flags for a context (client keys)","description":"Remote evaluation for browsers and mobile apps: returns values only, never rules, target lists or segments. Only flags marked client-side are visible to client keys. The context is evaluated in memory and never stored or logged.","security":[{"sdk-client-key":[]}],"parameters":[{"name":"Darkship-Sdk","in":"header","required":false,"description":"SDK name and version, e.g. `js/1.2.0` or `python/0.4.1`. Used for usage breakdowns and support; never for access decisions.","schema":{"type":"string","maxLength":64},"example":"js/0.1.0"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluateRequest"},"example":{"context":{"key":"usr_marta","email":"marta@example.com","plan":"pro","groups":["beta-testers"]},"flag_keys":["new-checkout-flow","promo-banner-text"]}}}},"responses":{"200":{"description":"One result per requested (or visible) flag.","headers":{"Darkship-Org-State":{"description":"Advisory organization state (`active`, `grace`, `suspended_soft`, ...). Only `suspended_hard` stops serving.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluateResponse"},"example":{"version":"9c1d5e0a3b7f4c2e8d6a1b0f9e8d7c6b5a4f3e2d1c0b9a8f7e6d5c4b3a2f1e0d","flags":{"new-checkout-flow":{"value":true,"variation_key":"on","reason":"RULE_MATCH","flag_type":"boolean"},"promo-banner-text":{"value":"Free shipping this week","variation_key":"promo","reason":"FALLTHROUGH","flag_type":"string"}}}}}},"400":{"description":"Malformed JSON or a body without `context` (`validation_failed`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, revoked or expired SDK key (`unauthenticated`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Wrong key kind for this route, or the organization is hard-suspended (`org_suspended`, also signalled by `Darkship-Org-State: suspended_hard`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"No snapshot could be served (cold start with Redis unavailable). Retry with backoff; keep your last ruleset.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/sdk/evaluate/{flagKey}":{"servers":[{"url":"https://sdk.darkship.tech","description":"Data plane (SDK evaluation service)"}],"post":{"operationId":"sdk.evaluateFlag","tags":["SDK data plane"],"summary":"Evaluate one client-visible flag for a context (client keys)","description":"Same as the bulk evaluation for a single flag. A flag that does not exist or is not client-visible answers 404 `flag_not_found`.","security":[{"sdk-client-key":[]}],"parameters":[{"name":"flagKey","in":"path","required":true,"description":"Flag key.","schema":{"type":"string","maxLength":128},"example":"new-checkout-flow"},{"name":"Darkship-Sdk","in":"header","required":false,"description":"SDK name and version, e.g. `js/1.2.0` or `python/0.4.1`. Used for usage breakdowns and support; never for access decisions.","schema":{"type":"string","maxLength":64},"example":"js/0.1.0"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluateFlagRequest"},"example":{"context":{"key":"usr_marta","email":"marta@example.com","plan":"pro","groups":["beta-testers"]}}}}},"responses":{"200":{"description":"The result for the flag.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluateFlagResponse"},"example":{"flag_key":"new-checkout-flow","version":"9c1d5e0a3b7f4c2e8d6a1b0f9e8d7c6b5a4f3e2d1c0b9a8f7e6d5c4b3a2f1e0d","value":true,"variation_key":"on","reason":"RULE_MATCH","flag_type":"boolean"}}}},"400":{"description":"Invalid flag key, malformed JSON or missing `context` (`validation_failed`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, revoked or expired SDK key (`unauthenticated`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Wrong key kind for this route, or the organization is hard-suspended (`org_suspended`, also signalled by `Darkship-Org-State: suspended_hard`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"No client-visible flag with this key (`flag_not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"No snapshot could be served (cold start with Redis unavailable). Retry with backoff; keep your last ruleset.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/telemetry/counters":{"servers":[{"url":"https://sdk.darkship.tech","description":"Data plane (SDK evaluation service)"}],"post":{"operationId":"sdk.telemetry","tags":["SDK data plane"],"summary":"Report aggregate evaluation counters (server keys)","description":"Counters per flag x variation x one-minute window, never contexts or user ids. Unknown flags and windows outside the accepted range are dropped silently (an SDK may lag behind a deleted flag).","security":[{"sdk-server-key":[]}],"parameters":[{"name":"Darkship-Sdk","in":"header","required":false,"description":"SDK name and version, e.g. `js/1.2.0` or `python/0.4.1`. Used for usage breakdowns and support; never for access decisions.","schema":{"type":"string","maxLength":64},"example":"js/0.1.0"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TelemetryCounters"},"example":{"sdk":"js","sdk_version":"0.1.0","counters":[{"flag_key":"new-checkout-flow","variation":"on","window_start":"2026-10-28T14:30:00Z","count":1842}]}}}},"responses":{"202":{"description":"Accepted for aggregation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TelemetryAccepted"},"example":{"accepted":1}}}},"400":{"description":"Body does not match the schema (`validation_failed`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing, malformed, revoked or expired SDK key (`unauthenticated`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Wrong key kind for this route, or the organization is hard-suspended (`org_suspended`, also signalled by `Darkship-Org-State: suspended_hard`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"No snapshot could be served (cold start with Redis unavailable). Retry with backoff; keep your last ruleset.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/sdk/telemetry":{"servers":[{"url":"https://sdk.darkship.tech","description":"Data plane (SDK evaluation service)"}],"post":{"operationId":"sdk.telemetryLegacy","tags":["SDK data plane"],"deprecated":true,"summary":"Report aggregate evaluation counters (deprecated alias)","description":"Deprecated alias of `POST /v1/telemetry/counters` kept for early SDK builds; responses carry `Deprecation: true`. Use `/v1/telemetry/counters`.","security":[{"sdk-server-key":[]}],"parameters":[{"name":"Darkship-Sdk","in":"header","required":false,"description":"SDK name and version, e.g. `js/1.2.0` or `python/0.4.1`. Used for usage breakdowns and support; never for access decisions.","schema":{"type":"string","maxLength":64},"example":"js/0.1.0"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TelemetryCounters"}}}},"responses":{"202":{"description":"Accepted for aggregation.","headers":{"Deprecation":{"description":"Always `true` on this route.","schema":{"type":"string","enum":["true"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SdkTelemetryLegacyResponse"}}}},"401":{"description":"Missing, malformed, revoked or expired SDK key (`unauthenticated`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Wrong key kind for this route, or the organization is hard-suspended (`org_suspended`, also signalled by `Darkship-Org-State: suspended_hard`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited. Honour `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"No snapshot could be served (cold start with Redis unavailable). Retry with backoff; keep your last ruleset.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}}},"info":{"title":"Darkship API","description":"Darkship REST API. The **control plane** (`api` host) manages organizations, projects, environments, flags, segments, keys, tokens and webhooks; the **data plane** (`eval` host, tag *SDK data plane*) serves rulesets and evaluations to SDKs.\n\nJSON with `snake_case` fields, ISO-8601 UTC timestamps, cursor pagination (`limit`, `cursor` -> `next_cursor`). Errors share one envelope (`ErrorEnvelope`) with a stable `code`.\n\n**Authentication.** Machine access: `Authorization: Bearer ds_pat_...` (API token). Each operation lists the permission an API token needs in `x-required-scope` (the catalogue is `GET /v1/roles`); operations marked *session only* are for console users. Console access: session cookie plus `Darkship-Org-Id`. SDK routes take a server (`ds_srv_`) or client (`ds_cli_`) key.","version":"1.0.0","contact":{}},"tags":[{"name":"Account","description":"The signed-in user (console session)."},{"name":"Organizations","description":"Organizations you belong to: create, rename, delete and transfer ownership."},{"name":"Projects","description":"Projects group flags, segments and environments. Creating one adds dev, staging and prod."},{"name":"Environments","description":"Environments of a project (dev, staging, prod, ...). Each has its own flag configuration and SDK keys."},{"name":"Flags","description":"Typed feature flags. The type and key are fixed at creation; variations, name and tags can change."},{"name":"Flag environments","description":"Per-environment state of a flag: on/off, individual targets, rules, fallthrough and rollout."},{"name":"Segments","description":"Reusable audiences, project-wide. Every environment snapshot embeds them."},{"name":"SDK keys","description":"Server (`ds_srv_`) and client (`ds_cli_`) keys for the data plane. Secrets are shown once."},{"name":"API tokens","description":"Scoped `ds_pat_` tokens for this API. Secrets are shown once."},{"name":"Members","description":"Organization members, their roles and scopes, and the role catalogue."},{"name":"Invitations","description":"Invite people by email; they join with the role and scope you choose."},{"name":"Webhooks","description":"Signed HTTP callbacks for flag, segment and environment changes, with a delivery log."},{"name":"Audit log","description":"Who changed what and when, newest first."},{"name":"Usage","description":"Requests and evaluations over time, per organization, project and flag."},{"name":"Billing","description":"Plan, subscription, Stripe Checkout and Customer Portal, and the public plan catalogue."},{"name":"Platform","description":"Public platform status: maintenance, announcements, read-only mode."},{"name":"SDK data plane","description":"Served by the evaluation service (`eval` host), not the management API. Server keys download the ruleset snapshot (or subscribe to changes) and evaluate in-process; client keys ask for evaluated values only. Use these routes to write an SDK for a language we do not ship."}],"servers":[{"url":"https://api.darkship.tech","description":"Control plane (management API)"}],"components":{"securitySchemes":{"api-token":{"type":"http","scheme":"bearer","description":"API token (`ds_pat_...`), created in the console or with `POST /v1/api-tokens`."},"session":{"type":"apiKey","in":"cookie","name":"darkship.session_token","description":"Console session cookie (Better Auth). Send `Darkship-Org-Id` too."},"sdk-server-key":{"type":"http","scheme":"bearer","description":"Server SDK key (`ds_srv_...`). Secret: never ship it to a browser."},"sdk-client-key":{"type":"http","scheme":"bearer","description":"Client SDK key (`ds_cli_...`). Public by design; only evaluates client-side flags."}},"schemas":{"ErrorCode":{"type":"string","description":"Stable, machine-readable error code. New codes may be added; never renamed.\n\n- `validation_failed` (400): The request body, query or path failed validation. `details` lists each offending field.\n- `invalid_credentials` (401): The supplied credentials are invalid.\n- `authentication_required` (401): No valid session or API token was sent.\n- `forbidden` (403): The caller's role does not allow this action.\n- `insufficient_scope` (403): The API token lacks the scope required by this endpoint.\n- `api_token_required` (403): The endpoint describes the calling API token and needs `Authorization: Bearer ds_pat_...`; a console session was used.\n- `csrf_origin_mismatch` (403): A cookie-authenticated, state-changing request came from an untrusted origin.\n- `org_context_required` (400): Organization-scoped route called without `Darkship-Org-Id` (or an `:orgId` path segment).\n- `not_a_member` (403): The caller is not a member of the organization.\n- `not_found` (404): The resource does not exist or is not visible to the caller.\n- `organization_not_found` (404): Organization not found.\n- `project_not_found` (404): Project not found.\n- `environment_not_found` (404): Environment not found.\n- `member_not_found` (404): Member not found.\n- `invitation_not_found` (404): Invitation not found.\n- `invitation_invalid` (400): The invitation is expired, revoked, already used or addressed to another email.\n- `sdk_key_not_found` (404): SDK key not found.\n- `api_token_not_found` (404): API token not found.\n- `conflict` (409): The request conflicts with the current state of the resource.\n- `slug_taken` (409): The organization slug is already in use.\n- `key_taken` (409): The key is already used by another resource in the same scope.\n- `last_owner_required` (409): An organization must keep at least one Owner.\n- `member_already_exists` (409): The user is already a member of the organization.\n- `invalid_scope` (422): The requested role or token scope is not allowed for this caller.\n- `rate_limited` (429): Too many requests. Honor `Retry-After`.\n- `payload_too_large` (413): The request body exceeds the maximum accepted size (1 MiB).\n- `unsupported_media_type` (415): The `Content-Type` is not supported. Send `application/json`.\n- `organization_limit_reached` (422): The user already owns the maximum number of organizations allowed on this deployment.\n- `flag_not_found` (404): Flag not found.\n- `flag_archived` (409): The flag is archived. Restore it before changing it.\n- `flag_config_not_found` (404): The flag has no configuration in this environment.\n- `segment_not_found` (404): Segment not found.\n- `history_revision_not_found` (404): History revision not found.\n- `webhook_not_found` (404): Webhook endpoint not found.\n- `variation_in_use` (409): A variation to remove is still served by an environment configuration.\n- `segment_in_use` (409): The segment is still referenced by flag rules.\n- `plan_limit_exceeded` (422): A target list or segment list exceeds the plan's entry limit. Nothing was saved.\n- `production_confirmation_required` (428): Changing production needs `Darkship-Confirm-Production: true` or `?confirm=true`.\n- `idempotency_key_conflict` (409): The `Idempotency-Key` was already used with a different request body.\n- `invalid_json_schema` (422): The JSON Schema of a json flag is invalid or uses unsupported features.\n- `restore_not_applicable` (422): The history revision no longer fits the current flag, so it cannot be restored.\n- `quota_exceeded` (402): The plan's resource limit (projects, environments, seats, flags) is reached. Upgrade to add more.\n- `payment_required` (402): A payment failed; creating resources is paused until the payment method is updated.\n- `billing_unavailable` (503): Billing is not configured on this deployment.\n- `invalid_signature` (400): The webhook signature does not match the payload.\n- `precondition_failed` (412): `If-Match` does not match the current ETag. Reload and retry.\n- `org_suspended_console` (403): The organization is suspended by Darkship staff (console or hard suspension). The management API and sessions are blocked; SDK evaluation is not affected by a console suspension.\n- `user_suspended` (403): The user is suspended by Darkship staff. Sessions and API tokens of this user are rejected.\n- `signups_disabled` (403): New sign-ups are temporarily disabled on this deployment.\n- `platform_read_only` (503): The control plane is in read-only mode (maintenance). Writes are rejected, reads and SDK evaluation keep working. Retry later.\n- `mfa_step_up_required` (403): This sensitive action needs a recent sign-in with MFA (the account has MFA enabled). Sign in again and retry.\n- `confirmation_required` (428): This environment requires an explicit confirmation (`Darkship-Confirm-Environment: true` or `?confirm=true`) for changes; see `require_confirm`.\n- `internal_error` (500): Unexpected server error. Quote the `request_id`.\n- `not_ready` (503): A dependency (database or Redis) is not ready.\n- `organization_pending_deletion` (409): The organization is scheduled for deletion: the console and the management API are read-only until an Owner restores it. SDK keys keep serving.\n- `reauthentication_failed` (403): This destructive action needs your current password (and, with MFA enabled, a recent MFA sign-in); the password did not match.\n- `sole_owner` (409): You are the only Owner of an organization. Transfer ownership or delete that organization before deleting your account.","enum":["validation_failed","invalid_credentials","authentication_required","forbidden","insufficient_scope","api_token_required","csrf_origin_mismatch","org_context_required","not_a_member","not_found","organization_not_found","project_not_found","environment_not_found","member_not_found","invitation_not_found","invitation_invalid","sdk_key_not_found","api_token_not_found","conflict","slug_taken","key_taken","last_owner_required","member_already_exists","invalid_scope","rate_limited","payload_too_large","unsupported_media_type","organization_limit_reached","flag_not_found","flag_archived","flag_config_not_found","segment_not_found","history_revision_not_found","webhook_not_found","variation_in_use","segment_in_use","plan_limit_exceeded","production_confirmation_required","idempotency_key_conflict","invalid_json_schema","restore_not_applicable","quota_exceeded","payment_required","billing_unavailable","invalid_signature","precondition_failed","org_suspended_console","user_suspended","signups_disabled","platform_read_only","mfa_step_up_required","confirmation_required","internal_error","not_ready","organization_pending_deletion","reauthentication_failed","sole_owner"]},"ErrorEnvelope":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","request_id","details"],"properties":{"code":{"$ref":"#/components/schemas/ErrorCode"},"message":{"type":"string"},"request_id":{"type":"string"},"details":{"type":"array","items":{"type":"object","required":["issue"],"properties":{"field":{"type":"string"},"issue":{"type":"string"}}}},"docs_url":{"type":"string"}}}}},"JsonValue":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/JsonValue"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/JsonValue"}}]},"ApiTokenList":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"user_id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string"},"last4":{"type":"string"},"masked":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"project_ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"environment_ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"status":{"type":"string","enum":["active","expired","revoked"]},"created_at":{"type":"string"},"last_used_at":{"type":["string","null"]},"expires_at":{"type":["string","null"]},"revoked_at":{"type":["string","null"]},"requests_7d":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Audited uses of this token in the last 7 days (`api_token.used`). Present on list responses."},"secret":{"description":"Shown exactly once, at creation.","type":"string"}},"required":["id","user_id","name","prefix","last4","masked","scopes","project_ids","environment_ids","status","created_at","last_used_at","expires_at","revoked_at"]}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"]},"ApiTokenCreate":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"scopes":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","enum":["org:read","org:manage","org:transfer","project:read","project:manage","environment:read","environment:manage","flag:read","flag:write","flag:delete","segment:manage","sdk_key:read","sdk_key:manage","webhook:manage","api_token:manage","member:read","member:manage","audit:read","usage:read","billing:manage"]}},"project_ids":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"environment_ids":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["name","scopes"],"additionalProperties":false},"ApiTokenWithSecret":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"user_id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string"},"last4":{"type":"string"},"masked":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"project_ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"environment_ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"status":{"type":"string","enum":["active","expired","revoked"]},"created_at":{"type":"string"},"last_used_at":{"type":["string","null"]},"expires_at":{"type":["string","null"]},"revoked_at":{"type":["string","null"]},"requests_7d":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Audited uses of this token in the last 7 days (`api_token.used`). Present on list responses."},"secret":{"description":"Shown exactly once, at creation.","type":"string"}},"required":["id","user_id","name","prefix","last4","masked","scopes","project_ids","environment_ids","status","created_at","last_used_at","expires_at","revoked_at"]},"AuditLogPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"occurred_at":{"type":"string"},"actor_type":{"type":"string","enum":["USER","API_TOKEN","SYSTEM"]},"actor_id":{"type":["string","null"]},"token_prefix":{"type":["string","null"]},"action":{"type":"string"},"resource_type":{"type":"string"},"resource_id":{"type":["string","null"]},"project_id":{"type":["string","null"]},"environment_id":{"type":["string","null"]},"before":{"anyOf":[{},{"type":"null"}]},"after":{"anyOf":[{},{"type":"null"}]},"ip":{"type":["string","null"]},"user_agent":{"type":["string","null"]},"request_id":{"type":["string","null"]},"summary":{"type":"string","description":"One human sentence, e.g. `Created flag checkout-v2 in production`."},"reason":{"description":"The reason given with the change, if any.","type":["string","null"]},"environment_key":{"type":["string","null"]},"actor":{"type":"object","properties":{"type":{"type":"string","enum":["USER","API_TOKEN","SYSTEM"]},"id":{"type":["string","null"]},"name":{"description":"The user's name, the API token's name, or `Darkship staff` / `System`.","type":["string","null"]},"email":{"description":"The user's email; masked (`a***@example.com`) for roles below Admin.","type":["string","null"]}},"required":["type","id","name","email"]}},"required":["id","occurred_at","actor_type","actor_id","token_prefix","action","resource_type","resource_id","project_id","environment_id","before","after","ip","user_agent","request_id","summary","reason","environment_key","actor"]}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"]},"EnvironmentList":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"project_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"key":{"type":"string"},"color":{"type":"string"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"require_confirm":{"type":"boolean"},"require_reason":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","project_id","name","key","color","position","require_confirm","require_reason","created_at","updated_at"]}},"next_cursor":{"type":"null"}},"required":["data","next_cursor"]},"EnvironmentCreate":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"key":{"type":"string","minLength":2,"maxLength":48,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"require_confirm":{"description":"Every change to this environment needs an explicit confirmation (any role).","type":"boolean"},"require_reason":{"description":"State-changing requests for this environment must carry a `reason`.","type":"boolean"}},"required":["name","key"],"additionalProperties":false},"Environment":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"project_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"key":{"type":"string"},"color":{"type":"string"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"require_confirm":{"type":"boolean"},"require_reason":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","project_id","name","key","color","position","require_confirm","require_reason","created_at","updated_at"]},"FlagPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"project_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"key":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["boolean","string","int","float","json","date"]},"description":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"temporary":{"type":"boolean"},"client_side":{"type":"boolean"},"json_schema":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"variations":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":["string","null"]},"description":{"type":["string","null"]},"value":{"$ref":"#/components/schemas/JsonValue"}},"required":["key","name","description","value"]}},"archived":{"type":"boolean"},"archived_at":{"type":["string","null"]},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"},"maintainer":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string","description":"Masked (`a***@example.com`) for roles below Admin."}},"required":["id","name","email"]},{"type":"null"}]},"environments":{"description":"Only with `include=environments`.","type":"array","items":{"type":"object","properties":{"environment_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"environment_key":{"type":"string"},"enabled":{"type":"boolean"},"rule_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"target_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Number of target entries across all target lists."},"version":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Configuration version (ETag); null while the flag has no configuration in the environment yet."},"updated_at":{"type":["string","null"]}},"required":["environment_id","environment_key","enabled","rule_count","target_count","version","updated_at"]}},"stats":{"description":"Only with `include=stats`.","type":"object","properties":{"evals_7d":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Evaluations in the last 7 days across the environments you can see (hourly rollups)."},"last_eval_at":{"description":"Start of the last hour with an evaluation inside the telemetry retention window; null when none.","type":["string","null"]},"stale":{"type":"boolean","description":"The flag is older than 30 days and has no evaluation inside the window below."},"stale_basis_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Days of telemetry the stale hint is based on: min(30, plan telemetry retention)."}},"required":["evals_7d","last_eval_at","stale","stale_basis_days"]}},"required":["id","project_id","key","name","type","description","tags","temporary","client_side","json_schema","variations","archived","archived_at","revision","created_at","updated_at","maintainer"]}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"]},"FlagCreate":{"type":"object","properties":{"key":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},"name":{"type":"string","minLength":1,"maxLength":120},"type":{"type":"string","enum":["boolean","string","int","float","json","date"]},"description":{"default":"","type":"string","maxLength":2000},"tags":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"temporary":{"default":false,"type":"boolean"},"client_side":{"default":false,"type":"boolean"},"variations":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},"value":{"$ref":"#/components/schemas/JsonValue"},"name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["key","value"],"additionalProperties":false}},"json_schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"off_variation":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},"fallthrough_variation":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},"maintainer_id":{"type":"string","minLength":1,"maxLength":128},"reason":{"type":"string","minLength":5,"maxLength":500}},"required":["key","name","type"],"additionalProperties":false},"Flag":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"project_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"key":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["boolean","string","int","float","json","date"]},"description":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"temporary":{"type":"boolean"},"client_side":{"type":"boolean"},"json_schema":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"variations":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":["string","null"]},"description":{"type":["string","null"]},"value":{"$ref":"#/components/schemas/JsonValue"}},"required":["key","name","description","value"]}},"archived":{"type":"boolean"},"archived_at":{"type":["string","null"]},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"},"maintainer":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string","description":"Masked (`a***@example.com`) for roles below Admin."}},"required":["id","name","email"]},{"type":"null"}]},"environments":{"description":"Only with `include=environments`.","type":"array","items":{"type":"object","properties":{"environment_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"environment_key":{"type":"string"},"enabled":{"type":"boolean"},"rule_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"target_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Number of target entries across all target lists."},"version":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Configuration version (ETag); null while the flag has no configuration in the environment yet."},"updated_at":{"type":["string","null"]}},"required":["environment_id","environment_key","enabled","rule_count","target_count","version","updated_at"]}},"stats":{"description":"Only with `include=stats`.","type":"object","properties":{"evals_7d":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Evaluations in the last 7 days across the environments you can see (hourly rollups)."},"last_eval_at":{"description":"Start of the last hour with an evaluation inside the telemetry retention window; null when none.","type":["string","null"]},"stale":{"type":"boolean","description":"The flag is older than 30 days and has no evaluation inside the window below."},"stale_basis_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Days of telemetry the stale hint is based on: min(30, plan telemetry retention)."}},"required":["evals_7d","last_eval_at","stale","stale_basis_days"]}},"required":["id","project_id","key","name","type","description","tags","temporary","client_side","json_schema","variations","archived","archived_at","revision","created_at","updated_at","maintainer"]},"FlagUpdate":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","maxLength":2000},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"temporary":{"type":"boolean"},"client_side":{"type":"boolean"},"variations":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},"value":{"$ref":"#/components/schemas/JsonValue"},"name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["key","value"],"additionalProperties":false}},"json_schema":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"maintainer_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":128},{"type":"null"}]},"reason":{"type":"string","minLength":5,"maxLength":500}},"additionalProperties":false},"FlagEnvironmentConfig":{"type":"object","properties":{"flag_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"flag_key":{"type":"string"},"environment_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"enabled":{"type":"boolean"},"off_variation":{"type":"string","minLength":1,"maxLength":128},"fallthrough":{"anyOf":[{"type":"object","properties":{"variation":{"type":"string","minLength":1,"maxLength":128}},"required":["variation"],"additionalProperties":false},{"type":"object","properties":{"rollout":{"type":"object","properties":{"bucket_by":{"type":"string","maxLength":64},"variations":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"variation":{"type":"string","minLength":1,"maxLength":128},"weight":{"type":"integer","minimum":0,"maximum":10000}},"required":["variation","weight"],"additionalProperties":false}}},"required":["variations"],"additionalProperties":false}},"required":["rollout"],"additionalProperties":false}]},"targets":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64},"match_by":{"type":"string","maxLength":64},"values":{"maxItems":100000,"type":"array","items":{"type":"string","maxLength":1024}},"variation":{"type":"string","minLength":1,"maxLength":128}},"required":["match_by","values","variation"],"additionalProperties":false}},"rules":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64},"description":{"type":"string","maxLength":500},"groups":{"minItems":1,"maxItems":5,"type":"array","items":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"attribute":{"type":"string","maxLength":128},"op":{"type":"string","maxLength":32},"values":{"maxItems":1000,"type":"array","items":{"type":["string","number","boolean"]}}},"required":["attribute","op","values"],"additionalProperties":false}}},"serve":{"anyOf":[{"type":"object","properties":{"variation":{"type":"string","minLength":1,"maxLength":128}},"required":["variation"],"additionalProperties":false},{"type":"object","properties":{"rollout":{"type":"object","properties":{"bucket_by":{"type":"string","maxLength":64},"variations":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"variation":{"type":"string","minLength":1,"maxLength":128},"weight":{"type":"integer","minimum":0,"maximum":10000}},"required":["variation","weight"],"additionalProperties":false}}},"required":["variations"],"additionalProperties":false}},"required":["rollout"],"additionalProperties":false}]}},"required":["groups","serve"],"additionalProperties":false}},"salt":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updated_at":{"type":"string"}},"required":["flag_id","flag_key","environment_id","enabled","off_variation","fallthrough","targets","rules","salt","version","updated_at"]},"FlagEnvironmentConfigInput":{"type":"object","properties":{"enabled":{"type":"boolean"},"off_variation":{"type":"string","minLength":1,"maxLength":128},"fallthrough":{"anyOf":[{"type":"object","properties":{"variation":{"type":"string","minLength":1,"maxLength":128}},"required":["variation"],"additionalProperties":false},{"type":"object","properties":{"rollout":{"type":"object","properties":{"bucket_by":{"type":"string","maxLength":64},"variations":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"variation":{"type":"string","minLength":1,"maxLength":128},"weight":{"type":"integer","minimum":0,"maximum":10000}},"required":["variation","weight"],"additionalProperties":false}}},"required":["variations"],"additionalProperties":false}},"required":["rollout"],"additionalProperties":false}]},"targets":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64},"match_by":{"type":"string","maxLength":64},"values":{"maxItems":100000,"type":"array","items":{"type":"string","maxLength":1024}},"variation":{"type":"string","minLength":1,"maxLength":128}},"required":["match_by","values","variation"],"additionalProperties":false}},"rules":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64},"description":{"type":"string","maxLength":500},"groups":{"minItems":1,"maxItems":5,"type":"array","items":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"attribute":{"type":"string","maxLength":128},"op":{"type":"string","maxLength":32},"values":{"maxItems":1000,"type":"array","items":{"type":["string","number","boolean"]}}},"required":["attribute","op","values"],"additionalProperties":false}}},"serve":{"anyOf":[{"type":"object","properties":{"variation":{"type":"string","minLength":1,"maxLength":128}},"required":["variation"],"additionalProperties":false},{"type":"object","properties":{"rollout":{"type":"object","properties":{"bucket_by":{"type":"string","maxLength":64},"variations":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"variation":{"type":"string","minLength":1,"maxLength":128},"weight":{"type":"integer","minimum":0,"maximum":10000}},"required":["variation","weight"],"additionalProperties":false}}},"required":["variations"],"additionalProperties":false}},"required":["rollout"],"additionalProperties":false}]}},"required":["groups","serve"],"additionalProperties":false}},"reason":{"type":"string","minLength":5,"maxLength":500}},"required":["enabled","off_variation","fallthrough","targets","rules"],"additionalProperties":false},"FlagEnvironmentConfigPatch":{"type":"object","properties":{"enabled":{"type":"boolean"},"off_variation":{"type":"string","minLength":1,"maxLength":128},"fallthrough":{"anyOf":[{"type":"object","properties":{"variation":{"type":"string","minLength":1,"maxLength":128}},"required":["variation"],"additionalProperties":false},{"type":"object","properties":{"rollout":{"type":"object","properties":{"bucket_by":{"type":"string","maxLength":64},"variations":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"variation":{"type":"string","minLength":1,"maxLength":128},"weight":{"type":"integer","minimum":0,"maximum":10000}},"required":["variation","weight"],"additionalProperties":false}}},"required":["variations"],"additionalProperties":false}},"required":["rollout"],"additionalProperties":false}]},"targets":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64},"match_by":{"type":"string","maxLength":64},"values":{"maxItems":100000,"type":"array","items":{"type":"string","maxLength":1024}},"variation":{"type":"string","minLength":1,"maxLength":128}},"required":["match_by","values","variation"],"additionalProperties":false}},"rules":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64},"description":{"type":"string","maxLength":500},"groups":{"minItems":1,"maxItems":5,"type":"array","items":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"attribute":{"type":"string","maxLength":128},"op":{"type":"string","maxLength":32},"values":{"maxItems":1000,"type":"array","items":{"type":["string","number","boolean"]}}},"required":["attribute","op","values"],"additionalProperties":false}}},"serve":{"anyOf":[{"type":"object","properties":{"variation":{"type":"string","minLength":1,"maxLength":128}},"required":["variation"],"additionalProperties":false},{"type":"object","properties":{"rollout":{"type":"object","properties":{"bucket_by":{"type":"string","maxLength":64},"variations":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"variation":{"type":"string","minLength":1,"maxLength":128},"weight":{"type":"integer","minimum":0,"maximum":10000}},"required":["variation","weight"],"additionalProperties":false}}},"required":["variations"],"additionalProperties":false}},"required":["rollout"],"additionalProperties":false}]}},"required":["groups","serve"],"additionalProperties":false}},"reason":{"type":"string","minLength":5,"maxLength":500}},"additionalProperties":false},"FlagToggle":{"type":"object","properties":{"enabled":{"type":"boolean"},"reason":{"type":"string","minLength":5,"maxLength":500}},"required":["enabled"],"additionalProperties":false},"EvaluationPreviewRequest":{"type":"object","properties":{"context":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"draft":{"type":"object","properties":{"enabled":{"type":"boolean"},"off_variation":{"type":"string","minLength":1,"maxLength":128},"fallthrough":{"anyOf":[{"type":"object","properties":{"variation":{"type":"string","minLength":1,"maxLength":128}},"required":["variation"],"additionalProperties":false},{"type":"object","properties":{"rollout":{"type":"object","properties":{"bucket_by":{"type":"string","maxLength":64},"variations":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"variation":{"type":"string","minLength":1,"maxLength":128},"weight":{"type":"integer","minimum":0,"maximum":10000}},"required":["variation","weight"],"additionalProperties":false}}},"required":["variations"],"additionalProperties":false}},"required":["rollout"],"additionalProperties":false}]},"targets":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64},"match_by":{"type":"string","maxLength":64},"values":{"maxItems":100000,"type":"array","items":{"type":"string","maxLength":1024}},"variation":{"type":"string","minLength":1,"maxLength":128}},"required":["match_by","values","variation"],"additionalProperties":false}},"rules":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64},"description":{"type":"string","maxLength":500},"groups":{"minItems":1,"maxItems":5,"type":"array","items":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"attribute":{"type":"string","maxLength":128},"op":{"type":"string","maxLength":32},"values":{"maxItems":1000,"type":"array","items":{"type":["string","number","boolean"]}}},"required":["attribute","op","values"],"additionalProperties":false}}},"serve":{"anyOf":[{"type":"object","properties":{"variation":{"type":"string","minLength":1,"maxLength":128}},"required":["variation"],"additionalProperties":false},{"type":"object","properties":{"rollout":{"type":"object","properties":{"bucket_by":{"type":"string","maxLength":64},"variations":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"variation":{"type":"string","minLength":1,"maxLength":128},"weight":{"type":"integer","minimum":0,"maximum":10000}},"required":["variation","weight"],"additionalProperties":false}}},"required":["variations"],"additionalProperties":false}},"required":["rollout"],"additionalProperties":false}]}},"required":["groups","serve"],"additionalProperties":false}},"reason":{"type":"string","minLength":5,"maxLength":500}},"additionalProperties":false}},"required":["context"],"additionalProperties":false},"EvaluationPreview":{"type":"object","properties":{"value":{"anyOf":[{"$ref":"#/components/schemas/JsonValue"},{"type":"null"}]},"variation":{"type":["string","null"]},"reason":{"type":"string"},"rule_id":{"type":["string","null"]},"error_code":{"type":["string","null"]},"bucket":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"detail":{"type":["string","null"]}},"required":["value","variation","reason","rule_id","error_code","bucket","detail"]},"InvitationCreate":{"type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"role":{"type":"string","enum":["OWNER","ADMIN","DEVELOPER","VIEWER","BILLING"]},"project_ids":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"environment_ids":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["email","role"],"additionalProperties":false},"MemberPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"user_id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["OWNER","ADMIN","DEVELOPER","VIEWER","BILLING"]},"project_ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"environment_ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"created_at":{"type":"string"},"mfa_enabled":{"type":"boolean"},"last_active_at":{"description":"Latest of the member's last session refresh and last audited action in this organization.","type":["string","null"]},"invited_by":{"anyOf":[{"type":"object","properties":{"user_id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}},"required":["user_id","name","email"]},{"type":"null"}],"description":"Who sent the invitation the member accepted; null for the founder or when unknown."}},"required":["id","user_id","email","name","role","project_ids","environment_ids","created_at","mfa_enabled","last_active_at","invited_by"]}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"]},"RoleCatalogue":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["OWNER","ADMIN","DEVELOPER","VIEWER","BILLING"]},"label":{"type":"string"},"description":{"type":"string"},"scopable":{"type":"boolean","description":"The role may be narrowed to projects/environments."},"assignable_by":{"type":"array","items":{"type":"string","enum":["OWNER","ADMIN","DEVELOPER","VIEWER","BILLING"]},"description":"Roles allowed to assign this role."},"permissions":{"type":"array","items":{"type":"string"}}},"required":["role","label","description","scopable","assignable_by","permissions"]}}},"required":["data"]},"Organization":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"slug":{"type":"string"},"role":{"type":"string","enum":["OWNER","ADMIN","DEVELOPER","VIEWER","BILLING"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"state":{"type":"string","enum":["active","pending_deletion"],"description":"`pending_deletion`: inside the 30-day regret window; read-only, SDK keys keep serving, an Owner can restore it."},"deletion_requested_at":{"type":["string","null"]},"purge_after":{"description":"When the purge job erases the organization (end of the regret window).","type":["string","null"]}},"required":["id","name","slug","created_at","updated_at","state","deletion_requested_at","purge_after"]},"Me":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"email_verified":{"type":"boolean"},"two_factor_enabled":{"type":"boolean"},"deletion":{"anyOf":[{"type":"object","properties":{"requested_at":{"type":"string"},"erase_after":{"type":"string"}},"required":["requested_at","erase_after"]},{"type":"null"}],"description":"Set while the account is scheduled for deletion (regret window)."}},"required":["id","email","name","email_verified","two_factor_enabled","deletion"]},"organizations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"slug":{"type":"string"},"role":{"type":"string","enum":["OWNER","ADMIN","DEVELOPER","VIEWER","BILLING"]}},"required":["id","name","slug","role"],"additionalProperties":{}}}},"required":["user","organizations"]},"ProjectPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"key":{"type":"string"},"description":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","key","description","created_at","updated_at"]}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"]},"ProjectCreate":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"key":{"type":"string","minLength":2,"maxLength":48,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"description":{"type":"string","maxLength":500}},"required":["name","key"],"additionalProperties":false},"Project":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"key":{"type":"string"},"description":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","key","description","created_at","updated_at"]},"SdkKeyList":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"project_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"environment_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"role":{"type":"string","enum":["server","client"]},"name":{"type":"string"},"prefix":{"type":"string"},"last4":{"type":"string"},"masked":{"type":"string"},"allowed_origins":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","retiring","retired","revoked","expired"]},"rotated_from_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"created_at":{"type":"string"},"last_used_at":{"type":["string","null"]},"expires_at":{"type":["string","null"]},"retire_at":{"type":["string","null"]},"revoked_at":{"type":["string","null"]},"secret":{"description":"Shown exactly once, at creation or rotation.","type":"string"}},"required":["id","project_id","environment_id","role","name","prefix","last4","masked","allowed_origins","status","rotated_from_id","created_at","last_used_at","expires_at","retire_at","revoked_at"]}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"]},"SdkKeyCreate":{"type":"object","properties":{"role":{"type":"string","enum":["server","client"]},"name":{"type":"string","minLength":1,"maxLength":120},"allowed_origins":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","maxLength":200}},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["role","name"],"additionalProperties":false},"SdkKeyWithSecret":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"project_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"environment_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"role":{"type":"string","enum":["server","client"]},"name":{"type":"string"},"prefix":{"type":"string"},"last4":{"type":"string"},"masked":{"type":"string"},"allowed_origins":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","retiring","retired","revoked","expired"]},"rotated_from_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"created_at":{"type":"string"},"last_used_at":{"type":["string","null"]},"expires_at":{"type":["string","null"]},"retire_at":{"type":["string","null"]},"revoked_at":{"type":["string","null"]},"secret":{"description":"Shown exactly once, at creation or rotation.","type":"string"}},"required":["id","project_id","environment_id","role","name","prefix","last4","masked","allowed_origins","status","rotated_from_id","created_at","last_used_at","expires_at","retire_at","revoked_at"]},"SdkKeyRotate":{"type":"object","properties":{"grace_period_hours":{"type":"integer","minimum":0,"maximum":168}},"additionalProperties":false},"SdkKeyRotation":{"type":"object","properties":{"key":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"project_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"environment_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"role":{"type":"string","enum":["server","client"]},"name":{"type":"string"},"prefix":{"type":"string"},"last4":{"type":"string"},"masked":{"type":"string"},"allowed_origins":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","retiring","retired","revoked","expired"]},"rotated_from_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"created_at":{"type":"string"},"last_used_at":{"type":["string","null"]},"expires_at":{"type":["string","null"]},"retire_at":{"type":["string","null"]},"revoked_at":{"type":["string","null"]},"secret":{"description":"Shown exactly once, at creation or rotation.","type":"string"}},"required":["id","project_id","environment_id","role","name","prefix","last4","masked","allowed_origins","status","rotated_from_id","created_at","last_used_at","expires_at","retire_at","revoked_at"],"description":"The new key. Its `secret` is shown exactly once."},"previous_key":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"project_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"environment_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"role":{"type":"string","enum":["server","client"]},"name":{"type":"string"},"prefix":{"type":"string"},"last4":{"type":"string"},"masked":{"type":"string"},"allowed_origins":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","retiring","retired","revoked","expired"]},"rotated_from_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"created_at":{"type":"string"},"last_used_at":{"type":["string","null"]},"expires_at":{"type":["string","null"]},"retire_at":{"type":["string","null"]},"revoked_at":{"type":["string","null"]},"secret":{"description":"Shown exactly once, at creation or rotation.","type":"string"}},"required":["id","project_id","environment_id","role","name","prefix","last4","masked","allowed_origins","status","rotated_from_id","created_at","last_used_at","expires_at","retire_at","revoked_at"],"description":"The key being replaced; valid until `retire_at` (the grace period)."},"grace_period_hours":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["key","previous_key","grace_period_hours"]},"SegmentPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"project_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"key":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"included":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64},"match_by":{"type":"string","maxLength":64},"values":{"maxItems":100000,"type":"array","items":{"type":"string","maxLength":1024}}},"required":["match_by","values"],"additionalProperties":false}},"excluded":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64},"match_by":{"type":"string","maxLength":64},"values":{"maxItems":100000,"type":"array","items":{"type":"string","maxLength":1024}}},"required":["match_by","values"],"additionalProperties":false}},"groups":{"type":"array","items":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"attribute":{"type":"string","maxLength":128},"op":{"type":"string","maxLength":32},"values":{"maxItems":1000,"type":"array","items":{"type":["string","number","boolean"]}}},"required":["attribute","op","values"],"additionalProperties":false}}},"entry_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","project_id","key","name","description","included","excluded","groups","entry_count","version","created_at","updated_at"]}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"]},"SegmentCreate":{"type":"object","properties":{"key":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"default":"","type":"string","maxLength":2000},"included":{"default":[],"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64},"match_by":{"type":"string","maxLength":64},"values":{"maxItems":100000,"type":"array","items":{"type":"string","maxLength":1024}}},"required":["match_by","values"],"additionalProperties":false}},"excluded":{"default":[],"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64},"match_by":{"type":"string","maxLength":64},"values":{"maxItems":100000,"type":"array","items":{"type":"string","maxLength":1024}}},"required":["match_by","values"],"additionalProperties":false}},"groups":{"default":[],"maxItems":5,"type":"array","items":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"attribute":{"type":"string","maxLength":128},"op":{"type":"string","maxLength":32},"values":{"maxItems":1000,"type":"array","items":{"type":["string","number","boolean"]}}},"required":["attribute","op","values"],"additionalProperties":false}}},"reason":{"type":"string","minLength":5,"maxLength":500}},"required":["key","name"],"additionalProperties":false},"Segment":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"project_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"key":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"included":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64},"match_by":{"type":"string","maxLength":64},"values":{"maxItems":100000,"type":"array","items":{"type":"string","maxLength":1024}}},"required":["match_by","values"],"additionalProperties":false}},"excluded":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64},"match_by":{"type":"string","maxLength":64},"values":{"maxItems":100000,"type":"array","items":{"type":"string","maxLength":1024}}},"required":["match_by","values"],"additionalProperties":false}},"groups":{"type":"array","items":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"attribute":{"type":"string","maxLength":128},"op":{"type":"string","maxLength":32},"values":{"maxItems":1000,"type":"array","items":{"type":["string","number","boolean"]}}},"required":["attribute","op","values"],"additionalProperties":false}}},"entry_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","project_id","key","name","description","included","excluded","groups","entry_count","version","created_at","updated_at"]},"SegmentUpdate":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":2000},"included":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64},"match_by":{"type":"string","maxLength":64},"values":{"maxItems":100000,"type":"array","items":{"type":"string","maxLength":1024}}},"required":["match_by","values"],"additionalProperties":false}},"excluded":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64},"match_by":{"type":"string","maxLength":64},"values":{"maxItems":100000,"type":"array","items":{"type":"string","maxLength":1024}}},"required":["match_by","values"],"additionalProperties":false}},"groups":{"maxItems":5,"type":"array","items":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"attribute":{"type":"string","maxLength":128},"op":{"type":"string","maxLength":32},"values":{"maxItems":1000,"type":"array","items":{"type":["string","number","boolean"]}}},"required":["attribute","op","values"],"additionalProperties":false}}},"reason":{"type":"string","minLength":5,"maxLength":500}},"additionalProperties":false},"WebhookEndpointCreate":{"type":"object","properties":{"url":{"type":"string","minLength":12,"maxLength":2048},"description":{"default":"","type":"string","maxLength":500},"event_types":{"maxItems":30,"type":"array","items":{"type":"string"}},"environment_ids":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["url"],"additionalProperties":false},"WebhookEndpointWithSecret":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"project_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"environment_ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"url":{"type":"string"},"description":{"type":"string"},"event_types":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","disabled"]},"health":{"type":"string","enum":["healthy","degraded","disabled"]},"disabled_reason":{"type":["string","null"]},"disabled_at":{"type":["string","null"]},"consecutive_failures":{"type":"number"},"last_success_at":{"type":["string","null"]},"last_failure_at":{"type":["string","null"]},"secret_last4":{"type":"string"},"secret_rotation_ends_at":{"description":"While set, deliveries carry a signature for the old secret too.","type":["string","null"]},"secret":{"description":"whsec_... Returned once, on creation and on rotation. Never retrievable again.","type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","project_id","environment_ids","url","description","event_types","status","health","disabled_reason","disabled_at","consecutive_failures","last_success_at","last_failure_at","secret_last4","secret_rotation_ends_at","created_at","updated_at"]},"RulesetSnapshot":{"type":"object","properties":{"schemaVersion":{"type":"number","const":1},"version":{"type":"string","pattern":"^[0-9a-f]{64}$"},"environmentId":{"type":"string","minLength":1},"generatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"flags":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"key":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},"type":{"type":"string","enum":["boolean","string","int","float","json","date"]},"variations":{"minItems":1,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":128},"value":{"$ref":"#/components/schemas/JsonValue"}},"required":["key","value"]}},"enabled":{"type":"boolean"},"offVariation":{"type":"string","minLength":1},"fallthrough":{"anyOf":[{"type":"object","properties":{"variation":{"type":"string","minLength":1}},"required":["variation"],"additionalProperties":false},{"type":"object","properties":{"rollout":{"type":"object","properties":{"bucketBy":{"type":"string","pattern":"^[A-Za-z][\\w.-]{0,63}$"},"variations":{"minItems":1,"type":"array","items":{"type":"object","properties":{"variation":{"type":"string","minLength":1},"weight":{"type":"integer","minimum":0,"maximum":10000}},"required":["variation","weight"]}}},"required":["variations"]}},"required":["rollout"],"additionalProperties":false}]},"salt":{"type":"string","minLength":1},"clientSide":{"type":"boolean"},"targets":{"default":[],"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"matchBy":{"type":"string","pattern":"^[A-Za-z][\\w.-]{0,63}$"},"values":{"type":"array","items":{"type":"string","minLength":1,"maxLength":256}},"variation":{"type":"string","minLength":1}},"required":["id","matchBy","values","variation"]}},"rules":{"default":[],"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"description":{"type":"string","maxLength":500},"groups":{"minItems":1,"maxItems":5,"type":"array","items":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"attribute":{"type":"string","maxLength":128},"op":{"type":"string","enum":["equals","not_equals","in","not_in","contains","starts_with","ends_with","matches","lt","lte","gt","gte","before","after","semver_eq","semver_gt","semver_gte","semver_lt","semver_lte","in_segment","not_in_segment"]},"values":{"maxItems":1000,"type":"array","items":{"type":["string","number","boolean"]}}},"required":["attribute","op","values"]}}},"conditions":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"attribute":{"type":"string","maxLength":128},"op":{"type":"string","enum":["equals","not_equals","in","not_in","contains","starts_with","ends_with","matches","lt","lte","gt","gte","before","after","semver_eq","semver_gt","semver_gte","semver_lt","semver_lte","in_segment","not_in_segment"]},"values":{"maxItems":1000,"type":"array","items":{"type":["string","number","boolean"]}}},"required":["attribute","op","values"]}},"serve":{"anyOf":[{"type":"object","properties":{"variation":{"type":"string","minLength":1}},"required":["variation"],"additionalProperties":false},{"type":"object","properties":{"rollout":{"type":"object","properties":{"bucketBy":{"type":"string","pattern":"^[A-Za-z][\\w.-]{0,63}$"},"variations":{"minItems":1,"type":"array","items":{"type":"object","properties":{"variation":{"type":"string","minLength":1},"weight":{"type":"integer","minimum":0,"maximum":10000}},"required":["variation","weight"]}}},"required":["variations"]}},"required":["rollout"],"additionalProperties":false}]}},"required":["id","serve"]}},"jsonSchema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["key","type","variations","enabled","offVariation","fallthrough","salt"]}},"segments":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":128},"name":{"type":"string","maxLength":200},"included":{"default":[],"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"matchBy":{"type":"string","pattern":"^[A-Za-z][\\w.-]{0,63}$"},"values":{"type":"array","items":{"type":"string","minLength":1,"maxLength":256}}},"required":["matchBy","values"]}},"excluded":{"default":[],"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"matchBy":{"type":"string","pattern":"^[A-Za-z][\\w.-]{0,63}$"},"values":{"type":"array","items":{"type":"string","minLength":1,"maxLength":256}}},"required":["matchBy","values"]}},"groups":{"default":[],"maxItems":5,"type":"array","items":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"attribute":{"type":"string","maxLength":128},"op":{"type":"string","enum":["equals","not_equals","in","not_in","contains","starts_with","ends_with","matches","lt","lte","gt","gte","before","after","semver_eq","semver_gt","semver_gte","semver_lt","semver_lte","in_segment","not_in_segment"]},"values":{"maxItems":1000,"type":"array","items":{"type":["string","number","boolean"]}}},"required":["attribute","op","values"]}}}},"required":["key"]}}},"required":["schemaVersion","version","environmentId","generatedAt","flags","segments"]},"EvaluateRequest":{"type":"object","properties":{"context":{},"flag_keys":{"maxItems":1000,"type":"array","items":{"type":"string","maxLength":128}}},"required":["context"]},"EvaluateResponse":{"type":"object","properties":{"version":{"type":"string","minLength":1},"flags":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"value":{"$ref":"#/components/schemas/JsonValue"},"variation_key":{"type":["string","null"]},"reason":{"type":"string","enum":["OFF","TARGET_MATCH","RULE_MATCH","FALLTHROUGH","ERROR"]},"error_code":{"type":"string","enum":["FLAG_NOT_FOUND","TYPE_MISMATCH","PROVIDER_NOT_READY","MALFORMED_FLAG","INVALID_CONTEXT","GENERAL"]},"rule_id":{"type":"string"},"bucket":{"type":"integer","minimum":0,"maximum":9999},"flag_type":{"type":"string","enum":["boolean","string","int","float","json","date"]}},"required":["value","variation_key","reason"]}},"org_state":{"type":"string","minLength":1,"maxLength":64}},"required":["version","flags"]},"EvaluateFlagRequest":{"type":"object","required":["context"],"properties":{"context":{"type":"object","description":"Evaluation context: `key` plus any attributes."}}},"EvaluateFlagResponse":{"type":"object","properties":{"value":{"$ref":"#/components/schemas/JsonValue"},"variation_key":{"type":["string","null"]},"reason":{"type":"string","enum":["OFF","TARGET_MATCH","RULE_MATCH","FALLTHROUGH","ERROR"]},"error_code":{"type":"string","enum":["FLAG_NOT_FOUND","TYPE_MISMATCH","PROVIDER_NOT_READY","MALFORMED_FLAG","INVALID_CONTEXT","GENERAL"]},"rule_id":{"type":"string"},"bucket":{"type":"integer","minimum":0,"maximum":9999},"flag_type":{"type":"string","enum":["boolean","string","int","float","json","date"]},"flag_key":{"type":"string","minLength":1,"maxLength":128},"version":{"type":"string","minLength":1},"org_state":{"type":"string","minLength":1,"maxLength":64}},"required":["value","variation_key","reason","flag_key","version"]},"TelemetryCounters":{"type":"object","properties":{"sdk":{"type":"string","minLength":1,"maxLength":64},"sdk_version":{"type":"string","minLength":1,"maxLength":64},"counters":{"maxItems":5000,"type":"array","items":{"type":"object","properties":{"flag_key":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},"variation":{"type":"string","minLength":1,"maxLength":128},"window_start":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"count":{"type":"integer","minimum":0,"maximum":1000000}},"required":["flag_key","variation","window_start","count"]}}},"required":["sdk","sdk_version","counters"]},"TelemetryAccepted":{"type":"object","required":["accepted"],"properties":{"accepted":{"type":"integer","minimum":0,"description":"Number of counters received."}}},"BillingGetResponse":{"type":"object","properties":{"plan":{"type":"string","enum":["free","pro","business"]},"effective_plan":{"type":"string","enum":["free","pro","business"]},"interval":{"anyOf":[{"type":"string","enum":["month","year"]},{"type":"null"}]},"status":{"type":"string","enum":["trialing","active","past_due","canceled","unpaid"]},"org_state":{"type":"string","enum":["active","over_quota","past_due_grace","downgraded","suspended","suspended_hard"],"description":"Advisory state published for evaluation. `suspended` / `suspended_hard` are set by Darkship staff (console / hard suspension)."},"cancel_at_period_end":{"type":"boolean"},"current_period_start":{"type":["string","null"]},"current_period_end":{"type":["string","null"]},"grace_until":{"type":["string","null"]},"billing_email":{"type":["string","null"]},"limits":{"type":"object","properties":{"monthly_requests":{"type":"number"},"projects":{"type":"number"},"environments_per_project":{"type":"number"},"seats":{"type":"number"},"flags":{"type":"number"},"audit_retention_days":{"type":"number"},"target_list_entries":{"type":"number"},"segment_entries":{"type":"number"},"entry_length":{"type":"number"}},"required":["monthly_requests","projects","environments_per_project","seats","flags","audit_retention_days","target_list_entries","segment_entries","entry_length"]},"usage":{"type":"object","properties":{"period_start":{"type":"string"},"period_end":{"type":"string"},"requests":{"type":"number"},"requests_limit":{"type":"number"},"requests_percent":{"type":"number"},"projects":{"type":"object","properties":{"used":{"type":"number"},"limit":{"type":"number"}},"required":["used","limit"]},"seats":{"type":"object","properties":{"used":{"type":"number"},"limit":{"type":"number"}},"required":["used","limit"]},"environments":{"type":"object","properties":{"used":{"type":"number"},"limit_per_project":{"type":"number"}},"required":["used","limit_per_project"]}},"required":["period_start","period_end","requests","requests_limit","requests_percent","projects","seats","environments"]},"notices":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"period_start":{"type":"string"},"created_at":{"type":"string"}},"required":["kind","period_start","created_at"]}},"invoices":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":["string","null"]},"status":{"type":"string"},"currency":{"type":"string"},"amount_due":{"type":"number"},"amount_paid":{"type":"number"},"created_at":{"type":"string"},"hosted_invoice_url":{"type":["string","null"]}},"required":["id","number","status","currency","amount_due","amount_paid","created_at","hosted_invoice_url"]}},"invoices_available":{"type":"boolean"}},"required":["plan","effective_plan","interval","status","org_state","cancel_at_period_end","current_period_start","current_period_end","grace_until","billing_email","limits","usage","notices","invoices","invoices_available"]},"BillingCheckoutRequest":{"type":"object","properties":{"plan":{"type":"string","enum":["pro","business"]},"interval":{"type":"string","enum":["month","year"]}},"required":["plan","interval"],"additionalProperties":false},"BillingCheckoutResponse":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"]},"PlansListResponse":{"type":"object","properties":{"currency":{"type":"string","const":"usd"},"pricing_is_placeholder":{"type":"boolean"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["free","pro","business"]},"name":{"type":"string"},"price_usd_cents":{"anyOf":[{"type":"object","properties":{"month":{"type":"number"},"year":{"type":"number"}},"required":["month","year"]},{"type":"null"}]},"purchasable":{"type":"boolean"},"limits":{"type":"object","properties":{"monthly_requests":{"type":"number"},"projects":{"type":"number"},"environments_per_project":{"type":"number"},"seats":{"type":"number"},"flags":{"type":"number"},"audit_retention_days":{"type":"number"},"target_list_entries":{"type":"number"},"segment_entries":{"type":"number"},"entry_length":{"type":"number"}},"required":["monthly_requests","projects","environments_per_project","seats","flags","audit_retention_days","target_list_entries","segment_entries","entry_length"]}},"required":["id","name","price_usd_cents","purchasable","limits"]}}},"required":["currency","pricing_is_placeholder","data"]},"StripeWebhookReceiveResponse":{"type":"object","properties":{"received":{"type":"boolean","const":true}},"required":["received"]},"EnvironmentsReorderRequest":{"type":"object","properties":{"environment_ids":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["environment_ids"],"additionalProperties":false},"EnvironmentsUpdateRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"require_confirm":{"type":"boolean"},"require_reason":{"type":"boolean"}},"additionalProperties":false},"FlagsArchiveRequest":{"default":{},"type":"object","properties":{"reason":{"type":"string","minLength":5,"maxLength":500}},"additionalProperties":false},"FlagsListHistoryResponse":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["flag","config"]},"environment_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"action":{"type":"string"},"reason":{"description":"The reason given with the change, if any.","type":["string","null"]},"actor_type":{"type":"string"},"actor_id":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","kind","environment_id","revision","action","reason","actor_type","actor_id","created_at"]}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"]},"FlagsGetHistoryResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["flag","config"]},"environment_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"action":{"type":"string"},"reason":{"description":"The reason given with the change, if any.","type":["string","null"]},"actor_type":{"type":"string"},"actor_id":{"type":["string","null"]},"created_at":{"type":"string"},"state":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","kind","environment_id","revision","action","reason","actor_type","actor_id","created_at","state"]},"FlagConfigImportPreviewRequest":{"type":"object","properties":{"target_id":{"type":"string","minLength":1,"maxLength":64},"match_by":{"default":"key","type":"string","maxLength":64},"variation":{"type":"string","minLength":1,"maxLength":128},"mode":{"default":"append","type":"string","enum":["append","replace"]},"text":{"type":"string","maxLength":1100000},"csv":{"type":"string","maxLength":1100000},"reason":{"type":"string","minLength":5,"maxLength":500}},"additionalProperties":false},"FlagConfigImportPreviewResponse":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"added":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invalid":{"type":"array","items":{"type":"object","properties":{"sample":{"type":"string"},"error":{"type":"string"}},"required":["sample","error"]}},"over_limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"applied":{"type":"boolean"},"version":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["total","added","duplicates","invalid","over_limit","limit","applied","version"]},"InvitationsListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"email":{"type":"string"},"role":{"type":"string","enum":["OWNER","ADMIN","DEVELOPER","VIEWER","BILLING"]},"project_ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"environment_ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"status":{"type":"string","enum":["pending","accepted","revoked","expired"]},"expires_at":{"type":"string"},"created_at":{"type":"string"}},"required":["id","email","role","project_ids","environment_ids","status","expires_at","created_at"]}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"]},"InvitationsCreateResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"email":{"type":"string"},"role":{"type":"string","enum":["OWNER","ADMIN","DEVELOPER","VIEWER","BILLING"]},"project_ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"environment_ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"status":{"type":"string","enum":["pending","accepted","revoked","expired"]},"expires_at":{"type":"string"},"created_at":{"type":"string"}},"required":["id","email","role","project_ids","environment_ids","status","expires_at","created_at"]},"InvitationsAcceptRequest":{"type":"object","properties":{"token":{"type":"string","minLength":20,"maxLength":200}},"required":["token"],"additionalProperties":false},"InvitationsAcceptResponse":{"type":"object","properties":{"organization_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"member_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"role":{"type":"string","enum":["OWNER","ADMIN","DEVELOPER","VIEWER","BILLING"]}},"required":["organization_id","member_id","role"]},"MembersUpdateRequest":{"type":"object","properties":{"role":{"type":"string","enum":["OWNER","ADMIN","DEVELOPER","VIEWER","BILLING"]},"project_ids":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"environment_ids":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"additionalProperties":false},"MembersUpdateResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"user_id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["OWNER","ADMIN","DEVELOPER","VIEWER","BILLING"]},"project_ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"environment_ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"created_at":{"type":"string"},"mfa_enabled":{"type":"boolean"},"last_active_at":{"description":"Latest of the member's last session refresh and last audited action in this organization.","type":["string","null"]},"invited_by":{"anyOf":[{"type":"object","properties":{"user_id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}},"required":["user_id","name","email"]},{"type":"null"}],"description":"Who sent the invitation the member accepted; null for the founder or when unknown."}},"required":["id","user_id","email","name","role","project_ids","environment_ids","created_at","mfa_enabled","last_active_at","invited_by"]},"OrganizationsListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"slug":{"type":"string"},"role":{"type":"string","enum":["OWNER","ADMIN","DEVELOPER","VIEWER","BILLING"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"state":{"type":"string","enum":["active","pending_deletion"],"description":"`pending_deletion`: inside the 30-day regret window; read-only, SDK keys keep serving, an Owner can restore it."},"deletion_requested_at":{"type":["string","null"]},"purge_after":{"description":"When the purge job erases the organization (end of the regret window).","type":["string","null"]}},"required":["id","name","slug","created_at","updated_at","state","deletion_requested_at","purge_after"]}}},"required":["data"]},"OrganizationsCreateRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"slug":{"type":"string","minLength":2,"maxLength":48,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"}},"required":["name","slug"],"additionalProperties":false},"OrganizationsUpdateRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"slug":{"type":"string","minLength":2,"maxLength":48,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"}},"additionalProperties":false},"OrganizationDeletionRemoveRequest":{"type":"object","properties":{"confirm_name":{"type":"string","minLength":1,"maxLength":200,"description":"The organization name, typed exactly."},"password":{"description":"Your current password (required when your account has one).","type":"string","minLength":1,"maxLength":1024}},"required":["confirm_name"],"additionalProperties":false},"OrganizationsTransferRequest":{"type":"object","properties":{"new_owner_user_id":{"type":"string","minLength":1,"maxLength":128,"description":"User id of an existing member of the organization."}},"required":["new_owner_user_id"],"additionalProperties":false},"OrganizationsTransferResponse":{"type":"object","properties":{"new_owner_user_id":{"type":"string"},"previous_owner_user_id":{"type":"string"},"previous_owner_role":{"type":"string","const":"ADMIN"}},"required":["new_owner_user_id","previous_owner_user_id","previous_owner_role"]},"MeTokenResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"project_ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Empty = every project the issuing member can reach."},"environment_ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Empty = every environment of the allowed projects."},"expires_at":{"type":["string","null"]},"organization":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"slug":{"type":"string"}},"required":["id","name","slug"]}},"required":["id","name","prefix","scopes","project_ids","environment_ids","expires_at","organization"]},"PlatformStatusStatusResponse":{"type":"object","properties":{"read_only":{"type":"boolean","description":"The control plane rejects writes (`platform_read_only`). Reads and SDK evaluation keep working."},"signups_disabled":{"type":"boolean"},"signups_message":{"type":["string","null"]},"maintenance":{"anyOf":[{"type":"object","properties":{"message":{"type":"string"},"severity":{"type":"string","enum":["info","warning","critical"]}},"required":["message","severity"]},{"type":"null"}],"description":"Maintenance banner to show in the console and the site; null when none is active."},"announcements":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"},"body":{"type":"string"},"severity":{"type":"string","enum":["info","warning","critical"]},"starts_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"ends_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","title","body","severity","starts_at","ends_at"]}}},"required":["read_only","signups_disabled","signups_message","maintenance","announcements"]},"ProjectsUpdateRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"additionalProperties":false},"SdkKeysListOrgResponse":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"project_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"environment_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"role":{"type":"string","enum":["server","client"]},"name":{"type":"string"},"prefix":{"type":"string"},"last4":{"type":"string"},"masked":{"type":"string"},"allowed_origins":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","retiring","retired","revoked","expired"]},"rotated_from_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"created_at":{"type":"string"},"last_used_at":{"type":["string","null"]},"expires_at":{"type":["string","null"]},"retire_at":{"type":["string","null"]},"revoked_at":{"type":["string","null"]},"secret":{"description":"Shown exactly once, at creation or rotation.","type":"string"},"project_key":{"type":["string","null"]},"environment_key":{"type":["string","null"]},"requests_7d":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Requests (fetches + remote evaluations) of the key's ENVIRONMENT in the last 7 days; per-key counters do not exist (see `requests_scope`)."},"requests_scope":{"type":"string","const":"environment"}},"required":["id","project_id","environment_id","role","name","prefix","last4","masked","allowed_origins","status","rotated_from_id","created_at","last_used_at","expires_at","retire_at","revoked_at","project_key","environment_key","requests_7d","requests_scope"]}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"]},"SegmentsUsageResponse":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"flag_key":{"type":"string"},"environment_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rule_ids":{"type":"array","items":{"type":"string"}}},"required":["flag_key","environment_id","rule_ids"]}}},"required":["data"]},"SegmentsImportPreviewRequest":{"type":"object","properties":{"list":{"type":"string","enum":["included","excluded"]},"match_by":{"default":"key","type":"string","maxLength":64},"mode":{"default":"append","type":"string","enum":["append","replace"]},"text":{"type":"string","maxLength":1100000},"csv":{"type":"string","maxLength":1100000},"reason":{"type":"string","minLength":5,"maxLength":500}},"required":["list"],"additionalProperties":false},"UsageOrganizationResponse":{"type":"object","properties":{"month":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"},"as_of":{"type":["string","null"]},"requests":{"type":"object","properties":{"fetches":{"type":"number"},"remote_evaluations":{"type":"number"},"total":{"type":"number"}},"required":["fetches","remote_evaluations","total"]},"daily":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"fetches":{"type":"number"},"remote_evaluations":{"type":"number"}},"required":["day","fetches","remote_evaluations"]}},"by_project":{"type":"array","items":{"type":"object","properties":{"project_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"fetches":{"type":"number"},"remote_evaluations":{"type":"number"},"total":{"type":"number"}},"required":["project_id","fetches","remote_evaluations","total"]}},"by_environment":{"type":"array","items":{"type":"object","properties":{"environment_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"environment_key":{"type":["string","null"]},"project_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"fetches":{"type":"number"},"remote_evaluations":{"type":"number"},"total":{"type":"number"}},"required":["environment_id","environment_key","project_id","fetches","remote_evaluations","total"]},"description":"The same month split per environment (largest first)."}},"required":["month","from","to","as_of","requests","daily","by_project","by_environment"]},"UsageProjectResponse":{"type":"object","properties":{"project_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"environment_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"granularity":{"type":"string","enum":["hour","day"]},"from":{"type":"string"},"to":{"type":"string"},"as_of":{"description":"Latest minute already drained from the evaluation service; newer traffic is not counted yet.","type":["string","null"]},"requests":{"type":"array","items":{"type":"object","properties":{"t":{"type":"string"},"fetches":{"type":"number"},"remote_evaluations":{"type":"number"}},"required":["t","fetches","remote_evaluations"]}},"evaluations":{"type":"array","items":{"type":"object","properties":{"t":{"type":"string"},"count":{"type":"number"}},"required":["t","count"]}},"totals":{"type":"object","properties":{"fetches":{"type":"number"},"remote_evaluations":{"type":"number"},"evaluations":{"type":"number"}},"required":["fetches","remote_evaluations","evaluations"]},"top_flags":{"type":"array","items":{"type":"object","properties":{"flag_key":{"type":"string"},"count":{"type":"number"},"share":{"type":"number"},"variations":{"type":"array","items":{"type":"object","properties":{"variation":{"type":"string"},"count":{"type":"number"}},"required":["variation","count"]}}},"required":["flag_key","count","share","variations"]}}},"required":["project_id","environment_id","granularity","from","to","as_of","requests","evaluations","totals","top_flags"]},"UsageFlagResponse":{"type":"object","properties":{"project_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"environment_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"flag_key":{"type":"string"},"granularity":{"type":"string","enum":["hour","day"]},"from":{"type":"string"},"to":{"type":"string"},"as_of":{"type":["string","null"]},"series":{"type":"array","items":{"type":"object","properties":{"t":{"type":"string"},"total":{"type":"number"},"by_variation":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}}},"required":["t","total","by_variation"]}},"variations":{"type":"array","items":{"type":"object","properties":{"variation":{"type":"string"},"count":{"type":"number"},"share":{"type":"number"}},"required":["variation","count","share"]}},"total":{"type":"number"}},"required":["project_id","environment_id","flag_key","granularity","from","to","as_of","series","variations","total"]},"WebhooksEventTypesResponse":{"type":"object","properties":{"data":{"type":"array","items":{"type":"string"}},"payload_version":{"type":"number"},"signature_tolerance_seconds":{"type":"number"}},"required":["data","payload_version","signature_tolerance_seconds"]},"WebhooksListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"project_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"environment_ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"url":{"type":"string"},"description":{"type":"string"},"event_types":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","disabled"]},"health":{"type":"string","enum":["healthy","degraded","disabled"]},"disabled_reason":{"type":["string","null"]},"disabled_at":{"type":["string","null"]},"consecutive_failures":{"type":"number"},"last_success_at":{"type":["string","null"]},"last_failure_at":{"type":["string","null"]},"secret_last4":{"type":"string"},"secret_rotation_ends_at":{"description":"While set, deliveries carry a signature for the old secret too.","type":["string","null"]},"secret":{"description":"whsec_... Returned once, on creation and on rotation. Never retrievable again.","type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","project_id","environment_ids","url","description","event_types","status","health","disabled_reason","disabled_at","consecutive_failures","last_success_at","last_failure_at","secret_last4","secret_rotation_ends_at","created_at","updated_at"]}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"]},"WebhooksUpdateRequest":{"type":"object","properties":{"url":{"type":"string","minLength":12,"maxLength":2048},"description":{"type":"string","maxLength":500},"event_types":{"maxItems":30,"type":"array","items":{"type":"string"}},"environment_ids":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"status":{"type":"string","enum":["active","disabled"]}},"additionalProperties":false},"WebhooksRotateRequest":{"type":"object","properties":{"overlap_hours":{"default":24,"type":"integer","minimum":0,"maximum":168}},"additionalProperties":false},"WebhooksTestResponse":{"type":"object","properties":{"delivery_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"ok":{"type":"boolean"},"status_code":{"type":["number","null"]},"duration_ms":{"type":"number"},"error":{"type":["string","null"]},"response_snippet":{"type":["string","null"]}},"required":["delivery_id","ok","status_code","duration_ms","error","response_snippet"]},"WebhooksDeliveriesResponse":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"endpoint_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"event_id":{"type":"string"},"event_type":{"type":"string"},"status":{"type":"string","enum":["pending","succeeded","dead"]},"attempt_count":{"type":"number"},"next_attempt_at":{"type":["string","null"]},"last_status_code":{"type":["number","null"]},"last_error":{"type":["string","null"]},"last_duration_ms":{"type":["number","null"]},"redelivery_of":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"created_at":{"type":"string"},"completed_at":{"type":["string","null"]}},"required":["id","endpoint_id","event_id","event_type","status","attempt_count","next_attempt_at","last_status_code","last_error","last_duration_ms","redelivery_of","created_at","completed_at"]}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"]},"WebhooksDeliveryResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"endpoint_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"event_id":{"type":"string"},"event_type":{"type":"string"},"status":{"type":"string","enum":["pending","succeeded","dead"]},"attempt_count":{"type":"number"},"next_attempt_at":{"type":["string","null"]},"last_status_code":{"type":["number","null"]},"last_error":{"type":["string","null"]},"last_duration_ms":{"type":["number","null"]},"redelivery_of":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"created_at":{"type":"string"},"completed_at":{"type":["string","null"]},"attempts":{"type":"array","items":{"type":"object","properties":{"attempt_number":{"type":"number"},"started_at":{"type":"string"},"duration_ms":{"type":"number"},"status_code":{"type":["number","null"]},"ok":{"type":"boolean"},"error":{"type":["string","null"]},"response_snippet":{"type":["string","null"]}},"required":["attempt_number","started_at","duration_ms","status_code","ok","error","response_snippet"]}},"payload":{}},"required":["id","endpoint_id","event_id","event_type","status","attempt_count","next_attempt_at","last_status_code","last_error","last_duration_ms","redelivery_of","created_at","completed_at","attempts","payload"]},"WebhooksRedeliverResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"endpoint_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"event_id":{"type":"string"},"event_type":{"type":"string"},"status":{"type":"string","enum":["pending","succeeded","dead"]},"attempt_count":{"type":"number"},"next_attempt_at":{"type":["string","null"]},"last_status_code":{"type":["number","null"]},"last_error":{"type":["string","null"]},"last_duration_ms":{"type":["number","null"]},"redelivery_of":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"created_at":{"type":"string"},"completed_at":{"type":["string","null"]}},"required":["id","endpoint_id","event_id","event_type","status","attempt_count","next_attempt_at","last_status_code","last_error","last_duration_ms","redelivery_of","created_at","completed_at"]},"AccountDeletionStatusResponse":{"type":"object","properties":{"deletion":{"anyOf":[{"type":"object","properties":{"requested_at":{"type":"string"},"erase_after":{"type":"string","description":"When the erasure job anonymises the account (end of the 30-day regret window)."}},"required":["requested_at","erase_after"]},{"type":"null"}]}},"required":["deletion"]},"AccountRequestDeletionRequest":{"type":"object","properties":{"confirm_email":{"type":"string","minLength":3,"maxLength":320,"description":"Your email address, typed exactly."},"password":{"description":"Your current password (required when your account has one).","type":"string","minLength":1,"maxLength":1024}},"required":["confirm_email"],"additionalProperties":false},"AccountRequestDeletionResponse":{"type":"object","properties":{"requested_at":{"type":"string"},"erase_after":{"type":"string","description":"When the erasure job anonymises the account (end of the 30-day regret window)."}},"required":["requested_at","erase_after"]},"AccountRequestExportResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["queued","processing","completed","failed","expired"]},"created_at":{"type":"string"},"completed_at":{"type":["string","null"]},"expires_at":{"type":["string","null"]},"size_bytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","status","created_at","completed_at","expires_at","size_bytes"]},"AccountListExportsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["queued","processing","completed","failed","expired"]},"created_at":{"type":"string"},"completed_at":{"type":["string","null"]},"expires_at":{"type":["string","null"]},"size_bytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","status","created_at","completed_at","expires_at","size_bytes"]}}},"required":["data"]},"AccountDownloadRequest":{"type":"object","properties":{"token":{"type":"string","minLength":16,"maxLength":256,"description":"The single-use token from the link in the export email (never sent in a URL query)."}},"required":["token"],"additionalProperties":false},"AccountDownloadResponse":{"type":"object","properties":{"format":{"type":"string","const":"darkship.user-export.v1"},"generated_at":{"type":"string"}},"required":["format","generated_at"],"additionalProperties":{},"description":"Personal data bundle: profile, memberships, sessions, sign-in methods and your own audit activity. Secrets are never included."},"SdkTelemetryLegacyResponse":{"type":"object","required":["accepted"],"properties":{"accepted":{"type":"integer","minimum":0}}}},"parameters":{"DarkshipOrgId":{"name":"Darkship-Org-Id","in":"header","required":false,"description":"Organization the call acts in. Required for session (console) calls to organization-scoped routes; API tokens are bound to one organization and ignore it.","schema":{"type":"string","format":"uuid"}}}}}