Skip to content

Delete City

Delete a city (soft delete). Requires authentication.

Endpoint

DELETE /v1/accounts/city/?id={city_id}

Authentication

Required

Query Parameters

Parameter Type Required Description
id integer Yes City ID

Response

Success (200 OK)

{
  "id": 1,
  "name": "Baku",
  "country_id": 1,
  "country": {
    "id": 1,
    "name": "Azerbaijan",
    "created": "2025-01-15T10:30:00Z"
  },
  "created": "2025-01-15T10:30:00Z"
}

Error Responses

Not Found (404)

{
  "error": "City not found"
}

Missing ID Parameter (400)

{
  "message": "Param not send!"
}

Unauthorized (401)

{
  "error": "Missing token on header!"
}

Internal Server Error (500)

{
  "error": "Failed to delete city"
}

Example Request

curl -X DELETE "https://api.luxmart.site/v1/accounts/city/?id=1" \
  -H "Authorization: Token your_access_token"

Notes

  • This is a soft delete operation - the city is marked as deleted but not removed from the database
  • Deleted cities will not appear in GET requests
  • The updated timestamp is automatically set by the system
  • Returns 404 if city is not found or has already been deleted