List Workspaces (v1)
Get all workspaces with filtering and pagination.
Method & Path
GET /v1/admin/workspaces
Description
Retrieves a paginated list of all workspaces in the platform. Supports filtering by plan, business category, marketing opt-in status, and search.
Authentication
Required: Admin authentication with businesses.manage permission.
Include the admin JWT token in the Authorization header:
Authorization: Bearer <admin_token>
Headers
Authorization: Bearer <admin_token>
Content-Type: application/json
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
page | number | No | Page number (default: 1) |
limit | number | No | Items per page (default: 20, max: 100) |
search | string | No | Search query for workspace name or email |
planId | string | No | Filter by subscription plan ID |
categorySlug | string | No | Filter by business category slug |
marketingOptIn | boolean | No | Filter by marketing opt-in status |
Request Body
None.
Response 200 OK
{
"workspaces": [
{
"id": "507f1f77bcf86cd799439011",
"name": "Example Workspace",
"email": "workspace@example.com",
"planId": "507f1f77bcf86cd799439012",
"businessCategorySlug": "beauty-salon",
"marketingOptIn": true,
"createdAt": "2024-01-15T10:00:00Z"
}
],
"meta": {
"pagination": {
"page": 1,
"limit": 20,
"total": 100,
"totalPages": 5
},
"filters": {
"availablePlans": [],
"availableCategories": []
}
}
}
Common Errors
- 401 Unauthorized: Missing or invalid admin authentication token
- 403 Forbidden: Insufficient permissions (missing
businesses.managepermission) - 400 Bad Request: Invalid query parameters
- 500 Internal Server Error: Server error