Skip to content
AlterEstate

Edit a contact

PATCHhttps://secure.alterestate.com/api/v1/contacts/edit/{uid}/

Updates fields on an existing contact. Send only the fields that change.


Authentication

Send Authorization: Token your_api_key_here. Account token. Keep it on your server.


Path parameters

uidstringrequired
Contact uid from List contacts or Retrieve a contact.Example: D9dEML2g39

Contact

FieldTypeDescription
full_namestringDisplay name. Example: Ana Martinez.
emailstringStored lowercase. Example: ana@example.com.
phonestringMain phone. Stored in E.164. Example: 8095550123.
descriptionstringNotes. Example: Visit confirmed for Saturday..
ctypenumberContact type id. Example: 37.
tagstringTag uid, or null to clear it. Example: TAG01HOT.
languagestringes_ES or en_US. Example: es_ES.
is_companybooleantrue when the contact is a company. Example: false.

Identity

FieldTypeDescription
ced_rncstringIdentity document. An agency that requires it rejects clearing a value that was already set. Example: 00100000000.
doc_typestringdni, passport, rnc, license or ssn. Example: dni.

Work

FieldTypeDescription
job_positionstringJob title. Example: Director.
job_placestringCompany or workplace. Example: Martinez Group.
addressstringFree-text address. Example: Naco, Santo Domingo.

Agents

FieldTypeDescription
relatedarrayNumeric user ids of the assigned agents. Replaces the list. These are ids, not uids. Example: [42].

Extra phones

FieldTypeDescription
phonesarrayExtra phones. Include id to update one that already exists. A new item is added when id is omitted. Example: [{"id":88,"phone":"8095550999","description":"3"}].

Custom fields

FieldTypeDescription
custom_fieldsobjectKeys you omit stay as they are. Send null to clear a key. Keys come from GET /api/v1/custom-fields/?app=contacts. Example: {"has_financing":true}.

Example request

PATCH
curl --request PATCH \
  --url 'https://secure.alterestate.com/api/v1/contacts/edit/D9dEML2g39/' \
  --header 'Authorization: Token your_api_key_here' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "phone": "8095550123",
  "description": "Visit confirmed for Saturday.",
  "custom_fields": {
    "has_financing": true
  }
}'

Example response

200 OK
{
  "uid": "D9dEML2g39",
  "full_name": "Ana Martinez",
  "email": "ana@example.com",
  "phone": "+18095550123",
  "description": "Visit confirmed for Saturday.",
  "custom_fields": {
    "original_source": "instagram",
    "has_financing": true
  }
}
400 Bad Request
{
  "error": 2,
  "message": "Este correo electrónico ya existe en tu Inmobiliaria."
}
403 Forbidden
{
  "error": "No tienes permiso para editar este contacto."
}
404 Not Found
{
  "detail": "Not found."
}

Partial updates

Send only the fields you want to change. created_by is ignored. The response is the updated contact, including custom_fields.


Duplicates on edit

When the agency does not allow duplicates, a phone, email or WhatsApp username that already belongs to another contact returns 400. error is 1 for phone, 2 for email and 3 for WhatsApp username. The message is in Spanish.


Who can edit

can_edit and is_owner on Retrieve a contact tell you whether this token can change it. Anyone else receives 403 with "No tienes permiso para editar este contacto." The contact stays with the user who registered it.


Status codes

StatusMeaning
200The request succeeded.
400A parameter or the body is invalid. The response names the field.
401The token is missing or invalid.
403The contact already exists, or this user cannot edit it.
404The contact does not exist, or this account cannot open it.
429Too many requests. Wait and retry.
500Server error while processing the request.

Frequently asked questions

Do I have to send every contact field?

No. PATCH updates only the fields you send. related replaces the assigned-agent list when you send it.

Can I change who registered the contact?

No. created_by is ignored on PATCH. The contact stays with the user who registered it.

Last updated . Questions? Emailengineering@alterestate.com.