How to get the company domain

There are a few methods for getting the value of the subdomain for a Pipedrive company for which we use the company_domain parameter:


Method 1


You can get it manually from the Pipedrive app by logging into your Developer Sandbox account and seeing the URL:

1480

Method 2


You can fetch it via GET /users/me. Just copy the command below into your terminal and don't forget to replace the placeholder with your actual API token. Execute the command and find the company_domain in the JSON output:

curl --request GET \
  --url https://api.pipedrive.com/v1/users/me \
  --header 'x-api-token: YOUR_API_TOKEN_HERE'

You can check the GET /users/me response structure here.


Method 3


If you’re using OAuth authorization you can get the company_domain in the OAuth server's response when making a HTTP request to it. In the JSON response body, company_domain will be a part of the api_domain parameter's value.

More info can be found about it in the getting the OAuth tokens and refreshing the OAuth tokens sections.