Create / Update Users
API to upsert (create if not exists, update if exists) user profile using a distinct_id.
curl -X POST "https://hub.suprsend.com/v1/user/user123/" \
--header 'Authorization: Bearer __YOUR_API_KEY__' \
--header 'Content-Type: application/json' \
--data '{
"$email": ["user@example.com"],
"$sms": ["+1234567890"],
"$slack": [{
"email_id": "user@example.com",
"access_token": "xoxb-..."
}],
"$ms_teams": [{
"user_id": "teams_user_id_12345",
"tenant_id": "tenant_12345",
"service_url": "https://smba.trafficmanager.net/amer"
}]
}'import requests
url = "https://hub.suprsend.com/v1/user/{distinct_id}/"
payload = {
"$email": ["jsmith@example.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": [
{
"user_id": "U01ABCDE2F3",
"team_id": "T1234567890",
"access_token": "xoxb-..."
}
],
"$ms_teams": [
{
"user_id": "teams_user_id_12345",
"tenant_id": "tenant_12345",
"conversation_id": "conversation_12345"
}
],
"$timezone": "America/New_York",
"$locale": "en_GB",
"custom_key": "custom_value"
}
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: ['jsmith@example.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: [{user_id: 'U01ABCDE2F3', team_id: 'T1234567890', access_token: 'xoxb-...'}],
$ms_teams: [
{
user_id: 'teams_user_id_12345',
tenant_id: 'tenant_12345',
conversation_id: 'conversation_12345'
}
],
$timezone: 'America/New_York',
$locale: 'en_GB',
custom_key: 'custom_value'
})
};
fetch('https://hub.suprsend.com/v1/user/{distinct_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}/",
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' => [
'jsmith@example.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' => [
[
'user_id' => 'U01ABCDE2F3',
'team_id' => 'T1234567890',
'access_token' => 'xoxb-...'
]
],
'$ms_teams' => [
[
'user_id' => 'teams_user_id_12345',
'tenant_id' => 'tenant_12345',
'conversation_id' => 'conversation_12345'
]
],
'$timezone' => 'America/New_York',
'$locale' => 'en_GB',
'custom_key' => 'custom_value'
]),
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}/"
payload := strings.NewReader("{\n \"$email\": [\n \"jsmith@example.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 \"user_id\": \"U01ABCDE2F3\",\n \"team_id\": \"T1234567890\",\n \"access_token\": \"xoxb-...\"\n }\n ],\n \"$ms_teams\": [\n {\n \"user_id\": \"teams_user_id_12345\",\n \"tenant_id\": \"tenant_12345\",\n \"conversation_id\": \"conversation_12345\"\n }\n ],\n \"$timezone\": \"America/New_York\",\n \"$locale\": \"en_GB\",\n \"custom_key\": \"custom_value\"\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}/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"$email\": [\n \"jsmith@example.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 \"user_id\": \"U01ABCDE2F3\",\n \"team_id\": \"T1234567890\",\n \"access_token\": \"xoxb-...\"\n }\n ],\n \"$ms_teams\": [\n {\n \"user_id\": \"teams_user_id_12345\",\n \"tenant_id\": \"tenant_12345\",\n \"conversation_id\": \"conversation_12345\"\n }\n ],\n \"$timezone\": \"America/New_York\",\n \"$locale\": \"en_GB\",\n \"custom_key\": \"custom_value\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://hub.suprsend.com/v1/user/{distinct_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 \"jsmith@example.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 \"user_id\": \"U01ABCDE2F3\",\n \"team_id\": \"T1234567890\",\n \"access_token\": \"xoxb-...\"\n }\n ],\n \"$ms_teams\": [\n {\n \"user_id\": \"teams_user_id_12345\",\n \"tenant_id\": \"tenant_12345\",\n \"conversation_id\": \"conversation_12345\"\n }\n ],\n \"$timezone\": \"America/New_York\",\n \"$locale\": \"en_GB\",\n \"custom_key\": \"custom_value\"\n}"
response = http.request(request)
puts response.read_body{
"distinct_id": "_distinct_id_",
"properties": {
"$locale": "en_GB",
"$timezone": "America/New_York"
},
"created_at": "2025-04-04T21:37:36.712496+00:00",
"updated_at": "2025-04-04T21:37:36.743167+00:00",
"$email": [
{
"value": "john@example.com",
"status": "active",
"perma_status": "active"
}
],
"$inbox": [
{
"value": "4nlPk4t4kurG5kChOELB8Q1LcDI9DHzHQ70st2E2C24",
"id_provider": "suprsend",
"status": "active",
"perma_status": "active"
}
],
"$sms": [
{
"value": "+1234567890",
"status": "active",
"perma_status": "active"
}
],
"$slack": [
{
"value": {
"email_id": "user@example.com",
"access_token": "xoxb-..."
},
"status": "active",
"perma_status": "active"
}
],
"$ms_teams": [
{
"value": {
"user_id": "teams_user_id_12345",
"tenant_id": "tenant_12345",
"service_url": "https://smba.trafficmanager.net/amer"
},
"status": "active",
"perma_status": "active"
}
]
}{
"code": 400,
"message": "invalid_request_error"
}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
Body
List of email addresses. You can add other channels in the same format by replacing $email with the respective channel keys. Supported keys- $email, $sms, $whatsapp, $inbox, $webpush, $androidpush, $iospush, $slack, $ms_teams.
List of phone numbers for SMS
List of phone numbers for WhatsApp
List of inbox identifiers
List of Android Push tokens
List of iOS Push tokens
Slack channel configuration
- Slack using email
- Slack using member ID
- Slack using channel
- Slack using incoming webhook
Show child attributes
Show child attributes
Microsoft Teams channel configuration
- MS Teams using conversation ID
- MS Teams using user ID
- MS Teams using incoming webhook
Show child attributes
Show child attributes
User's timezone in IANA format
"America/New_York"
User's locale for translating template content in SuprSend.
"en_GB"
Add any additional property in key-value pair
"val"
Response
201
Unique identifier of the user.
"_distinct_id_"
all user properties in key-value pair. SuprSend reserved properties start with $
Timestamp when the user was created.
"2025-04-04T09:55:12.397Z"
Timestamp when the user was last updated.
"2025-04-04T09:55:12.422Z"
List of active communication channels for the user.
Show child attributes
Show child attributes
Was this page helpful?
curl -X POST "https://hub.suprsend.com/v1/user/user123/" \
--header 'Authorization: Bearer __YOUR_API_KEY__' \
--header 'Content-Type: application/json' \
--data '{
"$email": ["user@example.com"],
"$sms": ["+1234567890"],
"$slack": [{
"email_id": "user@example.com",
"access_token": "xoxb-..."
}],
"$ms_teams": [{
"user_id": "teams_user_id_12345",
"tenant_id": "tenant_12345",
"service_url": "https://smba.trafficmanager.net/amer"
}]
}'import requests
url = "https://hub.suprsend.com/v1/user/{distinct_id}/"
payload = {
"$email": ["jsmith@example.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": [
{
"user_id": "U01ABCDE2F3",
"team_id": "T1234567890",
"access_token": "xoxb-..."
}
],
"$ms_teams": [
{
"user_id": "teams_user_id_12345",
"tenant_id": "tenant_12345",
"conversation_id": "conversation_12345"
}
],
"$timezone": "America/New_York",
"$locale": "en_GB",
"custom_key": "custom_value"
}
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: ['jsmith@example.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: [{user_id: 'U01ABCDE2F3', team_id: 'T1234567890', access_token: 'xoxb-...'}],
$ms_teams: [
{
user_id: 'teams_user_id_12345',
tenant_id: 'tenant_12345',
conversation_id: 'conversation_12345'
}
],
$timezone: 'America/New_York',
$locale: 'en_GB',
custom_key: 'custom_value'
})
};
fetch('https://hub.suprsend.com/v1/user/{distinct_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}/",
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' => [
'jsmith@example.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' => [
[
'user_id' => 'U01ABCDE2F3',
'team_id' => 'T1234567890',
'access_token' => 'xoxb-...'
]
],
'$ms_teams' => [
[
'user_id' => 'teams_user_id_12345',
'tenant_id' => 'tenant_12345',
'conversation_id' => 'conversation_12345'
]
],
'$timezone' => 'America/New_York',
'$locale' => 'en_GB',
'custom_key' => 'custom_value'
]),
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}/"
payload := strings.NewReader("{\n \"$email\": [\n \"jsmith@example.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 \"user_id\": \"U01ABCDE2F3\",\n \"team_id\": \"T1234567890\",\n \"access_token\": \"xoxb-...\"\n }\n ],\n \"$ms_teams\": [\n {\n \"user_id\": \"teams_user_id_12345\",\n \"tenant_id\": \"tenant_12345\",\n \"conversation_id\": \"conversation_12345\"\n }\n ],\n \"$timezone\": \"America/New_York\",\n \"$locale\": \"en_GB\",\n \"custom_key\": \"custom_value\"\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}/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"$email\": [\n \"jsmith@example.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 \"user_id\": \"U01ABCDE2F3\",\n \"team_id\": \"T1234567890\",\n \"access_token\": \"xoxb-...\"\n }\n ],\n \"$ms_teams\": [\n {\n \"user_id\": \"teams_user_id_12345\",\n \"tenant_id\": \"tenant_12345\",\n \"conversation_id\": \"conversation_12345\"\n }\n ],\n \"$timezone\": \"America/New_York\",\n \"$locale\": \"en_GB\",\n \"custom_key\": \"custom_value\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://hub.suprsend.com/v1/user/{distinct_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 \"jsmith@example.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 \"user_id\": \"U01ABCDE2F3\",\n \"team_id\": \"T1234567890\",\n \"access_token\": \"xoxb-...\"\n }\n ],\n \"$ms_teams\": [\n {\n \"user_id\": \"teams_user_id_12345\",\n \"tenant_id\": \"tenant_12345\",\n \"conversation_id\": \"conversation_12345\"\n }\n ],\n \"$timezone\": \"America/New_York\",\n \"$locale\": \"en_GB\",\n \"custom_key\": \"custom_value\"\n}"
response = http.request(request)
puts response.read_body{
"distinct_id": "_distinct_id_",
"properties": {
"$locale": "en_GB",
"$timezone": "America/New_York"
},
"created_at": "2025-04-04T21:37:36.712496+00:00",
"updated_at": "2025-04-04T21:37:36.743167+00:00",
"$email": [
{
"value": "john@example.com",
"status": "active",
"perma_status": "active"
}
],
"$inbox": [
{
"value": "4nlPk4t4kurG5kChOELB8Q1LcDI9DHzHQ70st2E2C24",
"id_provider": "suprsend",
"status": "active",
"perma_status": "active"
}
],
"$sms": [
{
"value": "+1234567890",
"status": "active",
"perma_status": "active"
}
],
"$slack": [
{
"value": {
"email_id": "user@example.com",
"access_token": "xoxb-..."
},
"status": "active",
"perma_status": "active"
}
],
"$ms_teams": [
{
"value": {
"user_id": "teams_user_id_12345",
"tenant_id": "tenant_12345",
"service_url": "https://smba.trafficmanager.net/amer"
},
"status": "active",
"perma_status": "active"
}
]
}{
"code": 400,
"message": "invalid_request_error"
}