Quick Navigation:

Before we get started, I’d like to let you know that this isn’t for the faint of heart, we will be getting technical. That being said, I have tried to simplify it as much as possible, and if you stick around till the end I provide some “cheat-sheet” copy & paste documentation for utilizing the Freshsales API with Zapier.

Don’t worry, I will be providing thorough, real-life examples to help you understand exactly how this works, as well as some nuances of automation.

Examples to be covered:

  1. Create invoices on an updated deal stage
    1. As well as a key piece of information to pass along
  2. Update a deal custom fields and pipeline stage after an invoice is sent
  3. Automatically record new invoice payments and update deals

Note: I do recommend checking the Freshworks Marketplace for an existing integration before worrying about creating your own with Zapier.

Getting started with Webhooks by Zapier and the Freshsales API

First off, how the heck do we even use the Freshsales API with Zapier? Quite simply, we’ll use Webhooks by Zapier and Freshsales Workflows.

Here’s a list of the tools and documentation you’ll need to get started.

  1. Freshsales account
  2. Zapier account
  3. Freshsales API documentation
  4. Webhooks by Zapier
  5. Freshsales workflows

Webhooks are a very powerful tool that enable you to not only send whatever information you want into Freshsales (via the API) but they also allow you to extract any information you want to then manipulate or send to another platform.

Let’s start with the simpler of the two, sending information out of Freshsales to Zapier using webhooks and workflows.

How to send any information out of Freshsales to Zapier using workflows and webhooks

Often you’ll want to send information from Freshsales to another system automatically. For most cases, Zapier has a supported “trigger” that makes this easy. But what do you do when there isn’t a supported trigger such as “Update Deal.”

For instance, let’s say you want to automatically create an invoice for a client once their deal reaches the stage “Accepted.”

Example: Automatically create an invoice on an updated deal stage

For this example, I will be using Invoice Ninja as the invoicing tool. You can really do this with whichever tool you use, but depending on what you use, you may need to do some additional integration. Invoice Ninja has tons of supported actions and triggers with Zapier.

Note: the Freshsales Marketplace is a great place to look for already existing integrations. For instance, they have a QBO integration.

Step 1: Setup a Zap with Webhooks by Zapier and “Catch Hook” as the trigger

Step 2: Copy the webhook URL

Step 3: Create a deal workflow in Freshsales, specify the trigger and select “Trigger Webhook” as the action

Step 4: Paste the webhook URL, select the data you want to send along, click to test, and then save and turn on the workflow

Pro-tip: Send along the deal ID and attach it to the invoice so you can easily update the appropriate deal later on in the process.

Step 5: Return to Zapier and pull in sample data to proceed with the workflow

Step 6: If the deal doesn’t contain all of the related contact profile information, you will want to find the contact in Freshsales using the email address or API search function (covered later)

Final Steps

After you have the initial part setup, it’s all about passing this information into the invoicing tool of your choice. For my example, using Invoice Ninja, I first create a client and then I create an invoice.

It’s important to note that I associate the deal ID with both the client and the invoice so that I can reference the associated deals easily when the workflow is being triggered elsewhere than Freshsales.

How to send any information through the Freshsales API using Webhooks by Zapier

You may find yourself wanting to make updates inside of Freshsales but Zapier doesn’t have a supported action.

Examples include:

  • Updating deals
  • Creating tasks/appointments
  • Logging calls
  • Attaching files

In these cases you must resort to using the Freshsales API. This can seem daunting, but if you stick with me you’ll see it’s really quite simple.

To continue with our previous example let’s say you want to automatically update a deal in Freshsales after an invoice for that deal has been paid. And then you want to take the information associated with that deal and add an event to your calendar to remind you to collect the last payment installment (or something else..)

[Part 1] Example: Automatically update Freshsales deal upon successful invoice payment

Continuing with the initial example, I will be using Invoice Ninja as the invoicing tool. Except this time I will be using Invoice Ninja as the trigger inside of Zapier and then sending information into Freshsales using their API and Webhooks by Zapier.

Note: the Freshsales Marketplace is a great place to look for already existing integrations. For instance, they have a QBO integration.

Step 1: Setup your Zap to trigger on a new invoice payment and retrieve the invoice details

In my case, I need to add a second step to my zap that finds the invoice associated with the payment because the information pulled in from the trigger does not contain all that I need to identify the deal in Freshsales.

Do you remember the pro-tip? So hopefully you passed along the deal ID as a field on either the invoice or the client, because you’re going to need it. To get the ID you’ll need to retrieve it from the invoice that has been paid or do a search for the client associated with the invoice to retrieve the ID from their profile.

I passed my deal ID in as a “private note” on the invoice.

Don’t have the deal ID? No worries, if you scroll to the bottom of the article I’ll show you how to perform an API search using information like phone number, email, name, etc.

Step 2: Perform any data formatting or steps you need, then make a PUT request to the Freshsales API using Webhooks by Zapier

This is kind of a long step, so bear with me.

So the way I know to use a PUT instead of a POST or GET is because I went to the Freshsales API documentation and looked at what they require under “Update A Deal.”

Before you edit the Zapier template you’ll want to know a few things:

  • URL:
    • https://YOURDOMAIN.freshsales.io/api/deals/DEALID
  • Payload Type:
    • Json
  • Data
    • This is the information you want to pass in or update inside of Freshsales
    • Formatting standard fields (copy exactly)
      • deal__ field_name
    • Formatting custom fields (copy exactly)
      • deal__custom_field__cf_field_name
  • Wrap Request in Array
    • No
  • File
    • Link to file you want to pass along
  • Unflatten
    • Yes
  • Basic Auth
    • This works fine for most cases
  • Headers
    • This is where you can pass along your API token for authorization if you didn’t use Basic Auth.

You’ll notice that I’m pulling in the deal ID from the invoice and then I’m doing 3 things in the data section.

  • deal__deal_stage_id
    • I’m updating the deal stag to move the deal further along in the pipeline
  • deal__custom_field__cf_payment_status
    • I’m updating the payment status to “Deposit Made.”
      • I know it’s a deposit vs a payment in full because of step number 3 in Zapier where I’m using a formula to compare the amount paid to the invoice total
  • deal__custom_field__cf_amount_paid
    • I’m updating a custom field “amount paid” to the amount that has been paid on the invoice

[Part 2] Example: Retrieve deal information via Freshsales API to then create a Google Calendar event

Now we’ve updated the deal in Freshsales, but what if we also want to create a calendar event with the deal/contact information to remind us to collect the remainder of the payment (or for any reason).

In our example, we want to make a calendar event to remind us to charge the client the second half of an invoice that only had the deposit paid.

I have a filter step setup in Zapier to look if the invoice was paid in full or only had a deposit made. If it was paid in full, the zap does not proceed.

Step 1: Perform a GET request using Webhooks by Zapier to the Freshsales API to retrieve information associated with the deal

As we did in part 1 where we had to update the deal, this time we want to pull the information associated with the deal. To know to use a GET request, we look at the Freshsales API documentation.

This time we don’t have to do anything except pass along the deal ID in the URL. Much simpler than updating the deal with the PUT request.

Once you test this step, you’ll be able to see all of the details associated with that deal. If everything looks good and you have the information you need, it’s time to proceed with creating the calendar event.

Step 2: Create a detailed Google Calendar event with Zapier

Pretty straightforward here, you’ll just want to pass in any data the is required/helpful for the calendar event. For this example, we’re passing through the customer name, the job type, the balance due, and the due date.

How to find leads/contacts/deals when you don’t have the ID by searching with the Freshsales API

As we’ve seen so far, there are many use cases that require sending information into Freshsales via their API. However, you may have noticed that to update a lead/contact/deal, you need to have the associated ID.

So what can you do if you don’t have the ID?

You can use the Search function of the API to locate the appropriate record by using other identifying information like phone number, email, name, etc.

For this next example, I’m going to show you how to log text messages from RingCentral as notes on a lead or contact profile using only the phone number.

To get started, we’re good to head over to the Search documentation on the Freshsales API documentation.

As you can see, we’re going to need to perform a GET request using Webhooks by Zapier.

Example: Automatically log RingCentral text messages to a Freshsales lead and/or contact profiles

I’m not going to spend a ton of time walking through all of this setup because I want to focus on searching with the Freshsales API.

That being said, RingCentral has a nice integration with Zapier that triggers off of new text messages so it’s very straight forward to get setup. You can do this with services other than RingCentral, but I have chosen them for this example.

Step 1: Setup 2 Zaps, one for inbound messages and another for outbound messages

You can set it up so that both inbound and outbound messages are processed in a single zap, but I recommend using 2 because it’s more straight-forward and allows you to troubleshoot errors more easily.

You’re going to want to set the trigger as “New SMS” and then add a filter step that looks at the direction (inbound/outbound) of the message as well as a formatter step to format the phone number and make it easy for searching.

Step 2: Perform a GET request to search via the Freshsales API

Now you’re going to use Webhooks by Zapier to perform a GET request to the Freshsales API to search leads based on phone number.

The URL and aprameters are as follow:

  • https://YOURDOMAIN.freshsales.io/api/search?q=PHONENUMBER&include=lead
  • The information after “q=” is what you are searching by
  • After “include=” you’ll put either lead, contact, deal, sales_account and this is what you are searching for

Step 3: Use a Path to account for texts from both leads and contacts

It may have occurred to you that both leads and contacts send messages and if you’re only searching for leads you’ll fail to record text messages for contacts.

The solution is to setup a Path within Zapier that looks at the results of the initial GET step. If the search is successful an ID will be returned for the lead. If it is not, there will not be an ID.

What you will do is have one path proceed if ID exists and the other proceed if it does not exist.

If the lead does exist, then proceed with adding a note to the lead. If the lead does not exist, then proceed with performing a new GET request where you’re searching for contacts instead of leads.

Then, the last step, add the note to the lead or contact. You can do this using Zapier and Freshsales supported actions.

Cheat sheet for using Webhooks by Zapier and the Freshsales API

I’ve pulled together a little cheat sheet to help you along the way. If you’d like the entire document or you’d like to ask me questions, please email me at rob@alice.design.

Alternative solutions and use cases

What if I told you there was an easier way to interface with the Freshsales API than by using Webhook by Zapier?

You’d probably wonder why I didn’t just start with that.. and good question. Maybe I like to save the best for last?

Actually, the reason I held off on telling you about the Integromat integration with Freshsales is because you’re likely to find more apps you want to integrate with Freshsales that are supported by Zapier.

Integromat is a great tool, it just doesn’t have as many integrations as Zapier (yet), and it also can be more difficult for automation beginners to use.

What is really awesome is you can integrate Zapier and Integromat to take your automations to the next level. Each tools has their strengths and being able to use them seamlessly together, is AWESOME!

The integration between Zapier and Integromat is handled via webhooks, so it’s very useful to have learned how to use webhooks in this article 🙂

You can pretty much automate anything by using tools like Zapier and Integromat, I encourage you to try your hand at solving simple, mundane tasks in your business, and then move onto tackling larger problems.

Also, don’t forget, me, Freshworks, and Zapier are all here to support you.

Happy automating!

Rob Schmidt is a Zapier Certified Expert and Freshworks Solutions Partner. He has an extensive background in digital marketing and business systems integrations. He lives in Austin TX where he and his team run the company Alice.Design.

Contact Rob:
rob@alice.design or
(512) 580-7664