EmployeesSubmit time registrations for approval

Submit time registrations for approval

Submits selected time registrations of one employee for approval, without closing whole days.

Used where approval runs per registration (registration-level approval, project-manager approval). Each listed registration is checked on its own: it must belong to EmployeeUserID, must not be approved by the employee manager already, and must not be waiting for approval already. Registrations that pass are closed and marked Submitted even if others fail — the call then answers 500 with one violation per refused registration and does not say which ones were saved. Unknown IDs are skipped silently. Unlike submit-period, no zero-hours / standard-time / running-tracker check applies.

Use it to:

  • Submit the registrations an integration just created for an employee.

Not for:

  • Resubmitting rejected registrations — use POST /v1/approval/timesheets/resubmit-rejected-time-registrations so they are marked rejected-and-resubmitted.

Behaviour:

  • Not idempotent.
  • Safe to retry only under a condition. A retry of a partly failed call refuses the already-submitted registrations with 37971; inspect the violations rather than retrying blindly.
  • Duplicates: A registration already submitted is refused with 37971.
  • Side effect: Valid registrations: status Closed; approval status Submitted on their approval context items.
  • Side effect: One approval-dialogue entry (SubmitTimeRegistration) spanning the first to last registration date.
  • On failure: All of the above for the registrations that passed, even though the call returns 500 Code 102 for the others.
  • Changes are visible to the next read immediately.
  • Batch: partial

Call first: POST /v1/time-registration, GET /v1/time-registration/{timeRegistrationID}

Next: GET /v1/approval/timesheets/get-status-by-dates

See also: POST /v1/approval/timesheets/resubmit-rejected-time-registrations, POST /v1/approval/timesheets/submit-dates

Not yet documented: examples (success).

curl -X POST "https://app3.timelog.com/your-account/api/v1/approval/timesheets/submit-time-registrations" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
  "EmployeeUserID": 123,
  "TimeRegistrationIds": [
    "null"
  ]
}'
"null"
POST
/v1/approval/timesheets/submit-time-registrations
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
EmployeeUserIDinteger
Required

User ID of the employee who owns the registrations. Every registration must belong to this user. Refers to UserRead.UserID. Look up valid values with GET /v1/user. - 0, negative or omitted — 400 "'Employee User ID' must be greater than '0'." - another user than the caller, without the needed rights — 500 Code 102, ErrorCode 37966; nothing is submitted.

Format: int32
TimeRegistrationIdsarray
Required

IDs of the registrations to submit. Each is validated on its own; valid ones are submitted even when others fail. Refers to TimeRegistrationRead.TimeRegistrationID. Look up valid values with GET /v1/time-registration/{timeRegistrationID}. - ID that does not exist — Not returned by the lookup, so silently skipped. - registration of another user than EmployeeUserID — ErrorCode 37972 for that registration. - registration already approved by the employee manager — ErrorCode 37615. - registration already submitted and not rejected — ErrorCode 37971. - null or omitted — No validation rule: fails in the lookup → 500. > Not yet documented: multiple. > 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
EmployeeUserIDinteger
Required

User ID of the employee who owns the registrations. Every registration must belong to this user.

Refers to UserRead.UserID. Look up valid values with GET /v1/user.

  • 0, negative or omitted — 400 "'Employee User ID' must be greater than '0'."

  • another user than the caller, without the needed rights — 500 Code 102, ErrorCode 37966; nothing is submitted.

TimeRegistrationIdsarray
Required

IDs of the registrations to submit. Each is validated on its own; valid ones are submitted even when others fail.

Refers to TimeRegistrationRead.TimeRegistrationID. Look up valid values with GET /v1/time-registration/{timeRegistrationID}.

  • ID that does not exist — Not returned by the lookup, so silently skipped.

  • registration of another user than EmployeeUserID — ErrorCode 37972 for that registration.

  • registration already approved by the employee manager — ErrorCode 37615.

  • registration already submitted and not rejected — ErrorCode 37971.

  • null or omitted — No validation rule: fails in the lookup → 500.

Not yet documented: multiple.

Not yet documented: behaviour.

Responses

Success without content: HTTP 200 with the literal JSON body null. Literal JSON null: every listed (existing) registration was submitted — or none of the IDs existed.