Update an existing contact
curl --request PATCH \
--url https://api.indiepitcher.com/v1/contacts/update \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "john@acme.com",
"userId": "1234567",
"avatarUrl": "https://example.com/avatar.jpg",
"name": "John Doe",
"languageCode": "en_US",
"addedListSubscripitons": [
"<string>"
],
"removedListSubscripitons": [
"<string>"
],
"customProperties": {}
}
'import requests
url = "https://api.indiepitcher.com/v1/contacts/update"
payload = {
"email": "john@acme.com",
"userId": "1234567",
"avatarUrl": "https://example.com/avatar.jpg",
"name": "John Doe",
"languageCode": "en_US",
"addedListSubscripitons": ["<string>"],
"removedListSubscripitons": ["<string>"],
"customProperties": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'john@acme.com',
userId: '1234567',
avatarUrl: 'https://example.com/avatar.jpg',
name: 'John Doe',
languageCode: 'en_US',
addedListSubscripitons: ['<string>'],
removedListSubscripitons: ['<string>'],
customProperties: {}
})
};
fetch('https://api.indiepitcher.com/v1/contacts/update', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.indiepitcher.com/v1/contacts/update",
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([
'email' => 'john@acme.com',
'userId' => '1234567',
'avatarUrl' => 'https://example.com/avatar.jpg',
'name' => 'John Doe',
'languageCode' => 'en_US',
'addedListSubscripitons' => [
'<string>'
],
'removedListSubscripitons' => [
'<string>'
],
'customProperties' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.indiepitcher.com/v1/contacts/update"
payload := strings.NewReader("{\n \"email\": \"john@acme.com\",\n \"userId\": \"1234567\",\n \"avatarUrl\": \"https://example.com/avatar.jpg\",\n \"name\": \"John Doe\",\n \"languageCode\": \"en_US\",\n \"addedListSubscripitons\": [\n \"<string>\"\n ],\n \"removedListSubscripitons\": [\n \"<string>\"\n ],\n \"customProperties\": {}\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}HttpResponse<String> response = Unirest.patch("https://api.indiepitcher.com/v1/contacts/update")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"john@acme.com\",\n \"userId\": \"1234567\",\n \"avatarUrl\": \"https://example.com/avatar.jpg\",\n \"name\": \"John Doe\",\n \"languageCode\": \"en_US\",\n \"addedListSubscripitons\": [\n \"<string>\"\n ],\n \"removedListSubscripitons\": [\n \"<string>\"\n ],\n \"customProperties\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.indiepitcher.com/v1/contacts/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"john@acme.com\",\n \"userId\": \"1234567\",\n \"avatarUrl\": \"https://example.com/avatar.jpg\",\n \"name\": \"John Doe\",\n \"languageCode\": \"en_US\",\n \"addedListSubscripitons\": [\n \"<string>\"\n ],\n \"removedListSubscripitons\": [\n \"<string>\"\n ],\n \"customProperties\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"email": "john@acme.com",
"userId": 123456,
"name": "John Doe",
"avatarUrl": "https://example.com/profile_pictures/123456",
"languageCode": "en-US",
"hardBouncedAt": "2024-04-23T18:25:43.511Z",
"subscribedToLists": [
"onboarding",
"newsletter"
],
"customProperties": {
"company": "Acme",
"age": 35
}
}
}Contacts
Update an existing contact
Updates a contact with given email address. This call will fail if a contact with provided email does not exist, use addContact instead in such case.
PATCH
/
contacts
/
update
Update an existing contact
curl --request PATCH \
--url https://api.indiepitcher.com/v1/contacts/update \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "john@acme.com",
"userId": "1234567",
"avatarUrl": "https://example.com/avatar.jpg",
"name": "John Doe",
"languageCode": "en_US",
"addedListSubscripitons": [
"<string>"
],
"removedListSubscripitons": [
"<string>"
],
"customProperties": {}
}
'import requests
url = "https://api.indiepitcher.com/v1/contacts/update"
payload = {
"email": "john@acme.com",
"userId": "1234567",
"avatarUrl": "https://example.com/avatar.jpg",
"name": "John Doe",
"languageCode": "en_US",
"addedListSubscripitons": ["<string>"],
"removedListSubscripitons": ["<string>"],
"customProperties": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'john@acme.com',
userId: '1234567',
avatarUrl: 'https://example.com/avatar.jpg',
name: 'John Doe',
languageCode: 'en_US',
addedListSubscripitons: ['<string>'],
removedListSubscripitons: ['<string>'],
customProperties: {}
})
};
fetch('https://api.indiepitcher.com/v1/contacts/update', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.indiepitcher.com/v1/contacts/update",
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([
'email' => 'john@acme.com',
'userId' => '1234567',
'avatarUrl' => 'https://example.com/avatar.jpg',
'name' => 'John Doe',
'languageCode' => 'en_US',
'addedListSubscripitons' => [
'<string>'
],
'removedListSubscripitons' => [
'<string>'
],
'customProperties' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.indiepitcher.com/v1/contacts/update"
payload := strings.NewReader("{\n \"email\": \"john@acme.com\",\n \"userId\": \"1234567\",\n \"avatarUrl\": \"https://example.com/avatar.jpg\",\n \"name\": \"John Doe\",\n \"languageCode\": \"en_US\",\n \"addedListSubscripitons\": [\n \"<string>\"\n ],\n \"removedListSubscripitons\": [\n \"<string>\"\n ],\n \"customProperties\": {}\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}HttpResponse<String> response = Unirest.patch("https://api.indiepitcher.com/v1/contacts/update")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"john@acme.com\",\n \"userId\": \"1234567\",\n \"avatarUrl\": \"https://example.com/avatar.jpg\",\n \"name\": \"John Doe\",\n \"languageCode\": \"en_US\",\n \"addedListSubscripitons\": [\n \"<string>\"\n ],\n \"removedListSubscripitons\": [\n \"<string>\"\n ],\n \"customProperties\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.indiepitcher.com/v1/contacts/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"john@acme.com\",\n \"userId\": \"1234567\",\n \"avatarUrl\": \"https://example.com/avatar.jpg\",\n \"name\": \"John Doe\",\n \"languageCode\": \"en_US\",\n \"addedListSubscripitons\": [\n \"<string>\"\n ],\n \"removedListSubscripitons\": [\n \"<string>\"\n ],\n \"customProperties\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"email": "john@acme.com",
"userId": 123456,
"name": "John Doe",
"avatarUrl": "https://example.com/profile_pictures/123456",
"languageCode": "en-US",
"hardBouncedAt": "2024-04-23T18:25:43.511Z",
"subscribedToLists": [
"onboarding",
"newsletter"
],
"customProperties": {
"company": "Acme",
"age": 35
}
}
}Authorizations
Body
application/json
