Skip to main content
Manage client records in your MainWP Dashboard.

What You’ll Learn

  • Listing and filtering clients
  • Creating and updating client records
  • Associating sites with clients

GET /clients

Returns all clients with pagination support. Method: GET (readonly)
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://your-dashboard.com/wp-json/mainwp/v2/clients"

Parameters

NameTypeRequiredDefaultDescription
pageintegerNo1Page number
per_pageintegerNo10Items per page
searchstringNoSearch in client name
includestringNoComma-separated client IDs to include
excludestringNoComma-separated client IDs to exclude
statusstringNoFilter by status

Response

[
  {
    "id": 1,
    "name": "Acme Corp",
    "email": "[email protected]",
    "phone": "+1-555-0100",
    "address": "123 Main St",
    "city": "New York",
    "state": "NY",
    "country": "USA",
    "sites_count": 5,
    "created_at": "2024-01-01T00:00:00"
  }
]

GET /clients/

Returns detailed information about a specific client. Method: GET (readonly)
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://your-dashboard.com/wp-json/mainwp/v2/clients/1"

Parameters

NameTypeRequiredDescription
clientinteger/stringYesClient ID or email address

Response

{
  "id": 1,
  "name": "Acme Corp",
  "email": "[email protected]",
  "phone": "+1-555-0100",
  "address": "123 Main St",
  "city": "New York",
  "state": "NY",
  "zip": "10001",
  "country": "USA",
  "notes": "Enterprise client",
  "sites": [
    {"id": 1, "url": "https://acme.com", "name": "Main Site"},
    {"id": 2, "url": "https://blog.acme.com", "name": "Blog"}
  ],
  "sites_count": 2,
  "created_at": "2024-01-01T00:00:00"
}

POST /clients/add

Creates a new client record. Method: POST
curl -X POST \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "New Client", "email": "[email protected]"}' \
  "https://your-dashboard.com/wp-json/mainwp/v2/clients/add"

Parameters

NameTypeRequiredDescription
namestringYesClient name
emailstringYesClient email address
phonestringNoPhone number
addressstringNoStreet address
citystringNoCity
statestringNoState/Province
zipstringNoZIP/Postal code
countrystringNoCountry
notesstringNoInternal notes
selected_sitesstringNoComma-separated site IDs to associate

Response

{
  "id": 5,
  "name": "New Client",
  "email": "[email protected]",
  "message": "Client created successfully"
}

PUT /clients//edit

Updates an existing client’s information. Method: PUT
curl -X PUT \
  -H "Authorization: Bearer YOUR_API_KEY" \
  "https://your-dashboard.com/wp-json/mainwp/v2/clients/1/edit?name=Updated%20Name"

Parameters

NameTypeRequiredDescription
clientinteger/stringYesClient ID or email
namestringNoUpdated name
emailstringNoUpdated email
phonestringNoUpdated phone
addressstringNoUpdated address
citystringNoUpdated city
statestringNoUpdated state
zipstringNoUpdated ZIP
countrystringNoUpdated country
notesstringNoUpdated notes
selected_sitesstringNoComma-separated site IDs to associate

Response

{
  "id": 1,
  "name": "Updated Name",
  "email": "[email protected]",
  "message": "Client updated successfully"
}