1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00
unleash.unleash/docs/api/oas/swagger.json

1480 lines
47 KiB
JSON
Raw Normal View History

{
"swagger": "2.0",
"info": {
"contact": {
"name": "The Unleash team",
"url": "https://unleash.github.io/"
},
"description": "Unleash is an open source feature flag and toggle system for all your applications and services.\n\nOnce you have [set your Unleash server up](https://unleash.github.io/docs/getting_started), you can test the API from inside your browser. The following assumes the server is running on localhost:4242.\n\nThe following 'endpoints' (such as `GET /admin/metrics/applications`) provide reference documentation for the Unleash REST API. To try out API calls:\n1. Expand an endpoint\n2. Click **Try it out**\n3. Customize the **Request body** and/or **Parameters**.\n4. Click **Execute**.\n\nYou will see the cURL request submitted to the API server and the corresponding response.\n\nAlternatively, you can test the API in [Postman](https://app.getpostman.com/run-collection/8552ddcd4cc9fc012548)\n\n[![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/8552ddcd4cc9fc012548)",
"title": "Unleash API",
"version": "3.5.6"
},
"host": "localhost:4242",
"basePath": "/api",
"schemes": ["http"],
"paths": {
"/admin/archive/features": {
"get": {
"produces": ["application/json"],
"parameters": [],
"responses": {
"200": {
"description": "Successful response",
"schema": {
"$ref": "#/definitions/200"
}
},
"401": {
"description": "Not authorized",
"schema": {
"$ref": "#/definitions/401"
}
},
"404": {
"description": "Feature Toggle not found"
}
},
"tags": ["Archive"],
"description": "Archived feature toggles are those that have been previously deleted",
"operationId": "fetchArchivedToggles",
"summary": "List all the archived feature toggles on the Unleash server"
}
},
"/admin/archive/revive/{featureName}": {
"post": {
"parameters": [
{
"description": "Must match an existing Feature Toggle name.",
"in": "path",
"name": "featureName",
"required": true,
"type": "string",
"x-example": "featureX"
}
],
"responses": {
"200": {
"description": "Feature Toggle successfully revived"
},
"404": {
"description": "Feature Toggle not found"
}
},
"tags": ["Archive"],
"description": "The Feature Toggle had been previously deleted",
"operationId": "reviveFeatureToggle",
"summary": "Un-archive a Feature Toggle"
}
},
"/admin/events": {
"get": {
"produces": ["application/json"],
"parameters": [],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/200-events"
}
},
"401": {
"description": "Not authorized",
"schema": {
"$ref": "#/definitions/401"
}
}
},
"tags": ["Events"],
"description": "Returns one of the six event types:\n- feature-created\n- feature-updated\n- feature-archived\n- feature-revived\n- strategy-created\n- strategy-deleted",
"operationId": "get-admin-events",
"summary": "Fetch all changes in the Unleash system"
}
},
"/admin/feature-types": {
"get": {
"produces": ["application/json"],
"parameters": [],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/200featuretype"
}
},
"401": {
"description": "Not authorized",
"schema": {
"$ref": "#/definitions/401"
}
}
},
"tags": ["Feature types"],
"description": "- release\n- experiment\n- ops\n- killswitch\n- permission",
"operationId": "get-admin-feature-types",
"summary": "Fetch the list of Unleash feature types"
}
},
"/admin/features": {
"get": {
"produces": ["application/json"],
"parameters": [],
"responses": {
"200": {
"description": "Successful response",
"schema": {
"$ref": "#/definitions/200"
}
},
"401": {
"description": "Not authorized",
"schema": {
"$ref": "#/definitions/401"
}
}
},
"tags": ["Feature toggles"],
"externalDocs": {
"description": "Activation strategies",
"url": "https://unleash.github.io/docs/activation_strategy"
},
"description": "The response returns all active feature toggles and their current strategy configuration:\n- A feature toggle will have *at least* one configured strategy.\n- A strategy will have a `name` and `parameters` map.\n",
"operationId": "getFeatures",
"summary": "Fetches all feature toggles from the Unleash server."
},
"post": {
"consumes": ["application/json"],
"produces": ["application/json"],
"parameters": [
{
"in": "body",
"name": "body",
"required": true,
"schema": {
"$ref": "#/definitions/featureToggleSchema"
}
}
],
"responses": {
"201": {
"description": "Feature Toggle successfully created"
},
"400": {
"description": "Bad body request (for example, Feature Toggle name is not unique)"
},
"401": {
"description": "Not authorized",
"schema": {
"$ref": "#/definitions/401"
}
}
},
"tags": ["Feature toggles"],
"description": "Create a new Feature Toggle",
"operationId": "createFeatureToggle",
"summary": "Create a Feature Toggle"
}
},
"/admin/features/{featureName}": {
"delete": {
"produces": ["application/json"],
"parameters": [
{
"description": "Must match an existing Feature Toggle name.",
"in": "path",
"name": "featureName",
"required": true,
"type": "string",
"x-example": "featureX"
}
],
"responses": {
"200": {
"description": "Feature Toggle successfully archived"
},
"401": {
"description": "Not authorized",
"schema": {
"$ref": "#/definitions/401"
}
},
"404": {
"description": "Feature Toggle not found"
}
},
"tags": ["Feature toggles", "Archive"],
"description": "Feature toggles can only be archived - they cannot be deleted.\n\nIf an old Feature Toggle *re-appears*, this is because someone else has created a new one with the same name.\n",
"operationId": "archiveFeatureToggle",
"summary": "Archive a Feature Toggle."
},
"get": {
"produces": ["application/json"],
"parameters": [
{
"description": "Must match an existing Feature Toggle name.",
"in": "path",
"name": "featureName",
"required": true,
"type": "string",
"x-example": "featureX"
}
],
"responses": {
"200": {
"description": "Successful response",
"schema": {
"$ref": "#/definitions/200"
}
},
"401": {
"description": "Not authorized",
"schema": {
"$ref": "#/definitions/401"
}
}
},
"tags": ["Feature toggles"],
"externalDocs": {
"description": "Activation strategies",
"url": "https://unleash.github.io/docs/activation_strategy"
},
"description": "The response returns the Feature Toggle's current strategy configuration:\n- It will have *at least* one configured strategy.\n- A strategy will have a *name* and *parameters* map.\n",
"operationId": "getFeature",
"summary": "Fetches a specific Feature Toggle from the Unleash server."
},
"put": {
"consumes": ["application/json"],
"produces": ["application/json"],
"parameters": [
{
"description": "Must match an existing Feature Toggle name.",
"in": "path",
"name": "featureName",
"required": true,
"type": "string",
"x-example": "featureX"
},
{
"in": "body",
"name": "body",
"required": true,
"schema": {
"$ref": "#/definitions/featureToggleSchema"
}
}
],
"responses": {
"200": {
"description": "Feature Toggle successfully updated",
"schema": {
"$ref": "#/definitions/200"
}
},
"400": {
"description": "Bad body request (for example 'strategies' is not an array)"
},
"401": {
"description": "Not authorized",
"schema": {
"$ref": "#/definitions/401"
}
},
"404": {
"description": "Feature Toggle not found"
}
},
"tags": ["Feature toggles"],
"description": "Update a Feature Toggle.",
"operationId": "featureName",
"summary": "Update a Feature Toggle"
}
},
"/admin/features/{featureName}/stale/off": {
"post": {
"produces": ["application/json"],
"parameters": [
{
"description": "Must match an existing Feature Toggle name.",
"in": "path",
"name": "featureName",
"required": true,
"type": "string",
"x-example": "featureX"
}
],
"responses": {
"200": {
"description": "Successful response",
"schema": {
"$ref": "#/definitions/200"
}
},
"401": {
"description": "Not authorized",
"schema": {
"$ref": "#/definitions/401"
}
},
"404": {
"description": "Feature Toggle not found"
}
},
"tags": ["Feature toggles"],
"externalDocs": {
"description": "Feature Toggle types",
"url": "https://unleash.github.io/docs/feature_toggle_types"
},
"description": "**featureName** must match an existing Feature Toggle.",
"operationId": "markFeatureToggleActive",
"summary": "Mark a Feature Toggle as active."
}
},
"/admin/features/{featureName}/stale/on": {
"post": {
"produces": ["application/json"],
"parameters": [
{
"description": "Must match an existing Feature Toggle name.",
"in": "path",
"name": "featureName",
"required": true,
"type": "string",
"x-example": "featureX"
}
],
"responses": {
"200": {
"description": "Successful response",
"schema": {
"$ref": "#/definitions/200"
}
},
"401": {
"description": "Not authorized",
"schema": {
"$ref": "#/definitions/401"
}
},
"404": {
"description": "Feature Toggle not found"
}
},
"tags": ["Feature toggles"],
"externalDocs": {
"description": "Feature Toggle types",
"url": "https://unleash.github.io/docs/feature_toggle_types"
},
"description": "**featureName** must match an existing Feature Toggle.",
"operationId": "markFeatureToggleStale",
"summary": "Mark a Feature Toggle as 'stale' (deprecated)."
}
},
"/admin/features/{featureName}/toggle/off": {
"post": {
"produces": ["application/json"],
"parameters": [
{
"description": "Must match an existing Feature Toggle name.",
"in": "path",
"name": "featureName",
"required": true,
"type": "string",
"x-example": "featureX"
}
],
"responses": {
"200": {
"description": "Successful response",
"schema": {
"$ref": "#/definitions/200"
}
},
"401": {
"description": "Not authorized",
"schema": {
"$ref": "#/definitions/401"
}
},
"404": {
"description": "Feature Toggle not found"
}
},
"tags": ["Feature toggles"],
"description": "**featureName** must match an existing Feature Toggle.",
"operationId": "disableFeatureToggle",
"summary": "Disable a Feature Toggle."
}
},
"/admin/features/{featureName}/toggle/on": {
"post": {
"produces": ["application/json"],
"parameters": [
{
"description": "Must match an existing Feature Toggle name.",
"in": "path",
"name": "featureName",
"required": true,
"type": "string",
"x-example": "featureX"
}
],
"responses": {
"200": {
"description": "Successful response",
"schema": {
"$ref": "#/definitions/200"
}
},
"401": {
"description": "Not authorized",
"schema": {
"$ref": "#/definitions/401"
}
},
"404": {
"description": "Feature Toggle not found"
}
},
"tags": ["Feature toggles"],
"description": "**featureName** must match an existing Feature Toggle.",
"operationId": "enableFeatureToggle",
"summary": "Enable a Feature Toggle."
}
},
"/admin/metrics/applications": {
"get": {
"produces": ["application/json"],
"parameters": [],
"responses": {
"200": {
"description": "Successful response",
"schema": {
"$ref": "#/definitions/applicationArray"
}
},
"401": {
"description": "Not authorized",
"schema": {
"$ref": "#/definitions/401"
}
}
},
"tags": ["Metrics"],
"description": "Also has a link for more details.",
"operationId": "getApplications",
"summary": "A list of known applications ('seen' by Unleash in the last two days)"
}
},
"/admin/metrics/applications/{appName}": {
"get": {
"produces": ["application/json"],
"parameters": [
{
"description": "Must match an existing application name.",
"in": "path",
"name": "appName",
"required": true,
"type": "string",
"x-example": "my-application"
}
],
"responses": {
"200": {
"description": "Successful response",
"schema": {
"$ref": "#/definitions/200appdetails"
}
},
"401": {
"description": "Not authorized",
"schema": {
"$ref": "#/definitions/401"
}
},
"500": {
"description": "Application name not found"
}
},
"tags": ["Metrics"],
"description": "Details include things such as instances, strategies implemented and seen feature toggles.",
"operationId": "getApplicationDetails",
"summary": "Details about a client application."
}
},
"/admin/metrics/feature-toggles": {
"get": {
"produces": ["application/json"],
"parameters": [],
"responses": {
"200": {
"description": "Successful response",
"schema": {
"$ref": "#/definitions/200feature"
}
},
"401": {
"description": "Not authorized",
"schema": {
"$ref": "#/definitions/401"
}
}
},
"tags": ["Metrics"],
"description": "- **Yes** is the number of times a given feature toggle was enabled in a client applucation\n- **No** is the number of times it was disabled.",
"operationId": "featureToggles",
"summary": "Gives 'last minute' and 'last hour' metrics for all active feature toggles (based on what was reported by the client applications)."
}
},
"/admin/metrics/seen-apps": {
"get": {
"produces": ["application/json"],
"parameters": [],
"responses": {
"200": {
"description": "Successful response",
"schema": {
"$ref": "#/definitions/applicationArray"
}
},
"401": {
"description": "Not authorized",
"schema": {
"$ref": "#/definitions/401"
}
}
},
"tags": ["Metrics"],
"description": "(per Feature Toggle)",
"operationId": "seenApps",
"summary": "Details about seen applications"
}
},
"/admin/metrics/seen-toggles": {
"get": {
"produces": ["application/json"],
"parameters": [],
"responses": {
"200": {
"description": "Successful response",
"schema": {
"$ref": "#/definitions/200seen"
}
}
},
"tags": ["Metrics"],
"description": "It is only guaranteed that feature toggles reported by client applications within the last hour will be returned. However, in most cases, earlier reported feature toggles will also be returned.",
"operationId": "seenToggles",
"summary": "Returns a list of applications and the feature toggles that Unleash has 'seen' for each application."
}
},
"/admin/state/export": {
"get": {
"produces": ["application/json"],
"parameters": [
{
"description": "Choose export format, either json or yaml. json is the default\n",
"enum": ["json", "yaml"],
"in": "query",
"name": "format",
"type": "string",
"x-example": "json"
},
{
"description": "Do you want to export the data as a file? Default is false",
"in": "query",
"name": "download",
"type": "boolean",
"x-example": false
},
{
"description": "Do you want to include feature toggles in the export? Default is true",
"in": "query",
"name": "featureToggles",
"type": "boolean",
"x-example": true
},
{
"description": "Do you want to include strategies in the export? Default is true",
"in": "query",
"name": "strategies",
"type": "boolean",
"x-example": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/200export"
}
},
"401": {
"description": "Not authorized",
"schema": {
"$ref": "#/definitions/401"
}
}
},
"tags": ["Import and export"],
"externalDocs": {
"description": "Import and export",
"url": "https://unleash.github.io/docs/import_export"
},
"description": "Exports a list of feature toggles and/or strategies in either JSON or YAML format.",
"operationId": "get-admin-state-export",
"summary": "Export feature toggles and strategies"
}
},
"/admin/state/import": {
"post": {
"consumes": ["multipart/form-data", "application/json"],
"produces": ["application/json"],
"parameters": [
{
"default": "false",
"description": "Be careful using this in production environments. Set to true if you want the to remove all strategies and feature toggles from the datebase before import. Default is false.",
"in": "query",
"name": "drop",
"type": "boolean"
},
{
"default": "false",
"description": "Set to *true* if you want keep all existing feature toggles and strategies as is; only the missing feature toggles and strategies will be inserted from the import data. Default is true.",
"in": "query",
"name": "keep",
"type": "boolean",
"x-example": true
},
{
"format": "binary",
"in": "formData",
"name": "fileName",
"type": "string"
}
],
"responses": {
"200": {
"description": "Successful import."
},
"401": {
"description": "Not authorized",
"schema": {
"$ref": "#/definitions/401"
}
},
"404": {
"description": "No import data provided."
}
},
"tags": ["Import and export"],
"externalDocs": {
"description": "Import and export",
"url": "https://unleash.github.io/docs/import_export"
},
"description": "Upload the data, in JSON or YAML format.\nYou can add in the POST body or upload a file\n- **POST body** (JSON format only) - next to **Request body**, choose the *application/json* dropdown option.\n- **File upload** (JOSN or YAML format) - next to **Request body**, choose the *multipart/form-data* dropdown option. This adopts the same schema as `GET /admin/state/export`",
"operationId": "post-admin-state-import",
"summary": "Import feature toggles and strategies"
}
},
"/admin/strategies": {
"get": {
"produces": ["application/json"],
"parameters": [],
"responses": {
"200": {
"description": "Successful response",
"schema": {
"$ref": "#/definitions/200strategy"
}
},
"401": {
"description": "Not authorized",
"schema": {
"$ref": "#/definitions/401"
}
}
},
"tags": ["Strategies"],
"description": "Fetch all strategies and their parameters.",
"operationId": "getStrategies",
"summary": "Fetch all strategies and their parameters."
},
"post": {
"consumes": ["application/json"],
"produces": ["application/json"],
"parameters": [
{
"in": "body",
"name": "body",
"required": true,
"schema": {
"$ref": "#/definitions/createStrategy"
}
}
],
"responses": {
"201": {
"description": "Strategy successfully added"
},
"400": {
"description": "Bad body request (for example 'strategies' is not an array)"
},
"401": {
"description": "Not authorized",
"schema": {
"$ref": "#/definitions/401"
}
},
"409": {
"description": "Strategy already exists",
"schema": {
"$ref": "#/definitions/409"
}
}
},
"tags": ["Strategies"],
"description": "Create Strategy",
"operationId": "createStrategy",
"summary": "Create Strategy"
}
},
"/admin/strategies/{strategyName}": {
"put": {
"consumes": ["application/json"],
"produces": ["application/json"],
"parameters": [
{
"description": "Must match an existing Strategy name.",
"in": "path",
"name": "strategyName",
"required": true,
"type": "string",
"x-example": "flexibleRollout"
},
{
"in": "body",
"name": "body",
"required": true,
"schema": {
"$ref": "#/definitions/createStrategy"
}
}
],
"responses": {
"200": {
"description": "Strategy successfully updated."
},
"401": {
"description": "Not authorized",
"schema": {
"$ref": "#/definitions/401"
}
},
"404": {
"description": "Strategy not updated due to errors in query and/or request body (such as **name** and **strategyName** not matching)."
}
},
"tags": ["Strategies"],
"description": "Use to update a Strategy definition.\n\n**name** and **strategyName** must match and must also match an existing Strategy name.\n\n**Caution: It can be dangerous to change a Strategy (as the implementation also might need to be changed).**\n",
"operationId": "updateStrategy",
"summary": "Update Strategy"
}
}
},
"definitions": {
"200": {
"properties": {
"features": {
"$ref": "#/definitions/featureToggleSchema"
},
"version": {
"$ref": "#/definitions/versionSchema"
}
},
"title": "Successful response",
"type": "object"
},
"401": {
"description": "Not authorized",
"title": "Unauthorized access",
"properties": {
"message": {
"minLength": 1,
"type": "string"
},
"path": {
"minLength": 1,
"type": "string"
},
"type": {
"minLength": 1,
"type": "string"
}
},
"required": ["type", "path", "message"],
"type": "object"
},
"409": {
"properties": {
"details": {
"items": {
"properties": {
"message": {
"description": "Error message",
"minLength": 1,
"type": "string"
}
},
"required": ["message"]
},
"minItems": 1,
"type": "array",
"uniqueItems": true
},
"isJoi": {
"description": "For internal use by the Unleash developers",
"type": "boolean"
},
"name": {
"description": "Title of error",
"minLength": 1,
"type": "string"
}
},
"required": ["isJoi", "name", "details"],
"title": "Error",
"type": "object"
},
"200-events": {
"properties": {
"events": {
"items": {
"properties": {
"createdAt": {
"description": "The first time the application registered with Unleash (in [ISO8601 format](https://www.w3.org/TR/NOTE-datetime))",
"example": "2016-12-09T14:56:36.730Z",
"type": "string"
},
"createdBy": {
"description": "The current user's *email* or *username* (taken from the *User* object on the current session)",
"minLength": 1,
"type": "string"
},
"data": {
"$ref": "#/definitions/featureToggleSchema"
},
"diffs": {
"externalDocs": {
"description": "Activation strategies",
"url": "https://www.npmjs.com/package/deep-diff#differences"
},
"description": "The JSON differences between the current and last version of the Feature Toggle.\n(Uses the [deep-diff Node.js module](https://www.npmjs.com/package/deep-diff))",
"items": {
"properties": {
"kind": {
"description": "The kind of change:\n- **N** - a newly-added property or element\n- **D** - a property or element was deleted\n- **E** - a property or element was edited\n- **A** - a change occurred within an array",
"enum": ["N", "D", "E", "A"],
"example": "E",
"type": "string"
},
"lhs": {
"description": "The value on the left-hand-side of the comparison (*undefined* if **kind** is *N*)",
"example": true,
"type": "boolean"
},
"path": {
"items": {
"required": ["pathItem"]
},
"properties": {
"pathItem": {
"description": "The property path (from the left-hand-side root)",
"example": "enabled",
"type": "string"
}
},
"type": "array"
},
"rhs": {
"description": "The value on the right-hand-side of the comparison (*undefined* if **kind** is *D*)",
"example": false,
"type": "boolean"
}
},
"required": ["kind", "lhs", "rhs"]
},
"type": "array"
},
"id": {
"description": "The event number. All events have a unique id.",
"example": 55,
"type": "number"
},
"type": {
"description": "One of the six event types",
"enum": [
"feature-created",
"feature-updated",
"feature-archived",
"feature-revived",
"strategy-created",
"strategy-deleted"
],
"example": "feature-updated",
"minLength": 1,
"type": "string"
}
}
},
"minItems": 1,
"required": ["id", "type", "createdBy", "createdAt"],
"type": "array",
"uniqueItems": true
},
"version": {
"$ref": "#/definitions/versionSchema"
}
},
"title": "Successful response",
"type": "object"
},
"200appdetails": {
"properties": {
"application": {
"$ref": "#/definitions/application"
},
"instances": {
"properties": {
"appName": {
"description": "Application name",
"example": "my-application",
"minLength": 1,
"type": "string"
},
"clientIp": {
"description": "The IP address of the system running this instance of the application",
"example": "::ffff:127.0.0.1",
"minLength": 1,
"type": "string"
},
"createdAt": {
"description": "The first time the application registered with Unleash (in [ISO8601 format](https://www.w3.org/TR/NOTE-datetime))",
"example": "2020-11-13T16:56:29.279Z",
"minLength": 1,
"type": "string"
},
"instanceId": {
"description": "The name of the system running the application",
"example": "generated-732038-17080",
"minLength": 1,
"type": "string"
},
"lastSeen": {
"description": "The last time the application 'talked' to Unleash (sent metrics, registered, fetched feature toggles) - in [ISO8601 format](https://www.w3.org/TR/NOTE-datetime)",
"example": "2020-11-14T11:17:24.482Z",
"minLength": 1,
"type": "string"
},
"sdkVersion": {
"description": "The version of the Unleash client SDK running the application",
"example": "unleash-client-node:3.4.0",
"minLength": 1,
"type": "string"
}
},
"required": [
"appName",
"instanceId",
"sdkVersion",
"clientIp",
"lastSeen",
"createdAt"
],
"type": "object"
},
"links": {
"properties": {
"self": {
"description": "Deprecated. Do not use",
"minLength": 1,
"type": "string"
}
},
"type": "object"
},
"seenToggles": {
"$ref": "#/definitions/featureToggleSchema"
},
"strategies": {
"$ref": "#/definitions/strategySchema"
}
},
"required": ["application", "instances", "strategies", "seenToggles"],
"title": "Successful response",
"type": "object"
},
"200export": {
"properties": {
"features": {
"$ref": "#/definitions/featureToggleSchema"
},
"strategies": {
"$ref": "#/definitions/strategySchema"
},
"version": {
"$ref": "#/definitions/versionSchema"
}
},
"required": ["version", "features", "strategies"],
"title": "Successful response",
"type": "object"
},
"200feature": {
"description": "- **lastHour** - how many times a Feature Toggle was accessed in the last hour.\n- **lastMinute** - how many times a Feature Toggle was accessed in the last minute.",
"items": {
"properties": {
"appName": {
"enum": ["lastHour", "lastMinute"],
"example": "lastHour",
"minLength": 1,
"type": "string"
},
"seenToggles": {
"properties": {
"metricsCount": {
"type": "number"
},
"yesno": {
"enum": ["yes", "no"],
"type": "string"
}
},
"required": ["yesno", "metricsCount"],
"type": "object"
}
},
"required": ["appName", "seenToggles"],
"title": "Feature Toggle metrics",
"type": "object"
},
"minItems": 1,
"title": "Successful response",
"type": "array",
"uniqueItems": true
},
"200featuretype": {
"properties": {
"types": {
"items": {
"properties": {
"description": {
"description": "A description of what this Feature Toggle type could be used for",
"enum": [
"Enables trunk-based development for teams practicing continuous delivery",
"Performs multivariate or A/B testing",
"Controls operational aspects of the system behavior",
"Gracefully degrades system functionality",
"Changes the features or product experiences that certain users receive"
],
"minLength": 1,
"type": "string"
},
"id": {
"$ref": "#/definitions/featureToggleTypeSchema"
},
"lifetimeDays": {
"externalDocs": {
"description": "Feature Toggle types",
"url": "https://unleash.github.io/docs/feature_toggle_types"
},
"description": "The number of days this Feature Toggle is intended to be used. This information is used to issue deprecation notices",
"example": 40,
"type": "number"
},
"name": {
"description": "The title of the Feature Toggle type",
"enum": [
"Release",
"Experiment",
"Operational",
"Kill switch",
"Permission"
],
"example": "Release",
"minLength": 1,
"type": "string"
}
},
"required": ["id", "name", "description", "lifetimeDays"]
},
"minItems": 1,
"type": "array",
"uniqueItems": true
},
"version": {
"$ref": "#/definitions/versionSchema"
}
},
"required": ["version", "types"],
"title": "Successful response",
"type": "object"
},
"200seen": {
"items": {
"properties": {
"appName": {
"minLength": 1,
"type": "string"
},
"metricsCount": {
"type": "number"
},
"seenToggles": {
"items": {
"properties": {}
},
"type": "array"
}
},
"required": ["appName", "seenToggles", "metricsCount"],
"title": "Feature Toggle information",
"type": "object"
},
"minItems": 1,
"title": "Successful response",
"type": "array",
"uniqueItems": true
},
"200strategy": {
"properties": {
"strategies": {
"$ref": "#/definitions/strategySchema"
},
"version": {
"$ref": "#/definitions/versionSchema"
}
},
"required": ["version", "strategies"],
"title": "Successful response",
"type": "object"
},
"application": {
"properties": {
"applications": {
"items": {
"properties": {
"appName": {
"description": "Application name",
"example": "my-application",
"type": "string"
},
"color": {
"description": "Deprecated. Do not use",
"type": "string"
},
"createdAt": {
"description": "The first time the application registered with Unleash (in [ISO8601 format](https://www.w3.org/TR/NOTE-datetime))",
"example": "2016-12-09T14:56:36.730Z",
"type": "string"
},
"description": {
"description": "A description of what the application does",
"type": "string"
},
"icon": {
"description": "The application's icon. Must be one of the [Material Design icon names](https://material.io/resources/icons/?style=baseline)",
"example": "comment_bank",
"type": "string"
},
"strategies": {
"description": "A description of what the application does",
"type": "string"
},
"updatedAt": {
"description": "The last time the application 'talked' to Unleash (sent metrics, registered, fetched feature toggles) - in [ISO8601 format](https://www.w3.org/TR/NOTE-datetime)",
"example": "2020-11-14T09:55:23.653Z",
"type": "string"
},
"url": {
"description": "Absolute URL to the actual application",
"example": "http://someapp.internal.url",
"type": "string"
}
},
"required": ["appName", "createdAt", "updatedAt", "strategies"]
},
"minItems": 1,
"type": "array",
"uniqueItems": true
}
},
"required": ["applications"],
"title": "Application details",
"type": "object"
},
"applicationArray": {
"items": {
"$ref": "#/definitions/application"
},
"title": "List of applications",
"type": "array"
},
"createStrategy": {
"properties": {
"parameters": {
"items": {
"properties": {
"description": {
"example": "What percent of users should the new Feature Toggle be active for?",
"minLength": 1,
"type": "string"
},
"name": {
"example": "percentage",
"minLength": 1,
"type": "string"
},
"required": {
"example": true,
"type": "boolean"
},
"type": {
"example": "percentage",
"minLength": 1,
"type": "string"
}
},
"required": ["name", "type", "description", "required"]
},
"minItems": 1,
"type": "array",
"uniqueItems": true
},
"description": {
"example": "Gradual rollout to logged in users",
"minLength": 1,
"type": "string"
},
"name": {
"example": "gradualRollout",
"minLength": 1,
"type": "string"
}
},
"required": ["name", "description", "parameters"],
"title": "Strategy",
"type": "object"
},
"featureToggleSchema": {
"items": {
"properties": {
"createdAt": {
"minLength": 1,
"type": "string"
},
"description": {
"example": "Toggles featureX on and off",
"minLength": 1,
"type": "string"
},
"enabled": {
"description": "Is the Feature Toggle enabled?",
"example": true,
"type": "boolean"
},
"name": {
"description": "Feature Toggle name must be unique.",
"example": "featureX",
"minLength": 1,
"type": "string"
},
"stale": {
"description": "Is the Feature Toggle 'stale' (deprecated)?",
"example": false,
"type": "boolean"
},
"strategies": {
"$ref": "#/definitions/strategySchema"
},
"type": {
"$ref": "#/definitions/featureToggleTypeSchema"
},
"variants": {
"$ref": "#/definitions/variantsSchema"
}
},
"required": [
"name",
"description",
"type",
"enabled",
"stale",
"strategies"
],
"title": "Feature Toggle items",
"type": "object"
},
"title": "Feature Toggle",
"type": "array"
},
"featureToggleTypeSchema": {
"externalDocs": {
"description": "Feature Toggle types",
"url": "https://unleash.github.io/docs/feature_toggle_types"
},
"default": "release",
"description": "'One of the five Unleash Feature Toggle types.\n\n**type** is optional. If not defined, it defaults to *release*'",
"enum": ["release", "experiment", "ops", "killswitch", "permission"],
"example": "release",
"minLength": 1,
"title": "Types of Feature Toggle",
"type": "string"
},
"strategySchema": {
"items": {
"properties": {
"parameters": {
"properties": {
"parameter": {
"properties": {
"description": {
"description": "What the parameter does",
"example": "Define activation groups to allow you to correlate across feature toggles.",
"type": "string"
},
"name": {
"description": "The name of the parameter",
"example": "groupId",
"type": "string"
},
"required": {
"description": "Is this a required parameter?",
"example": false,
"type": "boolean"
},
"type": {
"description": "The type of the parameter",
"example": "string",
"type": "string"
}
},
"required": ["name", "type"],
"type": "object"
}
},
"type": "object"
},
"description": {
"description": "What the Strategy is",
"example": "Default on/off strategy.",
"type": "string"
},
"editable": {
"example": true,
"type": "boolean"
},
"name": {
"description": "Name of the Strategy",
"example": "default",
"minLength": 1,
"type": "string"
}
},
"type": "object"
},
"title": "Strategy",
"type": "array"
},
"variantsSchema": {
"externalDocs": {
"description": "How to use Feature Toggle variants",
"url": "https://unleash.github.io/docs/toggle_variants"
},
"items": {
"properties": {
"name": {
"description": "The name of the Feature Toggle variant",
"example": "yellow",
"minLength": 1,
"type": "string"
},
"weight": {
"description": "A number between 0 and 1,000.\nThe client SDK will summarize all variant weights, hash the number and divide the users among them. The distribution will be according to the weight as a fraction of the sum of weight.",
"example": 20,
"type": "number"
}
},
"required": ["name", "weight"]
},
"type": "array"
},
"versionSchema": {
"description": "For internal use by the Unleash developers",
"example": 1,
"title": "Internal version number",
"type": "number"
}
},
"tags": [
{
"description": "Handling Feature Toggle archiving and un-archiving",
"name": "Archive"
},
{
"description": "Identifying events on the Unleash server",
"name": "Events"
},
{
"description": "Accessing feature toggles",
"name": "Feature toggles"
},
{
"description": "Details of the five Unleash Feature Toggle types",
"name": "Feature types"
},
{
"description": "Importing and exporting feature toggles and strategies",
"name": "Import and export"
},
{
"description": "Determining usage of feature toggles and applications",
"name": "Metrics"
},
{
"description": "Accessing and updating strategies",
"name": "Strategies"
}
],
"externalDocs": {
"description": "Unleash documentation",
"url": "https://unleash.github.io/docs/getting_started"
},
"x-components": {
"parameters": {
"appNamePath": {
"description": "Must match an existing application name.",
"in": "path",
"name": "appName",
"required": true,
"type": "string",
"x-example": "my-application"
},
"featureNamePath": {
"description": "Must match an existing Feature Toggle name.",
"in": "path",
"name": "featureName",
"required": true,
"type": "string",
"x-example": "featureX"
},
"strategyNamePath": {
"description": "Must match an existing Strategy name.",
"in": "path",
"name": "strategyName",
"required": true,
"type": "string",
"x-example": "flexibleRollout"
}
}
}
}