EmployeesBook workload for an employee on a task

Book workload for an employee on a task

Asks Resource Planner to book (plan) a number of hours for an employee on a task over a date range.

TimeLog itself stores nothing; there is no booking ID in the response and no REST v1 operation to read, change or delete the booking afterwards. What Resource Planner does with it — how Hours is spread over the days, whether an existing booking for the same employee / task / period is replaced or added to, whether the employee is added to the project team (a TimeLog allocation) — is decided in that service and is not established here (see gaps). Note EmployeeId is an EMPLOYEE ID, not the user ID used by the other Employees operations.

Use it to:

  • A staffing or PSA tool pushes planned hours for a person on a task into TimeLog Resource Planner.

Not for:

  • Registering actual time — use the TimeRegistration service.

Rules across fields:

  • R1: EndDate must be on or after StartDate.

Behaviour:

  • Side effect: TimeLog: none — validations are reads; the only action is the HTTP PUT to Resource Planner.
  • Side effect: Resource Planner: a workload booking for EmployeeId on TaskId / its project over StartDate..EndDate with Hours (semantics owned by RP, see gaps).
  • On failure: On a 500 caused by an RP timeout or dropped connection the booking may or may not have been stored by RP — and there is no read operation to check.
  • Consistency: Visibility of the booking in Resource Planner views is RP-side and not established.

Call first: GET /v1/task/{taskID}

See also: POST /v1/task/{taskID}/allocation

Not yet documented: behaviour → duplicate handling; behaviour → idempotent; behaviour → safe to retry; behaviour → side effects; examples (success).

curl -X POST "https://app3.timelog.com/your-account/api/v1/workload/book" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
  "StartDate": "2024-12-25T10:00:00Z",
  "EndDate": "2024-12-25T10:00:00Z",
  "Hours": 3.14,
  "EmployeeId": 123,
  "TaskId": 123
}'
{}
POST
/v1/workload/book
POST
Base URLstring

Target server for requests. Edit to use your own host.

Bearer Token
Bearer Tokenstring
Required

OAuth 2.0 bearer token, sent as Authorization: Bearer <token>. JWT and reference tokens are both accepted. The token must carry the required scope (default tlp). The token's sub claim is the acting user. A token WITHOUT sub (client-credentials) acts as the system service user. If the sub user cannot log in (inactive, locked, deleted), the request is rejected with 401 — it is no longer let through without a user. > Not yet documented: how to obtain a token. > Not yet documented: token lifetime.

OAuth 2.0 bearer token, sent as Authorization: Bearer <token>. JWT and reference tokens are both accepted. The token must carry the required scope (default tlp). The token's sub claim is the acting user. A token WITHOUT sub (client-credentials) acts as the system service user. If the sub user cannot log in (inactive, locked, deleted), the request is rejected with 401 — it is no longer let through without a user. > Not yet documented: how to obtain a token. > Not yet documented: token lifetime.
Content-Typestring
Required

The media type of the request body

Options: application/json
StartDatestring
Required

First day of the booking period. Date only — no time component. - omitted, or outside 1753-01-01..9999-12-31 — 400 "StartDate is not a valid date." > Not yet documented: constraints → timezone.

Format: date-time
EndDatestring
Required

Last day of the booking period. Must not be before StartDate. Date only — no time component. - before StartDate — 400 "EndDate must be after StartDate" (equal dates are allowed). > Not yet documented: constraints → timezone.

Format: date-time
Hoursnumber
Required

Number of hours to book for the employee on the task in the period. Whether this is a total spread over the period or hours per day is decided by Resource Planner. Unit: hours - 0, negative or omitted — 400 "'Hours' must not be empty." / "'Hours' must be greater than '0'." > Not yet documented: description.

Format: double
EmployeeIdinteger
Required

EMPLOYEE ID of the person to book — not the user ID used by most other Employees operations. Must be an active employee. Refers to EmployeeID. - 0, negative or omitted — 400 "'Employee Id' must not be empty." / "must be greater than '0'". - no such employee, or the employee's user is inactive — 500 Code 102, ErrorCode 37040 "No user with UserID: {EmployeeId} exist" — inactive is reported as not-existing.

Format: int32
TaskIdinteger
Required

Task to book on. Its project must be enabled for Resource Planner. Refers to TaskRead.TaskID. - 0, negative or omitted — 400 "'Task Id' must not be empty." / "must be greater than '0'". - not an existing task — 500 Code 102, ErrorCode 37001. - task's project is not available in Resource Planner — 500 Code 102, ErrorCode 37968. > Not yet documented: behaviour.

Format: int32
Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Bearer token. OAuth 2.0 bearer token, sent as Authorization: Bearer <token>. JWT and reference tokens are both accepted. The token must carry the required scope (default tlp).

The token's sub claim is the acting user. A token WITHOUT sub (client-credentials) acts as the system service user. If the sub user cannot log in (inactive, locked, deleted), the request is rejected with 401 — it is no longer let through without a user.

Not yet documented: how to obtain a token.

Not yet documented: token lifetime.

Body

application/json
StartDatestring
Required

First day of the booking period.

Date only — no time component.

  • omitted, or outside 1753-01-01..9999-12-31 — 400 "StartDate is not a valid date."

Not yet documented: constraints → timezone.

EndDatestring
Required

Last day of the booking period. Must not be before StartDate.

Date only — no time component.

  • before StartDate — 400 "EndDate must be after StartDate" (equal dates are allowed).

Not yet documented: constraints → timezone.

Hoursnumber
Required

Number of hours to book for the employee on the task in the period. Whether this is a total spread over the period or hours per day is decided by Resource Planner.

Unit: hours

  • 0, negative or omitted — 400 "'Hours' must not be empty." / "'Hours' must be greater than '0'."

Not yet documented: description.

EmployeeIdinteger
Required

EMPLOYEE ID of the person to book — not the user ID used by most other Employees operations. Must be an active employee.

Refers to EmployeeID.

  • 0, negative or omitted — 400 "'Employee Id' must not be empty." / "must be greater than '0'".

  • no such employee, or the employee's user is inactive — 500 Code 102, ErrorCode 37040 "No user with UserID: {EmployeeId} exist" — inactive is reported as not-existing.

TaskIdinteger
Required

Task to book on. Its project must be enabled for Resource Planner.

Refers to TaskRead.TaskID.

  • 0, negative or omitted — 400 "'Task Id' must not be empty." / "must be greater than '0'".

  • not an existing task — 500 Code 102, ErrorCode 37001.

  • task's project is not available in Resource Planner — 500 Code 102, ErrorCode 37968.

Not yet documented: behaviour.

Responses