Add multiple contacts using a single API call
curl --request POST \
--url https://api.indiepitcher.com/v1/contacts/create_many \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contacts": [
{
"email": "john@acme.com",
"userId": "1234567",
"avatarUrl": "https://example.com/avatar.jpg",
"name": "John Doe",
"languageCode": "en_US",
"updateIfExists": true,
"ignoreListSubscriptionsWhenUpdating": true,
"subscribedToLists": [
"onboarding",
"newsletter"
],
"customProperties": {
"company": "Acme",
"age": 35
}
}
]
}
'import requests
url = "https://api.indiepitcher.com/v1/contacts/create_many"
payload = { "contacts": [
{
"email": "john@acme.com",
"userId": "1234567",
"avatarUrl": "https://example.com/avatar.jpg",
"name": "John Doe",
"languageCode": "en_US",
"updateIfExists": True,
"ignoreListSubscriptionsWhenUpdating": True,
"subscribedToLists": ["onboarding", "newsletter"],
"customProperties": {
"company": "Acme",
"age": 35
}
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
contacts: [
{
email: 'john@acme.com',
userId: '1234567',
avatarUrl: 'https://example.com/avatar.jpg',
name: 'John Doe',
languageCode: 'en_US',
updateIfExists: true,
ignoreListSubscriptionsWhenUpdating: true,
subscribedToLists: ['onboarding', 'newsletter'],
customProperties: {company: 'Acme', age: 35}
}
]
})
};
fetch('https://api.indiepitcher.com/v1/contacts/create_many', 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/create_many",
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([
'contacts' => [
[
'email' => 'john@acme.com',
'userId' => '1234567',
'avatarUrl' => 'https://example.com/avatar.jpg',
'name' => 'John Doe',
'languageCode' => 'en_US',
'updateIfExists' => true,
'ignoreListSubscriptionsWhenUpdating' => true,
'subscribedToLists' => [
'onboarding',
'newsletter'
],
'customProperties' => [
'company' => 'Acme',
'age' => 35
]
]
]
]),
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/create_many"
payload := strings.NewReader("{\n \"contacts\": [\n {\n \"email\": \"john@acme.com\",\n \"userId\": \"1234567\",\n \"avatarUrl\": \"https://example.com/avatar.jpg\",\n \"name\": \"John Doe\",\n \"languageCode\": \"en_US\",\n \"updateIfExists\": true,\n \"ignoreListSubscriptionsWhenUpdating\": true,\n \"subscribedToLists\": [\n \"onboarding\",\n \"newsletter\"\n ],\n \"customProperties\": {\n \"company\": \"Acme\",\n \"age\": 35\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.indiepitcher.com/v1/contacts/create_many")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contacts\": [\n {\n \"email\": \"john@acme.com\",\n \"userId\": \"1234567\",\n \"avatarUrl\": \"https://example.com/avatar.jpg\",\n \"name\": \"John Doe\",\n \"languageCode\": \"en_US\",\n \"updateIfExists\": true,\n \"ignoreListSubscriptionsWhenUpdating\": true,\n \"subscribedToLists\": [\n \"onboarding\",\n \"newsletter\"\n ],\n \"customProperties\": {\n \"company\": \"Acme\",\n \"age\": 35\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.indiepitcher.com/v1/contacts/create_many")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contacts\": [\n {\n \"email\": \"john@acme.com\",\n \"userId\": \"1234567\",\n \"avatarUrl\": \"https://example.com/avatar.jpg\",\n \"name\": \"John Doe\",\n \"languageCode\": \"en_US\",\n \"updateIfExists\": true,\n \"ignoreListSubscriptionsWhenUpdating\": true,\n \"subscribedToLists\": [\n \"onboarding\",\n \"newsletter\"\n ],\n \"customProperties\": {\n \"company\": \"Acme\",\n \"age\": 35\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true
}Contacts
Add multiple contacts using a single API call
Add miultiple contacts (up to 100) using a single API call to avoid being rate limited. Payloads with updateIfExists is set to true will be updated if a contact with given email already exists.
POST
/
contacts
/
create_many
Add multiple contacts using a single API call
curl --request POST \
--url https://api.indiepitcher.com/v1/contacts/create_many \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contacts": [
{
"email": "john@acme.com",
"userId": "1234567",
"avatarUrl": "https://example.com/avatar.jpg",
"name": "John Doe",
"languageCode": "en_US",
"updateIfExists": true,
"ignoreListSubscriptionsWhenUpdating": true,
"subscribedToLists": [
"onboarding",
"newsletter"
],
"customProperties": {
"company": "Acme",
"age": 35
}
}
]
}
'import requests
url = "https://api.indiepitcher.com/v1/contacts/create_many"
payload = { "contacts": [
{
"email": "john@acme.com",
"userId": "1234567",
"avatarUrl": "https://example.com/avatar.jpg",
"name": "John Doe",
"languageCode": "en_US",
"updateIfExists": True,
"ignoreListSubscriptionsWhenUpdating": True,
"subscribedToLists": ["onboarding", "newsletter"],
"customProperties": {
"company": "Acme",
"age": 35
}
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
contacts: [
{
email: 'john@acme.com',
userId: '1234567',
avatarUrl: 'https://example.com/avatar.jpg',
name: 'John Doe',
languageCode: 'en_US',
updateIfExists: true,
ignoreListSubscriptionsWhenUpdating: true,
subscribedToLists: ['onboarding', 'newsletter'],
customProperties: {company: 'Acme', age: 35}
}
]
})
};
fetch('https://api.indiepitcher.com/v1/contacts/create_many', 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/create_many",
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([
'contacts' => [
[
'email' => 'john@acme.com',
'userId' => '1234567',
'avatarUrl' => 'https://example.com/avatar.jpg',
'name' => 'John Doe',
'languageCode' => 'en_US',
'updateIfExists' => true,
'ignoreListSubscriptionsWhenUpdating' => true,
'subscribedToLists' => [
'onboarding',
'newsletter'
],
'customProperties' => [
'company' => 'Acme',
'age' => 35
]
]
]
]),
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/create_many"
payload := strings.NewReader("{\n \"contacts\": [\n {\n \"email\": \"john@acme.com\",\n \"userId\": \"1234567\",\n \"avatarUrl\": \"https://example.com/avatar.jpg\",\n \"name\": \"John Doe\",\n \"languageCode\": \"en_US\",\n \"updateIfExists\": true,\n \"ignoreListSubscriptionsWhenUpdating\": true,\n \"subscribedToLists\": [\n \"onboarding\",\n \"newsletter\"\n ],\n \"customProperties\": {\n \"company\": \"Acme\",\n \"age\": 35\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.indiepitcher.com/v1/contacts/create_many")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contacts\": [\n {\n \"email\": \"john@acme.com\",\n \"userId\": \"1234567\",\n \"avatarUrl\": \"https://example.com/avatar.jpg\",\n \"name\": \"John Doe\",\n \"languageCode\": \"en_US\",\n \"updateIfExists\": true,\n \"ignoreListSubscriptionsWhenUpdating\": true,\n \"subscribedToLists\": [\n \"onboarding\",\n \"newsletter\"\n ],\n \"customProperties\": {\n \"company\": \"Acme\",\n \"age\": 35\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.indiepitcher.com/v1/contacts/create_many")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contacts\": [\n {\n \"email\": \"john@acme.com\",\n \"userId\": \"1234567\",\n \"avatarUrl\": \"https://example.com/avatar.jpg\",\n \"name\": \"John Doe\",\n \"languageCode\": \"en_US\",\n \"updateIfExists\": true,\n \"ignoreListSubscriptionsWhenUpdating\": true,\n \"subscribedToLists\": [\n \"onboarding\",\n \"newsletter\"\n ],\n \"customProperties\": {\n \"company\": \"Acme\",\n \"age\": 35\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
The array of contacts to add.
Show child attributes
Show child attributes
Response
200 - application/json
A created or updated contact
Always true
⌘I
