Set preferred email
curl --request POST \
--url https://api.stardex.ai/v1/persons/{id}/preferred-email \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>"
}
'import requests
url = "https://api.stardex.ai/v1/persons/{id}/preferred-email"
payload = { "email": "<string>" }
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: '<string>'})
};
fetch('https://api.stardex.ai/v1/persons/{id}/preferred-email', 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.stardex.ai/v1/persons/{id}/preferred-email",
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' => '<string>'
]),
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://api.stardex.ai/v1/persons/{id}/preferred-email"
payload := strings.NewReader("{\n \"email\": \"<string>\"\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://api.stardex.ai/v1/persons/{id}/preferred-email")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.stardex.ai/v1/persons/{id}/preferred-email")
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\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "John Doe",
"linkedin_public_id": "johndoe",
"first_name": "John",
"last_name": "Doe",
"current_job_title": "Software Engineer",
"current_company_name": "Tech Corp",
"current_company_id": "456e7890-e12b-34d5-a678-901234567890",
"external_source_id": null,
"created_at": "2024-01-15T10:30:00.000Z",
"updated_at": "2024-06-20T14:45:00.000Z",
"image_url": "https://media.samplecdn.com/dms/image/example.jpg",
"location": "San Francisco, CA",
"latitude": 37.7749,
"longitude": -122.4194,
"date_of_last_engagement": "2024-06-18T09:00:00.000Z",
"last_activity_type": "email",
"do_not_contact": false,
"do_not_contact_reason": null,
"owner_id": null,
"preferred_email": "john@techcorp.com",
"preferred_phone": "+1-555-0123",
"emails": [
{
"contact_data_type": "work",
"value": "john@techcorp.com",
"is_preferred": true
},
{
"contact_data_type": "personal",
"value": "john@gmail.com",
"is_preferred": false
}
],
"phones": [
{
"contact_data_type": "mobile",
"value": "+1-555-0123",
"is_preferred": true
}
],
"work_experience": [
{
"company_name": "Tech Corp",
"company_linkedin_url": "https://www.linkedin.com/company/techcorp",
"company_linkedin_id": 12345678,
"company_id": "456e7890-e12b-34d5-a678-901234567890",
"duration_in_months": 36,
"positions": [
{
"title": "Software Engineer",
"start_date": "2022-01-01",
"end_date": null,
"duration_in_months": 36,
"description": "Full-stack development",
"location": "San Francisco, CA",
"position_type": "Full-time"
}
]
}
],
"education_experience": [
{
"company_name": "Stanford University",
"start_date": "2016-09-01",
"end_date": "2020-06-01",
"description": null,
"degree": "B.S. Computer Science",
"company_linkedin_url": "https://www.linkedin.com/school/stanford",
"company_linkedin_id": 1234,
"company_id": null
}
],
"certifications": [
{
"name": "AWS Solutions Architect",
"credential_id": "AWS-SA-001",
"start_date": "2023-06-01",
"end_date": "2026-06-01",
"company_name": "Amazon Web Services",
"company_linkedin_url": null,
"company_linkedin_id": null,
"company_id": null
}
],
"candidates": [
{
"candidate_id": "789e0123-e45f-67a8-b901-234567890123",
"job_name": "Senior Software Engineer",
"job_id": "345e6789-e01b-23c4-d567-890123456789",
"job_client_company_name": "StartupXYZ",
"current_pipeline_stage_name": "Technical Interview",
"current_pipeline_stage_id": "567e8901-e23c-45d6-e789-012345678901",
"is_archived": false,
"created_at": "2024-01-12T14:30:00Z",
"sourced_by": "234e5678-e90a-12b3-c456-789012345678",
"owner_id": null
}
],
"custom_fields": [
{
"attribute_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"attribute_name": "Seniority Level",
"data_type": "single-select",
"value": null,
"tag": {
"id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
"name": "Senior"
},
"team_member": null,
"company": null
},
{
"attribute_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"attribute_name": "Years of Experience",
"data_type": "decimal",
"value": 8,
"tag": null,
"team_member": null,
"company": null
},
{
"attribute_id": "c3d4e5f6-a7b8-9012-cdef-234567890123",
"attribute_name": "Referred By",
"data_type": "multi-company",
"value": null,
"tag": null,
"team_member": null,
"company": {
"id": "456e7890-e12b-34d5-a678-901234567890",
"name": "Tech Corp"
}
}
],
"activities": [
{
"id": "fff66666-0000-1111-2222-333333336666",
"activity_type": "pipeline_status",
"created_at": "2024-01-15T10:00:00Z",
"updated_at": "2024-01-15T10:00:00Z",
"activity_content": "Moved to Technical Interview",
"team_member": {
"id": "234e5678-e90a-12b3-c456-789012345678",
"name": "Jane Smith"
},
"job": {
"id": "345e6789-e01b-23c4-d567-890123456789",
"title": "Senior Software Engineer",
"company_name": "StartupXYZ"
},
"pipeline_status_details": {
"stage_name": "Technical Interview",
"is_rejection_stage": false,
"entered_at": "2024-01-15T10:00:00Z",
"exited_at": null,
"reason_text": null,
"rejection_reason": null
}
},
{
"id": "901e2345-e67f-89a0-b123-456789012345",
"activity_type": "secondary_note",
"created_at": "2024-01-14T16:00:00Z",
"updated_at": "2024-01-14T16:45:00Z",
"activity_content": "Great initial call. Strong system design skills.",
"team_member": {
"id": "234e5678-e90a-12b3-c456-789012345678",
"name": "Jane Smith"
},
"job": {
"id": "345e6789-e01b-23c4-d567-890123456789",
"title": "Senior Software Engineer",
"company_name": "StartupXYZ"
}
},
{
"id": "902e3456-f78a-90b1-c234-567890123456",
"activity_type": "email",
"created_at": "2024-01-13T11:00:00Z",
"updated_at": "2024-01-13T11:00:00Z",
"activity_content": "Hi John, following up on our conversation...",
"team_member": {
"id": "234e5678-e90a-12b3-c456-789012345678",
"name": "Jane Smith"
},
"job": {
"id": "345e6789-e01b-23c4-d567-890123456789",
"title": "Senior Software Engineer",
"company_name": "StartupXYZ"
},
"email_details": {
"subject": "Following up — Senior SWE role",
"from_email": "jane@startup.xyz",
"to_email": "john@techcorp.com",
"status": "sent"
}
}
],
"compensation": [
{
"id": "678e9012-e34d-56f7-a890-123456789012",
"compensation_type": "actual",
"currency_code": "USD",
"current_compensation_base": 180000,
"current_compensation_bonus": 20000,
"bonus_percent": null,
"equity_percent": null,
"equity_amount": 50000,
"compensation_year": 2024,
"total_estimated_compensation": 250000,
"note": "Current package at Tech Corp",
"job_id": null,
"job_name": null,
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z"
}
],
"related_people": [
{
"relation_id": "rel-1111-2222-3333-444444444444",
"person_id": "567e8901-e23c-45d6-e789-012345678901",
"name": "Jane Smith",
"current_job_title": "Engineering Manager",
"linkedin_public_id": "janesmith",
"current_company_name": "Tech Corp",
"current_company_id": "456e7890-e12b-34d5-a678-901234567890",
"relation_type": "colleague",
"note": "Worked together on Platform team",
"direction": "outgoing",
"created_at": "2024-01-05T10:00:00Z"
}
],
"offers": [
{
"id": "offer-1111-2222-3333-444444444444",
"job_id": "345e6789-e01b-23c4-d567-890123456789",
"job_name": "Senior Software Engineer",
"job_company_name": "StartupXYZ",
"candidate_id": "789e0123-e45f-67a8-b901-234567890123",
"status": {
"id": "status-1111",
"name": "Extended",
"color": "#22c55e",
"status_type": "pending"
},
"extended_date": "2024-02-01T00:00:00Z",
"accepted_date": null,
"candidate_start_date": "2024-03-01T00:00:00Z",
"compensation_currency": "USD",
"compensation_base": 200000,
"compensation_bonus": 30000,
"bonus_type": "fixed",
"annual_equity_grant_percent": null,
"annual_equity_grant_amount": 50000,
"initial_equity_grant_percent": null,
"initial_equity_grant_amount": 100000,
"relocation_bonus": 10000,
"sign_on_bonus": 25000,
"total_estimated_compensation": 315000,
"note": "Competitive offer with strong equity component",
"created_at": "2024-02-01T00:00:00Z",
"updated_at": "2024-02-01T00:00:00Z"
}
]
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}Persons
Set preferred email
Star a stored email as this person’s preferred address and return the updated person. Campaign enrollment uses the preferred email when it is set.
The email must already exist on the person. To update many people in one request, use POST /v1/persons/preferred-email.
POST
/
v1
/
persons
/
{id}
/
preferred-email
Set preferred email
curl --request POST \
--url https://api.stardex.ai/v1/persons/{id}/preferred-email \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>"
}
'import requests
url = "https://api.stardex.ai/v1/persons/{id}/preferred-email"
payload = { "email": "<string>" }
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: '<string>'})
};
fetch('https://api.stardex.ai/v1/persons/{id}/preferred-email', 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.stardex.ai/v1/persons/{id}/preferred-email",
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' => '<string>'
]),
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://api.stardex.ai/v1/persons/{id}/preferred-email"
payload := strings.NewReader("{\n \"email\": \"<string>\"\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://api.stardex.ai/v1/persons/{id}/preferred-email")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.stardex.ai/v1/persons/{id}/preferred-email")
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\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "John Doe",
"linkedin_public_id": "johndoe",
"first_name": "John",
"last_name": "Doe",
"current_job_title": "Software Engineer",
"current_company_name": "Tech Corp",
"current_company_id": "456e7890-e12b-34d5-a678-901234567890",
"external_source_id": null,
"created_at": "2024-01-15T10:30:00.000Z",
"updated_at": "2024-06-20T14:45:00.000Z",
"image_url": "https://media.samplecdn.com/dms/image/example.jpg",
"location": "San Francisco, CA",
"latitude": 37.7749,
"longitude": -122.4194,
"date_of_last_engagement": "2024-06-18T09:00:00.000Z",
"last_activity_type": "email",
"do_not_contact": false,
"do_not_contact_reason": null,
"owner_id": null,
"preferred_email": "john@techcorp.com",
"preferred_phone": "+1-555-0123",
"emails": [
{
"contact_data_type": "work",
"value": "john@techcorp.com",
"is_preferred": true
},
{
"contact_data_type": "personal",
"value": "john@gmail.com",
"is_preferred": false
}
],
"phones": [
{
"contact_data_type": "mobile",
"value": "+1-555-0123",
"is_preferred": true
}
],
"work_experience": [
{
"company_name": "Tech Corp",
"company_linkedin_url": "https://www.linkedin.com/company/techcorp",
"company_linkedin_id": 12345678,
"company_id": "456e7890-e12b-34d5-a678-901234567890",
"duration_in_months": 36,
"positions": [
{
"title": "Software Engineer",
"start_date": "2022-01-01",
"end_date": null,
"duration_in_months": 36,
"description": "Full-stack development",
"location": "San Francisco, CA",
"position_type": "Full-time"
}
]
}
],
"education_experience": [
{
"company_name": "Stanford University",
"start_date": "2016-09-01",
"end_date": "2020-06-01",
"description": null,
"degree": "B.S. Computer Science",
"company_linkedin_url": "https://www.linkedin.com/school/stanford",
"company_linkedin_id": 1234,
"company_id": null
}
],
"certifications": [
{
"name": "AWS Solutions Architect",
"credential_id": "AWS-SA-001",
"start_date": "2023-06-01",
"end_date": "2026-06-01",
"company_name": "Amazon Web Services",
"company_linkedin_url": null,
"company_linkedin_id": null,
"company_id": null
}
],
"candidates": [
{
"candidate_id": "789e0123-e45f-67a8-b901-234567890123",
"job_name": "Senior Software Engineer",
"job_id": "345e6789-e01b-23c4-d567-890123456789",
"job_client_company_name": "StartupXYZ",
"current_pipeline_stage_name": "Technical Interview",
"current_pipeline_stage_id": "567e8901-e23c-45d6-e789-012345678901",
"is_archived": false,
"created_at": "2024-01-12T14:30:00Z",
"sourced_by": "234e5678-e90a-12b3-c456-789012345678",
"owner_id": null
}
],
"custom_fields": [
{
"attribute_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"attribute_name": "Seniority Level",
"data_type": "single-select",
"value": null,
"tag": {
"id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
"name": "Senior"
},
"team_member": null,
"company": null
},
{
"attribute_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"attribute_name": "Years of Experience",
"data_type": "decimal",
"value": 8,
"tag": null,
"team_member": null,
"company": null
},
{
"attribute_id": "c3d4e5f6-a7b8-9012-cdef-234567890123",
"attribute_name": "Referred By",
"data_type": "multi-company",
"value": null,
"tag": null,
"team_member": null,
"company": {
"id": "456e7890-e12b-34d5-a678-901234567890",
"name": "Tech Corp"
}
}
],
"activities": [
{
"id": "fff66666-0000-1111-2222-333333336666",
"activity_type": "pipeline_status",
"created_at": "2024-01-15T10:00:00Z",
"updated_at": "2024-01-15T10:00:00Z",
"activity_content": "Moved to Technical Interview",
"team_member": {
"id": "234e5678-e90a-12b3-c456-789012345678",
"name": "Jane Smith"
},
"job": {
"id": "345e6789-e01b-23c4-d567-890123456789",
"title": "Senior Software Engineer",
"company_name": "StartupXYZ"
},
"pipeline_status_details": {
"stage_name": "Technical Interview",
"is_rejection_stage": false,
"entered_at": "2024-01-15T10:00:00Z",
"exited_at": null,
"reason_text": null,
"rejection_reason": null
}
},
{
"id": "901e2345-e67f-89a0-b123-456789012345",
"activity_type": "secondary_note",
"created_at": "2024-01-14T16:00:00Z",
"updated_at": "2024-01-14T16:45:00Z",
"activity_content": "Great initial call. Strong system design skills.",
"team_member": {
"id": "234e5678-e90a-12b3-c456-789012345678",
"name": "Jane Smith"
},
"job": {
"id": "345e6789-e01b-23c4-d567-890123456789",
"title": "Senior Software Engineer",
"company_name": "StartupXYZ"
}
},
{
"id": "902e3456-f78a-90b1-c234-567890123456",
"activity_type": "email",
"created_at": "2024-01-13T11:00:00Z",
"updated_at": "2024-01-13T11:00:00Z",
"activity_content": "Hi John, following up on our conversation...",
"team_member": {
"id": "234e5678-e90a-12b3-c456-789012345678",
"name": "Jane Smith"
},
"job": {
"id": "345e6789-e01b-23c4-d567-890123456789",
"title": "Senior Software Engineer",
"company_name": "StartupXYZ"
},
"email_details": {
"subject": "Following up — Senior SWE role",
"from_email": "jane@startup.xyz",
"to_email": "john@techcorp.com",
"status": "sent"
}
}
],
"compensation": [
{
"id": "678e9012-e34d-56f7-a890-123456789012",
"compensation_type": "actual",
"currency_code": "USD",
"current_compensation_base": 180000,
"current_compensation_bonus": 20000,
"bonus_percent": null,
"equity_percent": null,
"equity_amount": 50000,
"compensation_year": 2024,
"total_estimated_compensation": 250000,
"note": "Current package at Tech Corp",
"job_id": null,
"job_name": null,
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z"
}
],
"related_people": [
{
"relation_id": "rel-1111-2222-3333-444444444444",
"person_id": "567e8901-e23c-45d6-e789-012345678901",
"name": "Jane Smith",
"current_job_title": "Engineering Manager",
"linkedin_public_id": "janesmith",
"current_company_name": "Tech Corp",
"current_company_id": "456e7890-e12b-34d5-a678-901234567890",
"relation_type": "colleague",
"note": "Worked together on Platform team",
"direction": "outgoing",
"created_at": "2024-01-05T10:00:00Z"
}
],
"offers": [
{
"id": "offer-1111-2222-3333-444444444444",
"job_id": "345e6789-e01b-23c4-d567-890123456789",
"job_name": "Senior Software Engineer",
"job_company_name": "StartupXYZ",
"candidate_id": "789e0123-e45f-67a8-b901-234567890123",
"status": {
"id": "status-1111",
"name": "Extended",
"color": "#22c55e",
"status_type": "pending"
},
"extended_date": "2024-02-01T00:00:00Z",
"accepted_date": null,
"candidate_start_date": "2024-03-01T00:00:00Z",
"compensation_currency": "USD",
"compensation_base": 200000,
"compensation_bonus": 30000,
"bonus_type": "fixed",
"annual_equity_grant_percent": null,
"annual_equity_grant_amount": 50000,
"initial_equity_grant_percent": null,
"initial_equity_grant_amount": 100000,
"relocation_bonus": 10000,
"sign_on_bonus": 25000,
"total_estimated_compensation": 315000,
"note": "Competitive offer with strong equity component",
"created_at": "2024-02-01T00:00:00Z",
"updated_at": "2024-02-01T00:00:00Z"
}
]
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
Authenticate with a Bearer token: API key, OAuth token, or session token.
Path Parameters
Person UUID
Body
application/json
Email address to star as preferred. Must already exist on this person.
Minimum string length:
1Was this page helpful?