USERS
Edit User Profile
API to edit (add/remove) properties and communication-channels for a user.
PATCH
/
v1
/
user
/
{distinct_id}
/
Edit User Profile
curl -X PATCH "https://hub.suprsend.com/v1/user/user123/" \
--header 'Authorization: Bearer __YOUR_API_KEY__' \
--header 'Content-Type: application/json' \
--data '{
"operations": [
{
"$set": {
"name": "John Doe",
"$locale": "en_GB",
"$timezone": "America/New_York"
}
},
{
"$append": {
"$email": "john@example.com"
}
}
]
}'import requests
url = "https://hub.suprsend.com/v1/user/{distinct_id}/"
payload = { "operations": [
{
"$set": {},
"$unset": ["<string>"],
"$append": {},
"$remove": {},
"$set_once": {},
"$increment": {}
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
operations: [
{
$set: {},
$unset: ['<string>'],
$append: {},
$remove: {},
$set_once: {},
$increment: {}
}
]
})
};
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 => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'operations' => [
[
'$set' => [
],
'$unset' => [
'<string>'
],
'$append' => [
],
'$remove' => [
],
'$set_once' => [
],
'$increment' => [
]
]
]
]),
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 \"operations\": [\n {\n \"$set\": {},\n \"$unset\": [\n \"<string>\"\n ],\n \"$append\": {},\n \"$remove\": {},\n \"$set_once\": {},\n \"$increment\": {}\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://hub.suprsend.com/v1/user/{distinct_id}/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"operations\": [\n {\n \"$set\": {},\n \"$unset\": [\n \"<string>\"\n ],\n \"$append\": {},\n \"$remove\": {},\n \"$set_once\": {},\n \"$increment\": {}\n }\n ]\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::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"operations\": [\n {\n \"$set\": {},\n \"$unset\": [\n \"<string>\"\n ],\n \"$append\": {},\n \"$remove\": {},\n \"$set_once\": {},\n \"$increment\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"distinct_id": "_distinct_id_",
"properties": {
"name": "Marge Simpson",
"$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"
}
]
}Authorizations
Pass as Bearer <API_KEY>. Get API Key from SuprSend dashboard Developers -> API Keys section.
Path Parameters
unique identifier of the user
Body
application/json
You can use the following operations to edit user profile.
$setto add/update a property$unsetto delete property/channel$appendto insert values in property/channel array$removeto remove values from property/channel array$set_onceto remove immutable properties$incrementto increase/decrease integer values on further update
Show child attributes
Show child attributes
Response
202 - application/json
202
Unique identifier of the user.
Example:
"_distinct_id_"
all user properties in key-value pair. SuprSend reserved properties start with $
Timestamp when the user was created.
Example:
"2025-04-04T09:55:12.397Z"
Timestamp when the user was last updated.
Example:
"2025-04-04T09:55:12.422Z"
list of all active channels.
Show child attributes
Show child attributes
Was this page helpful?
⌘I
Edit User Profile
curl -X PATCH "https://hub.suprsend.com/v1/user/user123/" \
--header 'Authorization: Bearer __YOUR_API_KEY__' \
--header 'Content-Type: application/json' \
--data '{
"operations": [
{
"$set": {
"name": "John Doe",
"$locale": "en_GB",
"$timezone": "America/New_York"
}
},
{
"$append": {
"$email": "john@example.com"
}
}
]
}'import requests
url = "https://hub.suprsend.com/v1/user/{distinct_id}/"
payload = { "operations": [
{
"$set": {},
"$unset": ["<string>"],
"$append": {},
"$remove": {},
"$set_once": {},
"$increment": {}
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
operations: [
{
$set: {},
$unset: ['<string>'],
$append: {},
$remove: {},
$set_once: {},
$increment: {}
}
]
})
};
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 => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'operations' => [
[
'$set' => [
],
'$unset' => [
'<string>'
],
'$append' => [
],
'$remove' => [
],
'$set_once' => [
],
'$increment' => [
]
]
]
]),
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 \"operations\": [\n {\n \"$set\": {},\n \"$unset\": [\n \"<string>\"\n ],\n \"$append\": {},\n \"$remove\": {},\n \"$set_once\": {},\n \"$increment\": {}\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://hub.suprsend.com/v1/user/{distinct_id}/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"operations\": [\n {\n \"$set\": {},\n \"$unset\": [\n \"<string>\"\n ],\n \"$append\": {},\n \"$remove\": {},\n \"$set_once\": {},\n \"$increment\": {}\n }\n ]\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::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"operations\": [\n {\n \"$set\": {},\n \"$unset\": [\n \"<string>\"\n ],\n \"$append\": {},\n \"$remove\": {},\n \"$set_once\": {},\n \"$increment\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"distinct_id": "_distinct_id_",
"properties": {
"name": "Marge Simpson",
"$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"
}
]
}