Skip to content

Add a Collaborator

Terminal window
https://mapi.storyblok.com/v1/spaces/:space_id/collaborators/

You can set any property available in the collaborator object. Below we only list the properties in the examples and the possible required fields.

  • :space_id required number

    Numeric ID of a space

  • email required string

    The email used in the space for a collaborator or a collaborator SSO ID

  • role required string

    The role name of the collaborator. It could be admin, editor, or role_id. To add a single custom role, set the value to role_id. To add multiple custom roles, set the value to multi.

  • space_role_id required number

    Numeric ID associated with a role. Usually an array of IDs with more than one role.

  • space_role_ids number[]

    An array of numeric IDs for multiple roles assigned to a collaborator. Set allow_multiple_roles_creation to true while using this.

  • permissions enum[]

    Permissions for a collaborator. Usually set to can_subscribe for a collaborator.

    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 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 internationalization or variants)
    move_storyMove stories between folders
    edit_story_slugEdit the URL of a story
    view_contentControls the visibility of content entries. Without this, all content is hidden. To grant read-only access, set Allow reading content permission in the UI.
    view_foldersControls the visibility of folders. Without this, all folders are hidden. To grant read-only access, set Allow reading content permission in the UI.
    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_keysEdit keys of datasources
    access_commerceAccess e-commerce features
    manage_block_libraryManage components in the Block Library
    hide_asset_foldersHides assets and folders for which the role doesn’t have upload permission. You can specify which folders are accessible in the UI.
  • allow_multiple_roles_creation boolean

    If true, you can add multiple role IDs for a collaborator.

curl "https://mapi.storyblok.com/v1/spaces/656/collaborators/" \
-X POST \
-H "Authorization: YOUR_OAUTH_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"allow_multiple_roles_creation\":false,\"email\":\"api.test@storyblok.com\",\"permissions\":[],\"role\":\"admin\",\"space_role_id\":\"\",\"space_role_ids\":[]}"

Request for adding a collaborator with one custom role.

curl "https://mapi.storyblok.com/v1/spaces/656/collaborators/" \
-X POST \
-H "Authorization: YOUR_OAUTH_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"allow_multiple_roles_creation\":false,\"email\":\"api.test@storyblok.com\",\"permissions\":[],\"role\":\"62454\",\"space_role_id\":62454,\"space_role_ids\":[]}"

Request for adding a collaborator with multiple custom roles.

curl "https://mapi.storyblok.com/v1/spaces/656/collaborators/" \
-X POST \
-H "Authorization: YOUR_OAUTH_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"allow_multiple_roles_creation\":true,\"email\":\"api.test@storyblok.com\",\"permissions\":[],\"role\":\"multi\",\"space_role_ids\":[62454,123123]}"