Endpoint #
DELETE /wp-json/rtcl/v1/my/listings
Description #
Deletes a listing owned by the authenticated user.
Authentication & Permissions #
This endpoint requires BOTH:
Request Headers #
| Header | Required | Description |
|---|---|---|
X-API-KEY | ✅ Yes | API key (checked in permission_check) |
Authorization | ✅ Yes | Bearer {JWT_TOKEN} |
Request Parameters #
| Name | Type | Required | Description |
|---|---|---|---|
| listing_id | integer | ✅ Yes | ID of the listing to delete |
cURL Example #
curl -X DELETE "https://example.com/wp-json/rtcl/v1/my/listings?listing_id=401" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
Success Response #
Listing Deleted Successfully #
Status: 200 OK
401
Returns the deleted
listing_idon success.
Error Responses #
❌ Not Logged In #
Status: 403 Forbidden
{
"code": "FORBIDDEN",
"message": "You are not logged in.",
"data": {
"status": 403
}
}
❌ Listing Not Found / Invalid ID #
Status: 400 Bad Request
{
"status": "error",
"error": "BADREQUEST",
"code": "400",
"error_message": "Listing not found."
}
❌ Permission Denied (Not Owner) #
Status: 403 Forbidden
{
"status": "error",
"error": "FORBIDDEN",
"code": "403",
"error_message": "You are not permitted to delete."
}
❌ Unauthorized / Invalid Token #
Status: 401 Unauthorized
{
"code": "DENIED_REST_API",
"message": "Denied api call",
"data": {
"status": 401
}
}
Notes #
- Deletes listing permanently (skip trash enabled by default)
- Automatically deletes all listing attachments
- Triggers
rtcl_before_delete_listingaction hook