Update a Workflow Stage
PUT
https://mapi.storyblok.com/v1/spaces/:space_id/workflow_stages/:workflow_idThis endpoint can be used to update a workflow stage using the numeric ID.
Path parameters
Section titled “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
Section titled “Request body properties”- workflow_stage Workflow Stage Object
A workflow stage object
Examples
Section titled “Examples”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]}}"// Using the Universal JavaScript Client:// https://github.com/storyblok/storyblok-js-clientStoryblok.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 ] }}) .then(response => { console.log(response) }).catch(error => { console.log(error) })$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();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();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);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)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)var request = URLRequest(url: URL(string: "https://mapi.storyblok.com/v1/spaces/space_id/workflow_stages/18")!)request.setValue("YOUR_OAUTH_TOKEN", forHTTPHeaderField: "Authorization")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 URLSession.shared.data(for: request)print(try JSONSerialization.jsonObject(with: data))val client = HttpClient { install(ContentNegotiation) { json() } install(DefaultRequest) { url { takeFrom("https://mapi.storyblok.com/v1/") headers.append("Authorization", "YOUR_OAUTH_TOKEN") } }}
val response = client.put("spaces/space_id/workflow_stages/18") { contentType(ContentType.Application.Json) 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>())
Thanks! We received your feedback.
An error occurred. Please try again.
Was this page helpful?
This site uses reCAPTCHA and Google's Privacy Policy. Terms of Service apply.
Get in touch with the Storyblok community