---
title: Update a Workflow Stage
description: This endpoint can be used to update a workflow stage using the numeric ID.
url: https://storyblok.com/docs/api/management/workflow-stage/update-a-workflow-stage
---

# Update a Workflow Stage

PUT

```html
https://mapi.storyblok.com/v1/spaces/:space_id/workflow_stages/:workflow_id
```

This endpoint can be used to update a workflow stage using the numeric ID.

## Path parameters

-   `:space_id` (required) (number)
    
    Numeric ID of a space
    
-   `:workflow_id` (required) (number)
    
    Numeric ID of the connected workflow. If empty while creating a new stage, then the stage is created in the default workflow.
    

## Request body properties

-   `workflow_stage` (Workflow Stage Object)
    
    A [workflow stage](/docs/api/management#workflow-stages/object) object
    

## Examples

-   cURL
    
    ```shellscript
    curl "https://mapi.storyblok.com/v1/spaces/space_id/workflow_stages/18" \
      -X PUT \
      -H "Authorization: YOUR_OAUTH_TOKEN" \
      -H "Content-Type: application/json" \
      -d "{\"workflow_stage\":{\"after_publish_id\":561398,\"allow_admin_change\":true,\"allow_admin_publish\":false,\"allow_all_stages\":false,\"allow_all_users\":false,\"allow_editor_change\":true,\"allow_publish\":true,\"color\":\"#fff\",\"is_default\":true,\"name\":\"an updated stage \",\"position\":2,\"space_role_ids\":[232323],\"user_ids\":[343434],\"workflow_stage_ids\":[561398]}}"
    ```
    
-   JS
    
    ```javascript
    // storyblok-js-client@>=7, node@>=18
    import Storyblok from "storyblok-js-client";
    
    const storyblok = new Storyblok({
      oauthToken: "YOUR_PERSONAL_ACCESS_TOKEN",
    });
    
    try {
      const response = await storyblok.put('spaces/space_id/workflow_stages/18', {
        "workflow_stage": {
          "after_publish_id": 561398,
          "allow_admin_change": true,
          "allow_admin_publish": false,
          "allow_all_stages": false,
          "allow_all_users": false,
          "allow_editor_change": true,
          "allow_publish": true,
          "color": "#fff",
          "is_default": true,
          "name": "an updated stage ",
          "position": 2,
          "space_role_ids": [
            232323
          ],
          "user_ids": [
            343434
          ],
          "workflow_stage_ids": [
            561398
          ]
        }
      })
      console.log({ response })
    } catch (error) {
      console.log(error)
    }
    ```
    
-   PHP
    
    ```php
    $client = new \Storyblok\ManagementClient('YOUR_OAUTH_TOKEN');
    
    $payload = ["workflow_stage" => ["after_publish_id" => 561398,"allow_admin_change" => true,"allow_admin_publish" => false,"allow_all_stages" => false,"allow_all_users" => false,"allow_editor_change" => true,"allow_publish" => true,"color" => "#fff","is_default" => true,"name" => "an updated stage ","position" => 2,"space_role_ids" => [232323],"user_ids" => [343434],"workflow_stage_ids" => [561398]]];
    
    $client->put('spaces/space_id/workflow_stages/18', $payload)->getBody();
    ```
    
-   Java
    
    ```java
    HttpResponse<String> response = Unirest.put("https://mapi.storyblok.com/v1/spaces/space_id/workflow_stages/18")
      .header("Content-Type", "application/json")
      .header("Authorization", "YOUR_OAUTH_TOKEN")
      .body({"workflow_stage":{"after_publish_id":561398,"allow_admin_change":true,"allow_admin_publish":false,"allow_all_stages":false,"allow_all_users":false,"allow_editor_change":true,"allow_publish":true,"color":"#fff","is_default":true,"name":"an updated stage ","position":2,"space_role_ids":[232323],"user_ids":[343434],"workflow_stage_ids":[561398]}})
      .asString();
    ```
    
-   C#
    
    ```csharp
    var client = new RestClient("https://mapi.storyblok.com/v1/spaces/space_id/workflow_stages/18");
    var request = new RestRequest(Method.PUT);
    
    request.AddHeader("Content-Type", "application/json");
    request.AddHeader("Authorization", "YOUR_OAUTH_TOKEN");
    request.AddParameter("application/json", "{\"workflow_stage\":{\"after_publish_id\":561398,\"allow_admin_change\":true,\"allow_admin_publish\":false,\"allow_all_stages\":false,\"allow_all_users\":false,\"allow_editor_change\":true,\"allow_publish\":true,\"color\":\"#fff\",\"is_default\":true,\"name\":\"an updated stage \",\"position\":2,\"space_role_ids\":[232323],\"user_ids\":[343434],\"workflow_stage_ids\":[561398]}}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);
    ```
    
-   Python
    
    ```python
    import requests
    
    url = "https://mapi.storyblok.com/v1/spaces/space_id/workflow_stages/18"
    
    querystring = {}
    
    payload = {"workflow_stage":{"after_publish_id":561398,"allow_admin_change":true,"allow_admin_publish":false,"allow_all_stages":false,"allow_all_users":false,"allow_editor_change":true,"allow_publish":true,"color":"#fff","is_default":true,"name":"an updated stage ","position":2,"space_role_ids":[232323],"user_ids":[343434],"workflow_stage_ids":[561398]}}
    headers = {
      'Content-Type': "application/json",
      'Authorization': "YOUR_OAUTH_TOKEN"
    }
    
    response = requests.request("PUT", url, data=payload, headers=headers, params=querystring)
    
    print(response.text)
    ```
    
-   Ruby
    
    ```ruby
    require 'storyblok'
    client = Storyblok::Client.new(oauth_token: 'YOUR_OAUTH_TOKEN')
    
    payload = {"workflow_stage" => {"after_publish_id" => 561398,"allow_admin_change" => true,"allow_admin_publish" => false,"allow_all_stages" => false,"allow_all_users" => false,"allow_editor_change" => true,"allow_publish" => true,"color" => "#fff","is_default" => true,"name" => "an updated stage ","position" => 2,"space_role_ids" => [232323],"user_ids" => [343434],"workflow_stage_ids" => [561398]}}
    
    client.put('spaces/space_id/workflow_stages/18', payload)
    ```
    
-   Swift
    
    ```swift
    let storyblok = URLSession(storyblok: .mapi(accessToken: .oauth("YOUR_OAUTH_TOKEN")))
    var request = URLRequest(storyblok: storyblok, path: "spaces/space_id/workflow_stages/18")
    request.httpMethod = "PUT"
    request.httpBody = try JSONSerialization.data(withJSONObject: [
        "workflow_stage": [
            "after_publish_id": 561398,
            "allow_admin_change": true,
            "allow_admin_publish": false,
            "allow_all_stages": false,
            "allow_all_users": false,
            "allow_editor_change": true,
            "allow_publish": true,
            "color": "#fff",
            "is_default": true,
            "name": "an updated stage ",
            "position": 2,
            "space_role_ids": [
                232323,
            ],
            "user_ids": [
                343434,
            ],
            "workflow_stage_ids": [
                561398,
            ],
        ],
    ])
    let (data, _) = try await storyblok.data(for: request)
    print(try JSONSerialization.jsonObject(with: data))
    ```
    
-   Kotlin
    
    ```kotlin
    val client = HttpClient {
        install(Storyblok(MAPI)) {
            accessToken = OAuth("YOUR_OAUTH_TOKEN")
        }
    }
    
    val response = client.put("spaces/space_id/workflow_stages/18") {
        setBody(buildJsonObject {
            putJsonObject("workflow_stage") {
                put("after_publish_id", 561398)
                put("allow_admin_change", true)
                put("allow_admin_publish", false)
                put("allow_all_stages", false)
                put("allow_all_users", false)
                put("allow_editor_change", true)
                put("allow_publish", true)
                put("color", "#fff")
                put("is_default", true)
                put("name", "an updated stage ")
                put("position", 2)
                putJsonArray("space_role_ids") {
                    add(232323)
                }
                putJsonArray("user_ids") {
                    add(343434)
                }
                putJsonArray("workflow_stage_ids") {
                    add(561398)
                }
            }
        })
    }
    
    println(response.body<JsonElement>())
    ```

## Pagination

-   [Previous: Retrieve Multiple Workflow Stages](/docs/api/management/workflow-stage/retrieve-multiple-workflow-stages)
-   [Next: Workflow Stage Object](/docs/api/management/workflow-stage/workflow-stage-object)
