Update contact
Update contact using UUID or email (URL encoded)
patch
Authorizations
Api-TokenstringRequired
Pass the API token in the Api-Token
Path parameters
contact_identifierstring · uuid or emailRequiredExample:
Contact UUID or Email
018dd5e3-f6d2-7c00-8f9b-e5c3f2d8a132Body
Responses
200
OK.
application/json
actionstring · enumOptionalPossible values:
Performed action on the contact:
- "created" if contact does not exist
- "updated" if contact exists
401
Returns unauthorized error message. Check your credentials.
application/json
403
Returns forbidden error message. Check your permissions.
application/json
422
Returns validation errors.
application/json
429
Rate limit exceeded for the current account.
application/json
500
Internal error. Retry later or contact support.
application/json
patch/api/contacts/{contact_identifier}
curl -X PATCH https://mailtrap.io/api/contacts/{contact_identifier} \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"contact": { "email": "new@example.com", "fields": {"first_name": "John"}}}'
{
"action": "updated",
"data": {
"id": "018dd5e3-f6d2-7c00-8f9b-e5c3f2d8a132",
"status": "subscribed",
"email": "john.smith@example.com",
"fields": {
"first_name": "John",
"last_name": "Smith"
},
"list_ids": [
1,
2,
3
],
"created_at": 1740659901189,
"updated_at": 1742903266889
}
}Last updated
Was this helpful?

