Add recipients to a project
curl --request POST \
--url https://www.postable.com/api/v1/projects/add-recipients/{projectUuid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"recipients": [
{
"first_name": "John",
"last_name": "Doe",
"address": "123 Main St",
"city": "Anytown",
"state": "CA",
"zip": "12345",
"country": "United States",
"email": "john@example.com",
"internal_id": "CUST-001"
},
{
"first_name": "Jane",
"last_name": "Smith",
"address": "456 Oak Ave",
"apt": "Suite 100",
"city": "Othertown",
"state": "NY",
"zip": "67890",
"country": "United States",
"override_message": "Custom message for Jane"
}
]
}
'import requests
url = "https://www.postable.com/api/v1/projects/add-recipients/{projectUuid}"
payload = { "recipients": [
{
"first_name": "John",
"last_name": "Doe",
"address": "123 Main St",
"city": "Anytown",
"state": "CA",
"zip": "12345",
"country": "United States",
"email": "john@example.com",
"internal_id": "CUST-001"
},
{
"first_name": "Jane",
"last_name": "Smith",
"address": "456 Oak Ave",
"apt": "Suite 100",
"city": "Othertown",
"state": "NY",
"zip": "67890",
"country": "United States",
"override_message": "Custom message for Jane"
}
] }
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({
recipients: [
{
first_name: 'John',
last_name: 'Doe',
address: '123 Main St',
city: 'Anytown',
state: 'CA',
zip: '12345',
country: 'United States',
email: 'john@example.com',
internal_id: 'CUST-001'
},
{
first_name: 'Jane',
last_name: 'Smith',
address: '456 Oak Ave',
apt: 'Suite 100',
city: 'Othertown',
state: 'NY',
zip: '67890',
country: 'United States',
override_message: 'Custom message for Jane'
}
]
})
};
fetch('https://www.postable.com/api/v1/projects/add-recipients/{projectUuid}', 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://www.postable.com/api/v1/projects/add-recipients/{projectUuid}",
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([
'recipients' => [
[
'first_name' => 'John',
'last_name' => 'Doe',
'address' => '123 Main St',
'city' => 'Anytown',
'state' => 'CA',
'zip' => '12345',
'country' => 'United States',
'email' => 'john@example.com',
'internal_id' => 'CUST-001'
],
[
'first_name' => 'Jane',
'last_name' => 'Smith',
'address' => '456 Oak Ave',
'apt' => 'Suite 100',
'city' => 'Othertown',
'state' => 'NY',
'zip' => '67890',
'country' => 'United States',
'override_message' => 'Custom message for Jane'
]
]
]),
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://www.postable.com/api/v1/projects/add-recipients/{projectUuid}"
payload := strings.NewReader("{\n \"recipients\": [\n {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"address\": \"123 Main St\",\n \"city\": \"Anytown\",\n \"state\": \"CA\",\n \"zip\": \"12345\",\n \"country\": \"United States\",\n \"email\": \"john@example.com\",\n \"internal_id\": \"CUST-001\"\n },\n {\n \"first_name\": \"Jane\",\n \"last_name\": \"Smith\",\n \"address\": \"456 Oak Ave\",\n \"apt\": \"Suite 100\",\n \"city\": \"Othertown\",\n \"state\": \"NY\",\n \"zip\": \"67890\",\n \"country\": \"United States\",\n \"override_message\": \"Custom message for Jane\"\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://www.postable.com/api/v1/projects/add-recipients/{projectUuid}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"recipients\": [\n {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"address\": \"123 Main St\",\n \"city\": \"Anytown\",\n \"state\": \"CA\",\n \"zip\": \"12345\",\n \"country\": \"United States\",\n \"email\": \"john@example.com\",\n \"internal_id\": \"CUST-001\"\n },\n {\n \"first_name\": \"Jane\",\n \"last_name\": \"Smith\",\n \"address\": \"456 Oak Ave\",\n \"apt\": \"Suite 100\",\n \"city\": \"Othertown\",\n \"state\": \"NY\",\n \"zip\": \"67890\",\n \"country\": \"United States\",\n \"override_message\": \"Custom message for Jane\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.postable.com/api/v1/projects/add-recipients/{projectUuid}")
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 \"recipients\": [\n {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"address\": \"123 Main St\",\n \"city\": \"Anytown\",\n \"state\": \"CA\",\n \"zip\": \"12345\",\n \"country\": \"United States\",\n \"email\": \"john@example.com\",\n \"internal_id\": \"CUST-001\"\n },\n {\n \"first_name\": \"Jane\",\n \"last_name\": \"Smith\",\n \"address\": \"456 Oak Ave\",\n \"apt\": \"Suite 100\",\n \"city\": \"Othertown\",\n \"state\": \"NY\",\n \"zip\": \"67890\",\n \"country\": \"United States\",\n \"override_message\": \"Custom message for Jane\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"message": "<string>",
"contacts_updated": 123,
"contacts_created": 123
}
}{
"message": "You do not have permission to update this project"
}{
"message": "Project not found"
}API Reference
Add recipients to a project
Add one or more recipients to an existing project. Recipients will be added as contacts and associated with the project. If a recipient with the same internal_id already exists, they will be updated instead.
POST
/
projects
/
add-recipients
/
{projectUuid}
Add recipients to a project
curl --request POST \
--url https://www.postable.com/api/v1/projects/add-recipients/{projectUuid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"recipients": [
{
"first_name": "John",
"last_name": "Doe",
"address": "123 Main St",
"city": "Anytown",
"state": "CA",
"zip": "12345",
"country": "United States",
"email": "john@example.com",
"internal_id": "CUST-001"
},
{
"first_name": "Jane",
"last_name": "Smith",
"address": "456 Oak Ave",
"apt": "Suite 100",
"city": "Othertown",
"state": "NY",
"zip": "67890",
"country": "United States",
"override_message": "Custom message for Jane"
}
]
}
'import requests
url = "https://www.postable.com/api/v1/projects/add-recipients/{projectUuid}"
payload = { "recipients": [
{
"first_name": "John",
"last_name": "Doe",
"address": "123 Main St",
"city": "Anytown",
"state": "CA",
"zip": "12345",
"country": "United States",
"email": "john@example.com",
"internal_id": "CUST-001"
},
{
"first_name": "Jane",
"last_name": "Smith",
"address": "456 Oak Ave",
"apt": "Suite 100",
"city": "Othertown",
"state": "NY",
"zip": "67890",
"country": "United States",
"override_message": "Custom message for Jane"
}
] }
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({
recipients: [
{
first_name: 'John',
last_name: 'Doe',
address: '123 Main St',
city: 'Anytown',
state: 'CA',
zip: '12345',
country: 'United States',
email: 'john@example.com',
internal_id: 'CUST-001'
},
{
first_name: 'Jane',
last_name: 'Smith',
address: '456 Oak Ave',
apt: 'Suite 100',
city: 'Othertown',
state: 'NY',
zip: '67890',
country: 'United States',
override_message: 'Custom message for Jane'
}
]
})
};
fetch('https://www.postable.com/api/v1/projects/add-recipients/{projectUuid}', 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://www.postable.com/api/v1/projects/add-recipients/{projectUuid}",
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([
'recipients' => [
[
'first_name' => 'John',
'last_name' => 'Doe',
'address' => '123 Main St',
'city' => 'Anytown',
'state' => 'CA',
'zip' => '12345',
'country' => 'United States',
'email' => 'john@example.com',
'internal_id' => 'CUST-001'
],
[
'first_name' => 'Jane',
'last_name' => 'Smith',
'address' => '456 Oak Ave',
'apt' => 'Suite 100',
'city' => 'Othertown',
'state' => 'NY',
'zip' => '67890',
'country' => 'United States',
'override_message' => 'Custom message for Jane'
]
]
]),
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://www.postable.com/api/v1/projects/add-recipients/{projectUuid}"
payload := strings.NewReader("{\n \"recipients\": [\n {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"address\": \"123 Main St\",\n \"city\": \"Anytown\",\n \"state\": \"CA\",\n \"zip\": \"12345\",\n \"country\": \"United States\",\n \"email\": \"john@example.com\",\n \"internal_id\": \"CUST-001\"\n },\n {\n \"first_name\": \"Jane\",\n \"last_name\": \"Smith\",\n \"address\": \"456 Oak Ave\",\n \"apt\": \"Suite 100\",\n \"city\": \"Othertown\",\n \"state\": \"NY\",\n \"zip\": \"67890\",\n \"country\": \"United States\",\n \"override_message\": \"Custom message for Jane\"\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://www.postable.com/api/v1/projects/add-recipients/{projectUuid}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"recipients\": [\n {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"address\": \"123 Main St\",\n \"city\": \"Anytown\",\n \"state\": \"CA\",\n \"zip\": \"12345\",\n \"country\": \"United States\",\n \"email\": \"john@example.com\",\n \"internal_id\": \"CUST-001\"\n },\n {\n \"first_name\": \"Jane\",\n \"last_name\": \"Smith\",\n \"address\": \"456 Oak Ave\",\n \"apt\": \"Suite 100\",\n \"city\": \"Othertown\",\n \"state\": \"NY\",\n \"zip\": \"67890\",\n \"country\": \"United States\",\n \"override_message\": \"Custom message for Jane\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.postable.com/api/v1/projects/add-recipients/{projectUuid}")
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 \"recipients\": [\n {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"address\": \"123 Main St\",\n \"city\": \"Anytown\",\n \"state\": \"CA\",\n \"zip\": \"12345\",\n \"country\": \"United States\",\n \"email\": \"john@example.com\",\n \"internal_id\": \"CUST-001\"\n },\n {\n \"first_name\": \"Jane\",\n \"last_name\": \"Smith\",\n \"address\": \"456 Oak Ave\",\n \"apt\": \"Suite 100\",\n \"city\": \"Othertown\",\n \"state\": \"NY\",\n \"zip\": \"67890\",\n \"country\": \"United States\",\n \"override_message\": \"Custom message for Jane\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"message": "<string>",
"contacts_updated": 123,
"contacts_created": 123
}
}{
"message": "You do not have permission to update this project"
}{
"message": "Project not found"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
UUID of the project to add recipients to
Body
application/json
Show child attributes
Show child attributes
Response
Recipients added successfully
Show child attributes
Show child attributes
⌘I