Skip to main content
POST
/
api
/
v2
/
templates
Create workflow template
curl --request POST \
  --url https://app.launchdarkly.com/api/v2/templates \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "key": "<string>",
  "name": "<string>",
  "description": "<string>",
  "workflowId": "<string>",
  "stages": [
    {
      "name": "10% rollout on day 1",
      "executeConditionsInSequence": true,
      "conditions": [
        {
          "kind": "schedule",
          "scheduleKind": "relative",
          "waitDuration": 2,
          "waitDurationUnit": "calendarDay"
        }
      ],
      "action": "{\"instructions\": [{ \"kind\": \"turnFlagOn\"}]}"
    }
  ],
  "projectKey": "<string>",
  "environmentKey": "<string>",
  "flagKey": "<string>"
}
'
{
  "_id": "<string>",
  "_key": "<string>",
  "_creationDate": 123,
  "_ownerId": "<string>",
  "_maintainerId": "<string>",
  "_links": {},
  "name": "<string>",
  "description": "<string>",
  "stages": [
    {
      "_id": "12ab3c45de678910abc12345",
      "conditions": [
        {
          "_execution": {
            "status": "completed"
          },
          "id": "12ab3c45de678910abc12345",
          "kind": "schedule",
          "scheduleKind": "relative",
          "waitDuration": 2,
          "waitDurationUnit": "calendarDay"
        }
      ],
      "action": "{ \"kind\": \"patch\", \"instructions\": [{ \"kind\": \"turnFlagOn\"}] }",
      "_execution": "{ \"status\": \"completed\" }",
      "name": "10% rollout on day 1"
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://launchdarkly-preview.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Body

application/json
key
string
required
name
string
description
string
workflowId
string
stages
object[]
projectKey
string
environmentKey
string
flagKey
string

Response

Workflow template response JSON

_id
string
required
_key
string
required
_creationDate
integer<int64>
required
_ownerId
string
required
_maintainerId
string
required
name
string
description
string
stages
object[]