Webhooks triggered by mobile app

Hello, I have an app that interacts with multiple Pipedrive accounts.
App currently creates webhooks for each account and listens to the changes from it.

When changes are being made from the desktop app, webhooks requests includes the account name in the domain, eg “accountname.pipedrive.com”. I use this to differentiate between which account should receive the updates.

But when changes are made in mobile app, domain name says “app.pipedrive.com” and it never mentions from which account it originated. It has the account id though.

Is there a way to pull the account id and/or name from the API?

With the company_id and user_id, you can identify the company this way:

Thanks, I saw this endpoint, in API docs it says though that it only works for authorized users?

Does it mean user need to be currently authorized in the pipedrive account? I don’t think that’s feasible for our app, since it deals with multiples accounts, and account manager is not going to explicitly stay authorized in one of accounts

No, there shouldn’t be any issue there, the GET /users/me endpoint is a default scope for all Apps so you should be able to access it.

This only works for Pipedrive Marketplace apps, correct?

For any apps that use OAuth. They don’t need to be public on the Marketplace (but they would need to be approved).