Get a contact by email address
curl --request GET \
--url https://{notifuseDomain}/api/contacts.getByEmail \
--header 'Authorization: Bearer <token>'import requests
url = "https://{notifuseDomain}/api/contacts.getByEmail"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{notifuseDomain}/api/contacts.getByEmail', 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://{notifuseDomain}/api/contacts.getByEmail",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{notifuseDomain}/api/contacts.getByEmail"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{notifuseDomain}/api/contacts.getByEmail")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{notifuseDomain}/api/contacts.getByEmail")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"contact": {
"email": "user@example.com",
"external_id": "user_12345",
"timezone": "America/New_York",
"language": "en-US",
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"phone": "+15551234567",
"address_line_1": "123 Main St",
"address_line_2": "Apt 4B",
"country": "US",
"postcode": "10001",
"state": "NY",
"job_title": "Software Engineer",
"custom_string_1": "Premium tier",
"custom_string_2": "<string>",
"custom_string_3": "<string>",
"custom_string_4": "<string>",
"custom_string_5": "<string>",
"custom_number_1": 42,
"custom_number_2": 123,
"custom_number_3": 123,
"custom_number_4": 123,
"custom_number_5": 123,
"custom_datetime_1": "2023-06-01T09:00:00Z",
"custom_datetime_2": "2023-11-07T05:31:56Z",
"custom_datetime_3": "2023-11-07T05:31:56Z",
"custom_datetime_4": "2023-11-07T05:31:56Z",
"custom_datetime_5": "2023-11-07T05:31:56Z",
"custom_json_1": {
"preferences": {
"theme": "dark",
"notifications": true
}
},
"custom_json_2": {},
"custom_json_3": {},
"custom_json_4": {},
"custom_json_5": {},
"created_at": "2023-01-15T10:30:00Z",
"updated_at": "2023-04-22T15:45:00Z",
"contact_lists": [
{
"email": "user@example.com",
"list_id": "newsletter",
"list_name": "Newsletter",
"status": "active",
"created_at": "2023-01-15T10:30:00Z",
"updated_at": "2023-01-15T10:30:00Z",
"deleted_at": null
}
],
"contact_segments": [
{
"email": "user@example.com",
"segment_id": "premium_users",
"version": 1,
"matched_at": "2023-01-15T10:30:00Z",
"computed_at": "2023-01-15T10:30:00Z"
}
]
}
}Contacts
Get a contact by email address
Retrieves a contact by their email address within a specific workspace. The response always includes the contact’s list subscriptions with their status (active, pending, unsubscribed, bounced, complained).
GET
/
api
/
contacts.getByEmail
Get a contact by email address
curl --request GET \
--url https://{notifuseDomain}/api/contacts.getByEmail \
--header 'Authorization: Bearer <token>'import requests
url = "https://{notifuseDomain}/api/contacts.getByEmail"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{notifuseDomain}/api/contacts.getByEmail', 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://{notifuseDomain}/api/contacts.getByEmail",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{notifuseDomain}/api/contacts.getByEmail"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{notifuseDomain}/api/contacts.getByEmail")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{notifuseDomain}/api/contacts.getByEmail")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"contact": {
"email": "user@example.com",
"external_id": "user_12345",
"timezone": "America/New_York",
"language": "en-US",
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"phone": "+15551234567",
"address_line_1": "123 Main St",
"address_line_2": "Apt 4B",
"country": "US",
"postcode": "10001",
"state": "NY",
"job_title": "Software Engineer",
"custom_string_1": "Premium tier",
"custom_string_2": "<string>",
"custom_string_3": "<string>",
"custom_string_4": "<string>",
"custom_string_5": "<string>",
"custom_number_1": 42,
"custom_number_2": 123,
"custom_number_3": 123,
"custom_number_4": 123,
"custom_number_5": 123,
"custom_datetime_1": "2023-06-01T09:00:00Z",
"custom_datetime_2": "2023-11-07T05:31:56Z",
"custom_datetime_3": "2023-11-07T05:31:56Z",
"custom_datetime_4": "2023-11-07T05:31:56Z",
"custom_datetime_5": "2023-11-07T05:31:56Z",
"custom_json_1": {
"preferences": {
"theme": "dark",
"notifications": true
}
},
"custom_json_2": {},
"custom_json_3": {},
"custom_json_4": {},
"custom_json_5": {},
"created_at": "2023-01-15T10:30:00Z",
"updated_at": "2023-04-22T15:45:00Z",
"contact_lists": [
{
"email": "user@example.com",
"list_id": "newsletter",
"list_name": "Newsletter",
"status": "active",
"created_at": "2023-01-15T10:30:00Z",
"updated_at": "2023-01-15T10:30:00Z",
"deleted_at": null
}
],
"contact_segments": [
{
"email": "user@example.com",
"segment_id": "premium_users",
"version": 1,
"matched_at": "2023-01-15T10:30:00Z",
"computed_at": "2023-01-15T10:30:00Z"
}
]
}
}⌘I
