How to bulk updating contact info via API

Goal: bulk update contact information using request API via jupyter notebooks-python.

I’m requesting as follows:
url = “https://domain.freshdesk.com/api/v2/contacts

response = requests.get(url, auth=(api_key,pw))

Issue: How do I bulk update contact info?

I understand that I can update a contact’s info using:
url = “https://domain.freshdesk.com/api/v2/contacts/{contact_id}

However, how do I do this for all contacts? Do I have to create a url for each contact to then update?

Hello @ramiroft93

What would be the use-case here? There is an option in the UI to import/update contacts using a csv file.

You can use the search contact API to get the contact ID if it isn’t already stored somewhere.

Freshdesk Search Contact API

Then use the Update Contact API

Freshdesk Update Contact API

1 Like

Hey Adarsh! Thanks for the response!

Use case:
My company has been using the UI option to update but it takes a long time and I still have to download the information and upload it.
I was hoping to just automate things and update contact info using the API.

Response:
Totally! I was able to update one contact with your approach; however, I wasn’t sure how to do that for multiple contacts. My question was whether I needed to create urls with every contact id then update.

Out of curiosity how long does it take you to update contacts via UI? We update lifetime value figures in the company field which might be what’s making it take so long. I know we can add to tags but company field makes so that agents immediately see LTV groups

1 Like

The time taken to update contacts using UI will depend on the volume of data/contacts you want to update.

You will have to pass the Contact ID in the URL to update the contact one by one i case you want to do it using API. I usually use Run Postman collection option and bulk update contacts in one go.

Using the Collection Runner | Postman Learning Center

1 Like