Skip to main content

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

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token: Bearer <token>
Content-TypestringYesapplication/json

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace 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

ParameterTypeRequiredDescription
fullNamestringYesStaff member's full name (minimum 1 character)
emailstringYesValid email address
passwordstringYesPassword (minimum 8 characters)
permissionsarrayYesArray of permission strings (minimum 1)
statusstringNoStaff status. Valid values: active, invited, suspended. Default: active
avatarUrlstringNoURL to staff avatar image (must be valid URL if provided)
customFieldsarrayNoArray 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