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
    • Other
      • POSTCreate a release policy
      • DELDelete a release policy
      • GETGet a release policy by key
      • GETList release policies
      • PUTUpdate a release policy
      • POSTUpdate the order of existing release policies
Sign inTry it free
LogoLogo
REST API overviewRelease Policies Beta

Create a release policy

POST
/api/v2/projects/:projectKey/release-policies
POST
/api/v2/projects/:projectKey/release-policies
$curl -X POST https://app.launchdarkly.com/api/v2/projects/default/release-policies \
> -H "LD-API-Version: beta" \
> -H "Authorization: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "releaseMethod": "guarded-release",
> "name": "Production Release",
> "key": "production-release",
> "scope": {
> "environmentKeys": [
> "production",
> "staging"
> ],
> "flagTagKeys": [
> "frontend",
> "backend"
> ],
> "viewKeys": [
> "feature-a",
> "team-a"
> ]
> },
> "guardedReleaseConfig": {
> "rolloutContextKindKey": "user",
> "minSampleSize": 100,
> "rollbackOnRegression": true,
> "metricKeys": [
> "http-errors",
> "latency"
> ],
> "metricGroupKeys": [
> "frontend-metrics",
> "backend-metrics"
> ],
> "stages": [
> {
> "allocation": 25000,
> "durationMillis": 60000
> },
> {
> "allocation": 25000,
> "durationMillis": 60000
> }
> ]
> },
> "progressiveReleaseConfig": {
> "rolloutContextKindKey": "user",
> "stages": [
> {
> "allocation": 25000,
> "durationMillis": 60000
> },
> {
> "allocation": 25000,
> "durationMillis": 60000
> }
> ]
> }
>}'
1{
2 "_id": "550e8400-e29b-41d4-a716-446655440000",
3 "rank": 1,
4 "releaseMethod": "guarded-release",
5 "name": "Production Release",
6 "key": "production-release",
7 "_access": {
8 "allowed": [
9 {
10 "action": "action",
11 "reason": {
12 "effect": "allow",
13 "resources": [
14 "proj/*:env/*;qa_*:/flag/*"
15 ],
16 "notResources": [
17 "notResources",
18 "notResources"
19 ],
20 "actions": [
21 "*"
22 ],
23 "notActions": [
24 "string",
25 "string"
26 ],
27 "role_name": "role_name"
28 }
29 },
30 {
31 "action": "action",
32 "reason": {
33 "effect": "allow",
34 "resources": [
35 "proj/*:env/*;qa_*:/flag/*"
36 ],
37 "notResources": [
38 "notResources",
39 "notResources"
40 ],
41 "actions": [
42 "*"
43 ],
44 "notActions": [
45 "string",
46 "string"
47 ],
48 "role_name": "role_name"
49 }
50 }
51 ],
52 "denied": [
53 {
54 "action": "action",
55 "reason": {
56 "effect": "allow",
57 "resources": [
58 "proj/*:env/*;qa_*:/flag/*"
59 ],
60 "notResources": [
61 "notResources",
62 "notResources"
63 ],
64 "actions": [
65 "*"
66 ],
67 "notActions": [
68 "string",
69 "string"
70 ],
71 "role_name": "role_name"
72 }
73 },
74 {
75 "action": "action",
76 "reason": {
77 "effect": "allow",
78 "resources": [
79 "proj/*:env/*;qa_*:/flag/*"
80 ],
81 "notResources": [
82 "notResources",
83 "notResources"
84 ],
85 "actions": [
86 "*"
87 ],
88 "notActions": [
89 "string",
90 "string"
91 ],
92 "role_name": "role_name"
93 }
94 }
95 ]
96 },
97 "scope": {
98 "environmentKeys": [
99 "production",
100 "staging"
101 ],
102 "flagTagKeys": [
103 "frontend",
104 "backend"
105 ],
106 "viewKeys": [
107 "feature-a",
108 "team-a"
109 ]
110 },
111 "guardedReleaseConfig": {
112 "rolloutContextKindKey": "user",
113 "minSampleSize": 100,
114 "rollbackOnRegression": true,
115 "metricKeys": [
116 "http-errors",
117 "latency"
118 ],
119 "metricGroupKeys": [
120 "frontend-metrics",
121 "backend-metrics"
122 ],
123 "stages": [
124 {
125 "allocation": 25000,
126 "durationMillis": 60000
127 },
128 {
129 "allocation": 25000,
130 "durationMillis": 60000
131 }
132 ]
133 },
134 "progressiveReleaseConfig": {
135 "rolloutContextKindKey": "user",
136 "stages": [
137 {
138 "allocation": 25000,
139 "durationMillis": 60000
140 },
141 {
142 "allocation": 25000,
143 "durationMillis": 60000
144 }
145 ]
146 }
147}
Create a new release policy for the specified project.
Was this page helpful?
Previous

Delete a release policy

Next
Built with

Authentication

Authorizationstring
API Key authentication via header

Path parameters

projectKeystringRequired
The project key

Headers

LD-API-VersionenumRequired
Version of the endpoint.
Allowed values:

Request

Release policy to create
releaseMethodenumRequired
The release method for this policy
Allowed values:
namestringRequired<=256 characters
The name of the release policy
keystringRequired

The human-readable key of the release policy

scopeobjectOptional
guardedReleaseConfigobjectOptional
Configuration for guarded releases
progressiveReleaseConfigobjectOptional
Configuration for progressive releases

Response

Release policy created successfully
_idstring
The unique identifier of the release policy
rankinteger

The rank/priority of the release policy

releaseMethodenum
The release method for this policy
Allowed values:
namestring<=256 characters
The name of the release policy
keystring

The human-readable key of the release policy

_accessobject
scopeobject
guardedReleaseConfigobject
Configuration for guarded releases
progressiveReleaseConfigobject
Configuration for progressive releases

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
500
Internal Server Error