Update a client
PUT /property-v1/customers
Changes the details of the record. It is the reason the record exists: changing a phone number is this call and nothing else, instead of re-uploading the inventory.
curl -X PUT https://property-api.mapaprop.com/property-v1/customers \
-H "Authorization: Bearer $TOKEN" \
-H "x-client-ref: cliente-42" \
-H "Content-Type: application/json" \
-d '{ "name": "Inmobiliaria Modelo",
"email": "contacto@inmobiliaria-modelo.test",
"phone1": "2239999999" }'
It accepts the same fields as the POST and returns
200 with the updated record.
The PUT declares how the whole record ends up, it does not merge field by field: whatever you do
not send ends up empty. If you want to change only the phone number, send the rest of the details too.
That is why name, email and phone1 are required here too: a PUT that omitted them would leave
the client without the contact details published on their listings. It responds 400 with the field
in field.
The customerId is not touched. It is the only thing that makes changing a phone number not force
you to recreate anything.
Branches are updated here too
branches works the same as in the POST: you declare the
whole set and it is stored. And if you are a Mapaprop customer and you declare a new branch with
its data and no mapapropBranchId, we create it in your account and return its id in the response:
{
"branches": { "created": [ { "branchRef": "sur", "mapapropBranchId": 781 } ], "failed": [] },
"customer": { "…" }
}
Repeating the PUT does not duplicate anything, and you do not have to send the
mapapropBranchId. The link between your branchRef and the branch's id is kept by us, and
we preserve it even when your body does not mention it. So you can repeat exactly the same PUT:
the ones already created are not created again. If one failed, you fix that one and repeat.
What this PUT does not do is change the data of a branch that is already in Mapaprop: that
data is read from your account, which is where you edit it. What you declare here for a linked
branch is only the link.
The change reaches NEW properties
Each property stores the contact it was created with: it is the record of how it was published, so it is not rewritten — not even by sending the property again.
In other words: the record saves you from repeating the block on every upload, and what you already uploaded keeps its details.
If you need a contact change to reach the inventory you already uploaded, write to dev@mapaprop.com: there is no way to do it via the API today.
A deactivated client is not updated
If the client is deactivated, the PUT responds 404 with
error: customer_deleted. It is reactivated first with the
POST — which also applies the details you send it — and then
updated if needed.
It is on purpose: a PUT that updated it would leave a deactivated record with new details, which does
not mean anything.
Response codes
| Code | What happened | What to do |
|---|---|---|
200 | The updated record | — |
400 | name, email or phone1 is missing; country is not a positive integer; branch is not an object; or a text exceeds 256 characters | The field comes in field |
401 | Token missing or invalid | — |
403 | Your token does not have the property-api-update scope | Write to us to enable it |
404 | It does not exist, or it is deactivated (error: customer_deleted) | See GET |