Skip to main content

Get workspace permisions

Get the current user's access to the projects and tables in the specified workspace.

Request

curl -vvv "$API_HOST/open/api/v1/workspaces/$type/$id/roles/" -H "Authorization: $access-token"

Python example

def get_workspace_role(access_token, workspace):
url = '%s/open/api/v1/workspaces/%s/%d/roles/' % (API_HOST, workspace['type'], workspace['id'])
headers = {'Authorization': access_token}
req = requests.get(url, headers=headers)
return req.json()

Response

Response body

NameTypeDescription
detailarrayPermision list
∟ idint64Node ID
∟ typestringNode type: project, table, org, datafile
∟ rolestringPermission: admin editable readonly

Response body example

{
"code": 0,
"detail": [
{
"id": 56,
"type": "project",
"role": "admin"
},
{
"id": 55,
"type": "project",
"role": "admin"
}
],
"extra":null,
"message": "OK",
"requestID":null
}