Methods
Update
UpdateWithContext
Request Parameters
UpdateContactRequest
The contact ID to update. Either
id or email is required.The contact’s new email address, or use this to identify the contact instead of
idDeprecated: Optional - Omit for global contacts. Use Segments API for contact organization.
The contact’s first name
The contact’s last name
Whether the contact is unsubscribed. Use
SetUnsubscribed() method to set this value (see examples).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
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
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