Why does the Add an organization endpoint of the API not include address fields?

Hi,
I am trying to push organizations over to Pipedrive using their API endpoint “Add an organization”. However, there doesn’t seem to be any field for the ‘address’ related data in the API documentation and this is a little strange?

Hi @pipedrivefan :wave: , cool name :slightly_smiling_face:

If you want to update an address for an organization, you need to know the keys for the fields. To get them, you can call api/v1/organizationFields api. Fields for addresses are for example address, address_lat, address_long, address_street_number, etc…

Those fields can be later passed in a body while calling POST api/v1/organizations api or PUT api/v1/organizations/{id} api

1 Like

Hi, thanks for this information, that clears up a lot.

I am trying to Add a new Organization now through the API but running into this error.

Do you know what is wrong with my payload? Do you have a sample payload?

Hey,
your issue is that you marked the content-type of your body as plain text. The API expects application/json. You can change the setting in your postman.

an example CURL might be:

curl --location 'https://{yourCompany}.pipedrive.com/api/v1/organizations?api_token={api_token}' \
--header 'Content-Type: application/json' \
--data '{
    "name": "esse fugiat ipsum",
    "owner_id": 56092724,
    "visible_to": "3"
}'

Also, I encourage you to check our Postman collection where predefined calls can be found.