Skip to main content

Create a strategy

POST /api/admin/strategies
deprecated

This endpoint has been deprecated and may be 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

Body

required

createStrategySchema

  • name string required

    The name of the strategy type. Must be unique.

  • title string

    The title of the strategy

  • description string

    A description of the strategy type.

  • editable boolean

    Whether the strategy type is editable or not. Defaults to true.

  • deprecated boolean

    Whether the strategy type is deprecated or not. Defaults to false.

  • 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.

  • Array [
  • name string required

    The name of the parameter

  • type string required

    Possible values: [string, percentage, list, number, boolean]

  • description string

    A description of this strategy parameter. Use this to indicate to the users what the parameter does.

  • required boolean

    Whether this parameter must be configured when using the strategy. Defaults to false

  • ]
Responses

The resource was successfully created.

Response Headers
  • location string

    The location of the newly created resource.

Schema
  • title string nullable

    An optional title for the strategy

  • name string required

    The name (type) of the strategy

  • displayName string nullable required

    A human friendly name for the strategy

  • description string nullable required

    A short description of the strategy

  • editable boolean required

    Whether the strategy can be edited or not. Strategies bundled with Unleash cannot be edited.

  • deprecated boolean required
  • parameters object[]required

    A list of relevant parameters for each strategy

  • Array [
  • name string
  • type string
  • description string
  • required boolean
  • ]
Loading...