Create a strategy
POST/api/admin/strategies
This endpoint has been deprecated and may be replaced or removed in future versions of the API.
Creates a custom strategy type based on the supplied data. Custom strategies are deprecated and should not be used. Prefer using built in strategies with constraints instead.
Request
- application/json
Body
required
createStrategySchema
Array [
]
The name of the strategy type. Must be unique.
my-custom-strategy
The title of the strategy
My awesome strategy
A description of the strategy type.
Enable the feature for users who have not logged in before.
Whether the strategy type is editable or not. Defaults to true
.
false
Whether the strategy type is deprecated or not. Defaults to false
.
true
parameters
object[]
required
The parameter list lets you pass arguments to your custom activation strategy. These will be made available to your custom strategy implementation.
The name of the parameter
Rollout percentage
Possible values: [string
, percentage
, list
, number
, boolean
]
percentage
A description of this strategy parameter. Use this to indicate to the users what the parameter does.
How many percent of users should see this feature?
Whether this parameter must be configured when using the strategy. Defaults to false
false
Responses
- 201
- 401
- 403
- 409
- 415
The resource was successfully created.
Response Headers
location
string
The location of the newly created resource.
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
An optional title for the strategy
GradualRollout - Prod25
The name (type) of the strategy
flexibleRollout
A human friendly name for the strategy
Gradual Rollout
A short description of the strategy
Gradual rollout to logged in users
Whether the strategy can be edited or not. Strategies bundled with Unleash cannot be edited.
true
true
parameters
object[]
required
A list of relevant parameters for each strategy
percentage
percentage
Gradual rollout to logged in users
true
{
"title": "GradualRollout - Prod25",
"name": "flexibleRollout",
"displayName": "Gradual Rollout",
"description": "Gradual rollout to logged in users",
"editable": true,
"deprecated": true,
"parameters": [
{
"name": "percentage",
"type": "percentage",
"description": "Gradual rollout to logged in users",
"required": true
}
]
}
Authorization information is missing or invalid. Provide a valid API token as the authorization
header, e.g. authorization:*.*.my-admin-token
.
- application/json
- Schema
- Example (from schema)
Schema
The ID of the error instance
9c40958a-daac-400e-98fb-3bb438567008
The name of the error kind
AuthenticationRequired
A description of what went wrong.
You must log in to use Unleash. Your request had no authorization header, so we could not authorize you. Try logging in at /auth/simple/login.
{
"id": "9c40958a-daac-400e-98fb-3bb438567008",
"name": "AuthenticationRequired",
"message": "You must log in to use Unleash. Your request had no authorization header, so we could not authorize you. Try logging in at /auth/simple/login."
}
The provided user credentials are valid, but the user does not have the necessary permissions to perform this operation
- application/json
- Schema
- Example (from schema)
Schema
The ID of the error instance
9c40958a-daac-400e-98fb-3bb438567008
The name of the error kind
NoAccessError
A description of what went wrong.
You need the "UPDATE_ADDON" permission to perform this action in the "development" environment.
{
"id": "9c40958a-daac-400e-98fb-3bb438567008",
"name": "NoAccessError",
"message": "You need the \"UPDATE_ADDON\" permission to perform this action in the \"development\" environment."
}
The provided resource can not be created or updated because it would conflict with the current state of the resource or with an already existing resource, respectively.
- application/json
- Schema
- Example (from schema)
Schema
The ID of the error instance
9c40958a-daac-400e-98fb-3bb438567008
The name of the error kind
NameExistsError
A description of what went wrong.
There is already a feature called "my-awesome-feature".
{
"id": "9c40958a-daac-400e-98fb-3bb438567008",
"name": "NameExistsError",
"message": "There is already a feature called \"my-awesome-feature\"."
}
The operation does not support request payloads of the provided type. Please ensure that you're using one of the listed payload types and that you have specified the right content type in the "content-type" header.
- application/json
- Schema
- Example (from schema)
Schema
The ID of the error instance
9c40958a-daac-400e-98fb-3bb438567008
The name of the error kind
ContentTypeerror
A description of what went wrong.
We do not accept the content-type you provided (application/xml). Try using one of the content-types we do accept instead (application/json) and make sure the body is in the corresponding format.
{
"id": "9c40958a-daac-400e-98fb-3bb438567008",
"name": "ContentTypeerror",
"message": "We do not accept the content-type you provided (application/xml). Try using one of the content-types we do accept instead (application/json) and make sure the body is in the corresponding format."
}