Storyblok
Search Storyblok's Documentation
  1. Retrieve a Single Space Role

Management API

Retrieve a Single Space Role

Returns a single, space role object by providing a specific numeric id.

https://mapi.storyblok.com/v1/spaces/:space_id/space_roles/:space_role_id

Path Parameters

  • :space_id

    required number

    Numeric ID of a space

  • :space_role_id

    required number

    Numeric ID of the space role

Response Properties

  • space_role

    The Space Role Object
    • id

      number

      Numeric Unique ID of the space role

    • 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"

    • readonly_field_permissions

      string[]

      An array of defined fields that are hidden for the specific role. The schema used is component_name.field_name

    • permissions

      enum[]

      An array of strings that defines the permissions for the a specific role. These are a few examples, but there are more value that can be present or used.

      Try changing the role permissions and retrieve a role to see all the possible values

      PermissionDescription
      read_storiesView stories without editing
      save_storiesEdit and save stories
      publish_storiesPublish stories to the live environment
      unpublish_storiesUnpublish stories from the live environment
      publish_foldersPublish entire folders and their contents
      unpublish_foldersUnpublish folders and their contents
      deploy_storiesDeploy pipeline stories
      delete_storiesPermanently delete stories
      edit_imageEdit images in the asset manager
      view_composerView the Visual Editor
      change_alternate_groupChange alternate content groupings (for i18n or variants)
      move_storyMove stories between folders
      edit_story_slugEdit the URL slug of a story
      view_contentControls visibility of content entries. Without this, all content is hidden unless explicitly granted. To give read-only access to others, enable allow reading content permission.
      view_foldersControls visibility of folders. Without this, all folders are hidden unless explicitly granted. To give read-only access to others, enable allow reading content permission.
      view_draft_jsonView the draft JSON payload of stories
      view_published_jsonView the published JSON payload of stories
      manage_tagsCreate, edit, or delete tags
      edit_datasourcesEdit datasources
      edit_datasource_keys Edit keys inside datasources
      access_commerceAccess commerce-related features
      manage_block_libraryManage components in the Block Library
      hide_asset_foldersHides assets and folders (including subfolders) that the role doesn't have upload permission for. In the UI, you can specify which folders are accessible.
    • role

      string

      Role of the collaborator, could be admin, editor or custom roles

    • subtitle

      string

      Description of the role

    • datasource_ids

      number[]

      An array of datasource IDs that can be accessed by the role. If no IDs is added, the user has rights to edit all datasources.

    • component_ids

      number[]

      An array of IDs of components that the user role cannot select/use. If none is present/selected, the user role has rights to all components.

    • branch_ids

      number[]

      An array of IDs of pipelines that the user role has right to deploy. If none is present/selected, the user role can access all the pipelines.

    • allowed_languages

      string[]

      List of languages (language codes) that the user role has access to. If none is present/selected, the user role has right to all the languages.

    • asset_folder_ids

      number[]

      An array of IDs of asset folders that the user role has access to. If none is present/selected, the user role can access all the asset folders.

Request
curl "https://mapi.storyblok.com/v1/spaces/606/space_roles/18" \
  -X GET \
  -H "Authorization: YOUR_OAUTH_TOKEN" \
  -H "Content-Type: application/json"
Request
// Using the Universal JavaScript Client:
// https://github.com/storyblok/storyblok-js-client
Storyblok.get('cdn/spaces/606/space_roles/18', {})
  .then(response => {
    console.log(response)
  }).catch(error => { 
    console.log(error)
  })
Request
$client = new \Storyblok\Client('YOUR_STORYBLOK_SPACE_ACCESS_TOKEN');

$client->get('/spaces/606/space_roles/18')->getBody();
Request
require 'storyblok'
client = Storyblok::Client.new(oauth_token: 'YOUR_OAUTH_TOKEN')

client.false('/spaces/606/space_roles/18')
Request
HttpResponse<String> response = Unirest.get("https://mapi.storyblok.com/v1/spaces/606/space_roles/18")
  .header("Authorization", "YOUR_OAUTH_TOKEN")
  .asString();
Request
var client = new RestClient("https://mapi.storyblok.com/v1/spaces/606/space_roles/18");
var request = new RestRequest(Method.GET);

request.AddHeader("Authorization", "YOUR_OAUTH_TOKEN");
IRestResponse response = client.Execute(request);
Request
import Foundation

let headers = [
  "Content-Type": "application/json",
  "Authorization": "YOUR_OAUTH_TOKEN"
]

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 = "GET"
request.allHTTPHeaderFields = headers

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()
Request
import requests

url = "https://mapi.storyblok.com/v1/spaces/606/space_roles/18"

querystring = {}

payload = ""
headers = {
  'Content-Type': "application/json",
  'Authorization': "YOUR_OAUTH_TOKEN"
}

response = requests.request("GET", url, data=payload, headers=headers, params=querystring)

print(response.text)