# NewsPro API Overview ## Authentication Include your API token in every request: ``` POST https://yoursite.newspro.io/functions/api Content-Type: application/json Authorization: Bearer YOUR_SECRET_KEY ``` Find your token in: **Dashboard → Settings → API** The API must be enabled in your dashboard settings. ## Request Format Every request is a JSON POST body with at minimum `resource` and `action`: ```json { "resource": "article", "action": "get" } ``` | Field | Required | Description | |---|---|---| | `resource` | Yes | One of: `article`, `category`, `page`, `breaking`, `user`, `media` | | `action` | Yes | One of: `get`, `add`, `edit`, `delete` (media has additional actions) | | `id` | No | Operate on a single record by ID | | `fields` | No | Array of field names to return. Omit to return all fields | | `filters` | No | Object of filter conditions (varies per resource) | | `limit` | No | Number of results (default: 50, max: 100) | | `offset` | No | Pagination offset (default: 0) | | `order_by` | No | e.g. `"created_at DESC"` or `"title ASC"` | ## Response Format Success: ```json { "status": "success", "data": { ... } } ``` Error: ```json { "status": "error", "message": "Description of the error" } ``` ## Available Resources - [Articles](https://newspro.io/docs/api/articles.md) - [Categories](https://newspro.io/docs/api/categories.md) - [Pages](https://newspro.io/docs/api/pages.md) - [Breaking News](https://newspro.io/docs/api/breaking.md) - [Users](https://newspro.io/docs/api/users.md) - [Media](https://newspro.io/docs/api/media.md)