Hello once more! (It’s been a busy week of announcements for us!) We have recently added a new resource to our API that provides more detail around users in the context of workspaces, called “workspace memberships.” These are similar to project memberships or portfolio memberships, and represent the join between a user and a workspace in Asana. These objects contain the following:
- A reference to the user
- A reference to the workspace
- A reference to the user’s “My Tasks” in that workspace
- Whether the user is a guest
- Whether the user is an admin
- Whether the user’s membership is still active
Here’s an example of one of these objects:
{
"gid": "...",
"is_active": true,
"is_admin": false,
"is_guest": false,
"resource_type": "workspace_membership",
"user_task_list": {
"gid": "...",
"name": "My Tasks in Asana, Inc",
"resource_type": "user_task_list",
},
"user": {
"gid": "...",
"name": "Joe Trollo",
"resource_type": "user",
},
"workspace": {
"gid": "...",
"name": "My Company, Inc",
"resource_type": "workspace",
},
}
You can fetch workspace memberships…
- For a given user with
GET /users/<user-gid>/workspace_memberships
- For a given workspace with
GET /workspace/<workspace-gid>/workspace_memberships
- By GID with
GET /workspace_memberships/<workspace-memberships-gid>
One important note: a user’s set of workspace memberships may not match their workspaces. If a user is removed from a workspace and then added back later, they would have multiple membership objects—the old inactive one and the new active one.