applyTags

Adds a subscrber to ConvertKit and applies one or more tags. Under the hood, this action calls the tag a subscriber API endpoint.

Configuration

This function type accepts the following parameters:

KeyTypeDefaultDescription
apiSecretstring@convertkit-api-secretYour ConvertKit API secret

Example

{
"functions": {
"addToConvertKit": {
"app": "convertkit",
"type": "applyTags"
}
}
}

Arguments

This function type accepts the following client-side arguments when called:

KeyTypeDefaultDescription
email *stringThe subscriber's email address
tags *Array<string>One or more tag names to apply to the subscriber
firstNamestringThe subscriber's first name
fieldsobject{}Custom fields to set on the subscriber

The tags you specify must already exist in your ConvertKit account. To add a tag, click + Create a Tag in the right-hand sidebar of your ConvertKit dashboard.

Example

import { createClient, addToConvertKit } from '@statickit/functions';
let client = createClient({ site: '{your-site-id}' });
let { status } = await addToConvertKit(client, {
first_name: "Jane"
tags: ["Customer"]
});

Response

Returns a status and no additional properties.