Endpoint #
PUT /wp-json/rtcl/v1/my/manage/listings/change-status
Description #
Allows an admin or manager to change the status of any listing. Returns the full listing data after update.
Authentication #
π Required
- JWT Authentication
- User must have administrator or rtcl_manager capability.
Request Headers #
| Header | Required | Description |
|---|---|---|
Authorization | β | Bearer <JWT_TOKEN> |
X-API-KEY | β | API key from RTCL settings |
Content-Type | β | application/json |
Request Body Parameters #
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | β Yes | Listing ID to update |
status | string | β Yes | New status. Allowed values: publish, pending, rtcl-reviewed, rtcl-expired, draft |
Example Request #
{
"id": 401,
"status": "publish"
}
cURL Example #
curl -X PUT https://yourwebsite.com/wp-json/rtcl/v1/my/manage/listings/change-status \
-H "Content-Type: application/json" \
-H "X-API-KEY: your_api_key_here" \
-H "Authorization: Bearer <JWT_TOKEN>" \
-d '{
"id": 401,
"status": "publish"
}'
Authorization Rules #
- User must be logged in
- User must be
administratororrtcl_manager idmust correspond to an existing listingstatusmust be one of the valid statuses
Success Response #
Status: 200 OK
Returns full single listing data, including:
- Listing info (
title,description,price,categories) - Author info (
first_name,last_name,isAdmin,email,phone,membership) - Store info
- Contact info
- Reviews and ratings
Example Response #
{
"listing_id": 123,
"author_id": 1,
"author": {
"first_name": "John",
"last_name": "Doe",
"description": "Demo author description",
"id": 1,
"isAdmin": true,
"email": "demo@example.com",
"username": "john_doe",
"phone": "+1234567890",
"whatsapp_number": "+1234567890",
"website": "https://example.com",
"locations": ["Demo City"],
"zipcode": "10001",
"address": "123 Demo Street",
"latitude": "40.7128",
"longitude": "-74.0060",
"pp_thumb_url": "https://gravatar.com/avatar/demo?s=80&d=mm",
"membership": {
"is_expired": false,
"expired_at": "2026-12-31 23:59:59",
"remaining_ads": "5",
"posted_ads": "2",
"promotions": {
"featured": { "ads": 2, "validate": 10 },
"_top": { "ads": 1, "validate": 5 },
"_bump_up": { "ads": 3, "validate": 7 }
},
"free_ads": 0
},
"store": true
},
"title": "Demo Listing",
"pricing_type": "price",
"raw_price": "500",
"raw_max_price": "",
"price": "500",
"max_price": "0",
"price_type": "fixed",
"price_units": [],
"price_unit": "",
"categories": [
{
"term_id": 10,
"name": "Demo Category",
"slug": "demo-category",
"term_group": 0,
"term_taxonomy_id": 10,
"taxonomy": "rtcl_category",
"description": "Category description",
"parent": 0,
"count": 0,
"filter": "raw"
}
],
"tags": [],
"ad_type": "sell",
"status": "publish",
"images": [],
"date_created": {
"date": "2026-01-01 10:00:00.000000",
"timezone_type": 1,
"timezone": "+00:00"
},
"created_at": "2026-01-01 10:00:00",
"view_count": 0,
"promotions": [],
"badges": ["is-new", "is-sell"],
"contact": {
"locations": ["Demo City"],
"latitude": "40.7128",
"longitude": "-74.0060",
"hide_map": false,
"zipcode": "10001",
"address": "123 Demo Street",
"phone": "+1234567890",
"whatsapp_number": "+1234567890",
"email": "contact@example.com",
"website": "https://example.com",
"geo_address": ""
},
"store": {
"id": 50,
"title": "Demo Store",
"slug": "demo-store",
"slogan": "Demo slogan",
"email": "store@example.com",
"phone": "+1234567890",
"whatsapp": "+1234567890",
"website": "https://store.example.com",
"address": "456 Store Street",
"description": "This is demo store details",
"logo_url": "https://example.com/logo.jpg",
"banner_url": "https://example.com/banner.jpg"
},
"url": "https://example.com/listing/123",
"description": "This is a demo listing description",
"is_favourite": false,
"video_urls": [],
"fb_custom_fields": [
{
"ai": false,
"id": "",
"name": "demo_text_field",
"uuid": "demo_text_field",
"label": "Demo Text Input",
"order": "0",
"logics": "",
"element": "text",
"filterable": true,
"validation": { "required": { "value": false, "message": "This field is required" } },
"placeholder": "Enter text",
"single_view": true,
"archive_view": false
}
],
"form_data": {
"_rtcl_whatsapp_number": "+1234567890",
"text_demo_field": "",
"description_demo": "This is a demo listing description",
"category_demo": [
{ "term_id": 10, "name": "Demo Category", "slug": "demo-category" }
],
"pricing": { "pricing_type": "price", "price_type": "fixed", "price": "500", "price_unit": "" }
},
"related": [],
"review": { "rating": { "average": "0", "count": 0 } }
}
Error Responses #
β User Not Logged In #
Status: 403 Forbidden
{
"code": "FORBIDDEN",
"message": "You are not logged in.",
"data": {
"status": 403
}
}
β Unauthorized User #
Status: 403 Forbidden
{
"code": "FORBIDDEN",
"message": "You are not permitted to update listing status.",
"data": {
"status": 403
}
}
β Invalid Listing ID #
Status: 400 Bad Request
{
"code": "BADREQUEST",
"message": "Listing not found.",
"data": {
"status": 400
}
}
β Invalid Status #
Status: 403 Forbidden
{
"code": "BADREQUEST",
"message": "Invalid listing status.",
"data": {
"status": 403
}
}
β No Status Change #
Status: 400 Bad Request
{
"code": "BADREQUEST",
"message": "Status no change",
"data": {
"status": 400
}
}
β Error Updating Listing #
Status: 400 Bad Request
{
"code": "BADREQUEST",
"message": "Error while updating status",
"data": {
"status": 400
}
}