Create Staff (v1)
Method + Path
POST /v1/workspace/:workspaceId/staff
Actual backend path: /v1/workspace/:workspaceId/staff
Description
Create a new staff member in a workspace.
Authentication
Required - JWT token in Authorization header
Required Permissions:
staff.create
Headers
| Header | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Bearer token: Bearer <token> |
Content-Type | string | Yes | application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | Workspace identifier |
Request Body
{
"fullName": "John Doe",
"email": "john@example.com",
"password": "securepassword123",
"permissions": [
"sessions.view",
"sessions.create",
"sessions.update"
],
"status": "active",
"avatarUrl": "https://example.com/avatar.jpg",
"customFields": [
{
"fieldKey": "department",
"value": "Sales"
}
]
}
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
fullName | string | Yes | Staff member's full name (minimum 1 character) |
email | string | Yes | Valid email address |
password | string | Yes | Password (minimum 8 characters) |
permissions | array | Yes | Array of permission strings (minimum 1) |
status | string | No | Staff status. Valid values: active, invited, suspended. Default: active |
avatarUrl | string | No | URL to staff avatar image (must be valid URL if provided) |
customFields | array | No | Array of custom field values |
Response (201)
{
"staff": {
"id": "507f1f77bcf86cd799439011",
"fullName": "John Doe",
"email": "john@example.com",
"permissions": ["sessions.view", "sessions.create", "sessions.update"],
"status": "active",
"avatarUrl": "https://example.com/avatar.jpg",
"customFields": [],
"createdAt": "2024-01-15T10:00:00Z"
}
}
Common Errors
- 400 Bad Request: Invalid request body or validation errors
- 401 Unauthorized: Missing or invalid authentication token
- 403 Forbidden: Insufficient permissions (requires
staff.create) - 404 Not Found: Workspace not found
- 409 Conflict: Email already exists
- 422 Unprocessable Entity: Validation errors
- 500 Internal Server Error: Server error