Update a Task
PUT
https://mapi.storyblok.com/v1/spaces/:space_id/tasks/:task_idThis endpoint can be used to update tasks.
Path parameters
Section titled “Path parameters”:space_idrequired numberNumeric ID of a space
:task_idrequired numberThe task id
Request body properties
Section titled “Request body properties”taskThe Task ObjectThe task object
Response properties
Section titled “Response properties”taskThe Task ObjectThe task object
Examples
Section titled “Examples”curl "https://mapi.storyblok.com/v1/spaces/288868932106293/tasks/124" \ -X PUT \ -H "Authorization: YOUR_PERSONAL_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d "{\"task\":{\"name\":\"My Updated Task Name\",\"task_type\":\"webhook\",\"webhook_url\":\"https://www.storyblok.com\"}}"// storyblok-js-client@>=7, node@>=18import Storyblok from "storyblok-js-client";
const storyblok = new Storyblok({ oauthToken: "YOUR_PERSONAL_ACCESS_TOKEN",});
try { const response = await storyblok.put('spaces/288868932106293/tasks/124', { "task": { "name": "My Updated Task Name", "task_type": "webhook", "webhook_url": "https://www.storyblok.com" } }) console.log({ response })} catch (error) { console.log(error)}$client = new \Storyblok\ManagementClient('YOUR_PERSONAL_ACCESS_TOKEN');
$payload = ["task" => ["name" => "My Updated Task Name","task_type" => "webhook","webhook_url" => "https => //www.storyblok.com"]];
$client->put('spaces/288868932106293/tasks/124', $payload)->getBody();HttpResponse<String> response = Unirest.put("https://mapi.storyblok.com/v1/spaces/288868932106293/tasks/124") .header("Content-Type", "application/json") .header("Authorization", "YOUR_PERSONAL_ACCESS_TOKEN") .body({"task":{"name":"My Updated Task Name","task_type":"webhook","webhook_url":"https://www.storyblok.com"}}) .asString();var client = new RestClient("https://mapi.storyblok.com/v1/spaces/288868932106293/tasks/124");var request = new RestRequest(Method.PUT);
request.AddHeader("Content-Type", "application/json");request.AddHeader("Authorization", "YOUR_PERSONAL_ACCESS_TOKEN");request.AddParameter("application/json", "{\"task\":{\"name\":\"My Updated Task Name\",\"task_type\":\"webhook\",\"webhook_url\":\"https://www.storyblok.com\"}}", ParameterType.RequestBody);IRestResponse response = client.Execute(request);import requests
url = "https://mapi.storyblok.com/v1/spaces/288868932106293/tasks/124"
querystring = {}
payload = {"task":{"name":"My Updated Task Name","task_type":"webhook","webhook_url":"https://www.storyblok.com"}}headers = { 'Content-Type': "application/json", 'Authorization': "YOUR_PERSONAL_ACCESS_TOKEN"}
response = requests.request("PUT", url, data=payload, headers=headers, params=querystring)
print(response.text)require 'storyblok'client = Storyblok::Client.new(oauth_token: 'YOUR_PERSONAL_ACCESS_TOKEN')
payload = {"task" => {"name" => "My Updated Task Name","task_type" => "webhook","webhook_url" => "https => //www.storyblok.com"}}
client.put('spaces/288868932106293/tasks/124', payload)let storyblok = URLSession(storyblok: .mapi(accessToken: .personal("YOUR_PERSONAL_ACCESS_TOKEN")))var request = URLRequest(storyblok: storyblok, path: "spaces/288868932106293/tasks/124")request.httpMethod = "PUT"request.httpBody = try JSONSerialization.data(withJSONObject: [ "task": [ "name": "My Updated Task Name", "task_type": "webhook", "webhook_url": "https://www.storyblok.com", ],])let (data, _) = try await storyblok.data(for: request)print(try JSONSerialization.jsonObject(with: data))val client = HttpClient { install(Storyblok(MAPI)) { accessToken = Personal("YOUR_PERSONAL_ACCESS_TOKEN") }}
val response = client.put("spaces/288868932106293/tasks/124") { setBody(buildJsonObject { putJsonObject("task") { put("name", "My Updated Task Name") put("task_type", "webhook") put("webhook_url", "https://www.storyblok.com") } })}
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 (opens in a new window).Terms of Service (opens in a new window) apply.
Get in touch with the Storyblok community