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.
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"],
"$inbox": ["4nlPk4XXLcDxxxHQ70xx2Cx24"],
"$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'],
$inbox: ['4nlPk4XXLcDxxxHQ70xx2Cx24'],
$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'
],
'$inbox' => [
'4nlPk4XXLcDxxxHQ70xx2Cx24'
],
'$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 \"$inbox\": [\n \"4nlPk4XXLcDxxxHQ70xx2Cx24\"\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 \"$inbox\": [\n \"4nlPk4XXLcDxxxHQ70xx2Cx24\"\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 \"$inbox\": [\n \"4nlPk4XXLcDxxxHQ70xx2Cx24\"\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": "user is already associated with a different tenant; workspace is in exclusive mode"
}{
"code": 404,
"message": "tenant 'acme-corp' not found"
}Authorizations
Pass as Bearer <API_KEY>. Get API Key from SuprSend dashboard Developers -> API Keys section.
Path Parameters
Unique identifier of the user in your system. The user's global profile must exist before you upsert a per-tenant profile.
Tenant to scope the profile update to. Tenant must exist in the workspace.
Body
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.
List of email addresses to set on the per-tenant profile.
List of phone numbers for SMS on the per-tenant profile.
List of phone numbers for WhatsApp on the per-tenant profile.
List of inbox identifiers on the per-tenant profile.
Android push tokens on the per-tenant profile. Use this to isolate device tokens per tenant / app install.
iOS push tokens on the per-tenant profile.
Web push subscription objects on the per-tenant profile.
Slack channel configuration on the per-tenant profile. Same shape as the global profile — email + access_token, user_id + access_token, channel + access_token, or incoming_webhook.
Microsoft Teams channel configuration on the per-tenant profile. Same shape as the global profile.
IANA timezone for the per-tenant profile.
"America/New_York"
Preferred language code for the per-tenant profile.
"en"
Locale for the per-tenant profile.
"en_GB"
Any custom property to set on the per-tenant profile. Overrides the same key on 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.
The user identifier the operation applied to.
"user@example.com"
Merged (effective) properties — global properties layered with per-tenant overrides.
Timestamp when the user was originally created.
Timestamp when the user was last updated (global or per-tenant).
The per-tenant override block for the tenant the request targeted. Contains only the fields explicitly set at the tenant level, not the merged view.
Show child attributes
Show child attributes
Was this page helpful?
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"],
"$inbox": ["4nlPk4XXLcDxxxHQ70xx2Cx24"],
"$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'],
$inbox: ['4nlPk4XXLcDxxxHQ70xx2Cx24'],
$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'
],
'$inbox' => [
'4nlPk4XXLcDxxxHQ70xx2Cx24'
],
'$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 \"$inbox\": [\n \"4nlPk4XXLcDxxxHQ70xx2Cx24\"\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 \"$inbox\": [\n \"4nlPk4XXLcDxxxHQ70xx2Cx24\"\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 \"$inbox\": [\n \"4nlPk4XXLcDxxxHQ70xx2Cx24\"\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": "user is already associated with a different tenant; workspace is in exclusive mode"
}{
"code": 404,
"message": "tenant 'acme-corp' not found"
}