Update a Space Role
/spaces/:space_id/space_roles/:space_role_id
Path Parameters
-
:space_id
required numberNumeric id of a space
-
:space_role_id
required numberNumeric id of the space role connected with collaborators
Request Body Properties
-
space_role
The Space Role Object-
id
numberNumeric Unique ID
-
role
required stringRole of the collaborator, could be admin, editor or custom roles
-
allowed_paths
number[]Story ids the user should have access to (acts as whitelist). If no item is selected the user has rights to access all content items.
-
resolved_allowed_paths
string[]Resolved allowed_paths for displaying paths
-
field_permissions
string[]Hide specific fields for this user with an array of strings with the schema:
"component_name.field_name"
-
permissions
enum[]Allow specific actions for collaborator in interface and add the permission as array of strings
Permission Description publish_stories Allow publishing of content entries save_stories Allow editing and saving of content entries edit_datasources Allow editing and saving of datasources access_commerce Allow access to commerce app edit_story_slug Deny the change of slugs of content entries move_story Deny moving of content entries view_composer Deny access to visual composer
-
Response Properties
-
space_role
The Space Role Object-
id
numberNumeric Unique ID
-
role
stringRole of the collaborator, could be admin, editor or custom roles
-
allowed_paths
number[]Story ids the user should have access to (acts as whitelist). If no item is selected the user has rights to access all content items.
-
resolved_allowed_paths
string[]Resolved allowed_paths for displaying paths
-
field_permissions
string[]Hide specific fields for this user with an array of strings with the schema:
"component_name.field_name"
-
permissions
enum[]Allow specific actions for collaborator in interface and add the permission as array of strings
Permission Description publish_stories Allow publishing of content entries save_stories Allow editing and saving of content entries edit_datasources Allow editing and saving of datasources access_commerce Allow access to commerce app edit_story_slug Deny the change of slugs of content entries move_story Deny moving of content entries view_composer Deny access to visual composer
-
curl "https://mapi.storyblok.com/v1/spaces/606/space_roles/18" \
-X PUT \
-H "Authorization: YOUR_OAUTH_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"space_role\": {\"id\": 18,\"role\": \"English Editor\"}}"
// Using the Universal JavaScript Client:
// https://github.com/storyblok/storyblok-js-client
Storyblok.put('/spaces/606/space_roles/18', {
"space_role": {
"id": 18,
"role": "English Editor"
}
})
.then(response => {
console.log(response)
}).catch(error => {
console.log(error)
})
$client = new \Storyblok\Client('YOUR_STORYBLOK_SPACE_ACCESS_TOKEN');
$payload = [
"space_role" => [
"id" => 18,
"role" => "English Editor"
]
];
$client->put('/spaces/606/space_roles/18', $payload)->getBody();
require 'storyblok'
client = Storyblok::Client.new(oauth_token: 'YOUR_OAUTH_TOKEN')
payload = {
"space_role" => {
"id" => 18,
"role" => "English Editor"
}
}
client.put('/spaces/606/space_roles/18', payload)
HttpResponse<String> response = Unirest.put("https://mapi.storyblok.com/v1/spaces/606/space_roles/18")
.header("Content-Type", "application/json")
.header("Authorization", "YOUR_OAUTH_TOKEN")
.body("{\"space_role\": {\"id\": 18,\"role\": \"English Editor\"}}")
.asString();
var client = new RestClient("https://mapi.storyblok.com/v1/spaces/606/space_roles/18");
var request = new RestRequest(Method.PUT);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "YOUR_OAUTH_TOKEN");
request.AddParameter("application/json", "{\"space_role\": {\"id\": 18,\"role\": \"English Editor\"}}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
import Foundation
let headers = [
"Content-Type": "application/json",
"Authorization": "YOUR_OAUTH_TOKEN"
]
let postData = NSData(data: "{\"space_role\": {\"id\": 18,\"role\": \"English Editor\"}}".data(using: String.Encoding.utf8)!)
let request = NSMutableURLRequest(url: NSURL(string: "https://mapi.storyblok.com/v1/spaces/606/space_roles/18")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0)
request.method = "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)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
import requests
url = "https://mapi.storyblok.com/v1/spaces/606/space_roles/18"
querystring = {}
payload = "{\"space_role\": {\"id\": 18,\"role\": \"English Editor\"}}"
headers = {
'Content-Type': "application/json",
'Authorization': "YOUR_OAUTH_TOKEN"
}
response = requests.request("PUT", url, data=payload, headers=headers, params=querystring)
print(response.text)