---
title: "TimeEntries update service"
method: PUT
path: "/timmi-timesheet/services/time-entries"
tags: ["TimeEntries"]
---

# TimeEntries update service

`PUT /timmi-timesheet/services/time-entries`

## Request

- Base URL: `https://example.ilucca.net`
- URL: `https://example.ilucca.net/timmi-timesheet/services/time-entries`
- Auth: none required
- TypeScript: <https://skmtc.dev/luccasoftware/apis/lucca-expenses/docs/timmi-timesheet/services/time-entries/put.ts> (a function with typed inputs; its response is checked against the schema)

## Before using this service

This service is aimed at updating a given user TimeEntries easily, as it automatically detects and applies changes needed to transform whatever TimeEntries might currently exist to what you send it. It create, edit, or delete TimeEntries. **An algorithm tries to match and update any existing TimeEntries, but it might wipe clean TimeEntries before adding new ones.**

There are different ways to update TimeEntries. Please see [this guide](../docs/Use-cases/Timmi%20Timesheet/Update-time-entries.md) for a guide on how to update TimeEntries the right way depending on your use case.

## How to use

It will create, edit, or delete existing TimeEntries for a given period and owner to match the TimeEntries of the request body.

The request body is an array of 'simplified' TimeEntries, [please see the API reference for a TimeEntry model for additional information and main validation rules](reference/Timmi-Timesheet-v3.yaml/components/schemas/TimeEntry).

Here the TimeEntry `id` field is optional as the matching algorithm does not take it into account.

## Query parameters

- `startsOn` string, date, required
- `endsOn` string, date, required
- `ownerId` integer, required

## Request body

- object[]
  - `owner` object, required
    - `id` integer: Unique identifier of the TimeEntries owner.
  - `startsAt` string, date-time, required: The timeEntry start date and time. Please do NOT send any offset/timezone information ("Z", "+01:00", etc...).
  - `unit` 'day' | 'duration' | 'time', required: Unit in which the TimeEntry has been entered. - day: share a of a 24-hour day (e.g. "1/2 day") - duration: number of hours (e.g. "8h15min") - time: accurate time of a day (e.g. "23:45:00")
  - `duration` object, required
    - `iso` string, duration: ISO-8601 formatted duration of the TimeEntry.
  - `axisSections` object[], nullable: The activities this TimeEntry should be associated with. When not in activity mode, send an empty array, or do not serialize this property.
    - `id` integer
  - `timeType` object, nullable: Optional reference of a configured Time Type. To use only if the timesheet is set up to use Time Types. Null otherwise.
    - `id` integer
  - `timeSource` 'manual' | 'import' | 'timer': Attribute used to identify last modification source : - manual : Manually created or edited (default). - import : Imported from external sources. Is read-only on Lucca Timesheet user interfaces only if Timesheet regulation is in following modes : attendance schedule with clock-in clock-out, and activity-schedule - timer : Entered with Lucca Timesheet clock-in clock-out tool.
  - `comment` string, nullable: A comment on the TimeEntry, visible on Lucca Timesheet user interface.

## Response `200`

OK

## Other responses

- `400`: Bad Request
- `500`: Internal Server Error

---

[API](https://skmtc.dev/luccasoftware/apis/lucca-expenses.md) - [All operations](https://skmtc.dev/luccasoftware/apis/lucca-expenses/llms.txt) - [OpenAPI document](https://skmtc.dev/luccasoftware/apis/lucca-expenses/revisions/110f9897756c?raw)
