Skip to main content
POST
/
v4
/
subscribers
Create a subscriber
curl --request POST \
  --url https://api.kit.com/v4/subscribers \
  --header 'Content-Type: application/json' \
  --header 'X-Kit-Api-Key: <api-key>' \
  --data '
{
  "first_name": "Alice",
  "email_address": "alice@convertkit.dev",
  "state": "active",
  "fields": {
    "last_name": "Lamarr",
    "birthday": "Feb 17",
    "source": "landing page",
    "role": "Software developer",
    "company": "Convertkit",
    "postal_code": "83702",
    "website": "convertkit.com",
    "social_media": "https://www.linkedin.com/company/convertkit",
    "how_did_you_hear_about_us": "Social media",
    "interests": "Monetization",
    "coupon": "",
    "phone_number": "555-555-5555",
    "enrolled_in_coaching": "true",
    "lead_score": "87"
  }
}
'
require 'uri'
require 'net/http'

url = URI("https://api.kit.com/v4/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 \"first_name\": \"Alice\",\n \"email_address\": \"alice@convertkit.dev\",\n \"state\": \"active\",\n \"fields\": {\n \"last_name\": \"Lamarr\",\n \"birthday\": \"Feb 17\",\n \"source\": \"landing page\",\n \"role\": \"Software developer\",\n \"company\": \"Convertkit\",\n \"postal_code\": \"83702\",\n \"website\": \"convertkit.com\",\n \"social_media\": \"https://www.linkedin.com/company/convertkit\",\n \"how_did_you_hear_about_us\": \"Social media\",\n \"interests\": \"Monetization\",\n \"coupon\": \"\",\n \"phone_number\": \"555-555-5555\",\n \"enrolled_in_coaching\": \"true\",\n \"lead_score\": \"87\"\n }\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({
first_name: 'Alice',
email_address: 'alice@convertkit.dev',
state: 'active',
fields: {
last_name: 'Lamarr',
birthday: 'Feb 17',
source: 'landing page',
role: 'Software developer',
company: 'Convertkit',
postal_code: '83702',
website: 'convertkit.com',
social_media: 'https://www.linkedin.com/company/convertkit',
how_did_you_hear_about_us: 'Social media',
interests: 'Monetization',
coupon: '',
phone_number: '555-555-5555',
enrolled_in_coaching: 'true',
lead_score: '87'
}
})
};

fetch('https://api.kit.com/v4/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/subscribers"

payload := strings.NewReader("{\n \"first_name\": \"Alice\",\n \"email_address\": \"alice@convertkit.dev\",\n \"state\": \"active\",\n \"fields\": {\n \"last_name\": \"Lamarr\",\n \"birthday\": \"Feb 17\",\n \"source\": \"landing page\",\n \"role\": \"Software developer\",\n \"company\": \"Convertkit\",\n \"postal_code\": \"83702\",\n \"website\": \"convertkit.com\",\n \"social_media\": \"https://www.linkedin.com/company/convertkit\",\n \"how_did_you_hear_about_us\": \"Social media\",\n \"interests\": \"Monetization\",\n \"coupon\": \"\",\n \"phone_number\": \"555-555-5555\",\n \"enrolled_in_coaching\": \"true\",\n \"lead_score\": \"87\"\n }\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/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([
'first_name' => 'Alice',
'email_address' => 'alice@convertkit.dev',
'state' => 'active',
'fields' => [
'last_name' => 'Lamarr',
'birthday' => 'Feb 17',
'source' => 'landing page',
'role' => 'Software developer',
'company' => 'Convertkit',
'postal_code' => '83702',
'website' => 'convertkit.com',
'social_media' => 'https://www.linkedin.com/company/convertkit',
'how_did_you_hear_about_us' => 'Social media',
'interests' => 'Monetization',
'coupon' => '',
'phone_number' => '555-555-5555',
'enrolled_in_coaching' => 'true',
'lead_score' => '87'
]
]),
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/subscribers"

payload = {
"first_name": "Alice",
"email_address": "alice@convertkit.dev",
"state": "active",
"fields": {
"last_name": "Lamarr",
"birthday": "Feb 17",
"source": "landing page",
"role": "Software developer",
"company": "Convertkit",
"postal_code": "83702",
"website": "convertkit.com",
"social_media": "https://www.linkedin.com/company/convertkit",
"how_did_you_hear_about_us": "Social media",
"interests": "Monetization",
"coupon": "",
"phone_number": "555-555-5555",
"enrolled_in_coaching": "true",
"lead_score": "87"
}
}
headers = {
"X-Kit-Api-Key": "<api-key>",
"Content-Type": "application/json"
}

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

print(response.text)
{
  "subscriber": {
    "id": 353,
    "first_name": "Alice",
    "email_address": "alice@convertkit.dev",
    "state": "inactive",
    "created_at": "2023-02-17T11:43:55Z",
    "fields": {}
  }
}
{
"subscriber": {
"id": 349,
"first_name": "Alice",
"email_address": "alice@convertkit.dev",
"state": "active",
"created_at": "2023-02-17T11:43:55Z",
"fields": {
"birthday": "Feb 17",
"last_name": "Lamarr",
"source": "landing page"
}
}
}
{
"subscriber": {
"id": 351,
"first_name": "Alice",
"email_address": "alice@convertkit.dev",
"state": "active",
"created_at": "2023-02-17T11:43:55Z",
"fields": {
"company": null,
"coupon": null,
"enrolled_in_coaching": null,
"how_did_you_hear_about_us": null,
"interests": null,
"lead_score": null,
"phone_number": null,
"postal_code": null,
"role": null,
"social_media": null,
"website": null
}
}
}
{
"errors": [
"The access token is invalid"
]
}
{
"errors": [
"Email address is invalid"
]
}

Authorizations

X-Kit-Api-Key
string
header
required

Authenticate API requests via an API Key

Body

application/json
email_address
string
required
first_name
string | null
state
enum<string> | null

Create subscriber in this state (active, bounced, cancelled, complained or inactive). Defaults to active.

Available options:
active,
cancelled,
bounced,
complained,
inactive
fields
object

Custom field values keyed by the custom field's key (e.g. last_name, not Last Name). Unknown keys are ignored and reported in the response warnings array.

Response

Returns a 200 and updates the subscriber first name when a subscriber with provided email already exists

subscriber
object
required