Get News List
This API lets you retrieve the list of news articles created in your shop, with support for pagination and search by title.
Endpoint
http GET https://staging-manage.api.miniai.vn/api/external/news
http GET https://manage-api.miniap.vn/api/external/news
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 |
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 query. If you do send it, that value will be overwritten
with the shop matching your API key — the result always contains only your shop's news.
Query Parameters
All parameters are optional.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
page | number | Tùy chọn | 1 | Page to fetch, integer ≥ 1. |
limit | number | Tùy chọn | 10 | Articles per page, from 1 up to a maximum of 50. |
search | string | Tùy chọn | — | Search by title — partial, case-insensitive match. |
sortBy | string | Tùy chọn | — | Accepted but ignored (see note below). |
sortType | string | Tùy chọn | — | asc or desc. Accepted but ignored. |
filters | string | Tùy chọn | — | Accepted but ignored. |
The list is always sorted by creation time, newest first (createdAt descending).
The sortBy, sortType, and filters parameters are currently accepted for compatibility but
have no effect on the result.
This API's query does not accept categoryId. Sending it returns a 400 error
(e.g. "categoryId" is not allowed).
Example Request
- cURL (Staging)
- cURL (Production)
- Full URL
curl -X GET 'https://staging-manage.api.miniai.vn/api/external/news?page=1&limit=10&search=khuy%E1%BA%BFn%20m%C3%A3i' \
-H 'x-api-key: miniai-partner <YOUR_API_KEY>'
curl -X GET 'https://manage-api.miniap.vn/api/external/news?page=1&limit=10&search=khuy%E1%BA%BFn%20m%C3%A3i' \
-H 'x-api-key: miniai-partner <YOUR_API_KEY>'
GET /api/external/news?page=1&limit=10&search=khuyến mãi
Host: staging-manage.api.miniai.vn
x-api-key: miniai-partner <YOUR_API_KEY>
Response
Success returns 200. The article list is in data.news, pagination info is in data.meta.
- Response
{
"success": true,
"data": {
"news": [
{
"_id": "68c93dba802d36826bc45c9c",
"type": "news",
"title": "October Promotion",
"slug": "october-promotion",
"shortContent": "50% off everything from 10/01 to 10/31.",
"content": "<p>50% off <strong>everything</strong> from 10/01 to 10/31.</p>",
"status": "active",
"shopId": "64204a17a5a97a86f12e1f0a",
"images": [
"https://dmcl0k8mc5oht.cloudfront.net/64204a17a5a97a86f12e1f0a/e888246f-2647-42f1-9d89-53eacdb7bf64.webp"
],
"cta": [
{
"name": "Buy now",
"url": "https://zalo.me/s/1234567890/products"
}
],
"itemIds": [
"68c93dba802d36826bc45d01"
],
"items": [
{
"_id": "68c93dba802d36826bc45d01",
"name": "Product name",
"price": 20000,
"images": [
"https://dmcl0k8mc5oht.cloudfront.net/64204a17a5a97a86f12e1f0a/e888246f-2647-42f1-9d89-53eacdb7bf64.webp"
],
"slug": "product-name",
"id": "68c93dba802d36826bc45d01"
}
],
"createdAt": "2025-09-16T10:36:42.809Z",
"updatedAt": "2025-09-16T10:36:42.809Z",
"__v": 0,
"id": "68c93dba802d36826bc45c9c"
}
],
"meta": {
"page": 1,
"limit": 10,
"total": 1
}
}
}
Fields in data.news[]
| Field | Type | Description |
|---|---|---|
id / _id | string | News article ID — used for update, delete, and product-linking APIs |
type | string | Always news |
title | string | Article title |
slug | string | Friendly URL path, unique per shop |
shortContent | string | Auto-generated summary from the content |
content | string | Full HTML content |
status | string | active or inactive |
shopId | string | Shop ID |
images | string[] | List of image URLs |
cta | object[] | List of call-to-action buttons (name, url) |
itemIds | string[] | List of related product IDs |
items | object[] | Related products with details: name, price, images, slug |
createdAt | string | Creation time (ISO 8601) |
updatedAt | string | Last update time (ISO 8601) |
Fields in data.meta
| Field | Type | Description |
|---|---|---|
page | number | Current page |
limit | number | Articles per page |
total | number | Total number of articles matching the query (across all pages) |
Total pages = Math.ceil(meta.total / meta.limit). Loop page from 1 to this value to fetch all news.
Common Errors
| Code | Cause |
|---|---|
400 | Wrong parameter type (page/limit not a number), limit exceeds 50, sortType not asc/desc, or a disallowed parameter was sent (e.g. categoryId) |
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 | System error |
- 400 Error - Validation
- 429 Error - Rate Limited
{
"statusCode": 400,
"error": "Bad Request",
"message": "Validation failed",
"validation": {
"query": {
"source": "query",
"keys": ["limit"],
"message": "\"limit\" must be less than or equal to 50"
}
}
}
{
"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
With the id of each article in the list, you can:
- Create News — create a new article
- Update News — edit content,
slug,metaDescription, orstatus - Delete News — delete the article from the system
- Add Related Products to News — attach products to the article