Contacts

Update contact

PUT
/api/contact

Updates a contact identified by _id in the body. Resolves pipeline stage / status pairs to keep them in sync, records pipeline transitions, logs a manual event with field-level diffs, and emits the contact_updated socket event. A phone number or email the update introduces (primary or in conflictingPhoneNumbers / conflictingEmails) that is not in the stored format after normalization, or is not a string, is rejected with 400 INVALID_CONTACT_METHOD and nothing is written; values already stored on the contact are not re-checked and are kept exactly as stored. null for phoneNumber or email clears the field, like []. Org-scoped unless caller is SUPERADMIN.

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X PUT "https://example.com/api/contact" \  -H "Content-Type: application/json" \  -d '{    "_id": "64f0a1b2c3d4e5f6a7b8c9d0",    "status": "Qualified",    "pipelineStage": "64f0a1b2c3d4e5f6a7b8c9d2",    "pipelineId": "64f0a1b2c3d4e5f6a7b8c9d1"  }'
{  "message": "Contact updated successfully",  "success": true,  "contact": {    "_id": "64f0a1b2c3d4e5f6a7b8c9d0",    "firstName": "Jane",    "lastName": "Doe"  }}