> ## Documentation Index
> Fetch the complete documentation index at: https://docs.runalloy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Upgrade a workflow

> This endpoint allows you as the ISV to upgrade the workflow for a specified end user.  <br /> <br />In order to upgrade a workflow via this endpoint, the new workflow must have the same configurable fields as the original. If any new configurable fields were added, you will not be able to upgrade the workflow programmatically and instead would need to reinstall the workflow for the end user.



## OpenAPI

````yaml put /workflows/{workflowId}/upgrade
openapi: 3.0.1
info:
  title: Embedded 2025-09
  version: '5.0'
servers:
  - url: https://production.runalloy.com
security: []
paths:
  /workflows/{workflowId}/upgrade:
    put:
      summary: Upgrade a workflow
      description: >-
        This endpoint allows you as the ISV to upgrade the workflow for a
        specified end user.  <br /> <br />In order to upgrade a workflow via
        this endpoint, the new workflow must have the same configurable fields
        as the original. If any new configurable fields were added, you will not
        be able to upgrade the workflow programmatically and instead would need
        to reinstall the workflow for the end user.
      operationId: upgrade-workflow
      parameters:
        - name: workflowId
          in: path
          description: >-
            Id of the parent workflow in which you are upgrading for the end
            user
          schema:
            type: string
          required: true
        - name: userId
          in: query
          description: Id of the end user you wish to upgrade the workflow for
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: '#/components/parameters/xApiVersion'
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value:
                    upgraded: true
              schema:
                type: object
                properties:
                  upgraded:
                    type: boolean
                    example: true
                    default: true
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value: '{}'
              schema:
                type: object
                properties: {}
      deprecated: false
      security: []
      x-code-samples:
        - lang: cURL
          source: >
            curl -X PUT
            "https://production.runalloy.com/workflows/{workflowId}/upgrade?userId={{userId}}"
            \
              -H "Authorization: bearer YOUR_API_KEY" \
              -H "x-api-version: 2025-09"
        - lang: Python
          source: >
            import requests


            url =
            "https://production.runalloy.com/workflows/{workflowId}/upgrade"

            params = {"userId": "{{userId}}"}

            headers = {
                "Authorization": "bearer YOUR_API_KEY",
                "x-api-version": "2025-09"
            }


            response = requests.put(url, params=params, headers=headers)

            print(response.json())
        - lang: JavaScript
          source: >
            const userId = "{{userId}}";

            const workflowId = "{workflowId}";

            const url =
            `https://production.runalloy.com/workflows/${workflowId}/upgrade?userId=${userId}`;


            fetch(url, {
              method: "PUT",
              headers: {
                "Authorization": "bearer YOUR_API_KEY",
                "x-api-version": "2025-09"
              }
            })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error("Error:", error));
        - lang: PHP
          source: >
            <?php

            $userId = "{{userId}}";

            $workflowId = "{workflowId}";

            $url =
            "https://production.runalloy.com/workflows/{$workflowId}/upgrade?userId="
            . urlencode($userId);


            $ch = curl_init($url);

            curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

            curl_setopt($ch, CURLOPT_HTTPHEADER, [
                "Authorization: bearer YOUR_API_KEY",
                "x-api-version: 2025-09"
            ]);


            $response = curl_exec($ch);

            curl_close($ch);

            $data = json_decode($response, true);

            print_r($data);

            ?>
        - lang: Go
          source: |
            package main

            import (
                "encoding/json"
                "fmt"
                "io"
                "net/http"
                "net/url"
            )

            func main() {
                userId := "{{userId}}"
                workflowId := "{workflowId}"
                baseURL := "https://production.runalloy.com/workflows/" + workflowId + "/upgrade"
                params := url.Values{}
                params.Add("userId", userId)
                fullURL := baseURL + "?" + params.Encode()

                req, _ := http.NewRequest("PUT", fullURL, nil)
                req.Header.Set("Authorization", "bearer YOUR_API_KEY")
                req.Header.Set("x-api-version", "2025-09")

                client := &http.Client{}
                resp, _ := client.Do(req)
                defer resp.Body.Close()

                body, _ := io.ReadAll(resp.Body)
                var data map[string]interface{}
                json.Unmarshal(body, &data)
                fmt.Println(data)
            }
        - lang: Java
          source: |
            import java.net.HttpURLConnection;
            import java.net.URL;
            import java.io.BufferedReader;
            import java.io.InputStreamReader;
            import com.google.gson.Gson;
            import java.util.Map;

            public class Example {
                public static void main(String[] args) throws Exception {
                    String userId = "{{userId}}";
                    String workflowId = "{workflowId}";
                    String baseUrl = "https://production.runalloy.com/workflows/" + workflowId + "/upgrade";
                    String urlString = baseUrl + "?userId=" + java.net.URLEncoder.encode(userId, "UTF-8");
                    
                    URL url = new URL(urlString);
                    HttpURLConnection conn = (HttpURLConnection) url.openConnection();
                    conn.setRequestMethod("PUT");
                    conn.setRequestProperty("Authorization", "bearer YOUR_API_KEY");
                    conn.setRequestProperty("x-api-version", "2025-09");
                    
                    BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
                    String inputLine;
                    StringBuilder response = new StringBuilder();
                    while ((inputLine = in.readLine()) != null) {
                        response.append(inputLine);
                    }
                    in.close();
                    
                    Gson gson = new Gson();
                    Map<String, Object> data = gson.fromJson(response.toString(), Map.class);
                    System.out.println(data);
                }
            }
        - lang: Ruby
          source: >
            require 'net/http'

            require 'json'

            require 'uri'


            userId = "{{userId}}"

            workflowId = "{workflowId}"

            base_url =
            "https://production.runalloy.com/workflows/#{workflowId}/upgrade"

            uri = URI(base_url)

            params = { userId: userId }

            uri.query = URI.encode_www_form(params)


            http = Net::HTTP.new(uri.host, uri.port)

            http.use_ssl = true


            request = Net::HTTP::Put.new(uri)

            request['Authorization'] = 'bearer YOUR_API_KEY'

            request['x-api-version'] = '2025-09'


            response = http.request(request)

            data = JSON.parse(response.body)

            puts data
components:
  parameters:
    xApiVersion:
      name: x-api-version
      in: header
      required: true
      description: The version of the API to use. The current API version is **2025-09**.
      schema:
        type: string
        default: 2025-09

````