Admin functionality
Evo admins are users who have been given an administrator role in their organisation.
Evo admins have extra privileges:
- the ability to retrieve and list all workspaces in their organization (regardless of their role)
- the ability to assign and remove user roles for themselves or others in the organization
To utilize these permissions, separate administrator endpoints have been provided.
Admin endpoint URLs have the prefix /workspace/admin/orgs/<org_id>/workspaces
. An admin may choose to use the non admin endpoints - in that case, they are treated the same as any other user.
Note: Evo admins do not have permission to edit or delete workspaces unless they explicitly grant themselves proper role (i.e., owner or editor) in that workspace.
Adding/removing users from a workspace
GET/POST/DELETE https://<service_host>/workspace/admin/orgs/<org_id>/workspaces/<workspace_id>/users/[{user_id}]
An admin role allows you to add or remove users from a workspace when using the admin endpoints, regardless of whether you have a role in that workspace already.
For example, to get a list of users in a workspace, perform a GET request:
import requests
response = requests.get(
f"https://<service_host>/workspace/admin/orgs/<org_id>/workspaces/<workspace_id>/users",
headers={ "Authorization": "Bearer [yourtokenhere]" },
)
print(response.json())
You may add a user to this workspace with a POST request:
import requests
response = requests.post(
f"https://<service_host>/workspace/admin/orgs/<org_id>/workspaces/<workspace_id>/users",
json={
"role": "editor",
"user_id": "71aa0a41-6177-4248-94e5-78ba4ebf9d7e",
},
headers={ "Authorization": "Bearer [yourtokenhere]" },
)
print(response.json())
Users may be removed from a workspace using a DELETE request:
import requests
response = requests.delete(
f"https://<service_host>/workspace/admin/orgs/<org_id>/workspaces/<workspace_id>/users/<user_id>",
headers={ "Authorization": "Bearer [yourtokenhere]" },
)
print(response)
Listing all workspaces
GET https://<service_host>/workspace/admin/orgs/<org_id>/workspaces
You can retrieve a list of all workspaces in an organisation, where the regular "list workspaces" endpoint will only return workspaces that you have a role in.
import requests
response = requests.get(
f"https://<service_host>/workspace/admin/orgs/<org_id>/workspaces",
headers={ "Authorization": "Bearer [yourtokenhere]" },
)
print(response.json())
Retrieving a workspace
GET https://<service_host>/workspace/admin/orgs/<org_id>/workspaces/<workspace_id>
Similarly to an admin "list workspaces" request, you can retrieve a workspace's details without an existing role in that workspace:
import requests
response = requests.get(
f"https://<service_host>/workspace/admin/orgs/<org_id>/workspaces/<workspace_id>",
headers={ "Authorization": "Bearer [yourtokenhere]" },
)
print(response.json())
Bulk assigning user roles
POST https://<service_host>/workspace/admin/orgs/<org_id>/action/bulk_assign_roles
Multiple users may be assigned roles to multiple workspaces in a single request:
import requests
response = requests.post(
f"https://<service_host>/workspace/admin/orgs/<org_id>/action/bulk_assign_roles",
json=[
{
"role": "editor",
"user_id": "e0f56b2a-e1e0-4992-88c3-d2173d4b7c58",
"workspace_id": "e06c00f5-6202-41e8-b3cb-193a7b0c8523"
},
{
"role": "viewer",
"user_id": "23670af2-ffad-43de-aa6a-3259775991e3",
"workspace_id": "045463f8-2130-4065-81db-ccd0c7cd9ddb",
},
],
headers={ "Authorization": "Bearer [yourtokenhere]" },
)
Listing workspaces for a user
GET https://<service_host>/workspace/admin/orgs/<org_id>/users/<user_id>/workspaces
You can retrieve a list of workspaces that a specific user has a role in:
import requests
response = requests.get(
f"https://<service_host>/workspace/admin/orgs/<org_id>/users/<user_id>/workspaces",
headers={ "Authorization": "Bearer [yourtokenhere]" },
)
print(response.json())