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-registrationsso 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
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"
]
}'
import requests
import json
url = "https://app3.timelog.com/your-account/api/v1/approval/timesheets/submit-time-registrations"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
data = {
"EmployeeUserID": 123,
"TimeRegistrationIds": [
"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-time-registrations", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
},
body: JSON.stringify({
"EmployeeUserID": 123,
"TimeRegistrationIds": [
"null"
]
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"EmployeeUserID": 123,
"TimeRegistrationIds": [
"null"
]
}`)
req, err := http.NewRequest("POST", "https://app3.timelog.com/your-account/api/v1/approval/timesheets/submit-time-registrations", 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-time-registrations')
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,
"TimeRegistrationIds": [
"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: {"TimeRegistrationIds":null,"EmployeeUserID":0}",
"Url": "https://app{server-number}.timelog.com/{account}/api/v1/approval/timesheets/submit-time-registrations"
}
{
"Message": "Authorization has been denied for this request."
}
{
"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-time-registrations"
}
/v1/approval/timesheets/submit-time-registrations
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.
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.The media type of the request body
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.
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.
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.
Body
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.
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.
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.