curl -X PUT "https://api.mailgreet.com/api/v1/external/subscribers/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"first_name": "Jane",
"last_name": "Smith",
"phone": "+0987654321",
"custom_fields": {
"company": "New Company Inc",
"role": "CEO"
}
}'
const subscriberId = '550e8400-e29b-41d4-a716-446655440000';
const response = await fetch(
`https://api.mailgreet.com/api/v1/external/subscribers/${subscriberId}`,
{
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
first_name: 'Jane',
last_name: 'Smith',
phone: '+0987654321',
custom_fields: {
company: 'New Company Inc',
role: 'CEO'
}
})
}
);
const data = await response.json();
console.log(data);
import requests
subscriber_id = '550e8400-e29b-41d4-a716-446655440000'
payload = {
'first_name': 'Jane',
'last_name': 'Smith',
'phone': '+0987654321',
'custom_fields': {
'company': 'New Company Inc',
'role': 'CEO'
}
}
response = requests.put(
f'https://api.mailgreet.com/api/v1/external/subscribers/{subscriber_id}',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
json=payload
)
print(response.json())
<?php
$subscriberId = '550e8400-e29b-41d4-a716-446655440000';
$payload = json_encode([
'first_name' => 'Jane',
'last_name' => 'Smith',
'phone' => '+0987654321',
'custom_fields' => [
'company' => 'New Company Inc',
'role' => 'CEO'
]
]);
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => "https://api.mailgreet.com/api/v1/external/subscribers/{$subscriberId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS => $payload,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_KEY',
'Content-Type: application/json'
]
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"email": "john@example.com",
"first_name": "Jane",
"last_name": "Smith",
"phone": "+0987654321",
"status": "active",
"custom_fields": {
"company": "New Company Inc",
"role": "CEO"
},
"updated_at": "2026-01-18T14:00:00Z"
}
}
{
"success": false,
"error": "Subscriber not found"
}
{
"success": false,
"error": "Validation failed",
"data": {
"status": ["The status must be one of: active, unsubscribed."]
}
}
Subscribers
Update Subscriber
Update an existing subscriber profile
PUT
/
api
/
v1
/
external
/
subscribers
/
{subscriberId}
curl -X PUT "https://api.mailgreet.com/api/v1/external/subscribers/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"first_name": "Jane",
"last_name": "Smith",
"phone": "+0987654321",
"custom_fields": {
"company": "New Company Inc",
"role": "CEO"
}
}'
const subscriberId = '550e8400-e29b-41d4-a716-446655440000';
const response = await fetch(
`https://api.mailgreet.com/api/v1/external/subscribers/${subscriberId}`,
{
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
first_name: 'Jane',
last_name: 'Smith',
phone: '+0987654321',
custom_fields: {
company: 'New Company Inc',
role: 'CEO'
}
})
}
);
const data = await response.json();
console.log(data);
import requests
subscriber_id = '550e8400-e29b-41d4-a716-446655440000'
payload = {
'first_name': 'Jane',
'last_name': 'Smith',
'phone': '+0987654321',
'custom_fields': {
'company': 'New Company Inc',
'role': 'CEO'
}
}
response = requests.put(
f'https://api.mailgreet.com/api/v1/external/subscribers/{subscriber_id}',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
json=payload
)
print(response.json())
<?php
$subscriberId = '550e8400-e29b-41d4-a716-446655440000';
$payload = json_encode([
'first_name' => 'Jane',
'last_name' => 'Smith',
'phone' => '+0987654321',
'custom_fields' => [
'company' => 'New Company Inc',
'role' => 'CEO'
]
]);
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => "https://api.mailgreet.com/api/v1/external/subscribers/{$subscriberId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS => $payload,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_KEY',
'Content-Type: application/json'
]
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"email": "john@example.com",
"first_name": "Jane",
"last_name": "Smith",
"phone": "+0987654321",
"status": "active",
"custom_fields": {
"company": "New Company Inc",
"role": "CEO"
},
"updated_at": "2026-01-18T14:00:00Z"
}
}
{
"success": false,
"error": "Subscriber not found"
}
{
"success": false,
"error": "Validation failed",
"data": {
"status": ["The status must be one of: active, unsubscribed."]
}
}
Overview
Update a subscriber’s profile information including their name, phone number, status, custom fields, and group memberships. Only include the fields you want to update.Authentication
string
required
Bearer token. Format:
Bearer YOUR_API_KEYPath Parameters
string
required
The unique identifier (UUID) of the subscriber to update.Example:
550e8400-e29b-41d4-a716-446655440000Request Body
Only include the fields you want to update. Unspecified fields will remain unchanged.
string
Updated first name.
string
Updated last name.
string
Updated phone number.
string
Updated status. Options:
active- Subscriber can receive emailsunsubscribed- Subscriber has opted out
array
Array of group UUIDs. This will replace all current group memberships.
object
Object containing custom field key-value pairs. Merges with existing custom fields.
Response
boolean
Indicates if the update was successful
object
The updated subscriber object
curl -X PUT "https://api.mailgreet.com/api/v1/external/subscribers/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"first_name": "Jane",
"last_name": "Smith",
"phone": "+0987654321",
"custom_fields": {
"company": "New Company Inc",
"role": "CEO"
}
}'
const subscriberId = '550e8400-e29b-41d4-a716-446655440000';
const response = await fetch(
`https://api.mailgreet.com/api/v1/external/subscribers/${subscriberId}`,
{
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
first_name: 'Jane',
last_name: 'Smith',
phone: '+0987654321',
custom_fields: {
company: 'New Company Inc',
role: 'CEO'
}
})
}
);
const data = await response.json();
console.log(data);
import requests
subscriber_id = '550e8400-e29b-41d4-a716-446655440000'
payload = {
'first_name': 'Jane',
'last_name': 'Smith',
'phone': '+0987654321',
'custom_fields': {
'company': 'New Company Inc',
'role': 'CEO'
}
}
response = requests.put(
f'https://api.mailgreet.com/api/v1/external/subscribers/{subscriber_id}',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
json=payload
)
print(response.json())
<?php
$subscriberId = '550e8400-e29b-41d4-a716-446655440000';
$payload = json_encode([
'first_name' => 'Jane',
'last_name' => 'Smith',
'phone' => '+0987654321',
'custom_fields' => [
'company' => 'New Company Inc',
'role' => 'CEO'
]
]);
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => "https://api.mailgreet.com/api/v1/external/subscribers/{$subscriberId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS => $payload,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_KEY',
'Content-Type: application/json'
]
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"email": "john@example.com",
"first_name": "Jane",
"last_name": "Smith",
"phone": "+0987654321",
"status": "active",
"custom_fields": {
"company": "New Company Inc",
"role": "CEO"
},
"updated_at": "2026-01-18T14:00:00Z"
}
}
{
"success": false,
"error": "Subscriber not found"
}
{
"success": false,
"error": "Validation failed",
"data": {
"status": ["The status must be one of: active, unsubscribed."]
}
}
Examples
Unsubscribe a Subscriber
curl -X PUT "https://api.mailgreet.com/api/v1/external/subscribers/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"status": "unsubscribed"}'
Add to Groups
curl -X PUT "https://api.mailgreet.com/api/v1/external/subscribers/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"group_ids": [
"group-uuid-1",
"group-uuid-2"
]
}'
Setting
group_ids will replace all current group memberships. To add a subscriber to additional groups without removing existing ones, first fetch the current groups and include them in the array.
