Skip to main content

Delete News

This API lets you delete a news article from the system by its id.

⚠️Permanent deletion — cannot be undone

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

🔗Endpoint Staging

http DELETE https://staging-manage.api.miniai.vn/api/external/news/{id}

🔗Endpoint Production

http DELETE https://manage-api.miniap.vn/api/external/news/{id}

A note on the path

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:

HeaderValueRequired
x-api-keyminiai-partner <YOUR_API_KEY>Bắt buộc

Path Parameters

ParameterTypeRequiredDescription
idstringBắt buộcID 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 -X DELETE 'https://staging-manage.api.miniai.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.

{
"success": true
}
Before you delete
  • 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 status to inactive.

Common Errors

CodeCause
404No news article found with the given id (or it was already deleted)
401Missing x-api-key header, wrong miniai-partner prefix, or invalid API key
429Rate limit exceeded (see the Rate Limit section below)
500id is not a valid ObjectId format (24-character hex), or a system error occurred
{
"error": "Resource not found",
"message": "không tìm thấy tin tức"
}

Rate Limit

100 requests / minute

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: inactive instead of deleting it