curl --request PATCH \
--url https://api.maildiver.com/v1/automation/contacts/{email} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"properties": {
"first_name": "John",
"last_name": "Doe",
"plan": "enterprise"
}
}
'{
"message": "Contact metadata updated successfully",
"email": "user@example.com",
"updated_properties": [
"first_name",
"last_name",
"plan",
"company"
]
}Automation Contact
Update automation contact properties
Endpoint: v1/automation/contacts/{email}
Update a contact’s properties using deep merge with null deletion. Properties can be used in workflow conditions and email personalization.
Merge Behavior:
- Omitted fields: Preserved unchanged in existing properties
- Fields with values: Updated or added to properties
- Fields set to
null: Explicitly deleted from properties - Nested objects: Recursively merged (NOT replaced entirely)
- Arrays: Replaced entirely (NOT merged element-wise)
Unsubscribe Management:
To manage subscriptions, include {{ unsubscribe_url }} in your email templates. When a contact clicks this link, they will be automatically unsubscribed from the workflow. Subscription status cannot be managed via this endpoint.
Note: Contact must exist before updating. Send an event first to create the contact.
curl --request PATCH \
--url https://api.maildiver.com/v1/automation/contacts/{email} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"properties": {
"first_name": "John",
"last_name": "Doe",
"plan": "enterprise"
}
}
'{
"message": "Contact metadata updated successfully",
"email": "user@example.com",
"updated_properties": [
"first_name",
"last_name",
"plan",
"company"
]
}Authorizations
API key with format "Bearer {your-api-key}"
Path Parameters
Contact's email address
Body
application/json
Contact properties to merge (key-value pairs, set to null to delete)
Example:
{
"first_name": "John",
"plan": "enterprise"
}
Response
Contact successfully updated
Was this page helpful?
⌘I