1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00
unleash.unleash/docs/api/strategies-api.md

52 lines
1.1 KiB
Markdown
Raw Normal View History

2016-11-30 21:17:39 +01:00
## Strategies API
### Fetch Strategies
`GET: http://unleash.host.com/api/strategies`
Used to fetch all defined strategies and their defined paramters.
**Response**
```json
{
"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**
```json
{
"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.