Clients Endpoints
FreshSource: MainWP Clients API
The {id_or_email} parameter accepts either a numeric client ID or email address.
Client Records
| Method | Path | Description |
|---|---|---|
| GET | /clients | List clients (pagination + filtering) |
| GET | /clients/count | Client count |
| POST | /clients/add | Create client (requires name, client_email) |
| GET | /clients/{id_or_email} | Get single client |
| POST/PUT/PATCH | /clients/{id_or_email}/edit | Update client |
| DELETE | /clients/{id_or_email}/remove | Remove client |
| GET | /clients/{id_or_email}/sites | Associated sites |
| GET | /clients/{id_or_email}/sites/count | Site count |
| GET | /clients/{id_or_email}/costs | Associated costs |
| POST/PUT/PATCH | /clients/{id_or_email}/suspend | Suspend client |
| POST/PUT/PATCH | /clients/{id_or_email}/unsuspend | Reactivate client |
| POST | /clients/batch | Batch operations |
Custom Client Fields
| Method | Path | Description |
|---|---|---|
| GET | /clients/fields | List custom fields |
| POST | /clients/fields/add | Create field |
| PUT/PATCH | /clients/fields/{id_name}/edit | Modify field |
| DELETE | /clients/fields/{id_name}/delete | Remove field |
Example: Create Client
bash
curl -X POST \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "Acme Corp", "client_email": "contact@acme.com"}' \
"https://your-dashboard.com/wp-json/mainwp/v2/clients/add"