POST/users/{userId}/tasks

Creates my task.

Authorization

oauth2

OAuth 2.0 authentication.
For more information, see Authentication and Authorization.

Scope

task

HTTP Request

POSThttps://www.worksapis.com/v1.0/users/{userId}/tasks

Path Parameters

ParameterTypeDescription
userId string 

User ID


required
example : userf7da-f82c-4284-13e7-030f3b4c756x 

Header Parameters

HeadertypeDescription
Authorization string 

Bearer {token}


required 

Request Body

PropertyTypeDescription
assignorId string 

Assignor ID


required 
assignees array (Assignee) 

Assignee information


required 
title string 

Task title


required 
content string 

Task content


required 
dueDate string 

Due date (if it exists)

  • Format: YYYY-MM-DD
  • Example: 2024-03-08

nullable : true 
completionCondition string 

Completion options

  • ANY_ONE: A task that any one assignee can complete
  • MUST_ALL: A task that all assignees must complete.

Note

  • When updating a task, it is available only if there are two or more assignees.

required
Allowed values : ANY_ONE, MUST_ALL 
categoryId string 

Task category ID

 

Assignee

PropertyTypeDescription
assigneeId string 

Assignee ID

  • If the member has been deleted, respond with an empty value.

required 
status string 

Task status

  • DONE: Complete
  • TODO: Incomplete

Note

  • The status of an assignee's new task is always set to TODO.
  • You can change the status of a task using the the following API operations.
  • Mark a task as complete
  • Mark a task as incomplete
  • Mark an assignee task as complete
  • Mark an assignee task as incomplete

required
Allowed values : DONE, TODO 

Request Example

example

1{2  "assignorId": "userf7da-f82c-4284-13e7-030f3b4c756x",3  "assignees": [4    {5      "assigneeId": "userf7da-f82c-4284-13e7-030f3b4c756x",6      "status": "TODO"7    },8    {9      "assigneeId": "userf7da-f82c-4284-13e7-030f3b4c754x",10      "status": "TODO"11    }12  ],13  "title": "Arrange a weekly meeting",14  "content": "Book a meeting room",15  "dueDate": "2024-05-25",16  "completionCondition": "ANY_ONE",17  "categoryId": "7f5078df-bf67-417c-a559-f5539e59bd0d"18}

Response

HTTP 201

Created

PropertyTypeDescription
task object (task) 

Task

 

task

PropertyTypeDescription
assignees array (Assignee) 

Assignee information

 
assignorId string 

Assignor ID

  • If the member has been deleted, respond with an empty value.
 
assignorName string 

Assignor name

 
completionCondition string 

Completion options

  • ANY_ONE: A task that any one assignee can complete
  • MUST_ALL: A task that all assignees must complete.

Note

  • When updating a task, it is available only if there are two or more assignees.

Allowed values : ANY_ONE, MUST_ALL 
content string 

Content

 
createdTime string 

Creation time (YYYY-MM-DDThh:mm:ssTZD)


readOnly : true 
dueDate string 

Due date (YYYY-MM-DD)


nullable : true 
modifiedTime string 

Update time (YYYY-MM-DDThh:mm:ssTZD)


readOnly : true 
resourceLocation integer 

The instance where the original task is located


readOnly : true 
status string 

Task status

  • DONE: Complete
  • TODO: Incomplete

Note

  • The status of an assignee's new task is always set to TODO.
  • You can change the status of a task using the the following API operations.
  • Mark a task as complete
  • Mark a task as incomplete
  • Mark an assignee task as complete
  • Mark an assignee task as incomplete

Allowed values : DONE, TODO 
taskId string 

Task ID

 
title string 

Title

 

Assignee

PropertyTypeDescription
assigneeId string 

Assignee ID

  • If the member has been deleted, respond with an empty value.

required 
assigneeName string 

Assignee name


readOnly : true 
status string 

Task status

  • DONE: Complete
  • TODO: Incomplete

Note

  • The status of an assignee's new task is always set to TODO.
  • You can change the status of a task using the the following API operations.
  • Mark a task as complete
  • Mark a task as incomplete
  • Mark an assignee task as complete
  • Mark an assignee task as incomplete

required
Allowed values : DONE, TODO 

Response Example

example

1{2  "assignees": [3    {4      "assigneeId": "userf7da-f82c-4284-13e7-030f3b4c754x",5      "assigneeName": "John Doe",6      "status": "TODO"7    },8    {9      "assigneeId": "userf7da-f82c-4284-13e7-030f3b4c756x",10      "assigneeName": "Jane Doe",11      "status": "TODO"12    }13  ],14  "assignorId": "userf7da-f82c-4284-13e7-030f3b4c756x",15  "assignorName": "Jane Doe",16  "completionCondition": "MUST_ALL",17  "content": "",18  "createdTime": "2024-04-04T04:52:06.405Z",19  "dueDate": null,20  "modifiedTime": "2024-04-04T05:41:52.624Z",21  "resourceLocation": 14101,22  "status": "TODO",23  "taskId": "95e426f5-9c85-4d28-9c41-f22950398c9c",24  "title": "Task content"25}