Updated on 2026-10-13 GMT+08:00

Creating Work Hours

Function

This API is used to create work hours.

Calling Method

For details, see Calling APIs.

Authorization Information

Each account root user has all the permissions required to call all APIs, but IAM users must be assigned the following required identity policy-based permissions. For details about the required permissions, see Permissions Policies and Supported Actions.

Action

Access Level

Resource Type (*: required)

Condition Key

Alias

Dependencies

codeartsreq:workhour:create

Write

-

  • codeartsreq:Model

  • codeartsreq:ProjectId

-

-

URI

POST /v1/ipdprojectservice/projects/{project_id}/work-items/{workitem_id}/work-hour

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

32-character ID of a project, which must be unique. Obtain the value by calling the API for querying the IPD project list. The value of id in the response message body is the project ID.

Constraints

N/A

Range

A string of 32 characters consisting of letters and digits.

Default Value

N/A

workitem_id

Yes

String

Work item ID.

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

work_hour_category

No

String

Definition

Work type. The value of the display_value field is displayed on the page, and the value of the value field is used as the input parameter of the API.

Constraints

N/A

Range

0 to 512 characters. Obtain the value by calling the Querying Work Types API.

Default Value

N/A

work_date_begin

Yes

String

Definition

Work start date.

Constraints

The start date cannot be later than the end date (work_date_end).

Range

Format: yyyy-MM-dd.

Default Value

N/A

work_date_end

Yes

String

Definition

Work end date.

Constraints

The end date cannot be earlier than the start date (work_date_begin).

Range

Format: yyyy-MM-dd.

Default Value

N/A

work_hours

Yes

String

Definition

Total workloads.

Constraints

The value must be a non-negative numeric string. When work_hour_type is set to 1, the value indicates the total number of person-days from the start date to the end date. When work_hour_type is set to 2, the value indicates the number of person-days per day.

Range

0–100000

Default Value

N/A

work_hour_type

Yes

String

Definition

Workload calculation type, which defines the work_hours field.

Constraints

N/A

Range

  • 1: total (The work_hours field indicates the total number of workloads from the start date to the end date.)

  • 2: daily (The work_hours field indicates the number of workloads per day from the start date to the end date.)

Default Value

N/A

include_weekend

Yes

Boolean

Definition

Whether to include weekends in workload calculation.

Constraints

N/A

Range

  • true: include weekends

  • false: exclude weekends

Default Value

false

description

No

String

Definition

Workload description.

Constraints

N/A

Range

0 to 10,000 characters.

Default Value

N/A

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

status

String

Definition

Response status.

Range

  • success: The workload is successfully created.

  • error: Failed to create the workload.

message

String

Definition

Response message. When the request fails, the failure cause is returned.

Range

0 to 1,000 characters.

result

WorkHourTotalVO object

Definition

List of workload information and total workloads.

Range

N/A

Table 4 WorkHourTotalVO

Parameter

Type

Description

data

Array of WorkHourVO objects

Work hour information list.

work_hours_total

String

Total actual work hours.

Table 5 WorkHourVO

Parameter

Type

Description

id

String

Definition

Workload record ID.

Range

A string of 18 to 19 digits.

title

String

Definition

Workload name.

Range

N/A

operation_id

String

Definition

Operation ID, which identifies a specific operation record.

Range

N/A

description

String

Definition

Description of the work content.

Range

Max. 10,000 characters.

workitem_id

String

Definition

ID of the work item associated with the workload. You can obtain the value from the Querying Work Items or Querying Tree-shaped Work Items API. The value is id in the response body.

Range

A string of 18 to 19 digits.

work_date

String

Definition

Timestamp of the work time, in milliseconds.

Range

N/A

created_by

UserEntity object

Definition

Creator of the workload record.

modified_by

UserEntity object

Definition

Information about the last person who modifies the workload record.

work_hour_category

String

Definition

Work type. The value displayed on the page is display_value, and the unique ID is value.

Range

N/A

work_hours

Double

Definition

Time spent (person-days).

Range

N/A

Table 6 UserEntity

Parameter

Type

Description

id

String

Definition

User ID. Obtain it by calling the API for querying project members. The value of id in the response message body is the user ID.

Range

N/A

name

String

Definition

Username.

Range

2 to 64 characters.

nick_name

String

Definition

User alias.

Range

2 to 30 characters

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Definition

Error code.

Range

N/A

error_msg

String

Definition

Error description, which is a supplement to error_code.

Range

N/A

Example Requests

100 person-days created from February 1 to 6, 2024; type: R&D design; weekends included

POST https://{endpoint}/v1/ipdprojectservice/projects/05c7d8bcf3db4829bc841e4ba93aaea5/work-items/976857692367659008/work-hour?_=1708329665577

{
  "work_hour_category" : "R&D design",
  "work_date_begin" : "2024/02/01",
  "work_date_end" : "2024/02/02",
  "work_hours" : "12",
  "work_hour_type" : 1,
  "include_weekend" : true,
  "description" : "Work content"
}

Example Responses

Status code: 200

{
  "status" : "success",
  "message" : null,
  "result" : {
    "data" : [ {
      "work_date" : "1745337600000",
      "modified_by" : "testuser",
      "work_hour_category" : {
        "id" : "1",
        "display_value" : "Backend development",
        "value" : "Backend development",
        "value_py" : "hdkf",
        "sequence" : 2,
        "level" : 1,
        "domain_id" : "1",
        "created_by" : "testuser",
        "created_date" : 1744750470000,
        "modified_by" : "testuser",
        "modified_date" : 1744750470000,
        "belong_definition_type" : "5"
      },
      "description" : null,
      "operation_id" : "1",
      "id" : "1",
      "work_hours" : 0.5,
      "title" : null,
      "created_by" : "testuser"
    } ],
    "work_hours_total" : 1
  }
}

Status Codes

Status Code

Description

200

Response body for creating work hours.

400

Failure response body.

Error Codes

See Error Codes.