Skip to main content
DELETE
/
pois
/
{id}
Delete POI
curl --request DELETE \
  --url https://api.example.com/pois/{id}
{
  "message": "POI 5 deleted sucessfully"
}

Endpoint

DELETE /pois/{id}

Description

Deletes a point of interest from the MayTravel catalog. This operation permanently removes the POI and all associated data.

Request

Path Parameters

id
integer
required
Unique identifier of the POI to delete

Example Request

cURL
curl -X DELETE https://api.maytravel.com/pois/5
JavaScript
const response = await fetch('https://api.maytravel.com/pois/5', {
  method: 'DELETE',
  headers: {
    'Content-Type': 'application/json'
  }
});

const result = await response.json();
Python
import requests

response = requests.delete('https://api.maytravel.com/pois/5')
result = response.json()

Response

Success Response

message
string
Confirmation message indicating successful deletion with the POI ID
{
  "message": "POI 5 deleted sucessfully"
}

Error Response

{
  "error": "POI not found"
}

Implementation Details

Source: backend/src/components/poi_catalog/controller/PoisController.mjs:25 The endpoint removes the POI record from the poi_catalog table based on the provided ID.
This operation is permanent and cannot be undone. Make sure you have the correct POI ID before deleting.
If the POI is referenced by trips or stops in the system, consider the impact on related data before deletion. You may need to implement cascade delete logic or handle orphaned references.

Build docs developers (and LLMs) love