{"openapi":"3.0.2","info":{"title":"api Public API","version":"1.0.0"},"servers":[{"url":"https:\/\/api.zenmanage.com"}],"paths":{"\/v1\/flags":{"get":{"summary":"Retrieve all flags","description":"Evaluate and retrieve the complete list of active flags for a given environment.","parameters":[{"name":"x-zen-context","in":"header","description":"The context information that is used to determine how flags should be evaluated. The `x-zenmanage-context` header (or the shortened `c` header) is also accepted as a legacy alias.","required":false,"schema":{"$ref":"#\/components\/schemas\/Context"}},{"name":"x-zen-default-value","in":"header","description":"The default value that is used if a response is not received from the API. The `x-default-value` header (or the shortened `d` header) is also accepted as a legacy alias.","required":false,"schema":{"$ref":"#\/components\/schemas\/DefaultValue"}}],"responses":{"200":{"description":"Success.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"},"data":{"type":"array","items":{"type":"object","properties":{"flag":{"type":"object","properties":{"":{"$ref":"#\/components\/schemas\/Flag"}}}}}}}}}}},"401":{"$ref":"#\/components\/responses\/ErrorUnauthorized"},"429":{"$ref":"#\/components\/responses\/ErrorRateLimited"},"500":{"$ref":"#\/components\/responses\/InternalServerError"}}}},"\/v1\/flags\/{flagKey}":{"get":{"summary":"Retrieve individual flags","description":"Evaluate and retrieve an individual active flags for a given environment.","parameters":[{"name":"x-zen-context","in":"header","description":"The context information that is used to determine how flags should be evaluated. The `x-zenmanage-context` header (or the shortened `c` header) is also accepted as a legacy alias.","required":false,"schema":{"$ref":"#\/components\/schemas\/Context"}},{"name":"x-zen-default-value","in":"header","description":"The default value that is used if a response is not received from the API. The `x-default-value` header (or the shortened `d` header) is also accepted as a legacy alias.","required":false,"schema":{"$ref":"#\/components\/schemas\/DefaultValue"}}],"responses":{"200":{"description":"Success.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"},"data":{"type":"object","properties":{"flag":{"type":"object","properties":{"":{"$ref":"#\/components\/schemas\/Flag"}}}}}}}}}},"401":{"$ref":"#\/components\/responses\/ErrorUnauthorized"},"404":{"$ref":"#\/components\/responses\/ErrorNotFound"},"429":{"$ref":"#\/components\/responses\/ErrorRateLimited"},"500":{"$ref":"#\/components\/responses\/InternalServerError"}}}},"\/v1\/flags\/{flagKey}\/usage":{"post":{"summary":"Store flag usage","description":"Stores flag usage for a given environment.","parameters":[{"name":"flagKey","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"}}}}}},"401":{"$ref":"#\/components\/responses\/ErrorUnauthorized"},"404":{"$ref":"#\/components\/responses\/ErrorNotFound"},"429":{"$ref":"#\/components\/responses\/ErrorRateLimited"}}}},"\/v1\/flag-json":{"get":{"summary":"Retrieve precomputed flag JSON","description":"Retrieve the location of the precomputed flag JSON for the given environment based on the token\nthat was passed in the headers.","parameters":[{"name":"x-zen-client-agent","in":"header","description":"Identifies the calling SDK as `<sdk-family>\/<version>`, e.g. `zenmanage-php\/1.2.0`. Required \u2014 requests without a recognized SDK family are rejected.","required":true,"schema":{"type":"string","example":"zenmanage-php\/1.2.0"}},{"name":"x-zen-context","in":"header","description":"The context information that is used to determine how flags should be evaluated. The `x-zenmanage-context` header (or the shortened `c` header) is also accepted as a legacy alias.","required":false,"schema":{"$ref":"#\/components\/schemas\/Context"}}],"responses":{"200":{"description":"Success.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"},"data":{"type":"object","properties":{"url":{"type":"string","nullable":true,"example":"https:\/\/cdn.zenmanage.com\/flags\/01environmentulidexample\/server.json"},"cdn":{"type":"string","nullable":true,"example":"https:\/\/cdn.zenmanage.com"},"path":{"type":"string","nullable":true,"example":"flags\/01environmentulidexample\/server.json"},"signed":{"type":"boolean","example":false}}}}}}}},"401":{"$ref":"#\/components\/responses\/ErrorUnauthorized"},"403":{"$ref":"#\/components\/responses\/ErrorForbidden"},"429":{"$ref":"#\/components\/responses\/ErrorRateLimited"}}}}},"components":{"schemas":{"Context":{"type":"object","properties":{"type":{"type":"string","example":"user"},"name":{"type":"string","example":"John Doe"},"identifier":{"type":"string","example":"5ca10e14-f587-4805-9d48-e00c76f9e780"},"attributes":{"type":"object","properties":{"":{"anyOf":[{"type":"boolean","example":true},{"type":"integer","example":12456},{"type":"string","example":"west"},{"type":"array","items":{"type":"string","example":"AB2912"}}]}}}}},"DefaultValue":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","example":"feature-flag"},"name":{"type":"string","example":"test-value"},"type":{"enum":["string","number","boolean"],"type":"string"}}}},"Flag":{"type":"object","properties":{"key":{"type":"string","example":"feature-flag"},"name":{"type":"string","example":"Feature Flag"},"type":{"enum":["string","number","boolean"],"type":"string"},"value":{"oneOf":[{"type":"object","properties":{"string":{"type":"string","example":"This is a string"}}},{"type":"object","properties":{"number":{"type":"number","example":123}}},{"type":"object","properties":{"boolean":{"type":"boolean","example":false}}}]}}},"FlagUsageHistory":{"type":"object","properties":{"period":{"type":"string","example":"7d"},"interval":{"type":"string","example":"day"},"compare":{"type":"boolean","example":true},"range":{"type":"object","properties":{"start":{"format":"date-time","type":"string","example":"2026-03-03T00:00:00Z"},"end":{"format":"date-time","type":"string","example":"2026-03-09T00:00:00Z"}}},"points":{"type":"array","items":{"type":"object","properties":{"bucket_start":{"type":"string","example":"2026-03-09T00:00:00Z"},"count":{"type":"integer","example":20},"previous_count":{"type":"integer","nullable":true,"example":14},"delta":{"type":"integer","nullable":true,"example":6},"value_breakdown":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","example":"01valueulidexample"},"label":{"type":"string","example":"on"},"color":{"type":"string","example":"#0ea5e9"},"count":{"type":"integer","example":12}}}}}}},"value_series":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","example":"01valueulidexample"},"label":{"type":"string","example":"on"},"color":{"type":"string","example":"#0ea5e9"},"total":{"type":"integer","example":100}}}},"totals":{"type":"object","properties":{"current":{"type":"integer","example":120},"previous":{"type":"integer","nullable":true,"example":100},"delta":{"type":"integer","nullable":true,"example":20},"change_percent":{"type":"number","nullable":true,"example":20}}}}}},"responses":{"ErrorForbidden":{"description":"Unauthorized access.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"error"},"message":{"type":"string","example":"Invalid API key provided."}}}}}},"InternalServerError":{"description":"Internal Server Error.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"error"},"message":{"type":"string","example":"Internal Server Error"}}}}}},"ErrorNotFound":{"description":"Not Found.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"error"},"message":{"type":"string","example":"Flag not found."}}}}}},"ErrorRateLimited":{"description":"The request has exceeded the per-minute rate limit for this IP or account. 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":{"type":"object","properties":{"message":{"type":"string","example":"Too Many Attempts."}}}}}},"ErrorUnauthorized":{"description":"Unauthorized access.","content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"error"},"message":{"type":"string","example":"Invalid API key provided."}}}}}}},"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","description":"The `x-api-key` and `x-zenmanage-key` headers (or the shortened `u` header) are also accepted as legacy aliases for `x-zen-api-key`.","name":"x-zen-api-key","in":"header"}}},"security":{"ApiKeyAuth":[]}}