Methods
Update
UpdateWithContext
Request Parameters
UpdateContactRequest
string
required
The contact ID to update. Either
id or email is required.string
The contact’s new email address, or use this to identify the contact instead of
idstring
Deprecated: Optional - Omit for global contacts. Use Segments API for contact organization.
string
The contact’s first name
string
The contact’s last name
bool
Whether the contact is unsubscribed. Use
SetUnsubscribed() method to set this value (see examples).map[string]any
Custom key-value pairs for global contacts (when
audience_id is omitted).Important: Currently, the Resend API only accepts string values for properties. Non-string values will be rejected.Example: map[string]any{"tier": "premium", "age": "30"}SetUnsubscribed Method
false, since the default zero value for bool is false with omitempty.
Response
UpdateContactResponse
Contact
The updated contact object containing:
id(string): Contact identifieremail(string): Email addressobject(string): Object typefirst_name(string): First namelast_name(string): Last namecreated_at(string): Creation timestampunsubscribed(bool): Unsubscribe statusproperties(map[string]any): Custom properties
struct{}
Error information if the update failed
Examples
Update Contact Name
Update Using Email Address
Update Unsubscribe Status
Update Contact Properties
Complete Update with Context
Notes
- Either
IdorEmailmust be provided to identify the contact - Use
SetUnsubscribed()method to set the unsubscribed status - Properties are only supported for global contacts (without
audience_id) - The API currently only accepts string values for properties