Posts Endpoints
FreshSource: MainWP Posts API
Endpoints
| Method | Path | Description | Key Parameters |
|---|---|---|---|
| GET | /posts | List posts | search, status, date_from, date_to, sites, post_type |
| GET | /posts/{id_or_domain}/{post_id} | Get single post | - |
| PUT/PATCH | /posts/{id_or_domain}/{post_id}/update-status | Change status | status |
| PUT/PATCH | /posts/{id_or_domain}/{post_id}/edit | Edit content | title, content, status, slug |
| POST | /posts/{id_or_domain}/create | Create post | title, content, status (required) |
| DELETE | /posts/{id_or_domain}/{post_id}/delete | Delete post | - |
Example: Create Post
bash
curl -X POST \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"title": "New Post", "content": "Hello world", "status": "publish"}' \
"https://your-dashboard.com/wp-json/mainwp/v2/posts/1/create"