1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/docs/api/strategies-api.md
2020-02-20 08:30:40 +01:00

1.1 KiB

Strategies API

Fetch Strategies

GET: http://unleash.host.com/api/strategies

Used to fetch all defined strategies and their defined paramters.

Response

{
   "version": 1,
   "strategies": [
       {
       "name": "default",
       "description": "Default on/off strategy.",
           "parametersTemplate": null
       },
       {
           "name": "ActiveForUserWithEmail",
           "description": "A comma separated list of email adresses this feature should be active for.",
           "parametersTemplate": {
               "emails": "string"
           }
       },
       {
           "name": "Accounts",
           "description": "Enable for user accounts",
           "parametersTemplate": {
               "Accountname": "string"
           }
       }
]}

Create strategy

POST: http://unleash.host.com/api/strategies

Body

{
    "name": "ActiveForUserWithEmail",
    "description": "A comma separated list of email adresses this feature should be active for.",
    "parametersTemplate": {
        "emails": "string"
    }
}

Used to create a new Strategy. Name must be unique.