Skip to main content

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.update or task-related permissions

Headers

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

Path Parameters

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

ParameterTypeRequiredDescription
assigneeIdstringYesStaff member ID to assign the task to
titlestringYesTask title (minimum 1 character)
descriptionstringNoTask description (maximum 2000 characters)
statusstringNoTask status. Valid values: pending, in-progress, blocked, completed. Default: pending
prioritystringNoTask priority. Valid values: low, medium, high. Default: medium
dueAtstringNoDue date in ISO 8601 format (without timezone offset)
blockersarrayNoArray 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