Create Task (v1)
Method + Path
POST /v1/workspace/:workspaceId/staff/tasks
Actual backend path: /v1/workspace/:workspaceId/staff/tasks
Description
Create a new task assigned to a staff member.
Authentication
Required - JWT token in Authorization header
Required Permissions:
staff.updateor task-related permissions
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
{
"assigneeId": "507f1f77bcf86cd799439012",
"title": "Complete project documentation",
"description": "Write comprehensive documentation for the project",
"status": "pending",
"priority": "high",
"dueAt": "2024-01-20T10:00:00Z",
"blockers": ["Waiting for API documentation"]
}
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
assigneeId | string | Yes | Staff member ID to assign the task to |
title | string | Yes | Task title (minimum 1 character) |
description | string | No | Task description (maximum 2000 characters) |
status | string | No | Task status. Valid values: pending, in-progress, blocked, completed. Default: pending |
priority | string | No | Task priority. Valid values: low, medium, high. Default: medium |
dueAt | string | No | Due date in ISO 8601 format (without timezone offset) |
blockers | array | No | Array of blocker descriptions (maximum 20, each max 200 characters) |
Response (201)
{
"task": {
"id": "507f1f77bcf86cd799439011",
"assigneeId": "507f1f77bcf86cd799439012",
"title": "Complete project documentation",
"description": "Write comprehensive documentation for the project",
"status": "pending",
"priority": "high",
"dueAt": "2024-01-20T10:00:00Z",
"blockers": ["Waiting for API documentation"],
"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
- 404 Not Found: Workspace or assignee not found
- 422 Unprocessable Entity: Validation errors
- 500 Internal Server Error: Server error