Skip to main content

Remove Related Products from News

This API lets you detach one or more related products from a news article. Only the link between the product and the article is removed — the product itself is not deleted from the system.


Endpoint

🔗Endpoint Staging

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

🔗Endpoint Production

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

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
Content-Typeapplication/jsonBắt buộc
No need to send shopId

The system automatically determines your shop (shopId) from your API key and assigns it to the request. So you don't need to send shopId in the body.

Path Parameters

ParameterTypeRequiredDescription
idstringBắt buộcID of the news article to detach products from (24-character hex ObjectId)

Request Body

DELETE request with a body

This is a DELETE request with a JSON body — unlike the convention of some HTTP libraries. For example, with axios, the body of a DELETE must be placed in config.data: axios.delete(url, { headers, data: { newsIds: [...] } }). With fetch or curl, send the body just like a regular POST request.

Parameters

FieldTypeRequiredDescription
newsIdsstring[]Bắt buộcList of product IDs to detach from the article (see note below)
The newsIds field actually holds PRODUCT IDs

Despite its name, newsIds accepts product IDs, not news article IDs — same as the Add Related Products to News API.

Removing an unattached product is safe

If a product ID isn't in the article's related list, the system ignores it and still returns success (idempotent). You can call this API repeatedly without causing an error.

{
"newsIds": [
"68c93dba802d36826bc45d01",
"68c93dba802d36826bc45d02"
]
}

Response

Success returns 200. The response only contains the success flag — no article data is included. To see the remaining products, call Get News List and check the article's items field.

{
"success": true
}

Common Errors

CodeCause
400Missing newsIds, or newsIds is not an array of strings
404No news article found with the given id
401Missing x-api-key header, wrong miniai-partner prefix, or invalid API key
429Rate limit exceeded (see the Rate Limit section below)
500id or an element in newsIds is not a valid ObjectId format, or a system error occurred
{
"statusCode": 400,
"error": "Bad Request",
"message": "Validation failed",
"validation": {
"body": {
"source": "body",
"keys": ["newsIds"],
"message": "\"newsIds\" is required"
}
}
}

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