curl --request PUT \
--url https://api.upwell.com/api/rest/customer_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
},
"sourceSystem": "<string>",
"sourceSystemId": "<string>"
}
'import requests
url = "https://api.upwell.com/api/rest/customer_delivery_recipients"
payload = {
"input": {
"emailAddresses": ["ap@acme.com", "billing@acme.com; cc@acme.com"],
"forceClearRecipients": False
},
"sourceSystem": "<string>",
"sourceSystemId": "<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
},
sourceSystem: '<string>',
sourceSystemId: '<string>'
})
};
fetch('https://api.upwell.com/api/rest/customer_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/customer_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
],
'sourceSystem' => '<string>',
'sourceSystemId' => '<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/customer_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 \"sourceSystem\": \"<string>\",\n \"sourceSystemId\": \"<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/customer_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 \"sourceSystem\": \"<string>\",\n \"sourceSystemId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upwell.com/api/rest/customer_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 \"sourceSystem\": \"<string>\",\n \"sourceSystemId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"setCustomerEmailDeliveryRecipientsBySourceSystemId": {
"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 source system id
Replace the invoice email recipients for the customer identified by sourceSystem + sourceSystemId (query parameters). Use this to keep Upwell in sync when the AP contact changes in your TMS.
Behavior:
input.emailAddressesis the full replacement list. Each entry may itself be comma- or semicolon-separated (e.g."ap@acme.com; cc@acme.com"). Addresses are trimmed, lowercased and de-duplicated.- Every address is validated; any malformed address rejects the whole request and nothing is written.
- Writes the customer’s email delivery method only. Portal and EDI delivery methods are never modified. If the customer has no email delivery method, one is created.
- Only the recipient list changes. Other delivery settings (subject, schedule, delivery mode, conditional recipients) are preserved.
- Delivery routing is written only when your organization has delivery routing switched on (Customer Settings → Delivery Routing). Then the customer’s default routing rule is updated (or created) with the same recipients, and only the rule’s primary target is replaced: any additional targets on that rule keep their own recipients and keep receiving routed invoices. The delivery method and the routing rule are written together: if the routing write fails, the delivery method change is rolled back. With routing off, routing rules are not read or changed and
routingRuleIdisnullin the response. - An empty
emailAddresseslist is rejected unlessinput.forceClearRecipientsistrue. A forced clear clears the email delivery method’s recipients only; routing rules require at least one recipient and are left unchanged (routingRuleIdisnullin the response), so routed invoice email can keep going to the existing routing targets. sourceSystemmatches case-insensitively;sourceSystemIdmust match exactly. The request is rejected if no customer, or more than one, matches.
Errors: a rejected request still returns HTTP 200. The body has no setCustomerEmailDeliveryRecipientsBySourceSystemId object and instead carries the error message (for example Invalid email address(es): ...). Check for the result object before reading it.
curl --request PUT \
--url https://api.upwell.com/api/rest/customer_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
},
"sourceSystem": "<string>",
"sourceSystemId": "<string>"
}
'import requests
url = "https://api.upwell.com/api/rest/customer_delivery_recipients"
payload = {
"input": {
"emailAddresses": ["ap@acme.com", "billing@acme.com; cc@acme.com"],
"forceClearRecipients": False
},
"sourceSystem": "<string>",
"sourceSystemId": "<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
},
sourceSystem: '<string>',
sourceSystemId: '<string>'
})
};
fetch('https://api.upwell.com/api/rest/customer_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/customer_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
],
'sourceSystem' => '<string>',
'sourceSystemId' => '<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/customer_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 \"sourceSystem\": \"<string>\",\n \"sourceSystemId\": \"<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/customer_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 \"sourceSystem\": \"<string>\",\n \"sourceSystemId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upwell.com/api/rest/customer_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 \"sourceSystem\": \"<string>\",\n \"sourceSystemId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"setCustomerEmailDeliveryRecipientsBySourceSystemId": {
"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
Your API key, sent in the Authorization header: Authorization: YOUR_API_KEY. A Bearer prefix is also accepted (Authorization: Bearer YOUR_API_KEY). Keys are created in the Upwell dashboard (Account → API keys) and are scoped to one organization.
Query Parameters
The customer's source system (case-insensitive)
The customer's id in the source system
Body
Query parameters can also be provided in the request body as a JSON object
Response
Recipients updated
Show child attributes
Show child attributes

