Update a subscriber's Kit Fields
curl --request PATCH \
--url https://api.kit.com/v4/subscribers/{subscriber_id}/kit_fields \
--header 'Content-Type: application/json' \
--header 'X-Kit-Api-Key: <api-key>' \
--data '
{
"kit_fields": {
"gender": "female",
"age": 34
}
}
'require 'uri'
require 'net/http'
url = URI("https://api.kit.com/v4/subscribers/{subscriber_id}/kit_fields")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Kit-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"kit_fields\": {\n \"gender\": \"female\",\n \"age\": 34\n }\n}"
response = http.request(request)
puts response.read_bodyconst options = {
method: 'PATCH',
headers: {'X-Kit-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({kit_fields: {gender: 'female', age: 34}})
};
fetch('https://api.kit.com/v4/subscribers/{subscriber_id}/kit_fields', 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/{subscriber_id}/kit_fields"
payload := strings.NewReader("{\n \"kit_fields\": {\n \"gender\": \"female\",\n \"age\": 34\n }\n}")
req, _ := http.NewRequest("PATCH", 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/{subscriber_id}/kit_fields",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'kit_fields' => [
'gender' => 'female',
'age' => 34
]
]),
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/{subscriber_id}/kit_fields"
payload = { "kit_fields": {
"gender": "female",
"age": 34
} }
headers = {
"X-Kit-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"subscriber": {
"id": 130,
"kit_fields": {
"age": 34,
"gender": "female"
}
}
}{
"errors": [
"The access token is invalid"
]
}{
"errors": [
"household_income must be one of: Under $10,000, $10,000 - $19,999, $20,000 - $29,999, $30,000 - $39,999, $40,000 - $49,999, $50,000 - $59,999, $60,000 - $74,999, $75,000 - $99,999, $100,000 - $149,999, $150,000 - $174,999, $175,000 - $199,999, $200,000 - $249,999, $250,000 - $299,999, $300,000 - $399,999, $400,000 - $499,999, $500,000 - $699,999, $700,000 - $999,999, $1,000,000 +"
]
}Kit Fields
Update a subscriber's Kit Fields
PATCH
/
v4
/
subscribers
/
{subscriber_id}
/
kit_fields
Update a subscriber's Kit Fields
curl --request PATCH \
--url https://api.kit.com/v4/subscribers/{subscriber_id}/kit_fields \
--header 'Content-Type: application/json' \
--header 'X-Kit-Api-Key: <api-key>' \
--data '
{
"kit_fields": {
"gender": "female",
"age": 34
}
}
'require 'uri'
require 'net/http'
url = URI("https://api.kit.com/v4/subscribers/{subscriber_id}/kit_fields")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Kit-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"kit_fields\": {\n \"gender\": \"female\",\n \"age\": 34\n }\n}"
response = http.request(request)
puts response.read_bodyconst options = {
method: 'PATCH',
headers: {'X-Kit-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({kit_fields: {gender: 'female', age: 34}})
};
fetch('https://api.kit.com/v4/subscribers/{subscriber_id}/kit_fields', 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/{subscriber_id}/kit_fields"
payload := strings.NewReader("{\n \"kit_fields\": {\n \"gender\": \"female\",\n \"age\": 34\n }\n}")
req, _ := http.NewRequest("PATCH", 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/{subscriber_id}/kit_fields",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'kit_fields' => [
'gender' => 'female',
'age' => 34
]
]),
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/{subscriber_id}/kit_fields"
payload = { "kit_fields": {
"gender": "female",
"age": 34
} }
headers = {
"X-Kit-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"subscriber": {
"id": 130,
"kit_fields": {
"age": 34,
"gender": "female"
}
}
}{
"errors": [
"The access token is invalid"
]
}{
"errors": [
"household_income must be one of: Under $10,000, $10,000 - $19,999, $20,000 - $29,999, $30,000 - $39,999, $40,000 - $49,999, $50,000 - $59,999, $60,000 - $74,999, $75,000 - $99,999, $100,000 - $149,999, $150,000 - $174,999, $175,000 - $199,999, $200,000 - $249,999, $250,000 - $299,999, $300,000 - $399,999, $400,000 - $499,999, $500,000 - $699,999, $700,000 - $999,999, $1,000,000 +"
]
}Authorizations
API KeyOAuth2
Body
application/json
Was this page helpful?