REST API
API Reference
Full documentation for the NewsPro REST API. Manage content, media, and users programmatically.
Categories
Available Fields
| Field | Type | Description |
|---|---|---|
id | int | Category ID |
title | string | Category name |
slug | string | URL slug (auto-generated if empty) |
description | string | Short description of the category |
color | string | Hex color for the category label/badge (e.g. #FF5733) |
parent_id | int | Parent category ID (0 = top-level) |
category_top | int | 1 = show in top navigation bar |
top_menu_position | int | Sort order in top navigation (lower = first) |
status | int | 1 = Private, 2 = Registered only, 3 = Public |
total_views | int | View count |
created_at | datetime | Creation date |
Get Categories
{"resource":"category","action":"get","filters":{"parent_id":0,"status":3},"fields":["id","title","slug","color","category_top"],"limit":50,"order_by":"top_menu_position ASC"}
Get Single Category
{"resource":"category","action":"get","id":2}
Add Category
{"resource":"category","action":"add","title":"Technology","slug":"technology","color":"#FF5733","description":"Tech news and updates","category_top":1,"top_menu_position":5,"user_id":1,"parent_id":0,"approved":1,"status":3}
Edit Category
All fields are optional except id.
{"resource":"category","action":"edit","id":116,"title":"Tech & Science","color":"#00FF00","category_top":1,"top_menu_position":2,"status":3}
Delete Category
Deleting a category moves all its articles to the default category and detaches any sub-categories.
{"resource":"category","action":"delete","id":121}
Copied to clipboard!