Edit a contact
https://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
| Field | Type | Description |
|---|---|---|
full_name | string | Display name. Example: Ana Martinez. |
email | string | Stored lowercase. Example: ana@example.com. |
phone | string | Main phone. Stored in E.164. Example: 8095550123. |
description | string | Notes. Example: Visit confirmed for Saturday.. |
ctype | number | Contact type id. Example: 37. |
tag | string | Tag uid, or null to clear it. Example: TAG01HOT. |
language | string | es_ES or en_US. Example: es_ES. |
is_company | boolean | true when the contact is a company. Example: false. |
Identity
| Field | Type | Description |
|---|---|---|
ced_rnc | string | Identity document. An agency that requires it rejects clearing a value that was already set. Example: 00100000000. |
doc_type | string | dni, passport, rnc, license or ssn. Example: dni. |
Work
| Field | Type | Description |
|---|---|---|
job_position | string | Job title. Example: Director. |
job_place | string | Company or workplace. Example: Martinez Group. |
address | string | Free-text address. Example: Naco, Santo Domingo. |
Agents
| Field | Type | Description |
|---|---|---|
related | array | Numeric user ids of the assigned agents. Replaces the list. These are ids, not uids. Example: [42]. |
Extra phones
| Field | Type | Description |
|---|---|---|
phones | array | Extra 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
| Field | Type | Description |
|---|---|---|
custom_fields | object | Keys 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
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
{
"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
}
}{
"error": 2,
"message": "Este correo electrónico ya existe en tu Inmobiliaria."
}{
"error": "No tienes permiso para editar este contacto."
}{
"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
| Status | Meaning |
|---|---|
| 200 | The request succeeded. |
| 400 | A parameter or the body is invalid. The response names the field. |
| 401 | The token is missing or invalid. |
| 403 | The contact already exists, or this user cannot edit it. |
| 404 | The contact does not exist, or this account cannot open it. |
| 429 | Too many requests. Wait and retry. |
| 500 | Server 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.