Skip to main content
POST
/
v4
/
tags
/
{tag_id}
/
subscribers
Tag a subscriber by email address
curl --request POST \
  --url https://api.kit.com/v4/tags/{tag_id}/subscribers \
  --header 'Content-Type: application/json' \
  --header 'X-Kit-Api-Key: <api-key>' \
  --data '
{
  "email_address": "alice@convertkit.dev"
}
'
require 'uri'
require 'net/http'

url = URI("https://api.kit.com/v4/tags/{tag_id}/subscribers")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-Kit-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email_address\": \"alice@convertkit.dev\"\n}"

response = http.request(request)
puts response.read_body
const options = {
method: 'POST',
headers: {'X-Kit-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({email_address: 'alice@convertkit.dev'})
};

fetch('https://api.kit.com/v4/tags/{tag_id}/subscribers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.kit.com/v4/tags/{tag_id}/subscribers"

payload := strings.NewReader("{\n \"email_address\": \"alice@convertkit.dev\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("X-Kit-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.kit.com/v4/tags/{tag_id}/subscribers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email_address' => 'alice@convertkit.dev'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Kit-Api-Key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import requests

url = "https://api.kit.com/v4/tags/{tag_id}/subscribers"

payload = { "email_address": "alice@convertkit.dev" }
headers = {
"X-Kit-Api-Key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
{
  "subscriber": {
    "id": 1265,
    "first_name": "Alice",
    "email_address": "alice@convertkit.dev",
    "state": "active",
    "created_at": "2023-02-17T11:43:55Z",
    "tagged_at": "2023-02-17T11:43:55Z",
    "fields": {}
  }
}
{
"subscriber": {
"id": 1266,
"first_name": "Alice",
"email_address": "alice@convertkit.dev",
"state": "active",
"created_at": "2023-02-17T11:43:55Z",
"tagged_at": "2023-02-17T11:43:55Z",
"fields": {}
}
}
{
"errors": [
"The access token is invalid"
]
}
{
"errors": [
"Not Found"
]
}
{
"errors": [
"Either subscriber id or email address is required to tag subscriber"
]
}

Authorizations

X-Kit-Api-Key
string
header
required

Authenticate API requests via an API Key

Path Parameters

tag_id
integer
required

Body

application/json
email_address
string
required

Response

Returns a 200 when the subscriber already has the tag

subscriber
object
required