Submit timesheet days for approval
Closes the listed days of an employee's timesheet and sends each one for approval.
Like submit-period, but for an explicit set of days that need not be consecutive. The close checks (running time tracker, account zero-hours / below-standard-time rule) are evaluated once over all listed days together; if they pass, each day is then closed and announced separately — one dialogue entry and one TimesheetClosed* event per day.
Use it to:
- Submit only the working days that the source system has finalised.
- Resubmit a day after fixing a rejected registration.
Not for:
- A contiguous range —
POST /v1/approval/timesheets/submit-perioddoes it in one batch and one event.
Behaviour:
- Not idempotent.
- Safe to retry only under a condition. Re-submitting adds another dialogue entry and event per day; nothing checks that a day is already submitted.
- Duplicates: Not deduplicated.
- Side effect: Per listed day: an approval-dialogue entry with Comment; approval context items set to Submitted.
- On failure: Days are closed one at a time after the up-front checks; an unexpected failure on a later day leaves the earlier days submitted.
- Changes are visible to the next read immediately.
- Batch: partial
Call first: GET /v1/approval/timesheets/get-status-by-dates
Next: GET /v1/approval/timesheets/get-status-by-dates
See also: POST /v1/approval/timesheets/submit-period
Not yet documented: behaviour → side effects on failure; examples (success).
curl -X POST "https://app3.timelog.com/your-account/api/v1/approval/timesheets/submit-dates" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"EmployeeUserID": 123,
"Dates": [
"null"
],
"Comment": "null"
}'
import requests
import json
url = "https://app3.timelog.com/your-account/api/v1/approval/timesheets/submit-dates"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
data = {
"EmployeeUserID": 123,
"Dates": [
"null"
],
"Comment": "null"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://app3.timelog.com/your-account/api/v1/approval/timesheets/submit-dates", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
},
body: JSON.stringify({
"EmployeeUserID": 123,
"Dates": [
"null"
],
"Comment": "null"
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"EmployeeUserID": 123,
"Dates": [
"null"
],
"Comment": "null"
}`)
req, err := http.NewRequest("POST", "https://app3.timelog.com/your-account/api/v1/approval/timesheets/submit-dates", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://app3.timelog.com/your-account/api/v1/approval/timesheets/submit-dates')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
request.body = '{
"EmployeeUserID": 123,
"Dates": [
"null"
],
"Comment": "null"
}'
response = http.request(request)
puts response.body
"null"
{
"Code": 200,
"Details": [
"'Employee User ID' must be greater than '0'."
],
"Message": "Invalid model state error.",
"Parameters": "model: {"Dates":null,"Comment":null,"EmployeeUserID":0}",
"Url": "https://app{server-number}.timelog.com/{account}/api/v1/approval/timesheets/submit-dates"
}
{
"error": "Unauthorized",
"message": "Authentication required. Please provide a valid API token",
"code": 401
}
{
"Code": 100,
"Details": [],
"Message": "Unknown error occur in system, please contact system administrator.",
"Parameters": "model: null",
"Url": "https://app{server-number}.timelog.com/{account}/api/v1/approval/timesheets/submit-dates"
}
/v1/approval/timesheets/submit-dates
Target server for requests. Edit to use your own host.
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.
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.The media type of the request body
User ID of the employee whose days are submitted.
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.
The days to close. Each day is closed and announced (TimesheetClosed event) separately, in the order sent. Date only — no time component. - omitted, null or empty — No validation rule: fails inside the engine → 500 Code 100. - a date with a time-of-day — Compared as sent: the active-time-tracker check matches only midnight values (x == StartTime.Date). > Not yet documented: multiple.
Optional free text stored on the submit dialogue entry of every submitted day. Contains personal data. > Not yet documented: constraints.
Request Preview
Response
Response will appear here after sending the request
Authentication
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
User ID of the employee whose days are submitted.
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.
The days to close. Each day is closed and announced (TimesheetClosed event) separately, in the order sent.
Date only — no time component.
-
omitted, null or empty — No validation rule: fails inside the engine → 500 Code 100.
-
a date with a time-of-day — Compared as sent: the active-time-tracker check matches only midnight values (x == StartTime.Date).
Not yet documented: multiple.
Optional free text stored on the submit dialogue entry of every submitted day.
Contains personal data.
Not yet documented: constraints.
Responses
Success without content: HTTP 200 with the literal JSON body null. Literal JSON null (TafSuccessResult). Read the result back with get-status-by-dates.