For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Sign inTry it free
DocsGuidesSDKsIntegrationsAPI docsTutorialsFlagship blog
DocsGuidesSDKsIntegrationsAPI docsTutorialsFlagship blog
  • REST API overview
    • Access Tokens
    • Account Members
    • Account Usage Beta
    • AI Configs
    • Announcements
    • Applications Beta
    • Approvals
    • Approvals Beta
    • Audit Log
    • Code References
    • Contexts
    • Context Settings
    • Custom Roles
    • Data Export Destinations
    • Environments
    • Experiments
    • Feature Flags
    • Feature Flags Beta
    • Flag Import Configurations Beta
    • Flag Links Beta
    • Flag Triggers
    • Follow Flags
    • Holdouts Beta
    • Insights Charts Beta
    • Insights Deployments Beta
    • Insights Flag Events Beta
    • Insights Pull Requests Beta
    • Insights Repositories Beta
    • Insights Scores Beta
    • Integration Audit Log Subscriptions
    • Integration Delivery Configurations Beta
    • Integrations Beta
    • Layers
    • Metrics
    • Metrics Beta
    • OAuth2 Clients
    • Persistent Store Integrations Beta
    • Projects
    • Relay Proxy Configurations
    • Release Pipelines Beta
    • Releases Beta
    • Scheduled Changes
    • Segments
    • Tags
    • Teams
    • Teams Beta
    • Users
    • Users Beta
    • User Settings
    • Views Beta
    • Webhooks
    • Workflows
    • Workflow Templates
      • POSTCreate workflow template
      • DELDelete workflow template
      • GETGet workflow templates
    • Other
Sign inTry it free
LogoLogo
REST API overviewWorkflow Templates

Create workflow template

POST
/api/v2/templates
POST
/api/v2/templates
$curl -X POST https://app.launchdarkly.com/api/v2/templates \
> -H "Authorization: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "key": "string"
>}'
1{
2 "_id": "string",
3 "_key": "string",
4 "_creationDate": 1,
5 "_ownerId": "string",
6 "_maintainerId": "string",
7 "_links": {},
8 "name": "string",
9 "description": "string",
10 "stages": [
11 {
12 "_id": "12ab3c45de678910abc12345",
13 "conditions": [
14 {
15 "_id": "string",
16 "_execution": {
17 "status": "completed"
18 },
19 "description": "string",
20 "notifyMemberIds": [
21 "string"
22 ],
23 "allReviews": [
24 {
25 "_id": "string",
26 "kind": "string",
27 "creationDate": 1,
28 "comment": "string",
29 "memberId": "string",
30 "serviceTokenId": "string"
31 }
32 ],
33 "reviewStatus": "string",
34 "kind": "schedule",
35 "scheduleKind": "relative",
36 "waitDuration": 2,
37 "waitDurationUnit": "calendarDay",
38 "id": "12ab3c45de678910abc12345"
39 }
40 ],
41 "action": {
42 "kind": "patch",
43 "instructions": [
44 "[{\"kind\": \"turnFlagOn\"}]"
45 ]
46 },
47 "_execution": {
48 "status": "completed"
49 },
50 "name": "10% rollout on day 1"
51 }
52 ]
53}
> ### Workflows are in maintenance mode > > The workflows feature is in maintenance mode, and is planned for future deprecation at a date not yet specified. We will work with existing customers using workflows to migrate to a replacement solution when deprecation occurs. Create a template for a feature flag workflow.
Was this page helpful?
Previous

Delete workflow template

Next
Built with

Workflows are in maintenance mode

The workflows feature is in maintenance mode, and is planned for future deprecation at a date not yet specified. We will work with existing customers using workflows to migrate to a replacement solution when deprecation occurs.

Create a template for a feature flag workflow.

Authentication

Authorizationstring
API Key authentication via header

Request

This endpoint expects an object.
keystringRequired
namestringOptional
descriptionstringOptional
workflowIdstringOptional
stageslist of objectsOptional
projectKeystringOptional
environmentKeystringOptional
flagKeystringOptional

Response

Workflow template response JSON
_idstring
_keystring
_creationDatelong
_ownerIdstring
_maintainerIdstring
_linksmap from strings to objects
namestring
descriptionstring
stageslist of objects

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
429
Too Many Requests Error