curl --request PATCH \
--url https://api.example.com/pois/{id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"address": "<string>",
"category": "<string>",
"open_time": {},
"close_time": {},
"average_stay_minutes": 123
}
'{
"message": "POI ID 1 updated succesfully"
}
Update an existing point of interest
curl --request PATCH \
--url https://api.example.com/pois/{id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"address": "<string>",
"category": "<string>",
"open_time": {},
"close_time": {},
"average_stay_minutes": 123
}
'{
"message": "POI ID 1 updated succesfully"
}
PATCH /pois/{id}
curl -X PATCH https://api.maytravel.com/pois/1 \
-H "Content-Type: application/json" \
-d '{
"open_time": "08:00:00",
"close_time": "22:00:00",
"average_stay_minutes": 150
}'
const response = await fetch('https://api.maytravel.com/pois/1', {
method: 'PATCH',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
open_time: '08:00:00',
close_time: '22:00:00',
average_stay_minutes: 150
})
});
const result = await response.json();
import requests
data = {
'open_time': '08:00:00',
'close_time': '22:00:00',
'average_stay_minutes': 150
}
response = requests.patch('https://api.maytravel.com/pois/1', json=data)
result = response.json()
{
"message": "POI ID 1 updated succesfully"
}
{
"message": "Sin datos para actualizar"
}
{
"error": "POI not found"
}
backend/src/components/poi_catalog/controller/PoisController.mjs:36
The endpoint dynamically constructs an SQL UPDATE statement based on the provided fields. Only the fields included in the request body will be updated in the database.
lat and lng fields together to maintain data integrity in the PostGIS Point geometry.