Workspace Memberships

This object determines if a user is a member of a workspace.

Workspace Memberships have the following fields:
Field Description
gid "1234" Read-only. Globally unique ID of the workspace membership.
resource_type "workspace_membership" Read-only. The resource type of this resource. The value for this resource is always workspace_membership.
user { id: 12345, gid: "12345", name: "Tim Bizarro" } Read-only. The user in the membership.
workspace { id: 14916, gid: "14916", name: 'My Workspace' } Read-only. The workspace the user is a member of.
user_task_list { gid: "12345", resource_type: "user_task_list", name: 'My Tasks' } Read-only. The user’s “My Tasks” in the workspace.
is_active false Read-only. Reflects if this user still a member of the workspace.
is_admin false Read-only. Reflects if this user is an admin of the workspace.
is_guest false Read-only. Reflects if this user is a guest of the workspace.

GET ALL MEMBERSHIPS FOR A WORKSPACE

GET    /workspaces/{workspace_gid}/workspace_memberships

Returns the compact workspace membership records for the workspace.

Parameter Description
workspace_gid "1331" Required: The workspace for which to fetch memberships.
user "14641" "me" "sashimi@asana.com" If present, the user to filter the memberships on.
# Request
curl -H "Authorization: Bearer <personal_access_token>" \
https://app.asana.com/api/1.0/workspaces/6432/workspace_memberships?user=5678

# Response
HTTP/1.1 200
{
  "data": [
    {
      "gid": "7424",
      "resource_type": "workspace_membership",
      "user": {
        "gid": "5678",
        "resource_type": "user",
        "name": "Greg Sanchez"
      },
      "workspace": {
        "gid": "6432",
        "resource_type": "workspace",
        "name": "Personal Projects"
      }
    },
    "~..."
  ]
}

GET ALL WORKSPACE MEMBERSHIPS FOR A USER

GET    /users/{user_gid}/workspace_memberships

Returns the compact workspace membership records for the user.

Parameter Description
user_gid "14641" "me" "sashimi@asana.com" Required: If present, the user to filter the memberships on.
# Request
curl -H "Authorization: Bearer <personal_access_token>" \
https://app.asana.com/api/1.0/users/5678/workspace_memberships

# Response
HTTP/1.1 200
{
  "data": [
    {
      "gid": "6342",
      "resource_type": "workspace_membership",
      "user": {
        "gid": "5678",
        "resource_type": "user",
        "name": "Greg Sanchez"
      },
      "workspace": {
        "gid": "6432",
        "resource_type": "workspace",
        "name": "Personal Projects"
      }
    },
    {
      "gid": "7424",
      "resource_type": "workspace_membership",
      "user": {
        "gid": "5678",
        "resource_type": "user",
        "name": "Greg Sanchez"
      },
      "workspace": {
        "gid": "7384",
        "resource_type": "workspace",
        "name": "Work Projects"
      }
    },
    "~..."
  ]
}

GET A WORKSPACE MEMBERSHIP

GET    /workspace_memberships/{workspace_membership_gid}

Returns the workspace membership record.

Parameter Description
workspace_membership_gid "1352" Required: Globally unique identifier for the workspace membership.
# Request
curl -H "Authorization: Bearer <personal_access_token>" \
https://app.asana.com/api/1.0/workspace_memberships/6274

# Response
HTTP/1.1 200
{
  "data": {
    "gid": "6274",
    "resource_type": "workspace_membership",
    "user": {
      "gid": "1234",
      "resource_type": "user",
      "name": "Tim Bizarro"
    },
    "workspace": {
      "gid": "6432",
      "resource_type": "workspace",
      "name": "Personal Projects"
    },
    "user_task_list": {
      "gid": "5167",
      "resource_type": "user_task_list",
      "name": "My Tasks"
    },
    "is_active": true,
    "is_admin": true,
    "is_guest": false
  }
}