100 Free Automations

Validate and replace Smartlead API key overnight

by Noel Maniraguha on December, 2024

Validate and replace Smartlead API key overnight

Do you ever forget to update your Smartlead API key in different apps? Fix it with this automation

This automation has 3 components. 
1. Updating your Smartlead API key regularly (to prevent hackers)
2. Syncing your Smartlead API key with your Clay account
3. Storing your Smartlead API key in (make), ensuring that key changes affect all automation

Yes, this automation is great... But if you don't use it, I still highly recommend following the Data Store step below. This will ensure that you never run into authorization errors across all scenarios.

Afonto Profile Picture
Validate and replace Smartlead API key overnight
Download Blueprint

Insert the blueprint in make (new scenario)


Manual Changes

Add API key to a datastore

We use a data store in Make as it's easy to retrieve and update. 

Follow the Image below on how to create a data store:

Once completed, add your Smartlead API key in the first section

key = "Smartlead"

API Key = your Smartlead API key

BONUS: you can retrieve your API key across all Smartlead automations with this same process. Use a data store module to "get a record" then input "API key" in any Smartlead module

Add API key to a datastore

Now that you've added your API key, you can easily retrieve it from the Datastore within the automation.

Screenshot 2024-12-24 225435

Undocumented Clay/Smartlead APIs

Both Clay and Smartlead don't have these APIs on their docs, so we'll need to use a workaround. Login to both applications by using your username and password.

Screenshot 2024-12-24 225631

Clay Undocumented API

To leverage undocumented APIs you will need to log in to Clay which will give you your Clay token. This token will be used in the modules following the Clay log-in, for example:
 

 
In order to find the {INSERT_COOKIE_DETAILS} you need to

Click "inspect element" ➝ go to the "Network" tab ➝ click the "Fetch/XHR" button

Look for the request headers section



When you open this tab, there will be a section called "Cookie". This Cookie has 2 parts, the first part will remain static and it is what we will paste in the automation for ({INSERT_COOKIE_DETAILS}

The 2nd section is dynamic, and that's what we get from logging in (the token)... If you're unsure where the split occurs, simply run your Make module (Get Clay Token) and look at the output as it will contain a token; now you can take the first half from the header cookies, excluding your 


Set a schedule

The schedule you set depends on your needs. If many people have access to your keys, you could go "daily" but "weekly" or "on-demand" works just fine for most cases

Set Schedule