Invite users(users not in asana) to project using API

I was able to create a project in asana through API. After I create a project I would like to invite(Share to) a user(external user who is not in asana org) through API. Could you please let me know how to do this through API ? I would like to invoke functionality i.e. invite with email in below image through API
image

Hi @Hema_Sri_Sankarneni,

It’s not explained in the API documentation (cc: @Ross_Grambo hint hint :slight_smile: ) but the endpoint you want is AddUser:

When you call it with an email address instead of a User ID, it will do the following:

  • If the email address corresponds to a person who has an Asana account but is not part of your organization/workspace, it will add them as a guest user.
  • If the email address does not belong to any Asana user account, it will send them an email invite as you are asking about.
3 Likes

This doesn’t seem to be the case. I’m getting the error ‘Not a user in Organization’ unless the email address is already associated with an Asana account.

I’m trying to run a Make.com automation triggered by a Stripe transaction and really need the ability to invite a guest to a project from an API, with the possibility that the email address used is not already associated with an Asana account.

Any workarounds, or can the API be updated to work the way Phil described?

Hmmm, I know I tested it and it worked when I mentioned it here.

Any chance your behavior is due to your Guest Invite settings? I.e.

I just checked and it’s currently set to “Admins, members, and guests” with no option to even change the setting (because I’m not on an enterprise plan).

My API call works when I test on a personal email that I’ve used Asana with, but it doesn’t work when I try a new email of mine that has not ever been used with an Asana account.

It seems like the addMembers API is for strictly adding a member and I can’t seem to find any way to invite a new member to a project. This is pretty crucial for my workflow to be able to get clients up and running right away so if this can’t be resolved I probably won’t be able to use Asana. Which is a shame because I love Asana and everything else has been perfect for setting up my workflow.

Ah @Jason_Parry, sorry I missed this before - we’re talking about two separate API calls and functions.

I’m talking about adding a user to a workspace or organization; you’re talking about adding them to a project.

Before you add a user to a project, they have to have a valid user record in that project’s organization or workspace. You can’t directly create a brand new user record as part of adding them to a project as you’re trying to do. You’ll need to first invite them to the workspace/org using the endpoint I was referring to. Once they accept that invitation, they’ll have a user record and can be added to a project.

Yeah unfortunately that seems like the only way with the API, but that just won’t work with my workflow. I’m trying to create an automation that will create a new project and then add the client’s email to the project so they can start adding tasks right away. The API doesn’t offer a way (that I could tell) to listen for a user to join the organization and then add them to the appropriate project.

Really weird that Asana wouldn’t make the addMembers API function the same way as manually adding a user works.

Guess I’ll stick with Trello for now.