Automation with Insightly API

I have been using the cloud based CRM software Insightly for a while now. I use it to manage my clients' information, and projects that I have with those clients. Recently I was presented with a task by my boss. He wanted to automate some of our business processes because we were taking to much time entering data and creating spreadsheets to send to our accounting team. Every time we would start a new project with one of our clients we would create a spreadsheet showing all of the information about the project budgeted hours, budgeted amount, etc. Also, we would check with our accounting team to see if they already had the client within their system. If not we would also create a customer spreadsheet to send over so they could have emails, billing contacts information, etc.

This process took about thirty minutes every time we started a new Project. So, we needed to come up with a way to speed up or automate this process. We are closely associated with Mulesoft, and have a team of Certified Mule Developers, and we decided to use Mule to accomplish this task. Mulesoft has a suite of different integration and API products.

So let me explain a little bit about what is going on behind the scenes of this process that I have built out. Whenever we create a Project within Insightly we make sure to have all of the fields that we need to send over to our accounting team, this includes the linked customer(Organization) that we will also be creating a spreadsheet for and sending to our accounting team. We then use Insightly's “Tag” functionality to mark this Project as a New Project. Now Mule is polling constantly to look for Projects with the tag New Project and when it sees one it uses Insightly API to grab the Project and all of its linked information.

Once Mule has this data it starts to run checks to make sure that all of the fields that our accounting team require are populated. If any of the required fields are missing, it will stop the process and email our team letting them know that there are required fields missing and they need to go modify the record in Insightly to include those fields. Once it has made sure that it has everything it needs, it calls upon a custom transformer to take the data and put it into an Excel spreadsheet. This transformer is built using Java and Apache POI which is an add on to Java that is used for manipulating data into a custom formats such as XLS, DOC, and PPT. After the spreadsheet is created, it is sent to a shared drop-box folder for our accounting team to pick up and add to the accounting system. Then Mule reaches back out to Insightly and updates the “New Project” tag to “Project” so that Mule doesn't poll it again.

While that process is running there is also another process running that is working with the linked Organization on the Project. I needed a way to make sure that the organization that is associated with the project wasn't already in our accounting system. So I decided that I would add a tag to the Organization of Customer once it had been sent to our accounting team. So in my flow, I added a check to the Organization flow that makes sure there isn't a tag of customer. This flow is imaged below.

  1. The linked Organization information will come in here and then it will scan through tags that are on the Organization to see if there is one called Customer. If there is one then it will populate this variable with it, if not the variable will be blank.

  2. This will check the variable to see if it is blank or if it has a value in it. If the variable is blank it will go into path A where it will send a message stating that the Company has already been created in our accounting system and then the process will stop. If there is a value in there, it will go to path B where it will take the customer and begin processing it to be submitted to our accounting system.

After the Project comes into Mule, it takes the linked Organization and sends it over to a separate flow, and then it uses the Organization Id to call back out to Insightly to get the rest of the Organizations information. Once it has that back in Mule, the first thing it does is check for a tag of “Customer”. If it has one the process stops, and the customer spreadsheet is not created because it is already in our accounting system. If there is no tag, it begins to make sure it has all of the necessary fields to create the spreadsheet. After those checks are done, it sends the data through another custom transformer to manipulate the data into a spreadsheet and then send it to our shared drop-box folder, and finally it reaches back out to Insightly to update the Organization with the new tag of “Customer”. 

These flows run at the same time, so this process is very quick. From the moment Mule picks up the New project it takes under five seconds to complete this entire process. Saving time is not the only benefit of setting up processes like this. You don't have to use two monitors to hand copy data from Insightly over to a spreadsheet and worry about missing or misspelling fields. Also, like we did within our process, you can set up checks to make sure things are populated and formatted correctly.

Automating processes such as this are becoming more and more vital to having a successful business process. Assuring that your data is being passed between services quickly and efficiently while keeping it secure has never been more important. With all the new cloud based technology like Insightly this has never been easier. What time consuming process would you like to automate?



  • Thanks so much for sharing, chad. Great story! We love hearing how customers are using the Insightly API to make their business run quicker and more efficiently. :)

    Comment actions Permalink
  • I love this example of automation - it just goes to show so much more can be done when processes are reviewed against what simple IT developments can be produced rather than trying to fit a processinto a set methodology.

    I am still new to Insightly but haven't yet quite worked out full intregation with my iphone contacts (some of which are personal) my gmail contacts, some lists in Mailchimp, contacts in Insightly an an old CRM Excel Spreadsheet we used to use. The possibilites are vast but small businesses, like ours need assistance from those API developers to really acheive such efficeicncies Chad mentions.  For a non IT person like me it is all a bit baffling!




    Comment actions Permalink
  • Chad - dude!!

    I want want you got - GET and UPDATE APIs - automation - integration.

    But to start with.... I'd love just a simple way to extract the key record types with their record id's and their related links - to then use externally (in Excel)

    Then to be able to analyse, filter, update (Eg. in Excel) and import those back into insighlty for at record updates (on Record ID, for definied fields) via the appropriate update API.

    Say i have 10 contacts..... and their Record ID's
    I want all the Opportunities or Projects linked to those contacts.

    Or all the Contacts linked to an Event or a Project?

    Cant be that hard?

     re. "custom transformer to take the data and put it into an Excel spreadsheet. This transformer is built using Java and Apache POI which is an add on to Java that is used for manipulating data into a custom formats such as XLS, DOC, and PPT."

    I want this..... please! For sale? For trade? Where / how do I get this?

    (And why is this not something Insighlty offers? Would save everyone complaining about the lack of custom reporting / DB access and query features).

    I had a crack at Excel / VBA calls to API... and JSON?! who thought that up? what a pain to work with!!
    Simple Tables with Rows, columns, relational DB links between key fields.... is that too much to ask?

    Looking to the future..... In my case in particular we have a system called GLOBE TRACK... that has some APIs.... Insighlty has some API's

    I need to make them talk to each other. When x happens in system A, y needs to happen in system B.

    I dont have a team of developers... just me, and I don't have mulesoft, java, apache etc. experience. Lots of past programming experience but not it these areas.

    Any help / suggested overall apporach would be MUCH appreciated - Please email me at

    On another note... Given the limitation of Insightly reporting, and what you have described above, I imagine you have custom reporting (externally) nailed.

    May I ask.... How?
    What approach?
    What products do you use?

    I'd like a data wharehouse or some sort of Excel or SQL/DB based data wharehouse (that would also include tables/data from other input systems) that I can then write the reports we need (with whatever reporting add on / data analysis tool over the top... Crystal Reports, Visual SQL query builder of some sort etc) .... and of course be able to schedule data imports/updates and the periodic reports to run.
    Pretty standard stuff for businesses :)


    Simon (Mia's brother ;p )

    Comment actions Permalink
  • Hi There,

    Hip Hip Hooray! I was always told that slightly slow in the head, a slow learner. Not anymore! It’s like you have my back. I can’t tell you how much I’ve learnt here and how easily! Thank you for blessing me with this effortlessly<a href=""> ingestible digestible content</a>.

    We are lucky to have some great contributors in the MuleSoft community. And we’d like to highlight the things they do to make our community so fantastic. From the forums to in-person events and video tutorials, we see great community <a href=""> contributions from MuleSoft </a> Developers willing to share their knowledge with others. Today, we want to recognize the great work of MuleSoft Developers in January 2018 and share it with you.

    It was cool to see your article pop up in my google search for the process yesterday. Great Guide.
    Keep up the good work!

    Best Regards,

    Comment actions Permalink
  • Hello There,

    Allow me to show my gratitude  bloggers. You guys are like unicorns. Never seen but always spreading magic. Your content is yummy. So satisfied.

    I started using <a href="">Mulesoft Training</a> blog for my training practice.

    Harnessing the power of APIs is the key to competing in the new era of software. APIs provide the agility developers and businesses need to iterate and innovate quickly, and they’re everywhere. Businesses all over the world are looking to roll out or even acquire APIs, but if they don’t succeed at winning over developers

    Thanks a lot. This was a perfect step-by-step guide. Don’t think it could have been done better.

    Kind Regards,

    Krishna kumar

    Comment actions Permalink

Please sign in to leave a comment.