{"openapi":"3.0.2","info":{"title":"api Management API","description":"API for managing flags, targets, targeting rules, and reading audit logs.\n\n## Authentication\n\nEvery request must include a management API token as a Bearer token:\n`Authorization: Bearer <token>`. Use the **Authorize** button above to set a token\nfor \"Try it out\".\n\nTokens are scoped. Each operation below documents the scope it requires\n(`flags:read`, `flags:write`, `targets:write`, `audit:read`). A token missing the\nrequired scope gets a `403` even if the token itself is valid.\n\n## Error envelope\n\nMost errors return `{\"status\": \"error\", \"message\": \"...\"}`. The exception is\nrequest-body validation failures on write endpoints (`422`), which are rendered by\nLaravel's default validation handler and instead return\n`{\"message\": \"...\", \"errors\": {\"field\": [\"...\"]}}` \u2014 see `ManagementValidationError`\nin the schema list.\n\n## Rate limits\n\nEach token is rate limited per minute; limits vary by token tier. Every response\ncarries `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset`\nheaders. Exceeding the limit returns `429` with a `Retry-After` header.\n\n## Idempotency\n\n`POST` and `PUT` requests accept an optional `Idempotency-Key` header (max 255\nchars). Replaying the same key with the same request body and token returns the\noriginal response (marked with `X-Idempotent-Replayed: true`) instead of repeating\nthe operation.\n\n## Pagination\n\nList endpoints that support pagination are cursor-based: pass the previous\nresponse's `meta.next_cursor` as the `cursor` query parameter to fetch the next\npage. A `null` cursor means there are no more results. `per_page` defaults to 25\nand is capped at 100. Endpoints that return a bounded set (targets for a target,\nrules for a target) are not paginated.","version":"1.0.0"},"servers":[{"url":"https:\/\/api.zenmanage.com"}],"paths":{"\/management\/v1\/projects":{"get":{"tags":["Projects"],"summary":"List projects","description":"List projects the authenticated token has access to, with cursor pagination.\nRequires the `projects:read` scope. If the token is restricted to specific\nprojects via resource grants, only those projects are returned.","parameters":[{"name":"per_page","in":"query","description":"Items per page. Default 25, max 100.","required":false,"schema":{"default":25,"type":"integer","maximum":100,"minimum":1}},{"name":"cursor","in":"query","description":"Opaque cursor from a previous response's `meta.next_cursor`, for fetching the next page.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success. Cursor-paginated list of projects the token has access to.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/ManagementProject"}},"meta":{"type":"object","properties":{"per_page":{"type":"integer","example":25},"next_cursor":{"type":"string","nullable":true},"prev_cursor":{"type":"string","nullable":true}}}}}}}},"401":{"$ref":"#\/components\/responses\/ManagementUnauthorized"},"403":{"$ref":"#\/components\/responses\/ManagementForbiddenScope"},"429":{"$ref":"#\/components\/responses\/ManagementRateLimited"}}}},"\/management\/v1\/projects\/{projectKey}\/environments":{"get":{"tags":["Projects"],"summary":"List environments","description":"List environments for a project, with cursor pagination. Requires the\n`projects:read` scope and (if the token is resource-restricted) a\nproject-level grant for this project.","parameters":[{"name":"per_page","in":"query","description":"Items per page. Default 25, max 100.","required":false,"schema":{"default":25,"type":"integer","maximum":100,"minimum":1}},{"name":"cursor","in":"query","description":"Opaque cursor from a previous response's `meta.next_cursor`, for fetching the next page.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success. Cursor-paginated list of environments for the project.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/ManagementProjectEnvironment"}},"meta":{"type":"object","properties":{"per_page":{"type":"integer","example":25},"next_cursor":{"type":"string","nullable":true},"prev_cursor":{"type":"string","nullable":true}}}}}}}},"401":{"$ref":"#\/components\/responses\/ManagementUnauthorized"},"403":{"$ref":"#\/components\/responses\/ManagementForbiddenScope"},"404":{"$ref":"#\/components\/responses\/ManagementNotFound"},"429":{"$ref":"#\/components\/responses\/ManagementRateLimited"}}}},"\/management\/v1\/projects\/{projectKey}\/flags":{"get":{"tags":["Flags"],"summary":"List flags","description":"List flags for a project with optional filtering and cursor pagination. Requires the `flags:read` scope.","parameters":[{"name":"per_page","in":"query","description":"Items per page. Default 25, max 100.","required":false,"schema":{"default":25,"type":"integer","maximum":100,"minimum":1}},{"name":"type","in":"query","description":"Filter by flag type.","required":false,"schema":{"enum":["boolean","number","string","json"],"type":"string"}},{"name":"search","in":"query","description":"Filter by flag key or name (partial match).","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success. Cursor-paginated list of flags for the project.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/ManagementFlag"}},"meta":{"type":"object","properties":{"per_page":{"type":"integer","example":25},"next_cursor":{"type":"string","nullable":true},"prev_cursor":{"type":"string","nullable":true}}}}}}}},"401":{"$ref":"#\/components\/responses\/ManagementUnauthorized"},"403":{"$ref":"#\/components\/responses\/ManagementForbiddenScope"},"404":{"$ref":"#\/components\/responses\/ManagementNotFound"},"429":{"$ref":"#\/components\/responses\/ManagementRateLimited"}}},"post":{"tags":["Flags"],"summary":"Create a flag","description":"Create a new flag in the project. Requires the `flags:write` scope.","parameters":[{"name":"Idempotency-Key","in":"header","description":"Optional. Replaying the same key with the same request body and token returns the original response instead of repeating the operation.","required":false,"schema":{"type":"string","maxLength":255}}],"requestBody":{"description":"Create a flag.","content":{"application\/json":{"schema":{"type":"object","required":["key","name","type"],"properties":{"key":{"description":"Lowercase, unique within the project. Letters, numbers, hyphens, and underscores only.","type":"string","pattern":"^[a-z0-9][a-z0-9\\-_]*$","maxLength":200,"example":"checkout-redesign"},"name":{"type":"string","maxLength":200,"example":"Checkout Redesign"},"type":{"enum":["boolean","number","string","json"],"type":"string"},"description":{"type":"string","maxLength":1000,"nullable":true},"include_in_mobile":{"default":true,"type":"boolean"},"include_in_client":{"default":true,"type":"boolean"}}}}},"required":true},"responses":{"200":{"description":"Success.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"},"data":{"$ref":"#\/components\/schemas\/ManagementFlag"}}}}}},"401":{"$ref":"#\/components\/responses\/ManagementUnauthorized"},"403":{"$ref":"#\/components\/responses\/ManagementForbiddenScope"},"404":{"$ref":"#\/components\/responses\/ManagementNotFound"},"422":{"$ref":"#\/components\/responses\/ManagementValidationError"},"429":{"$ref":"#\/components\/responses\/ManagementRateLimited"}}}},"\/management\/v1\/projects\/{projectKey}\/flags\/{flagKey}":{"get":{"tags":["Flags"],"summary":"Get a flag","description":"Get a single flag by key. Requires the `flags:read` scope.","parameters":[{"name":"projectKey","in":"path","description":"The project's key.","required":true,"schema":{"type":"string"}},{"name":"flagKey","in":"path","description":"The flag's key.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"},"data":{"$ref":"#\/components\/schemas\/ManagementFlag"}}}}}},"401":{"$ref":"#\/components\/responses\/ManagementUnauthorized"},"403":{"$ref":"#\/components\/responses\/ManagementForbiddenScope"},"404":{"$ref":"#\/components\/responses\/ManagementNotFound"},"429":{"$ref":"#\/components\/responses\/ManagementRateLimited"}}},"put":{"tags":["Flags"],"summary":"Update a flag","description":"Update an existing flag's name, description, permanence, and inclusion flags. Requires the `flags:write` scope.","parameters":[{"name":"Idempotency-Key","in":"header","description":"Optional. Replaying the same key with the same request body and token returns the original response instead of repeating the operation.","required":false,"schema":{"type":"string","maxLength":255}}],"requestBody":{"description":"Update a flag. The key and type cannot be changed after creation.","content":{"application\/json":{"schema":{"type":"object","required":["name","permanent"],"properties":{"name":{"type":"string","maxLength":200,"example":"Checkout Redesign"},"description":{"type":"string","maxLength":1000,"nullable":true},"permanent":{"description":"Marks the flag as exempt from stale-flag cleanup prompts.","type":"boolean"},"include_in_mobile":{"type":"boolean"},"include_in_client":{"type":"boolean"}}}}},"required":true},"responses":{"200":{"description":"Success.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"},"data":{"$ref":"#\/components\/schemas\/ManagementFlag"}}}}}},"401":{"$ref":"#\/components\/responses\/ManagementUnauthorized"},"403":{"$ref":"#\/components\/responses\/ManagementForbiddenScope"},"404":{"$ref":"#\/components\/responses\/ManagementNotFound"},"422":{"$ref":"#\/components\/responses\/ManagementValidationError"},"429":{"$ref":"#\/components\/responses\/ManagementRateLimited"}}},"delete":{"tags":["Flags"],"summary":"Delete a flag","description":"Delete a flag. Requires the `flags:write` scope.","parameters":[{"name":"projectKey","in":"path","description":"The project's key.","required":true,"schema":{"type":"string"}},{"name":"flagKey","in":"path","description":"The flag's key.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#\/components\/responses\/ManagementEmpty"},"401":{"$ref":"#\/components\/responses\/ManagementUnauthorized"},"403":{"$ref":"#\/components\/responses\/ManagementForbiddenScope"},"404":{"$ref":"#\/components\/responses\/ManagementNotFound"},"429":{"$ref":"#\/components\/responses\/ManagementRateLimited"}}}},"\/management\/v1\/projects\/{projectKey}\/flags\/{flagKey}\/environments\/{environmentKey}\/evaluate":{"get":{"tags":["Flags"],"summary":"Evaluate a flag","description":"Evaluate a flag's current resolved value for an environment. Requires the `flags:read` scope.","parameters":[{"name":"projectKey","in":"path","description":"The project's key.","required":true,"schema":{"type":"string"}},{"name":"flagKey","in":"path","description":"The flag's key.","required":true,"schema":{"type":"string"}},{"name":"environmentKey","in":"path","description":"The environment's key.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"},"data":{"$ref":"#\/components\/schemas\/ManagementFlagEvaluation"}}}}}},"401":{"$ref":"#\/components\/responses\/ManagementUnauthorized"},"403":{"$ref":"#\/components\/responses\/ManagementForbiddenScope"},"404":{"$ref":"#\/components\/responses\/ManagementNotFound"},"429":{"$ref":"#\/components\/responses\/ManagementRateLimited"}}}},"\/management\/v1\/projects\/{projectKey}\/flags\/{flagKey}\/values":{"get":{"tags":["Flag Values"],"summary":"List flag values","description":"List all values defined for a flag. Requires the `flags:read` scope.","parameters":[{"name":"projectKey","in":"path","description":"The project's key.","required":true,"schema":{"type":"string"}},{"name":"flagKey","in":"path","description":"The flag's key.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success. All values for the flag. Not paginated.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/ManagementFlagValue"}}}}}}},"401":{"$ref":"#\/components\/responses\/ManagementUnauthorized"},"403":{"$ref":"#\/components\/responses\/ManagementForbiddenScope"},"404":{"$ref":"#\/components\/responses\/ManagementNotFound"},"429":{"$ref":"#\/components\/responses\/ManagementRateLimited"}}},"post":{"tags":["Flag Values"],"summary":"Create a flag value","description":"Create a new value for a flag. Requires the `flags:write` scope.","parameters":[{"name":"Idempotency-Key","in":"header","description":"Optional. Replaying the same key with the same request body and token returns the original response instead of repeating the operation.","required":false,"schema":{"type":"string","maxLength":255}}],"requestBody":{"description":"Create a flag value.","content":{"application\/json":{"schema":{"type":"object","required":["display"],"properties":{"display":{"description":"The value in display form. Must match the flag's type: \"true\"\/\"false\" for boolean, a numeric string for number, valid JSON for json, any string for string.","type":"string","example":"true"}}}}},"required":true},"responses":{"200":{"description":"Success.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"},"data":{"$ref":"#\/components\/schemas\/ManagementFlagValue"}}}}}},"401":{"$ref":"#\/components\/responses\/ManagementUnauthorized"},"403":{"$ref":"#\/components\/responses\/ManagementForbiddenScope"},"404":{"$ref":"#\/components\/responses\/ManagementNotFound"},"422":{"$ref":"#\/components\/responses\/ManagementValidationError"},"429":{"$ref":"#\/components\/responses\/ManagementRateLimited"}}}},"\/management\/v1\/projects\/{projectKey}\/flags\/bulk-delete":{"post":{"tags":["Flags"],"summary":"Bulk delete flags","description":"Delete multiple flags by key in a single request. Requires the `flags:write` scope.","parameters":[{"name":"projectKey","in":"path","description":"The project's key.","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Delete multiple flags by key.","content":{"application\/json":{"schema":{"type":"object","required":["flag_keys"],"properties":{"flag_keys":{"description":"Keys of the flags to delete. Max 100, no duplicates.","type":"array","items":{"type":"string"}}}}}},"required":true},"responses":{"200":{"$ref":"#\/components\/responses\/ManagementBulkDeleteFlags"},"401":{"$ref":"#\/components\/responses\/ManagementUnauthorized"},"403":{"$ref":"#\/components\/responses\/ManagementForbiddenScope"},"404":{"$ref":"#\/components\/responses\/ManagementNotFound"},"422":{"$ref":"#\/components\/responses\/ManagementValidationError"},"429":{"$ref":"#\/components\/responses\/ManagementRateLimited"}}}},"\/management\/v1\/projects\/{projectKey}\/flags\/{flagKey}\/values\/{valueUlid}":{"put":{"tags":["Flag Values"],"summary":"Update a flag value","description":"Update an existing flag value's display. Requires the `flags:write` scope.","parameters":[{"name":"Idempotency-Key","in":"header","description":"Optional. Replaying the same key with the same request body and token returns the original response instead of repeating the operation.","required":false,"schema":{"type":"string","maxLength":255}}],"requestBody":{"description":"Replace a flag value's display.","content":{"application\/json":{"schema":{"type":"object","required":["display"],"properties":{"display":{"description":"The value in display form. Must match the flag's type: \"true\"\/\"false\" for boolean, a numeric string for number, valid JSON for json, any string for string.","type":"string","example":"false"}}}}},"required":true},"responses":{"200":{"description":"Success.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"},"data":{"$ref":"#\/components\/schemas\/ManagementFlagValue"}}}}}},"401":{"$ref":"#\/components\/responses\/ManagementUnauthorized"},"403":{"$ref":"#\/components\/responses\/ManagementForbiddenScope"},"404":{"$ref":"#\/components\/responses\/ManagementNotFound"},"422":{"$ref":"#\/components\/responses\/ManagementValidationError"},"429":{"$ref":"#\/components\/responses\/ManagementRateLimited"}}},"delete":{"tags":["Flag Values"],"summary":"Delete a flag value","description":"Delete a flag value. Fails if the value is currently published to an environment,\nreferenced by a target rule, or is the flag's current default. Requires the\n`flags:write` scope.","parameters":[{"name":"projectKey","in":"path","description":"The project's key.","required":true,"schema":{"type":"string"}},{"name":"flagKey","in":"path","description":"The flag's key.","required":true,"schema":{"type":"string"}},{"name":"valueUlid","in":"path","description":"The value's ULID.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#\/components\/responses\/ManagementEmpty"},"401":{"$ref":"#\/components\/responses\/ManagementUnauthorized"},"403":{"$ref":"#\/components\/responses\/ManagementForbiddenScope"},"404":{"$ref":"#\/components\/responses\/ManagementNotFound"},"422":{"$ref":"#\/components\/responses\/ManagementValidationError"},"429":{"$ref":"#\/components\/responses\/ManagementRateLimited"}}}},"\/management\/v1\/projects\/{projectKey}\/flags\/{flagKey}\/values\/{valueUlid}\/default":{"patch":{"tags":["Flag Values"],"summary":"Set a flag value as the default","description":"Set a flag value as the flag's default, clearing the default flag on any other\nvalue for the flag. Requires the `flags:write` scope.","parameters":[{"name":"projectKey","in":"path","description":"The project's key.","required":true,"schema":{"type":"string"}},{"name":"flagKey","in":"path","description":"The flag's key.","required":true,"schema":{"type":"string"}},{"name":"valueUlid","in":"path","description":"The value's ULID.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"},"data":{"$ref":"#\/components\/schemas\/ManagementFlagValue"}}}}}},"401":{"$ref":"#\/components\/responses\/ManagementUnauthorized"},"403":{"$ref":"#\/components\/responses\/ManagementForbiddenScope"},"404":{"$ref":"#\/components\/responses\/ManagementNotFound"},"429":{"$ref":"#\/components\/responses\/ManagementRateLimited"}}}},"\/management\/v1\/projects\/{projectKey}\/flags\/{flagKey}\/environments\/{environmentKey}\/targets":{"get":{"tags":["Targets"],"summary":"List targets","description":"List all targets for a flag\/environment, newest first. Requires the `targets:read` scope.","parameters":[{"name":"projectKey","in":"path","description":"The project's key.","required":true,"schema":{"type":"string"}},{"name":"flagKey","in":"path","description":"The flag's key.","required":true,"schema":{"type":"string"}},{"name":"environmentKey","in":"path","description":"The environment's key.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success. All targets for the flag\/environment, newest first. Not paginated.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/ManagementTarget"}}}}}}},"401":{"$ref":"#\/components\/responses\/ManagementUnauthorized"},"403":{"$ref":"#\/components\/responses\/ManagementForbiddenScope"},"404":{"$ref":"#\/components\/responses\/ManagementNotFound"},"429":{"$ref":"#\/components\/responses\/ManagementRateLimited"}}},"post":{"tags":["Targets"],"summary":"Create a draft target","description":"Start a new draft target for a flag\/environment by cloning the currently-published\ntarget's rules, criteria, and value links. Requires the `targets:write` scope.","parameters":[{"name":"Idempotency-Key","in":"header","description":"Optional. Replaying the same key with the same request body and token returns the original response instead of repeating the operation.","required":false,"schema":{"type":"string","maxLength":255}}],"responses":{"200":{"description":"Success.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"},"data":{"$ref":"#\/components\/schemas\/ManagementTarget"}}}}}},"401":{"$ref":"#\/components\/responses\/ManagementUnauthorized"},"403":{"$ref":"#\/components\/responses\/ManagementForbiddenScope"},"404":{"$ref":"#\/components\/responses\/ManagementNotFound"},"422":{"$ref":"#\/components\/responses\/ManagementGenericError"},"429":{"$ref":"#\/components\/responses\/ManagementRateLimited"}}}},"\/management\/v1\/projects\/{projectKey}\/flags\/{flagKey}\/environments\/{environmentKey}\/targets\/{targetUlid}":{"get":{"tags":["Targets"],"summary":"Get a target","description":"Get a single target by ULID. Requires the `targets:read` scope.","parameters":[{"name":"projectKey","in":"path","description":"The project's key.","required":true,"schema":{"type":"string"}},{"name":"flagKey","in":"path","description":"The flag's key.","required":true,"schema":{"type":"string"}},{"name":"environmentKey","in":"path","description":"The environment's key.","required":true,"schema":{"type":"string"}},{"name":"targetUlid","in":"path","description":"The target's ULID.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"},"data":{"$ref":"#\/components\/schemas\/ManagementTarget"}}}}}},"401":{"$ref":"#\/components\/responses\/ManagementUnauthorized"},"403":{"$ref":"#\/components\/responses\/ManagementForbiddenScope"},"404":{"$ref":"#\/components\/responses\/ManagementNotFound"},"429":{"$ref":"#\/components\/responses\/ManagementRateLimited"}}},"put":{"tags":["Targets"],"summary":"Update a draft target","description":"Edit a draft target's base\/fallthrough value and\/or comment before publishing.\nThe target must be a draft. Requires the `targets:write` scope.","parameters":[{"name":"Idempotency-Key","in":"header","description":"Optional. Replaying the same key with the same request body and token returns the original response instead of repeating the operation.","required":false,"schema":{"type":"string","maxLength":255}}],"requestBody":{"description":"Edit a draft target's base\/fallthrough value and\/or comment. At least one field must be provided.","content":{"application\/json":{"schema":{"type":"object","properties":{"value_ulid":{"description":"The new base\/fallthrough value ULID.","type":"string"},"comment":{"description":"An optional comment describing the change.","type":"string","nullable":true}}}}},"required":true},"responses":{"200":{"description":"Success.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"},"data":{"$ref":"#\/components\/schemas\/ManagementTarget"}}}}}},"401":{"$ref":"#\/components\/responses\/ManagementUnauthorized"},"403":{"$ref":"#\/components\/responses\/ManagementForbiddenScope"},"404":{"$ref":"#\/components\/responses\/ManagementNotFound"},"422":{"$ref":"#\/components\/responses\/ManagementGenericError"},"429":{"$ref":"#\/components\/responses\/ManagementRateLimited"}}},"delete":{"tags":["Targets"],"summary":"Cancel a draft or scheduled target","description":"Cancel a draft or scheduled target without publishing it, discarding the target\nwithout affecting the currently-published target. Requires the `targets:write` scope.","parameters":[{"name":"projectKey","in":"path","description":"The project's key.","required":true,"schema":{"type":"string"}},{"name":"flagKey","in":"path","description":"The flag's key.","required":true,"schema":{"type":"string"}},{"name":"environmentKey","in":"path","description":"The environment's key.","required":true,"schema":{"type":"string"}},{"name":"targetUlid","in":"path","description":"The target's ULID.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#\/components\/responses\/ManagementEmpty"},"401":{"$ref":"#\/components\/responses\/ManagementUnauthorized"},"403":{"$ref":"#\/components\/responses\/ManagementForbiddenScope"},"404":{"$ref":"#\/components\/responses\/ManagementNotFound"},"422":{"$ref":"#\/components\/responses\/ManagementGenericError"},"429":{"$ref":"#\/components\/responses\/ManagementRateLimited"}}}},"\/management\/v1\/projects\/{projectKey}\/flags\/{flagKey}\/environments\/{environmentKey}\/targets\/{targetUlid}\/rules":{"get":{"tags":["Target Rules"],"summary":"List target rules","description":"List all targeting rules for a target, in evaluation order. Requires the `targets:read` scope.","parameters":[{"name":"projectKey","in":"path","description":"The project's key.","required":true,"schema":{"type":"string"}},{"name":"flagKey","in":"path","description":"The flag's key.","required":true,"schema":{"type":"string"}},{"name":"environmentKey","in":"path","description":"The environment's key.","required":true,"schema":{"type":"string"}},{"name":"targetUlid","in":"path","description":"The target's ULID.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success. All rules for the target, in evaluation order. Not paginated.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/ManagementTargetRule"}}}}}}},"401":{"$ref":"#\/components\/responses\/ManagementUnauthorized"},"403":{"$ref":"#\/components\/responses\/ManagementForbiddenScope"},"404":{"$ref":"#\/components\/responses\/ManagementNotFound"},"429":{"$ref":"#\/components\/responses\/ManagementRateLimited"}}},"post":{"tags":["Target Rules"],"summary":"Create a target rule","description":"Create a new targeting rule on a target. Requires the `targets:write` scope.","parameters":[{"name":"Idempotency-Key","in":"header","description":"Optional. Replaying the same key with the same request body and token returns the original response instead of repeating the operation.","required":false,"schema":{"type":"string","maxLength":255}}],"requestBody":{"description":"Create a targeting rule.","content":{"application\/json":{"schema":{"type":"object","required":["value_ulid","description","criteria"],"properties":{"value_ulid":{"description":"The flag value to serve when this rule matches.","type":"string"},"description":{"type":"string","maxLength":500,"example":"US-based enterprise accounts"},"criteria":{"type":"object","required":["selector","comparer"],"properties":{"selector":{"enum":["attribute","context","segment"],"type":"string"},"comparer":{"description":"Allowed values depend on `selector`: `context`\/`segment` allow equal, notequal, in, notin. `attribute` additionally allows gt, gte, lt, lte, isnull, notnull, contains, notcontains, startswith, endswith, notstartswith, notendswith.","enum":["equal","notequal","in","notin","gt","gte","lt","lte","isnull","notnull","contains","notcontains","startswith","endswith","notstartswith","notendswith"],"type":"string"},"sub_selector":{"description":"Attribute name, required when `selector` is `attribute`.","type":"string","nullable":true},"values":{"description":"Required (min 1) unless `comparer` is `isnull` or `notnull`, in which case it is omitted.","type":"array","items":{"type":"string"}}}}}}}},"required":true},"responses":{"200":{"description":"Success.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"},"data":{"$ref":"#\/components\/schemas\/ManagementTargetRule"}}}}}},"401":{"$ref":"#\/components\/responses\/ManagementUnauthorized"},"403":{"$ref":"#\/components\/responses\/ManagementForbiddenScope"},"404":{"$ref":"#\/components\/responses\/ManagementNotFound"},"422":{"$ref":"#\/components\/responses\/ManagementValidationError"},"429":{"$ref":"#\/components\/responses\/ManagementRateLimited"}}}},"\/management\/v1\/projects\/{projectKey}\/flags\/{flagKey}\/environments\/{environmentKey}\/targets\/{targetUlid}\/publish":{"put":{"tags":["Targets"],"summary":"Publish a target","description":"Publish a draft or scheduled target, replacing the currently-served value and\nexpiring the previously-published target(s) for the same flag\/environment.\nProvide `scheduled_at` to schedule a future publish instead of publishing\nimmediately. Requires the `targets:write` scope.\n\nIf the environment requires a comment for changes, `comment` becomes required.\nIf the environment requires a typed confirmation, this request is rejected\nwith a 422 regardless of other input, since the Management API has no way to\nsatisfy a confirmation step.","parameters":[{"name":"Idempotency-Key","in":"header","description":"Optional. Replaying the same key with the same request body and token returns the original response instead of repeating the operation.","required":false,"schema":{"type":"string","maxLength":255}}],"requestBody":{"description":"Publish a draft or scheduled target, replacing the currently-served value. Provide scheduled_at to schedule a future publish instead of publishing immediately.","content":{"application\/json":{"schema":{"type":"object","properties":{"comment":{"description":"A comment describing the change. Required if the environment has comments required for changes.","type":"string","nullable":true},"scheduled_at":{"description":"When provided, schedules the target for future publication instead of publishing it immediately. Must be a future date.","format":"date-time","type":"string","nullable":true},"rollout_enabled":{"description":"Whether to configure a percentage rollout as part of this publish\/schedule.","type":"boolean"},"rollout_mode":{"description":"Required when rollout_enabled is true.","enum":["manual","automatic"],"type":"string"},"rollout_percentage":{"description":"Required when rollout_enabled is true and rollout_mode is manual; prohibited otherwise.","type":"integer","maximum":100,"minimum":1}}}}},"required":true},"responses":{"200":{"description":"Success.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"},"data":{"$ref":"#\/components\/schemas\/ManagementTarget"}}}}}},"401":{"$ref":"#\/components\/responses\/ManagementUnauthorized"},"403":{"$ref":"#\/components\/responses\/ManagementForbiddenScope"},"404":{"$ref":"#\/components\/responses\/ManagementNotFound"},"422":{"$ref":"#\/components\/responses\/ManagementGenericError"},"429":{"$ref":"#\/components\/responses\/ManagementRateLimited"}}}},"\/management\/v1\/projects\/{projectKey}\/flags\/{flagKey}\/environments\/{environmentKey}\/targets\/{targetUlid}\/rollout":{"post":{"tags":["Targets"],"summary":"Initialize a rollout on a draft target","description":"Start a percentage-based rollout on a draft target. The target must be a draft\nand must not already have a rollout configured. Requires the `targets:write` scope.","parameters":[{"name":"Idempotency-Key","in":"header","description":"Optional. Replaying the same key with the same request body and token returns the original response instead of repeating the operation.","required":false,"schema":{"type":"string","maxLength":255}}],"requestBody":{"description":"Initialize a rollout on a draft target.","content":{"application\/json":{"schema":{"type":"object","required":["rollout_mode"],"properties":{"rollout_mode":{"enum":["manual","automatic"],"type":"string","example":"manual"},"rollout_percentage":{"description":"Required when rollout_mode is manual; prohibited when automatic.","type":"integer","maximum":100,"minimum":1,"example":10}}}}},"required":true},"responses":{"200":{"description":"Success.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"},"data":{"$ref":"#\/components\/schemas\/ManagementTarget"}}}}}},"401":{"$ref":"#\/components\/responses\/ManagementUnauthorized"},"403":{"$ref":"#\/components\/responses\/ManagementForbiddenScope"},"404":{"$ref":"#\/components\/responses\/ManagementNotFound"},"422":{"$ref":"#\/components\/responses\/ManagementGenericError"},"429":{"$ref":"#\/components\/responses\/ManagementRateLimited"}}},"put":{"tags":["Targets"],"summary":"Update, pause, or resume a target's rollout","description":"Update the rollout percentage of a target, or pause\/resume an in-progress rollout.\nThe target must be published and have an active rollout. Updating the percentage\nadditionally requires the rollout to be in manual mode. Requires the `targets:write` scope.","parameters":[{"name":"Idempotency-Key","in":"header","description":"Optional. Replaying the same key with the same request body and token returns the original response instead of repeating the operation.","required":false,"schema":{"type":"string","maxLength":255}}],"requestBody":{"description":"Update the rollout percentage of a published target with an active rollout, or pause\/resume it. Provide exactly one of action or rollout_percentage.","content":{"application\/json":{"schema":{"oneOf":[{"type":"object","required":["action"],"properties":{"action":{"description":"Pause or resume the rollout.","enum":["pause","resume"],"type":"string","example":"pause"}}},{"type":"object","required":["rollout_percentage"],"properties":{"rollout_percentage":{"description":"New manual-mode rollout percentage.","type":"integer","maximum":100,"minimum":1,"example":50}}}]}}},"required":true},"responses":{"200":{"description":"Success.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"},"data":{"$ref":"#\/components\/schemas\/ManagementTarget"}}}}}},"401":{"$ref":"#\/components\/responses\/ManagementUnauthorized"},"403":{"$ref":"#\/components\/responses\/ManagementForbiddenScope"},"404":{"$ref":"#\/components\/responses\/ManagementNotFound"},"422":{"$ref":"#\/components\/responses\/ManagementRolloutUpdateError"},"429":{"$ref":"#\/components\/responses\/ManagementRateLimited"}}},"delete":{"tags":["Targets"],"summary":"Remove a target's rollout","description":"Remove all rollout configuration from a target, reverting it to a plain\nbase\/fallthrough value. The target must have a rollout configured.\nRequires the `targets:write` scope.","parameters":[{"name":"projectKey","in":"path","description":"The project's key.","required":true,"schema":{"type":"string"}},{"name":"flagKey","in":"path","description":"The flag's key.","required":true,"schema":{"type":"string"}},{"name":"environmentKey","in":"path","description":"The environment's key.","required":true,"schema":{"type":"string"}},{"name":"targetUlid","in":"path","description":"The target's ULID.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"},"data":{"$ref":"#\/components\/schemas\/ManagementTarget"}}}}}},"401":{"$ref":"#\/components\/responses\/ManagementUnauthorized"},"403":{"$ref":"#\/components\/responses\/ManagementForbiddenScope"},"404":{"$ref":"#\/components\/responses\/ManagementNotFound"},"422":{"$ref":"#\/components\/responses\/ManagementGenericError"},"429":{"$ref":"#\/components\/responses\/ManagementRateLimited"}}}},"\/management\/v1\/projects\/{projectKey}\/flags\/{flagKey}\/environments\/{environmentKey}\/targets\/{targetUlid}\/rollout\/complete":{"post":{"tags":["Targets"],"summary":"Manually complete a target's rollout","description":"Complete a target's rollout immediately, setting it to 100% and expiring the\npreviously-published target(s) for the same flag\/environment. The target must\nhave a rollout configured that is not already completed. Requires the\n`targets:write` scope.","parameters":[{"name":"projectKey","in":"path","description":"The project's key.","required":true,"schema":{"type":"string"}},{"name":"flagKey","in":"path","description":"The flag's key.","required":true,"schema":{"type":"string"}},{"name":"environmentKey","in":"path","description":"The environment's key.","required":true,"schema":{"type":"string"}},{"name":"targetUlid","in":"path","description":"The target's ULID.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"},"data":{"$ref":"#\/components\/schemas\/ManagementTarget"}}}}}},"401":{"$ref":"#\/components\/responses\/ManagementUnauthorized"},"403":{"$ref":"#\/components\/responses\/ManagementForbiddenScope"},"404":{"$ref":"#\/components\/responses\/ManagementNotFound"},"422":{"$ref":"#\/components\/responses\/ManagementGenericError"},"429":{"$ref":"#\/components\/responses\/ManagementRateLimited"}}}},"\/management\/v1\/projects\/{projectKey}\/flags\/{flagKey}\/environments\/{environmentKey}\/targets\/{targetUlid}\/rules\/{ruleUlid}":{"put":{"tags":["Target Rules"],"summary":"Update a target rule","description":"Replace an existing targeting rule's value, description, and criteria. Requires the `targets:write` scope.","parameters":[{"name":"Idempotency-Key","in":"header","description":"Optional. Replaying the same key with the same request body and token returns the original response instead of repeating the operation.","required":false,"schema":{"type":"string","maxLength":255}}],"requestBody":{"description":"Replace a targeting rule's value, description, and criteria.","content":{"application\/json":{"schema":{"type":"object","required":["value_ulid","description","criteria"],"properties":{"value_ulid":{"description":"The flag value to serve when this rule matches.","type":"string"},"description":{"type":"string","maxLength":500,"example":"US-based enterprise accounts"},"criteria":{"type":"object","required":["selector","comparer"],"properties":{"selector":{"enum":["attribute","context","segment"],"type":"string"},"comparer":{"description":"Allowed values depend on `selector`: `context`\/`segment` allow equal, notequal, in, notin. `attribute` additionally allows gt, gte, lt, lte, isnull, notnull, contains, notcontains, startswith, endswith, notstartswith, notendswith.","enum":["equal","notequal","in","notin","gt","gte","lt","lte","isnull","notnull","contains","notcontains","startswith","endswith","notstartswith","notendswith"],"type":"string"},"sub_selector":{"description":"Attribute name, required when `selector` is `attribute`.","type":"string","nullable":true},"values":{"description":"Required (min 1) unless `comparer` is `isnull` or `notnull`, in which case it is omitted.","type":"array","items":{"type":"string"}}}}}}}},"required":true},"responses":{"200":{"description":"Success.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"},"data":{"$ref":"#\/components\/schemas\/ManagementTargetRule"}}}}}},"401":{"$ref":"#\/components\/responses\/ManagementUnauthorized"},"403":{"$ref":"#\/components\/responses\/ManagementForbiddenScope"},"404":{"$ref":"#\/components\/responses\/ManagementNotFound"},"422":{"$ref":"#\/components\/responses\/ManagementValidationError"},"429":{"$ref":"#\/components\/responses\/ManagementRateLimited"}}},"delete":{"tags":["Target Rules"],"summary":"Delete a target rule","description":"Delete a targeting rule. Requires the `targets:write` scope.","parameters":[{"name":"projectKey","in":"path","description":"The project's key.","required":true,"schema":{"type":"string"}},{"name":"flagKey","in":"path","description":"The flag's key.","required":true,"schema":{"type":"string"}},{"name":"environmentKey","in":"path","description":"The environment's key.","required":true,"schema":{"type":"string"}},{"name":"targetUlid","in":"path","description":"The target's ULID.","required":true,"schema":{"type":"string"}},{"name":"ruleUlid","in":"path","description":"The rule's ULID.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#\/components\/responses\/ManagementEmpty"},"401":{"$ref":"#\/components\/responses\/ManagementUnauthorized"},"403":{"$ref":"#\/components\/responses\/ManagementForbiddenScope"},"404":{"$ref":"#\/components\/responses\/ManagementNotFound"},"422":{"$ref":"#\/components\/responses\/ManagementValidationError"},"429":{"$ref":"#\/components\/responses\/ManagementRateLimited"}}}},"\/management\/v1\/projects\/{projectKey}\/flags\/{flagKey}\/environments\/{environmentKey}\/targets\/{targetUlid}\/rules-order":{"put":{"tags":["Target Rules"],"summary":"Reorder target rules","description":"Set the evaluation order of a target's rules. Rules are matched in ascending\n`order` when a target is evaluated. Requires the `targets:write` scope.","parameters":[{"name":"Idempotency-Key","in":"header","description":"Optional. Replaying the same key with the same request body and token returns the original response instead of repeating the operation.","required":false,"schema":{"type":"string","maxLength":255}}],"requestBody":{"description":"Reorder a target's rules.","content":{"application\/json":{"schema":{"type":"object","required":["rules"],"properties":{"rules":{"description":"Rules belonging to another target are ignored. Rules not included keep their current position.","type":"array","items":{"type":"object","required":["ulid","order"],"properties":{"ulid":{"description":"The rule's ULID.","type":"string"},"order":{"description":"The rule's new position, lowest evaluated first.","type":"integer"}}}}}}}},"required":true},"responses":{"200":{"description":"Success. All rules for the target, in evaluation order. Not paginated.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/ManagementTargetRule"}}}}}}},"401":{"$ref":"#\/components\/responses\/ManagementUnauthorized"},"403":{"$ref":"#\/components\/responses\/ManagementForbiddenScope"},"404":{"$ref":"#\/components\/responses\/ManagementNotFound"},"422":{"$ref":"#\/components\/responses\/ManagementValidationError"},"429":{"$ref":"#\/components\/responses\/ManagementRateLimited"}}}},"\/management\/v1\/audit-logs":{"get":{"tags":["Audit Logs"],"summary":"List audit log entries","description":"List Management API audit log entries for the authenticated token's account, newest first\nby default. Requires the `audit:read` scope.","parameters":[{"name":"per_page","in":"query","description":"Items per page. Default 25, max 100.","required":false,"schema":{"default":25,"type":"integer","maximum":100,"minimum":1}},{"name":"sort","in":"query","description":"Sort order by creation time.","required":false,"schema":{"enum":["created_at_desc","created_at_asc"],"default":"created_at_desc","type":"string"}},{"name":"from","in":"query","description":"Only entries created at or after this timestamp.","required":false,"schema":{"format":"date-time","type":"string"}},{"name":"to","in":"query","description":"Only entries created at or before this timestamp.","required":false,"schema":{"format":"date-time","type":"string"}},{"name":"action","in":"query","description":"Filter by audit action.","required":false,"schema":{"enum":["auth.missing_token","auth.invalid_token","auth.expired_token","auth.plan_restricted","scope.denied","project.listed","environment.listed","flag.listed","flag.read","flag.created","flag.updated","flag.deleted","flag.evaluated","flag.bulk_deleted","flag_value.listed","flag_value.read","flag_value.created","flag_value.updated","flag_value.deleted","flag_value.default_set","target.listed","target.read","target.created","target.updated","target.rollout_initialized","target.rollout_updated","target.rollout_deleted","target.rollout_completed","target.published","target.scheduled","target.deleted","target.cloned","target_rule.listed","target_rule.created","target_rule.updated","target_rule.deleted","target_rule.reordered","unknown"],"type":"string"}},{"name":"result","in":"query","description":"Filter by audit result.","required":false,"schema":{"enum":["success","denied_auth","denied_scope","denied_plan","not_found","validation_error","denied_environment_policy","server_error"],"type":"string"}},{"name":"subject_type","in":"query","description":"Filter by subject type (e.g. \"flag\", \"target\").","required":false,"schema":{"type":"string","maxLength":100}},{"name":"subject_ulid","in":"query","description":"Filter by subject ULID.","required":false,"schema":{"type":"string","maxLength":26}},{"name":"management_token_ulid","in":"query","description":"Filter by the management token that performed the action.","required":false,"schema":{"type":"string","maxLength":26}},{"name":"actor_ulid","in":"query","description":"Filter by the acting user.","required":false,"schema":{"type":"string","maxLength":26}},{"name":"cursor","in":"query","description":"Opaque cursor from a previous response's `meta.next_cursor`, for fetching the next page.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success. Cursor-paginated audit log entries for the token's account.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/ManagementAuditLogEntry"}},"meta":{"type":"object","properties":{"per_page":{"type":"integer","example":25},"sort":{"enum":["created_at_desc","created_at_asc"],"type":"string"},"next_cursor":{"type":"string","nullable":true}}}}}}}},"401":{"$ref":"#\/components\/responses\/ManagementUnauthorized"},"403":{"$ref":"#\/components\/responses\/ManagementForbiddenScope"},"422":{"$ref":"#\/components\/responses\/ManagementValidationError"},"429":{"$ref":"#\/components\/responses\/ManagementRateLimited"}}}},"\/management\/v1\/api-public-audit-logs":{"get":{"tags":["Audit Logs"],"summary":"List public API audit log entries","description":"List public API audit log entries for the authenticated token's account, newest first\nby default. Requires the `audit:read` scope.","parameters":[{"name":"per_page","in":"query","description":"Items per page. Default 25, max 100.","required":false,"schema":{"default":25,"type":"integer","maximum":100,"minimum":1}},{"name":"sort","in":"query","description":"Sort order by creation time.","required":false,"schema":{"enum":["created_at_desc","created_at_asc"],"default":"created_at_desc","type":"string"}},{"name":"from","in":"query","description":"Only entries created at or after this timestamp.","required":false,"schema":{"format":"date-time","type":"string"}},{"name":"to","in":"query","description":"Only entries created at or before this timestamp.","required":false,"schema":{"format":"date-time","type":"string"}},{"name":"action","in":"query","description":"Filter by audit action.","required":false,"schema":{"enum":["flags.evaluated","flag.evaluated","flag_json.retrieved","usage.reported","auth.invalid_token","unknown"],"type":"string"}},{"name":"result","in":"query","description":"Filter by audit result.","required":false,"schema":{"enum":["success","denied_auth","not_found","server_error"],"type":"string"}},{"name":"subject_type","in":"query","description":"Filter by subject type (e.g. \"flag\").","required":false,"schema":{"type":"string","maxLength":100}},{"name":"subject_ulid","in":"query","description":"Filter by subject ULID.","required":false,"schema":{"type":"string","maxLength":26}},{"name":"environment_ulid","in":"query","description":"Filter by the environment the request was made against.","required":false,"schema":{"type":"string","maxLength":26}},{"name":"actor_type","in":"query","description":"Filter by actor type.","required":false,"schema":{"enum":["sdk_key","anonymous"],"type":"string"}},{"name":"cursor","in":"query","description":"Opaque cursor from a previous response's `meta.next_cursor`, for fetching the next page.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success. Cursor-paginated public API audit log entries for the token's account.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/ApiPublicAuditLogEntry"}},"meta":{"type":"object","properties":{"per_page":{"type":"integer","example":25},"sort":{"enum":["created_at_desc","created_at_asc"],"type":"string"},"next_cursor":{"type":"string","nullable":true}}}}}}}},"401":{"$ref":"#\/components\/responses\/ManagementUnauthorized"},"403":{"$ref":"#\/components\/responses\/ManagementForbiddenScope"},"422":{"$ref":"#\/components\/responses\/ManagementValidationError"},"429":{"$ref":"#\/components\/responses\/ManagementRateLimited"}}}}},"components":{"schemas":{"ApiPublicAuditLogEntry":{"type":"object","required":["ulid","actor_type","action","result","status_code","created_at"],"properties":{"ulid":{"type":"string"},"actor_type":{"type":"string","example":"sdk_key"},"environment":{"type":"object","properties":{"ulid":{"type":"string"},"key":{"type":"string"}},"nullable":true},"action":{"type":"string","example":"flag.evaluated"},"subject_type":{"type":"string","nullable":true},"subject_ulid":{"type":"string","nullable":true},"subject_label":{"type":"string","nullable":true},"result":{"type":"string","example":"success"},"status_code":{"type":"integer","example":200},"result_detail":{"type":"object","nullable":true},"context":{"type":"object","nullable":true},"request_id":{"type":"string","nullable":true},"ip_address":{"type":"string","nullable":true},"client_agent":{"type":"string","nullable":true},"created_at":{"format":"date-time","type":"string"}}},"ManagementAuditLogEntry":{"type":"object","required":["ulid","action","result","status_code","created_at"],"properties":{"ulid":{"type":"string"},"actor":{"type":"object","properties":{"type":{"type":"string","nullable":true},"ulid":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}}},"token":{"type":"object","properties":{"ulid":{"type":"string"},"name":{"type":"string"}},"nullable":true},"http_method":{"type":"string","nullable":true},"http_path":{"type":"string","nullable":true},"action":{"type":"string","example":"flag.updated"},"subject_type":{"type":"string","nullable":true},"subject_ulid":{"type":"string","nullable":true},"subject_label":{"type":"string","nullable":true},"result":{"type":"string","example":"success"},"status_code":{"type":"integer","example":200},"result_detail":{"type":"object","nullable":true},"before":{"type":"object","nullable":true},"after":{"type":"object","nullable":true},"request_id":{"type":"string","nullable":true},"ip_address":{"type":"string","nullable":true},"created_at":{"format":"date-time","type":"string"}}},"ManagementError":{"type":"object","required":["status","message"],"properties":{"status":{"enum":["error"],"type":"string","example":"error"},"message":{"type":"string","example":"Flag not found."}}},"ManagementFlagEvaluation":{"type":"object","required":["key","name","type","value"],"properties":{"key":{"type":"string","example":"checkout-redesign"},"name":{"type":"string","example":"Checkout Redesign"},"type":{"enum":["boolean","number","string","json"],"type":"string"},"value":{"type":"object"},"resolved_by":{"enum":["rule","rollout","default"],"type":"string","nullable":true}}},"ManagementFlag":{"type":"object","required":["ulid","type","key","name","permanent","include_in_mobile","include_in_client","created_at","updated_at"],"properties":{"ulid":{"type":"string","example":"01hqz3k1e9v8j2n8k9v8j2n8k9"},"type":{"enum":["boolean","number","string","json"],"type":"string"},"key":{"type":"string","example":"checkout-redesign"},"name":{"type":"string","example":"Checkout Redesign"},"description":{"type":"string","nullable":true,"example":"Rolls out the redesigned checkout flow."},"permanent":{"type":"boolean","example":false},"include_in_mobile":{"type":"boolean","example":true},"include_in_client":{"type":"boolean","example":true},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}}},"ManagementFlagValue":{"type":"object","required":["ulid","display","value","default","created_at","updated_at"],"properties":{"ulid":{"type":"string","example":"01hqz3k1e9v8j2n8k9v8j2n8k9"},"display":{"type":"string","example":"true"},"value":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"object"},{"type":"array"}]},"default":{"type":"boolean","example":false},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}}},"ManagementProjectEnvironment":{"type":"object","required":["ulid","key","name","comments_required","confirmation_required","created_at","updated_at"],"properties":{"ulid":{"type":"string","example":"01hqz3k1e9v8j2n8k9v8j2n8k9"},"key":{"type":"string","example":"production"},"name":{"type":"string","example":"Production"},"description":{"type":"string","nullable":true,"example":"The live environment."},"color":{"type":"string","nullable":true,"example":"#22c55e"},"comments_required":{"type":"boolean","example":false},"confirmation_required":{"type":"boolean","example":false},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}}},"ManagementProject":{"type":"object","required":["ulid","key","name","created_at","updated_at"],"properties":{"ulid":{"type":"string","example":"01hqz3k1e9v8j2n8k9v8j2n8k9"},"key":{"type":"string","example":"my-app"},"name":{"type":"string","example":"My App"},"description":{"type":"string","nullable":true,"example":"The main product."},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}}},"ManagementTargetRuleCriterion":{"type":"object","required":["ulid","target_rule_ulid","selector","comparer","position"],"properties":{"ulid":{"type":"string"},"target_rule_ulid":{"type":"string"},"selector":{"enum":["attribute","context","segment"],"type":"string"},"sub_selector":{"type":"string","nullable":true},"comparer":{"enum":["equal","notequal","in","notin","gt","gte","lt","lte","isnull","notnull","contains","notcontains","startswith","endswith","notstartswith","notendswith"],"type":"string"},"position":{"type":"integer"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"contexts":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"ulid":{"type":"string","nullable":true},"type":{"type":"string","nullable":true},"name":{"type":"string"},"identifier":{"type":"string"}}}}}},"segments":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"ulid":{"type":"string"},"name":{"type":"string"},"count":{"type":"integer"}}}}}},"values":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"ulid":{"type":"string"},"environment_ulid":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}}}}}}}},"ManagementTargetRule":{"type":"object","required":["ulid","target_ulid","value_ulid","description","position","created_at","updated_at"],"properties":{"ulid":{"type":"string","example":"01hqz3k1e9v8j2n8k9v8j2n8k9"},"target_ulid":{"type":"string"},"value_ulid":{"type":"string"},"description":{"type":"string","example":"US-based enterprise accounts"},"position":{"type":"integer"},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"},"criteria":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/ManagementTargetRuleCriterion"}}}}}},"ManagementTarget":{"type":"object","required":["ulid","flag_ulid","environment_ulid","status","created_at","updated_at"],"properties":{"ulid":{"type":"string","example":"01hqz3k1e9v8j2n8k9v8j2n8k9"},"flag_ulid":{"type":"string"},"environment_ulid":{"type":"string"},"value_ulid":{"type":"string","nullable":true},"status":{"enum":["draft","scheduled","published","expired"],"type":"string"},"comment":{"type":"string","nullable":true},"rollout_percentage":{"type":"integer","maximum":100,"minimum":1,"nullable":true},"rollout_mode":{"enum":["manual","automatic"],"type":"string","nullable":true},"rollout_status":{"enum":["active","paused","completed"],"type":"string","nullable":true},"scheduled_at":{"format":"date-time","type":"string","nullable":true},"published_at":{"format":"date-time","type":"string","nullable":true},"expired_at":{"format":"date-time","type":"string","nullable":true},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}}},"ManagementValidationError":{"type":"object","required":["message","errors"],"properties":{"message":{"type":"string","example":"The key field is required."},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"example":{"key":["The key field is required."]}}}}},"responses":{"ManagementBulkDeleteFlags":{"description":"Success.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"},"data":{"type":"object","properties":{"deleted":{"description":"Keys of flags that were deleted.","type":"array","items":{"type":"string"}},"not_found":{"description":"Keys that did not match an existing flag.","type":"array","items":{"type":"string"}}}}}}}}},"ManagementEmpty":{"description":"Success.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"}}}}}},"ManagementForbiddenScope":{"description":"The token is valid but lacks the scope required for this operation.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"error"},"message":{"type":"string","example":"Token lacks required scope: flags:write"},"required_scope":{"type":"string","example":"flags:write"}}}}}},"ManagementGenericError":{"description":"The request failed \u2014 check the message field for what went wrong.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ManagementError"}}}},"ManagementNotFound":{"description":"The requested resource, or one of its ancestors in the path, does not exist for this account.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ManagementError"}}}},"ManagementRateLimited":{"description":"The token has exceeded its per-minute request limit. Retry after the window resets.","headers":{"X-RateLimit-Limit":{"description":"Requests allowed per window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix timestamp when the current window resets.","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds until the current window resets.","schema":{"type":"integer"}}},"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ManagementError"}}}},"ManagementRolloutUpdateError":{"description":"Either the request body failed validation, or the target\/rollout is not eligible for the requested update (not published, no active rollout, rollout not in manual mode for a percentage update, or pause\/resume does not match the rollout's current status).","content":{"application\/json":{"schema":{"oneOf":[{"$ref":"#\/components\/schemas\/ManagementValidationError"},{"$ref":"#\/components\/schemas\/ManagementError"}]}}}},"ManagementUnauthorized":{"description":"Missing, invalid, revoked, or expired management API token.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ManagementError"}}}},"ManagementValidationError":{"description":"The request body failed validation.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ManagementValidationError"}}}}},"securitySchemes":{"ManagementTokenAuth":{"type":"http","description":"Management API token, sent as a Bearer token: `Authorization: Bearer <token>`. Tokens are scoped \u2014 see the operation's required scope below.","scheme":"bearer","bearerFormat":"token"}}},"security":{"ManagementTokenAuth":[]},"tags":[{"name":"Flags","description":"Create, read, update, and delete feature flags."},{"name":"Targets","description":"Read targets and update rollout percentages."},{"name":"Target Rules","description":"Manage targeting rules attached to a target."},{"name":"Audit Logs","description":"Read the account audit trail for Management API activity."}]}