2020-12-03 21:09:16 +01:00
{
"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" ,
2021-06-04 11:17:15 +02:00
"schemes" : [ "http" ] ,
2020-12-03 21:09:16 +01:00
"paths" : {
"/admin/archive/features" : {
"get" : {
2021-06-04 11:17:15 +02:00
"produces" : [ "application/json" ] ,
2020-12-03 21:09:16 +01:00
"parameters" : [ ] ,
"responses" : {
"200" : {
"description" : "Successful response" ,
"schema" : {
"$ref" : "#/definitions/200"
}
} ,
"401" : {
"description" : "Not authorized" ,
"schema" : {
"$ref" : "#/definitions/401"
}
} ,
"404" : {
"description" : "Feature Toggle not found"
}
} ,
2021-06-04 11:17:15 +02:00
"tags" : [ "Archive" ] ,
2020-12-03 21:09:16 +01:00
"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"
}
} ,
2021-06-04 11:17:15 +02:00
"tags" : [ "Archive" ] ,
2020-12-03 21:09:16 +01:00
"description" : "The Feature Toggle had been previously deleted" ,
"operationId" : "reviveFeatureToggle" ,
"summary" : "Un-archive a Feature Toggle"
}
} ,
"/admin/events" : {
"get" : {
2021-06-04 11:17:15 +02:00
"produces" : [ "application/json" ] ,
2020-12-03 21:09:16 +01:00
"parameters" : [ ] ,
"responses" : {
"200" : {
"description" : "OK" ,
"schema" : {
"$ref" : "#/definitions/200-events"
}
} ,
"401" : {
"description" : "Not authorized" ,
"schema" : {
"$ref" : "#/definitions/401"
}
}
} ,
2021-06-04 11:17:15 +02:00
"tags" : [ "Events" ] ,
2020-12-03 21:09:16 +01:00
"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" : {
2021-06-04 11:17:15 +02:00
"produces" : [ "application/json" ] ,
2020-12-03 21:09:16 +01:00
"parameters" : [ ] ,
"responses" : {
"200" : {
"description" : "OK" ,
"schema" : {
"$ref" : "#/definitions/200featuretype"
}
} ,
"401" : {
"description" : "Not authorized" ,
"schema" : {
"$ref" : "#/definitions/401"
}
}
} ,
2021-06-04 11:17:15 +02:00
"tags" : [ "Feature types" ] ,
2020-12-03 21:09:16 +01:00
"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" : {
2021-06-04 11:17:15 +02:00
"produces" : [ "application/json" ] ,
2020-12-03 21:09:16 +01:00
"parameters" : [ ] ,
"responses" : {
"200" : {
"description" : "Successful response" ,
"schema" : {
"$ref" : "#/definitions/200"
}
} ,
"401" : {
"description" : "Not authorized" ,
"schema" : {
"$ref" : "#/definitions/401"
}
}
} ,
2021-06-04 11:17:15 +02:00
"tags" : [ "Feature toggles" ] ,
2020-12-03 21:09:16 +01:00
"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" : {
2021-06-04 11:17:15 +02:00
"consumes" : [ "application/json" ] ,
"produces" : [ "application/json" ] ,
2020-12-03 21:09:16 +01:00
"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"
}
}
} ,
2021-06-04 11:17:15 +02:00
"tags" : [ "Feature toggles" ] ,
2020-12-03 21:09:16 +01:00
"description" : "Create a new Feature Toggle" ,
"operationId" : "createFeatureToggle" ,
"summary" : "Create a Feature Toggle"
}
} ,
"/admin/features/{featureName}" : {
"delete" : {
2021-06-04 11:17:15 +02:00
"produces" : [ "application/json" ] ,
2020-12-03 21:09:16 +01:00
"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"
}
} ,
2021-06-04 11:17:15 +02:00
"tags" : [ "Feature toggles" , "Archive" ] ,
2020-12-03 21:09:16 +01:00
"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" : {
2021-06-04 11:17:15 +02:00
"produces" : [ "application/json" ] ,
2020-12-03 21:09:16 +01:00
"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"
}
}
} ,
2021-06-04 11:17:15 +02:00
"tags" : [ "Feature toggles" ] ,
2020-12-03 21:09:16 +01:00
"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" : {
2021-06-04 11:17:15 +02:00
"consumes" : [ "application/json" ] ,
"produces" : [ "application/json" ] ,
2020-12-03 21:09:16 +01:00
"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"
}
} ,
2021-06-04 11:17:15 +02:00
"tags" : [ "Feature toggles" ] ,
2020-12-03 21:09:16 +01:00
"description" : "Update a Feature Toggle." ,
"operationId" : "featureName" ,
"summary" : "Update a Feature Toggle"
}
} ,
"/admin/features/{featureName}/stale/off" : {
"post" : {
2021-06-04 11:17:15 +02:00
"produces" : [ "application/json" ] ,
2020-12-03 21:09:16 +01:00
"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"
}
} ,
2021-06-04 11:17:15 +02:00
"tags" : [ "Feature toggles" ] ,
2020-12-03 21:09:16 +01:00
"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" : {
2021-06-04 11:17:15 +02:00
"produces" : [ "application/json" ] ,
2020-12-03 21:09:16 +01:00
"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"
}
} ,
2021-06-04 11:17:15 +02:00
"tags" : [ "Feature toggles" ] ,
2020-12-03 21:09:16 +01:00
"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" : {
2021-06-04 11:17:15 +02:00
"produces" : [ "application/json" ] ,
2020-12-03 21:09:16 +01:00
"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"
}
} ,
2021-06-04 11:17:15 +02:00
"tags" : [ "Feature toggles" ] ,
2020-12-03 21:09:16 +01:00
"description" : "**featureName** must match an existing Feature Toggle." ,
"operationId" : "disableFeatureToggle" ,
"summary" : "Disable a Feature Toggle."
}
} ,
"/admin/features/{featureName}/toggle/on" : {
"post" : {
2021-06-04 11:17:15 +02:00
"produces" : [ "application/json" ] ,
2020-12-03 21:09:16 +01:00
"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"
}
} ,
2021-06-04 11:17:15 +02:00
"tags" : [ "Feature toggles" ] ,
2020-12-03 21:09:16 +01:00
"description" : "**featureName** must match an existing Feature Toggle." ,
"operationId" : "enableFeatureToggle" ,
"summary" : "Enable a Feature Toggle."
}
} ,
"/admin/metrics/applications" : {
"get" : {
2021-06-04 11:17:15 +02:00
"produces" : [ "application/json" ] ,
2020-12-03 21:09:16 +01:00
"parameters" : [ ] ,
"responses" : {
"200" : {
"description" : "Successful response" ,
"schema" : {
"$ref" : "#/definitions/applicationArray"
}
} ,
"401" : {
"description" : "Not authorized" ,
"schema" : {
"$ref" : "#/definitions/401"
}
}
} ,
2021-06-04 11:17:15 +02:00
"tags" : [ "Metrics" ] ,
2020-12-03 21:09:16 +01:00
"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" : {
2021-06-04 11:17:15 +02:00
"produces" : [ "application/json" ] ,
2020-12-03 21:09:16 +01:00
"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"
}
} ,
2021-06-04 11:17:15 +02:00
"tags" : [ "Metrics" ] ,
2020-12-03 21:09:16 +01:00
"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" : {
2021-06-04 11:17:15 +02:00
"produces" : [ "application/json" ] ,
2020-12-03 21:09:16 +01:00
"parameters" : [ ] ,
"responses" : {
"200" : {
"description" : "Successful response" ,
"schema" : {
"$ref" : "#/definitions/200feature"
}
} ,
"401" : {
"description" : "Not authorized" ,
"schema" : {
"$ref" : "#/definitions/401"
}
}
} ,
2021-06-04 11:17:15 +02:00
"tags" : [ "Metrics" ] ,
2020-12-03 21:09:16 +01:00
"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" : {
2021-06-04 11:17:15 +02:00
"produces" : [ "application/json" ] ,
2020-12-03 21:09:16 +01:00
"parameters" : [ ] ,
"responses" : {
"200" : {
"description" : "Successful response" ,
"schema" : {
"$ref" : "#/definitions/applicationArray"
}
} ,
"401" : {
"description" : "Not authorized" ,
"schema" : {
"$ref" : "#/definitions/401"
}
}
} ,
2021-06-04 11:17:15 +02:00
"tags" : [ "Metrics" ] ,
2020-12-03 21:09:16 +01:00
"description" : "(per Feature Toggle)" ,
"operationId" : "seenApps" ,
"summary" : "Details about seen applications"
}
} ,
"/admin/metrics/seen-toggles" : {
"get" : {
2021-06-04 11:17:15 +02:00
"produces" : [ "application/json" ] ,
2020-12-03 21:09:16 +01:00
"parameters" : [ ] ,
"responses" : {
"200" : {
"description" : "Successful response" ,
"schema" : {
"$ref" : "#/definitions/200seen"
}
}
} ,
2021-06-04 11:17:15 +02:00
"tags" : [ "Metrics" ] ,
2020-12-03 21:09:16 +01:00
"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" : {
2021-06-04 11:17:15 +02:00
"produces" : [ "application/json" ] ,
2020-12-03 21:09:16 +01:00
"parameters" : [
{
"description" : "Choose export format, either json or yaml. json is the default\n" ,
2021-06-04 11:17:15 +02:00
"enum" : [ "json" , "yaml" ] ,
2020-12-03 21:09:16 +01:00
"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"
}
}
} ,
2021-06-04 11:17:15 +02:00
"tags" : [ "Import and export" ] ,
2020-12-03 21:09:16 +01:00
"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" : {
2021-06-04 11:17:15 +02:00
"consumes" : [ "multipart/form-data" , "application/json" ] ,
"produces" : [ "application/json" ] ,
2020-12-03 21:09:16 +01:00
"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."
}
} ,
2021-06-04 11:17:15 +02:00
"tags" : [ "Import and export" ] ,
2020-12-03 21:09:16 +01:00
"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" : {
2021-06-04 11:17:15 +02:00
"produces" : [ "application/json" ] ,
2020-12-03 21:09:16 +01:00
"parameters" : [ ] ,
"responses" : {
"200" : {
"description" : "Successful response" ,
"schema" : {
"$ref" : "#/definitions/200strategy"
}
} ,
"401" : {
"description" : "Not authorized" ,
"schema" : {
"$ref" : "#/definitions/401"
}
}
} ,
2021-06-04 11:17:15 +02:00
"tags" : [ "Strategies" ] ,
2020-12-03 21:09:16 +01:00
"description" : "Fetch all strategies and their parameters." ,
"operationId" : "getStrategies" ,
"summary" : "Fetch all strategies and their parameters."
} ,
"post" : {
2021-06-04 11:17:15 +02:00
"consumes" : [ "application/json" ] ,
"produces" : [ "application/json" ] ,
2020-12-03 21:09:16 +01:00
"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"
}
}
} ,
2021-06-04 11:17:15 +02:00
"tags" : [ "Strategies" ] ,
2020-12-03 21:09:16 +01:00
"description" : "Create Strategy" ,
"operationId" : "createStrategy" ,
"summary" : "Create Strategy"
}
} ,
"/admin/strategies/{strategyName}" : {
"put" : {
2021-06-04 11:17:15 +02:00
"consumes" : [ "application/json" ] ,
"produces" : [ "application/json" ] ,
2020-12-03 21:09:16 +01:00
"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)."
}
} ,
2021-06-04 11:17:15 +02:00
"tags" : [ "Strategies" ] ,
2020-12-03 21:09:16 +01:00
"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"
}
} ,
2021-06-04 11:17:15 +02:00
"required" : [ "type" , "path" , "message" ] ,
2020-12-03 21:09:16 +01:00
"type" : "object"
} ,
"409" : {
"properties" : {
"details" : {
"items" : {
"properties" : {
"message" : {
"description" : "Error message" ,
"minLength" : 1 ,
"type" : "string"
}
} ,
2021-06-04 11:17:15 +02:00
"required" : [ "message" ]
2020-12-03 21:09:16 +01:00
} ,
"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"
}
} ,
2021-06-04 11:17:15 +02:00
"required" : [ "isJoi" , "name" , "details" ] ,
2020-12-03 21:09:16 +01:00
"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" ,
2021-06-04 11:17:15 +02:00
"enum" : [ "N" , "D" , "E" , "A" ] ,
2020-12-03 21:09:16 +01:00
"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" : {
2021-06-04 11:17:15 +02:00
"required" : [ "pathItem" ]
2020-12-03 21:09:16 +01:00
} ,
"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"
}
} ,
2021-06-04 11:17:15 +02:00
"required" : [ "kind" , "lhs" , "rhs" ]
2020-12-03 21:09:16 +01:00
} ,
"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 ,
2021-06-04 11:17:15 +02:00
"required" : [ "id" , "type" , "createdBy" , "createdAt" ] ,
2020-12-03 21:09:16 +01:00
"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"
}
} ,
2021-06-04 11:17:15 +02:00
"required" : [ "application" , "instances" , "strategies" , "seenToggles" ] ,
2020-12-03 21:09:16 +01:00
"title" : "Successful response" ,
"type" : "object"
} ,
"200export" : {
"properties" : {
"features" : {
"$ref" : "#/definitions/featureToggleSchema"
} ,
"strategies" : {
"$ref" : "#/definitions/strategySchema"
} ,
"version" : {
"$ref" : "#/definitions/versionSchema"
}
} ,
2021-06-04 11:17:15 +02:00
"required" : [ "version" , "features" , "strategies" ] ,
2020-12-03 21:09:16 +01:00
"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" : {
2021-06-04 11:17:15 +02:00
"enum" : [ "lastHour" , "lastMinute" ] ,
2020-12-03 21:09:16 +01:00
"example" : "lastHour" ,
"minLength" : 1 ,
"type" : "string"
} ,
"seenToggles" : {
"properties" : {
"metricsCount" : {
"type" : "number"
} ,
"yesno" : {
2021-06-04 11:17:15 +02:00
"enum" : [ "yes" , "no" ] ,
2020-12-03 21:09:16 +01:00
"type" : "string"
}
} ,
2021-06-04 11:17:15 +02:00
"required" : [ "yesno" , "metricsCount" ] ,
2020-12-03 21:09:16 +01:00
"type" : "object"
}
} ,
2021-06-04 11:17:15 +02:00
"required" : [ "appName" , "seenToggles" ] ,
2020-12-03 21:09:16 +01:00
"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"
}
} ,
2021-06-04 11:17:15 +02:00
"required" : [ "id" , "name" , "description" , "lifetimeDays" ]
2020-12-03 21:09:16 +01:00
} ,
"minItems" : 1 ,
"type" : "array" ,
"uniqueItems" : true
} ,
"version" : {
"$ref" : "#/definitions/versionSchema"
}
} ,
2021-06-04 11:17:15 +02:00
"required" : [ "version" , "types" ] ,
2020-12-03 21:09:16 +01:00
"title" : "Successful response" ,
"type" : "object"
} ,
"200seen" : {
"items" : {
"properties" : {
"appName" : {
"minLength" : 1 ,
"type" : "string"
} ,
"metricsCount" : {
"type" : "number"
} ,
"seenToggles" : {
"items" : {
"properties" : { }
} ,
"type" : "array"
}
} ,
2021-06-04 11:17:15 +02:00
"required" : [ "appName" , "seenToggles" , "metricsCount" ] ,
2020-12-03 21:09:16 +01:00
"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"
}
} ,
2021-06-04 11:17:15 +02:00
"required" : [ "version" , "strategies" ] ,
2020-12-03 21:09:16 +01:00
"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"
}
} ,
2021-06-04 11:17:15 +02:00
"required" : [ "appName" , "createdAt" , "updatedAt" , "strategies" ]
2020-12-03 21:09:16 +01:00
} ,
"minItems" : 1 ,
"type" : "array" ,
"uniqueItems" : true
}
} ,
2021-06-04 11:17:15 +02:00
"required" : [ "applications" ] ,
2020-12-03 21:09:16 +01:00
"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"
}
} ,
2021-06-04 11:17:15 +02:00
"required" : [ "name" , "type" , "description" , "required" ]
2020-12-03 21:09:16 +01:00
} ,
"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"
}
} ,
2021-06-04 11:17:15 +02:00
"required" : [ "name" , "description" , "parameters" ] ,
2020-12-03 21:09:16 +01:00
"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*'" ,
2021-06-04 11:17:15 +02:00
"enum" : [ "release" , "experiment" , "ops" , "killswitch" , "permission" ] ,
2020-12-03 21:09:16 +01:00
"example" : "release" ,
2021-06-04 11:17:15 +02:00
"minLength" : 1 ,
2020-12-03 21:09:16 +01:00
"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"
}
} ,
2021-06-04 11:17:15 +02:00
"required" : [ "name" , "type" ] ,
2020-12-03 21:09:16 +01:00
"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"
}
} ,
2021-06-04 11:17:15 +02:00
"required" : [ "name" , "weight" ]
2020-12-03 21:09:16 +01:00
} ,
"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"
}
}
}
}