How to backup collaborators
Load current collaborators
Access your current space from the management API and execute a GET request to receive a space object.
This will give you access to an object formed like this:
Where you will be able to access: space.collaborators
which is an array of all your current collaborators, their default role
or their custom space_role_id
.
What you will need to restore your collaborators will be:
- The e-mail or SSO
userid
available in eachcollaborator.user
object. Do not use thefriendly_name
. - The
role
field available on thecollaborator
object. - The
space_role_id
field available on thecollaborator
object.
Restoring your collaborators
To restore your collaborators you need the information above and execute a POST
request on your space for each of them. Make sure to replace SPACE_ID
from the below CURL request.
Create a collaborator by using its mail
curl 'https://mapi.storyblok.com/v1/spaces/SPACE_ID/collaborators/' -H 'authorization: YOUR_OAUTH_TOKEN' -H 'content-type: application/json' -H 'accept: application/json, text/plain, */*' --data-binary '{"email":"email@ofyourcollaborator.com","role":"editor","space_role_id":null}' --compressed