Permission issue on company-contact association

Hello here.

I am posting a message here because we are facing strange behaviour.

Here is the description of our workflow:

  1. We create a contact through API.
  2. Then we search if the contact’s company exists through the search API. We base this search on the domain of the contact email or, if it is a free email (eg gmail, yahoo), we search with the company name the contact gave us.
  3. If there is no company found, we create it.
  4. Last step, we proceed to an API call to associate the contact with the company.

This process is successful when the contact has a custom domain (eg johndoe@mycompany.io). But we have a USER_DOES_NOT_HAVE_PERMISSION error when the user has a free email (eg. johndoe@gmail.com).

Is there any reason why we cannot associate a user to a company if the user has a free email?

I checked different error messages, and it looks like the one we have is specific to an authorization issue, which is strange since we have the right scope declared, and we can associate contacts under certain conditions.

The scope of our application:

  • timeline
  • oauth
  • crm.objects.contacts.read
  • crm.objects.contacts.write
  • crm.objects.companies.write
  • crm.objects.companies.read
  • crm.objects.deals.read
  • crm.objects.deals.write

Error:

HTTP status code: 400
One or more associations are invalid “USER_DOES_NOT_HAVE_PERMISSION”:[“User does not have permissions to associate COMPANY XXXXXX with CONTACT XXXXXX”], “category”:“VALIDATION_ERROR”}

Thank you!

Hey, @Marc-Anthony :waving_hand: Welcome to our community! One question — are you using a Private App for auth in these requests? If so, I found several recent support tickets for similar issues. The common solution between them is to ask you or your team to:

  • Have Super Admin create a new Private App
  • Rotate the “old” Private App key out of your app and try the “new” key

If this doesn’t resolve the issue, it may be worth filing a support ticket if you have access.

Talk soon! — Jaycee

Thank you for your feedback.

We are the maintainer of an app listed on the App Marketplace. Should I expect the same issue since both connected and private apps seem to use the same API?

Thank you!