Track contact
curl --request POST \
--url https://api.sendx.io/api/v1/rest/contact/track \
--header 'Content-Type: application/json' \
--header 'X-Team-ApiKey: <api-key>' \
--data '
{
"email": "test@example.com",
"addTags": [
"new",
"cool"
],
"removeTags": [
"old",
"bad"
]
}
'import requests
url = "https://api.sendx.io/api/v1/rest/contact/track"
payload = {
"email": "test@example.com",
"addTags": ["new", "cool"],
"removeTags": ["old", "bad"]
}
headers = {
"X-Team-ApiKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Team-ApiKey': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'test@example.com',
addTags: ['new', 'cool'],
removeTags: ['old', 'bad']
})
};
fetch('https://api.sendx.io/api/v1/rest/contact/track', 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.sendx.io/api/v1/rest/contact/track",
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' => 'test@example.com',
'addTags' => [
'new',
'cool'
],
'removeTags' => [
'old',
'bad'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Team-ApiKey: <api-key>"
],
]);
$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.sendx.io/api/v1/rest/contact/track"
payload := strings.NewReader("{\n \"email\": \"test@example.com\",\n \"addTags\": [\n \"new\",\n \"cool\"\n ],\n \"removeTags\": [\n \"old\",\n \"bad\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Team-ApiKey", "<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.post("https://api.sendx.io/api/v1/rest/contact/track")
.header("X-Team-ApiKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"test@example.com\",\n \"addTags\": [\n \"new\",\n \"cool\"\n ],\n \"removeTags\": [\n \"old\",\n \"bad\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sendx.io/api/v1/rest/contact/track")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Team-ApiKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"test@example.com\",\n \"addTags\": [\n \"new\",\n \"cool\"\n ],\n \"removeTags\": [\n \"old\",\n \"bad\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "200",
"message": "OK"
}{
"status": 401,
"message": "The Team ID or API Key specified is not valid"
}{
"status": "error",
"message": "Resource not found"
}{
"status": "error",
"message": "Request body is not in proper format"
}{
"status": "error",
"message": "Internal server error occurred"
}Getting Started
Track contact
Legacy endpoint for tracking contact behavior through tags.
π― Key Features:
- Add or remove tags
- Trigger automations
- Track user behavior
POST
/
contact
/
track
Track contact
curl --request POST \
--url https://api.sendx.io/api/v1/rest/contact/track \
--header 'Content-Type: application/json' \
--header 'X-Team-ApiKey: <api-key>' \
--data '
{
"email": "test@example.com",
"addTags": [
"new",
"cool"
],
"removeTags": [
"old",
"bad"
]
}
'import requests
url = "https://api.sendx.io/api/v1/rest/contact/track"
payload = {
"email": "test@example.com",
"addTags": ["new", "cool"],
"removeTags": ["old", "bad"]
}
headers = {
"X-Team-ApiKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Team-ApiKey': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'test@example.com',
addTags: ['new', 'cool'],
removeTags: ['old', 'bad']
})
};
fetch('https://api.sendx.io/api/v1/rest/contact/track', 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.sendx.io/api/v1/rest/contact/track",
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' => 'test@example.com',
'addTags' => [
'new',
'cool'
],
'removeTags' => [
'old',
'bad'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Team-ApiKey: <api-key>"
],
]);
$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.sendx.io/api/v1/rest/contact/track"
payload := strings.NewReader("{\n \"email\": \"test@example.com\",\n \"addTags\": [\n \"new\",\n \"cool\"\n ],\n \"removeTags\": [\n \"old\",\n \"bad\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Team-ApiKey", "<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.post("https://api.sendx.io/api/v1/rest/contact/track")
.header("X-Team-ApiKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"test@example.com\",\n \"addTags\": [\n \"new\",\n \"cool\"\n ],\n \"removeTags\": [\n \"old\",\n \"bad\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sendx.io/api/v1/rest/contact/track")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Team-ApiKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"test@example.com\",\n \"addTags\": [\n \"new\",\n \"cool\"\n ],\n \"removeTags\": [\n \"old\",\n \"bad\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "200",
"message": "OK"
}{
"status": 401,
"message": "The Team ID or API Key specified is not valid"
}{
"status": "error",
"message": "Resource not found"
}{
"status": "error",
"message": "Request body is not in proper format"
}{
"status": "error",
"message": "Internal server error occurred"
}The Track API Method is used to track a contactβs actions by managing tags.
Add and remove tags:
Automation rules can be triggered based on tag additions or removals, e.g.:
Example Requests:
Add tags:{
"addTags": ["blogger", "female"]
}
{
"addTags": ["paid user"],
"removeTags": ["trial user"]
}
- On user registration tag, start onboarding drip campaigns.
- On account upgrade, start account expansion drip campaigns.
- On removal of the trial user tag, initiate upsell campaigns.
Authorizations
Team API key for authentication. Find your API key in SendX Settings β Team API Key.
Example:
X-Team-ApiKey: your_team_api_key_here
Body
application/json
Was this page helpful?
βI