Delete News
This API lets you delete a news article from the system by its id.
This is a hard delete: the record is permanently removed from the database
and cannot be recovered. Make sure the id is correct before calling this API.
Endpoint
http DELETE https://staging-manage.api.miniai.vn/api/external/news/{id}
http DELETE https://manage-api.miniap.vn/api/external/news/{id}
The news API sits directly under /api/external/news, without the /v1 prefix used by the product and order APIs.
Authentication
Every request must include your API key in the header:
| Header | Value | Required |
|---|---|---|
x-api-key | miniai-partner <YOUR_API_KEY> | Bắt buộc |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Bắt buộc | ID of the news article to delete (24-character hex ObjectId, e.g. 68c93dba802d36826bc45c9c) |
This API requires no request body. You can get the id from the results of
Get News List or from the response when Creating News.
Example Request
- cURL (Staging)
- cURL (Production)
curl -X DELETE 'https://staging-manage.api.miniai.vn/api/external/news/68c93dba802d36826bc45c9c' \
-H 'x-api-key: miniai-partner <YOUR_API_KEY>'
curl -X DELETE 'https://manage-api.miniap.vn/api/external/news/68c93dba802d36826bc45c9c' \
-H 'x-api-key: miniai-partner <YOUR_API_KEY>'
Response
Success returns 200. The response only contains the success flag — no data about the deleted article is included.
- Response
{
"success": true
}
- If you need to keep the content, call Get News List to back up the article before deleting.
- If you only want to hide the article from the Mini App instead of deleting it,
use Update News and set
statustoinactive.
Common Errors
| Code | Cause |
|---|---|
404 | No news article found with the given id (or it was already deleted) |
401 | Missing x-api-key header, wrong miniai-partner prefix, or invalid API key |
429 | Rate limit exceeded (see the Rate Limit section below) |
500 | id is not a valid ObjectId format (24-character hex), or a system error occurred |
- 404 Error - Not Found
- 429 Error - Rate Limited
{
"error": "Resource not found",
"message": "không tìm thấy tin tức"
}
{
"error": "Too many requests, limit to 100 requests per minute"
}
Rate Limit
Each shop can make at most 100 requests per minute across the entire External API.
Exceeding this limit returns a 429 status.
Next Steps
- Get News List — verify the article has been removed from the list
- Create News — create a new article
- Update News — hide an article with
status: inactiveinstead of deleting it