# [BETA] Create or update a milestone progression PUT https://app.unleash-instance.example.com/api/admin/projects/{project}/features/{featureName}/environments/{environment}/progressions/{id} Content-Type: application/json **Enterprise feature** **[BETA]** This API is in beta state, which means it may change or be removed in the future. Creates or updates a milestone progression by source milestone ID. If a progression with the given source milestone exists, it will be updated; otherwise, a new one will be created. Reference: https://docs.getunleash.io/api/release-templates/change-milestone-progression ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: '[BETA] Create or update a milestone progression' version: endpoint_releaseTemplates.changeMilestoneProgression paths: /api/admin/projects/{project}/features/{featureName}/environments/{environment}/progressions/{id}: put: operationId: change-milestone-progression summary: '[BETA] Create or update a milestone progression' description: >- **Enterprise feature** **[BETA]** This API is in beta state, which means it may change or be removed in the future. Creates or updates a milestone progression by source milestone ID. If a progression with the given source milestone exists, it will be updated; otherwise, a new one will be created. tags: - - subpackage_releaseTemplates parameters: - name: project in: path required: true schema: type: string - name: featureName in: path required: true schema: type: string - name: environment in: path required: true schema: type: string - name: id in: path required: true schema: type: string - name: Authorization in: header description: Header authentication of the form `undefined ` required: true schema: type: string responses: '200': description: '#/components/schemas/milestoneProgressionSchema' content: application/json: schema: $ref: '#/components/schemas/milestoneProgressionSchema' '401': description: >- Authorization information is missing or invalid. Provide a valid API token as the `authorization` header, e.g. `authorization:*.*.my-admin-token`. content: {} '403': description: >- The provided user credentials are valid, but the user does not have the necessary permissions to perform this operation content: {} requestBody: description: '#/components/schemas/changeMilestoneProgressionSchema' content: application/json: schema: $ref: '#/components/schemas/changeMilestoneProgressionSchema' components: schemas: transitionConditionSchema: type: object properties: intervalMinutes: type: integer description: The interval in minutes before transitioning required: - intervalMinutes changeMilestoneProgressionSchema: type: object properties: targetMilestone: type: string description: The ID of the target milestone transitionCondition: $ref: '#/components/schemas/transitionConditionSchema' description: The condition configuration for the transition required: - targetMilestone - transitionCondition milestoneProgressionSchema: type: object properties: sourceMilestone: type: string description: The ID of the source milestone targetMilestone: type: string description: The ID of the target milestone transitionCondition: $ref: '#/components/schemas/transitionConditionSchema' description: The condition that triggers the transition required: - sourceMilestone - targetMilestone - transitionCondition ``` ## SDK Code Examples ```python import requests url = "https://app.unleash-instance.example.com/api/admin/projects/project/features/featureName/environments/environment/progressions/id" payload = { "targetMilestone": "11K7NXD655W7R89659K58RE07B", "transitionCondition": { "intervalMinutes": 30 } } headers = { "Authorization": "", "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://app.unleash-instance.example.com/api/admin/projects/project/features/featureName/environments/environment/progressions/id'; const options = { method: 'PUT', headers: {Authorization: '', 'Content-Type': 'application/json'}, body: '{"targetMilestone":"11K7NXD655W7R89659K58RE07B","transitionCondition":{"intervalMinutes":30}}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://app.unleash-instance.example.com/api/admin/projects/project/features/featureName/environments/environment/progressions/id" payload := strings.NewReader("{\n \"targetMilestone\": \"11K7NXD655W7R89659K58RE07B\",\n \"transitionCondition\": {\n \"intervalMinutes\": 30\n }\n}") req, _ := http.NewRequest("PUT", url, payload) req.Header.Add("Authorization", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://app.unleash-instance.example.com/api/admin/projects/project/features/featureName/environments/environment/progressions/id") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Put.new(url) request["Authorization"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"targetMilestone\": \"11K7NXD655W7R89659K58RE07B\",\n \"transitionCondition\": {\n \"intervalMinutes\": 30\n }\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.put("https://app.unleash-instance.example.com/api/admin/projects/project/features/featureName/environments/environment/progressions/id") .header("Authorization", "") .header("Content-Type", "application/json") .body("{\n \"targetMilestone\": \"11K7NXD655W7R89659K58RE07B\",\n \"transitionCondition\": {\n \"intervalMinutes\": 30\n }\n}") .asString(); ``` ```php request('PUT', 'https://app.unleash-instance.example.com/api/admin/projects/project/features/featureName/environments/environment/progressions/id', [ 'body' => '{ "targetMilestone": "11K7NXD655W7R89659K58RE07B", "transitionCondition": { "intervalMinutes": 30 } }', 'headers' => [ 'Authorization' => '', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://app.unleash-instance.example.com/api/admin/projects/project/features/featureName/environments/environment/progressions/id"); var request = new RestRequest(Method.PUT); request.AddHeader("Authorization", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"targetMilestone\": \"11K7NXD655W7R89659K58RE07B\",\n \"transitionCondition\": {\n \"intervalMinutes\": 30\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "Authorization": "", "Content-Type": "application/json" ] let parameters = [ "targetMilestone": "11K7NXD655W7R89659K58RE07B", "transitionCondition": ["intervalMinutes": 30] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://app.unleash-instance.example.com/api/admin/projects/project/features/featureName/environments/environment/progressions/id")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "PUT" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```