curl --request PUT \
--url https://api.upwell.com/api/rest/customers/{id}/delivery_recipients \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"input": {
"emailAddresses": [
"ap@acme.com",
"billing@acme.com; cc@acme.com"
],
"forceClearRecipients": false
},
"id": "<string>"
}
'import requests
url = "https://api.upwell.com/api/rest/customers/{id}/delivery_recipients"
payload = {
"input": {
"emailAddresses": ["ap@acme.com", "billing@acme.com; cc@acme.com"],
"forceClearRecipients": False
},
"id": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
input: {
emailAddresses: ['ap@acme.com', 'billing@acme.com; cc@acme.com'],
forceClearRecipients: false
},
id: '<string>'
})
};
fetch('https://api.upwell.com/api/rest/customers/{id}/delivery_recipients', 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.upwell.com/api/rest/customers/{id}/delivery_recipients",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'input' => [
'emailAddresses' => [
'ap@acme.com',
'billing@acme.com; cc@acme.com'
],
'forceClearRecipients' => false
],
'id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.upwell.com/api/rest/customers/{id}/delivery_recipients"
payload := strings.NewReader("{\n \"input\": {\n \"emailAddresses\": [\n \"ap@acme.com\",\n \"billing@acme.com; cc@acme.com\"\n ],\n \"forceClearRecipients\": false\n },\n \"id\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<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))
}HttpResponse<String> response = Unirest.put("https://api.upwell.com/api/rest/customers/{id}/delivery_recipients")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"input\": {\n \"emailAddresses\": [\n \"ap@acme.com\",\n \"billing@acme.com; cc@acme.com\"\n ],\n \"forceClearRecipients\": false\n },\n \"id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upwell.com/api/rest/customers/{id}/delivery_recipients")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": {\n \"emailAddresses\": [\n \"ap@acme.com\",\n \"billing@acme.com; cc@acme.com\"\n ],\n \"forceClearRecipients\": false\n },\n \"id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"setCustomerEmailDeliveryRecipients": {
"customerId": "<string>",
"deliveryMethodCreated": true,
"deliveryMethodId": "<string>",
"emailAddresses": [
"<string>"
],
"routingRuleCreated": true,
"routingRuleId": "<string>",
"type": "<string>"
}
}{
"error": "Not-NULL violation. null value in column \"shipment_id\" of relation \"shipments\" violates not-null constraint",
"code": "constraint-violation"
}{
"error": "Authentication hook unauthorized this request",
"path": "$",
"code": "access-denied"
}Set customer invoice email recipients by ID
Replace the invoice email recipients for the customer with this Upwell id. Same behavior as PUT /api/rest/customer_delivery_recipients: full-replacement list, every address validated (any malformed address rejects the request), only the email delivery method is written (created if missing) with other delivery settings preserved, the default routing rule and its primary target are updated or created only when your organization has delivery routing switched on (other targets on that rule keep their recipients), and an empty list requires input.forceClearRecipients: true. A rejected request still returns HTTP 200, with the error message in the body and no setCustomerEmailDeliveryRecipients object.
curl --request PUT \
--url https://api.upwell.com/api/rest/customers/{id}/delivery_recipients \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"input": {
"emailAddresses": [
"ap@acme.com",
"billing@acme.com; cc@acme.com"
],
"forceClearRecipients": false
},
"id": "<string>"
}
'import requests
url = "https://api.upwell.com/api/rest/customers/{id}/delivery_recipients"
payload = {
"input": {
"emailAddresses": ["ap@acme.com", "billing@acme.com; cc@acme.com"],
"forceClearRecipients": False
},
"id": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
input: {
emailAddresses: ['ap@acme.com', 'billing@acme.com; cc@acme.com'],
forceClearRecipients: false
},
id: '<string>'
})
};
fetch('https://api.upwell.com/api/rest/customers/{id}/delivery_recipients', 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.upwell.com/api/rest/customers/{id}/delivery_recipients",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'input' => [
'emailAddresses' => [
'ap@acme.com',
'billing@acme.com; cc@acme.com'
],
'forceClearRecipients' => false
],
'id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.upwell.com/api/rest/customers/{id}/delivery_recipients"
payload := strings.NewReader("{\n \"input\": {\n \"emailAddresses\": [\n \"ap@acme.com\",\n \"billing@acme.com; cc@acme.com\"\n ],\n \"forceClearRecipients\": false\n },\n \"id\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<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))
}HttpResponse<String> response = Unirest.put("https://api.upwell.com/api/rest/customers/{id}/delivery_recipients")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"input\": {\n \"emailAddresses\": [\n \"ap@acme.com\",\n \"billing@acme.com; cc@acme.com\"\n ],\n \"forceClearRecipients\": false\n },\n \"id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upwell.com/api/rest/customers/{id}/delivery_recipients")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": {\n \"emailAddresses\": [\n \"ap@acme.com\",\n \"billing@acme.com; cc@acme.com\"\n ],\n \"forceClearRecipients\": false\n },\n \"id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"setCustomerEmailDeliveryRecipients": {
"customerId": "<string>",
"deliveryMethodCreated": true,
"deliveryMethodId": "<string>",
"emailAddresses": [
"<string>"
],
"routingRuleCreated": true,
"routingRuleId": "<string>",
"type": "<string>"
}
}{
"error": "Not-NULL violation. null value in column \"shipment_id\" of relation \"shipments\" violates not-null constraint",
"code": "constraint-violation"
}{
"error": "Authentication hook unauthorized this request",
"path": "$",
"code": "access-denied"
}Authorizations
Body
Query parameters can also be provided in the request body as a JSON object

