🔩

How to update ConvertKit subscriber with Zapier (Post)

There is no action in Zapier to update a Convertkit subscriber.

Until we have an action available in zapier, this little guide will help you to make some changes directly on the Convertkit API using Zapier WebHooks.

Updating Subscriber

First, we need to know what is required by the API so we can go to the API reference on this page.

image

Required fields

The first parameter required is the api_secret this is something you can get from your settings page in convertkit.

There is another parameter needed in the URL “/v3/subscribers/#{subscriber_id}” you have to change “#{subscriber_id}” for the real id of the subscriber, we will see in zapier how to do this.

Optional fields

The optional fields are the one you can update, so let´s see how to do this in zapier.

Updating Subscriber First Name

In this example, for every new subscriber, we are going to capitalize the first word of the name and update it in convertkit.

Step 1: Trigger New Subscriber

In the first step, we need to configure the trigger “New Subscriber” to get the subscriber id.

You can also use a search action to get the subscriber id.
image

Once we have the new subscriber, test the step to get an example from your account.

Step 2: Capitalize First Word

Before we update the subscriber with the API, we will use the Zapier Formatter action to capitalize the first word on the first name.

image

Of course, this is only an example, and you can use any transformer you need for your process automation.

Step 3: Webhook Action

For step 3, we will update the subscriber in convertkit, to do that you have to select “Webhooks by Zapier action.”

image

Choose the “PUT” option.

image

On the first configuration of the step, we need the endpoint/URL, for that you will use “https://api.convertkit.com/v3/subscribers/” and you will get the id from the previous trigger or search action to insert it at the end.

image

You will use “Payload type: json” and in data, you will put two parameters.

The first one is the api_secret, and the second one is the first_name as we will need to update it with the result of Step 2.

image

You will only add a header with “Content-Type: application/json” as shown in the next image and leave the other default data as it is.

image

When you click continue and test the API call, you will now see that the subscriber was updated.

image

Updating Subscriber Custom Field

For custom fields, you can see in the API documentation that you will need to send an object of key/value pairs with the custom fields.

For this example, we will get the length of the name and will update a custom field in the subscriber.

Step 2: Get Length of First Name

Using a Formatter Action, we will get the output of the first name from the first step, and use Length option in transform field, to get the length in the output of this step.

image

Step 3: Update Custom Field

In the previous example (updating first name), what Zapier is sending to ConvertKit API is the next JSON object:

{
"api_secret"
: "<your_secret_api_key>",
"first_name"
: "Sergio",
}

for this example we will need to send something like this:

{ 
"api_secret"
: "<your_secret_api_key>", 
"fields"
:{
 
"first_name_length"
:"6"
 }
}

As you can see you need to send an array with the custom fields you want to update so, to do this you can use the next configuration:

The URL, payload type and headers are the same from the previous example, but to update the first_name_length you need to add a prefix with the word “fields” and a double underscore: “fields__first_name_length”

image

When zapier finds that a field has a __ double underscore transforms it from “fields__first_name_length” to :

fields:{
 "first_name_length":"<value>"
}

But to make this work, you need to be sure that you have turned on the “Unflatten” option.

image

Then you can test it, and you can see the response with the field updated in ConvertKit.

image

You can confirm it in your ConvertKit account.