USERS
Upsert User Tenant Profile
Adds or updates the per-tenant profile for a user. Fields you set here override the user’s global profile when the workflow is triggered with tenant_id. Body accepts the same shape as Create / Update Users.
POST
/
v1
/
user
/
{distinct_id}
/
tenant
/
{tenant_id}
/
Upsert user tenant profile
curl -X POST "https://hub.suprsend.com/v1/user/user@example.com/tenant/acme-corp/" \
--header 'Authorization: Bearer __YOUR_API_KEY__' \
--header 'Content-Type: application/json' \
--data '{
"$email": ["user@acme-corp.com"],
"$slack": [{ "email": "user@acme-corp.com", "access_token": "xoxb-XXXXXXXX" }],
"$timezone": "America/New_York",
"$preferred_language": "en",
"role": "admin"
}'import requests
url = "https://hub.suprsend.com/v1/user/{distinct_id}/tenant/{tenant_id}/"
payload = {
"$email": ["user@acme-corp.com"],
"$sms": ["+1234567890"],
"$whatsapp": ["+1234567890"],
"$webpush": [
{
"token": "webpush_token_abc123",
"endpoint": "https://fcm.googleapis.com/fcm/send/abc123",
"keys": {
"p256dh": "BNJxwH...",
"auth": "tBH..."
}
}
],
"$androidpush": ["android_push_token_xyz987"],
"$iospush": ["ios_push_token_lmn456"],
"$slack": [
{
"email": "user@acme-corp.com",
"access_token": "xoxb-XXXXXXXX"
}
],
"$timezone": "America/New_York",
"$preferred_language": "en",
"role": "admin"
}
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({
$email: ['user@acme-corp.com'],
$sms: ['+1234567890'],
$whatsapp: ['+1234567890'],
$webpush: [
{
token: 'webpush_token_abc123',
endpoint: 'https://fcm.googleapis.com/fcm/send/abc123',
keys: {p256dh: 'BNJxwH...', auth: 'tBH...'}
}
],
$androidpush: ['android_push_token_xyz987'],
$iospush: ['ios_push_token_lmn456'],
$slack: [{email: 'user@acme-corp.com', access_token: 'xoxb-XXXXXXXX'}],
$timezone: 'America/New_York',
$preferred_language: 'en',
role: 'admin'
})
};
fetch('https://hub.suprsend.com/v1/user/{distinct_id}/tenant/{tenant_id}/', 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://hub.suprsend.com/v1/user/{distinct_id}/tenant/{tenant_id}/",
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([
'$email' => [
'user@acme-corp.com'
],
'$sms' => [
'+1234567890'
],
'$whatsapp' => [
'+1234567890'
],
'$webpush' => [
[
'token' => 'webpush_token_abc123',
'endpoint' => 'https://fcm.googleapis.com/fcm/send/abc123',
'keys' => [
'p256dh' => 'BNJxwH...',
'auth' => 'tBH...'
]
]
],
'$androidpush' => [
'android_push_token_xyz987'
],
'$iospush' => [
'ios_push_token_lmn456'
],
'$slack' => [
[
'email' => 'user@acme-corp.com',
'access_token' => 'xoxb-XXXXXXXX'
]
],
'$timezone' => 'America/New_York',
'$preferred_language' => 'en',
'role' => 'admin'
]),
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://hub.suprsend.com/v1/user/{distinct_id}/tenant/{tenant_id}/"
payload := strings.NewReader("{\n \"$email\": [\n \"user@acme-corp.com\"\n ],\n \"$sms\": [\n \"+1234567890\"\n ],\n \"$whatsapp\": [\n \"+1234567890\"\n ],\n \"$webpush\": [\n {\n \"token\": \"webpush_token_abc123\",\n \"endpoint\": \"https://fcm.googleapis.com/fcm/send/abc123\",\n \"keys\": {\n \"p256dh\": \"BNJxwH...\",\n \"auth\": \"tBH...\"\n }\n }\n ],\n \"$androidpush\": [\n \"android_push_token_xyz987\"\n ],\n \"$iospush\": [\n \"ios_push_token_lmn456\"\n ],\n \"$slack\": [\n {\n \"email\": \"user@acme-corp.com\",\n \"access_token\": \"xoxb-XXXXXXXX\"\n }\n ],\n \"$timezone\": \"America/New_York\",\n \"$preferred_language\": \"en\",\n \"role\": \"admin\"\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://hub.suprsend.com/v1/user/{distinct_id}/tenant/{tenant_id}/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"$email\": [\n \"user@acme-corp.com\"\n ],\n \"$sms\": [\n \"+1234567890\"\n ],\n \"$whatsapp\": [\n \"+1234567890\"\n ],\n \"$webpush\": [\n {\n \"token\": \"webpush_token_abc123\",\n \"endpoint\": \"https://fcm.googleapis.com/fcm/send/abc123\",\n \"keys\": {\n \"p256dh\": \"BNJxwH...\",\n \"auth\": \"tBH...\"\n }\n }\n ],\n \"$androidpush\": [\n \"android_push_token_xyz987\"\n ],\n \"$iospush\": [\n \"ios_push_token_lmn456\"\n ],\n \"$slack\": [\n {\n \"email\": \"user@acme-corp.com\",\n \"access_token\": \"xoxb-XXXXXXXX\"\n }\n ],\n \"$timezone\": \"America/New_York\",\n \"$preferred_language\": \"en\",\n \"role\": \"admin\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://hub.suprsend.com/v1/user/{distinct_id}/tenant/{tenant_id}/")
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 \"$email\": [\n \"user@acme-corp.com\"\n ],\n \"$sms\": [\n \"+1234567890\"\n ],\n \"$whatsapp\": [\n \"+1234567890\"\n ],\n \"$webpush\": [\n {\n \"token\": \"webpush_token_abc123\",\n \"endpoint\": \"https://fcm.googleapis.com/fcm/send/abc123\",\n \"keys\": {\n \"p256dh\": \"BNJxwH...\",\n \"auth\": \"tBH...\"\n }\n }\n ],\n \"$androidpush\": [\n \"android_push_token_xyz987\"\n ],\n \"$iospush\": [\n \"ios_push_token_lmn456\"\n ],\n \"$slack\": [\n {\n \"email\": \"user@acme-corp.com\",\n \"access_token\": \"xoxb-XXXXXXXX\"\n }\n ],\n \"$timezone\": \"America/New_York\",\n \"$preferred_language\": \"en\",\n \"role\": \"admin\"\n}"
response = http.request(request)
puts response.read_body{
"distinct_id": "user@example.com",
"properties": {
"$timezone": "America/New_York",
"$preferred_language": "en",
"role": "admin"
},
"created_at": "2022-02-13T12:47:00.388999+00:00",
"updated_at": "2026-07-21T09:49:36.383794+00:00",
"$email": [
{
"value": "user@acme-corp.com",
"status": "active",
"perma_status": "active"
}
],
"$slack": [
{
"value_json": {
"email": "user@acme-corp.com",
"access_token": "xoxb-XXXXXXXX"
},
"status": "active",
"perma_status": "active"
}
],
"tenant": {
"tenant_id": "acme-corp",
"properties": {
"$timezone": "America/New_York",
"$preferred_language": "en",
"role": "admin"
},
"$email": [
{
"value": "user@acme-corp.com",
"status": "active",
"perma_status": "active"
}
],
"$slack": [
{
"value_json": {
"email": "user@acme-corp.com",
"access_token": "xoxb-XXXXXXXX"
},
"status": "active",
"perma_status": "active"
}
]
}
}{
"code": 400,
"message": "[Exclusive-tenancy-mode] subscriber 'user@example.com' belongs to a different tenant"
}{
"code": 404,
"message": "tenant 'acme-corp' not found"
}Authorizations
Path Parameters
Body
application/json
Per-tenant profile payload. Same channel and property keys as Create / Update Users. Any key set here becomes the per-tenant override; keys omitted here fall through to the global profile at send time.
Response
201 - Created. The response is the full user object with the merged (effective) profile at the top level and the per-tenant override under tenant.
⌘I
Upsert user tenant profile
curl -X POST "https://hub.suprsend.com/v1/user/user@example.com/tenant/acme-corp/" \
--header 'Authorization: Bearer __YOUR_API_KEY__' \
--header 'Content-Type: application/json' \
--data '{
"$email": ["user@acme-corp.com"],
"$slack": [{ "email": "user@acme-corp.com", "access_token": "xoxb-XXXXXXXX" }],
"$timezone": "America/New_York",
"$preferred_language": "en",
"role": "admin"
}'import requests
url = "https://hub.suprsend.com/v1/user/{distinct_id}/tenant/{tenant_id}/"
payload = {
"$email": ["user@acme-corp.com"],
"$sms": ["+1234567890"],
"$whatsapp": ["+1234567890"],
"$webpush": [
{
"token": "webpush_token_abc123",
"endpoint": "https://fcm.googleapis.com/fcm/send/abc123",
"keys": {
"p256dh": "BNJxwH...",
"auth": "tBH..."
}
}
],
"$androidpush": ["android_push_token_xyz987"],
"$iospush": ["ios_push_token_lmn456"],
"$slack": [
{
"email": "user@acme-corp.com",
"access_token": "xoxb-XXXXXXXX"
}
],
"$timezone": "America/New_York",
"$preferred_language": "en",
"role": "admin"
}
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({
$email: ['user@acme-corp.com'],
$sms: ['+1234567890'],
$whatsapp: ['+1234567890'],
$webpush: [
{
token: 'webpush_token_abc123',
endpoint: 'https://fcm.googleapis.com/fcm/send/abc123',
keys: {p256dh: 'BNJxwH...', auth: 'tBH...'}
}
],
$androidpush: ['android_push_token_xyz987'],
$iospush: ['ios_push_token_lmn456'],
$slack: [{email: 'user@acme-corp.com', access_token: 'xoxb-XXXXXXXX'}],
$timezone: 'America/New_York',
$preferred_language: 'en',
role: 'admin'
})
};
fetch('https://hub.suprsend.com/v1/user/{distinct_id}/tenant/{tenant_id}/', 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://hub.suprsend.com/v1/user/{distinct_id}/tenant/{tenant_id}/",
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([
'$email' => [
'user@acme-corp.com'
],
'$sms' => [
'+1234567890'
],
'$whatsapp' => [
'+1234567890'
],
'$webpush' => [
[
'token' => 'webpush_token_abc123',
'endpoint' => 'https://fcm.googleapis.com/fcm/send/abc123',
'keys' => [
'p256dh' => 'BNJxwH...',
'auth' => 'tBH...'
]
]
],
'$androidpush' => [
'android_push_token_xyz987'
],
'$iospush' => [
'ios_push_token_lmn456'
],
'$slack' => [
[
'email' => 'user@acme-corp.com',
'access_token' => 'xoxb-XXXXXXXX'
]
],
'$timezone' => 'America/New_York',
'$preferred_language' => 'en',
'role' => 'admin'
]),
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://hub.suprsend.com/v1/user/{distinct_id}/tenant/{tenant_id}/"
payload := strings.NewReader("{\n \"$email\": [\n \"user@acme-corp.com\"\n ],\n \"$sms\": [\n \"+1234567890\"\n ],\n \"$whatsapp\": [\n \"+1234567890\"\n ],\n \"$webpush\": [\n {\n \"token\": \"webpush_token_abc123\",\n \"endpoint\": \"https://fcm.googleapis.com/fcm/send/abc123\",\n \"keys\": {\n \"p256dh\": \"BNJxwH...\",\n \"auth\": \"tBH...\"\n }\n }\n ],\n \"$androidpush\": [\n \"android_push_token_xyz987\"\n ],\n \"$iospush\": [\n \"ios_push_token_lmn456\"\n ],\n \"$slack\": [\n {\n \"email\": \"user@acme-corp.com\",\n \"access_token\": \"xoxb-XXXXXXXX\"\n }\n ],\n \"$timezone\": \"America/New_York\",\n \"$preferred_language\": \"en\",\n \"role\": \"admin\"\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://hub.suprsend.com/v1/user/{distinct_id}/tenant/{tenant_id}/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"$email\": [\n \"user@acme-corp.com\"\n ],\n \"$sms\": [\n \"+1234567890\"\n ],\n \"$whatsapp\": [\n \"+1234567890\"\n ],\n \"$webpush\": [\n {\n \"token\": \"webpush_token_abc123\",\n \"endpoint\": \"https://fcm.googleapis.com/fcm/send/abc123\",\n \"keys\": {\n \"p256dh\": \"BNJxwH...\",\n \"auth\": \"tBH...\"\n }\n }\n ],\n \"$androidpush\": [\n \"android_push_token_xyz987\"\n ],\n \"$iospush\": [\n \"ios_push_token_lmn456\"\n ],\n \"$slack\": [\n {\n \"email\": \"user@acme-corp.com\",\n \"access_token\": \"xoxb-XXXXXXXX\"\n }\n ],\n \"$timezone\": \"America/New_York\",\n \"$preferred_language\": \"en\",\n \"role\": \"admin\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://hub.suprsend.com/v1/user/{distinct_id}/tenant/{tenant_id}/")
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 \"$email\": [\n \"user@acme-corp.com\"\n ],\n \"$sms\": [\n \"+1234567890\"\n ],\n \"$whatsapp\": [\n \"+1234567890\"\n ],\n \"$webpush\": [\n {\n \"token\": \"webpush_token_abc123\",\n \"endpoint\": \"https://fcm.googleapis.com/fcm/send/abc123\",\n \"keys\": {\n \"p256dh\": \"BNJxwH...\",\n \"auth\": \"tBH...\"\n }\n }\n ],\n \"$androidpush\": [\n \"android_push_token_xyz987\"\n ],\n \"$iospush\": [\n \"ios_push_token_lmn456\"\n ],\n \"$slack\": [\n {\n \"email\": \"user@acme-corp.com\",\n \"access_token\": \"xoxb-XXXXXXXX\"\n }\n ],\n \"$timezone\": \"America/New_York\",\n \"$preferred_language\": \"en\",\n \"role\": \"admin\"\n}"
response = http.request(request)
puts response.read_body{
"distinct_id": "user@example.com",
"properties": {
"$timezone": "America/New_York",
"$preferred_language": "en",
"role": "admin"
},
"created_at": "2022-02-13T12:47:00.388999+00:00",
"updated_at": "2026-07-21T09:49:36.383794+00:00",
"$email": [
{
"value": "user@acme-corp.com",
"status": "active",
"perma_status": "active"
}
],
"$slack": [
{
"value_json": {
"email": "user@acme-corp.com",
"access_token": "xoxb-XXXXXXXX"
},
"status": "active",
"perma_status": "active"
}
],
"tenant": {
"tenant_id": "acme-corp",
"properties": {
"$timezone": "America/New_York",
"$preferred_language": "en",
"role": "admin"
},
"$email": [
{
"value": "user@acme-corp.com",
"status": "active",
"perma_status": "active"
}
],
"$slack": [
{
"value_json": {
"email": "user@acme-corp.com",
"access_token": "xoxb-XXXXXXXX"
},
"status": "active",
"perma_status": "active"
}
]
}
}{
"code": 400,
"message": "[Exclusive-tenancy-mode] subscriber 'user@example.com' belongs to a different tenant"
}{
"code": 404,
"message": "tenant 'acme-corp' not found"
}