Skip to main content
PUT
/
api
/
v1
/
contact-lists
/
{listId}
/
contacts
/
{id}
Update Contact
curl --request PUT \
  --url https://api.example.com/api/v1/contact-lists/{listId}/contacts/{id} \
  --header 'Content-Type: application/json' \
  --data '
{
  "firstName": "<string>",
  "lastName": "<string>",
  "phoneNumber": "<string>",
  "customFields": {},
  "consentType": "<string>",
  "consentSource": "<string>",
  "consentTimestamp": "<string>",
  "consentIpAddress": "<string>"
}
'

Documentation Index

Fetch the complete documentation index at: https://docs.mailbreeze.com/llms.txt

Use this file to discover all available pages before exploring further.

Update properties of an existing contact. The email address cannot be changed.

Path Parameters

listId
string
required
The unique list ID (e.g., lst_abc123).
id
string
required
The unique contact ID (e.g., cnt_abc123).

Request Body

firstName
string
Updated first name.
lastName
string
Updated last name.
phoneNumber
string
Updated phone number.
customFields
object
Updated custom field values. Merges with existing fields (use null to clear a field).
Type of consent obtained (NDPR compliance): explicit, implicit, or legitimate_interest.
Where consent was collected (e.g., signup_form, import, api).
ISO 8601 timestamp when consent was given.
IP address from which consent was given.

Examples

import { MailBreeze } from "mailbreeze";

const mailbreeze = new MailBreeze({ apiKey: "sk_live_xxx" });
const contacts = mailbreeze.contacts("lst_abc123");

// Update basic info
const contact = await contacts.update("cnt_abc123", {
  firstName: "Jonathan",
  lastName: "Doe-Smith",
});

// Update custom fields
const contact = await contacts.update("cnt_abc123", {
  customFields: {
    plan: "enterprise",
    company: "New Company Inc",
  },
});

console.log(contact.updatedAt); // "2024-01-20T14:15:00Z"

Response

Returns the updated contact object.
Example Response
{
  "success": true,
  "data": {
    "id": "cnt_abc123",
    "email": "john@example.com",
    "firstName": "Jonathan",
    "lastName": "Doe-Smith",
    "phoneNumber": "+1-555-0123",
    "customFields": {
      "company": "New Company Inc",
      "plan": "enterprise"
    },
    "status": "active",
    "source": "api",
    "createdAt": "2024-01-15T10:30:00Z",
    "updatedAt": "2024-01-20T14:15:00Z"
  },
  "meta": {
    "timestamp": "2024-01-20T14:15:00.000Z",
    "requestId": "req_abc123",
    "path": "/api/v1/contact-lists/lst_abc123/contacts/cnt_abc123"
  }
}

Errors

CodeHTTP StatusDescription
CONTACT_NOT_FOUND404Contact with this ID doesn’t exist
LIST_NOT_FOUND404List with this ID doesn’t exist
INVALID_CUSTOM_FIELD400Custom field key or value is invalid
VALIDATION_ERROR400Required custom field missing or invalid
Email addresses cannot be changed. To update an email, delete the contact and create a new one.