[ Change ] Memberships endpoints now support custom fields (and more)

Summary

We’ve enhanced the functionality of all memberships endpoints to support additional membership types:

The updated endpoints now allow for broader interaction with goals, projects, portfolios, and custom fields memberships, enabling you to query, create, update, and delete memberships across these different Asana object types.

Why we’re making this change

These updates were designed to provide more flexibility in managing memberships across different Asana object types. By adding support for custom field, portfolio, and goal memberships, you now have an easier way to integrate their workflows across a wider array of Asana projects and resources. This enhances the versatility of our memberships API, while keeping things intuitive and consistent.

Who is affected

  • Developers using memberships endpoints: Your existing integrations will not be affected by this change, as there are no breaking changes. The new functionality is additive, allowing you to manage custom fields, portfolios, and goals memberships alongside projects
  • Use cases for new membership types: If your application interacts with custom fields, portfolios, or goals, these new membership types can now be managed through the same API endpoints

Usage

The API reference has been updated to reflect the new changes. See any of the five memberships endpoints for details and examples.

Example request

GET /memberships?parent=<CUSTOM_FIELD_GID>&member=<USER_GID>

Example response

{
  "data": [
    {
      "gid": "<MEMBERSHIP_GID>",
      "parent": {
        "gid": "<CUSTOM_FIELD_GID>",
        "name": "Test",
        "resource_subtype": "text",
        "resource_type": "custom_field",
        "type": "text",
        "privacy_setting": "public",
        "is_formula_field": false
      },
      "member": {
        "gid": "<USER_GID>",
        "name": "My user name",
        "resource_type": "user"
      },
      "access_level": "admin",
      "resource_type": "membership",
      "resource_subtype": "custom_field_membership"
    }
  ]
}

Timeline

These changes are immediately available.

2 Likes

Nice! Beautiful implementation and documentation!

Thanks,

Larry

Hi! It really helped to our team.
While testing, I think there’s an error with custom field membership.

I put a member as a “user” but the result said like below.

{
“errors”: [
{
“message”: “Invalid role user for custom_field_membership, please choose one of: admin, editor, viewer”,
“help”: “For more information on API status codes and how to handle them, read the docs on errors: Errors
}
]
}

Pls take a look at it!

Hi @Robin28,

Good point here! I tested this out and it looks like an API bug (alerting @AndrewWong): although the value in the Asana UI and in the API documentation is user, the actual value in the underlying data object exposed in the API turns out to be viewer. This is clearly not right since the access level is not one of a viewer but in my testing, that’s what the API currently uses.

So until it’s fixed (assuming they’ll fix it), use viewer to set a custom field membership to “User”. I tried it and when I do this in a PUT:

{
  "data": {
    "access_level": "viewer"
  }
}

it sets the user’s access level to “User” in the Asana UI.

1 Like

Thanks for confirming, @Phil_Seeman !
I’ve also tried it as viewer and succeed updating the access level as user.
I should wait til the bug is fixed. Thanks!!