> ## Documentation Index
> Fetch the complete documentation index at: https://developers.luccasoftware.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Archive or restore a time-punch

> Archive a time-punch, for instance one sent by mistake, or restore an archived one.

Archived time-punches are no longer taken into account to compute worked time, but remain visible in the history. The API key must have the "Edit time-punches" permission on the employee.



## OpenAPI

````yaml /openapi-specs/timmi-timesheet.yaml patch /timmi-timesheet/api/time-punches/{id}
openapi: 3.1.0
info:
  title: Lucca Timesheet API (not v3)
  version: '1.0'
  description: The latest documentation for Lucca Timesheet API.
  contact:
    name: API Support
    url: https://www.luccasoftware.com
    email: no-reply@luccasoftware.com
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
servers:
  - url: https://{host}
    description: Your Lucca account URL.
    variables:
      host:
        default: example.ilucca.net
        description: >-
          The URL of your dedicated Lucca account: `{account}.{env}.{region}`.


          Account reflects your company name. Env indicates the environment.
          Region depends on your server location.


          **Please, use your test or sandbox environments (and not your
          production env.) for testing purposes.**


          **Please, use your test or sandbox environments (and not your
          production env.) for testing purposes.**


          Environments:

          - `ilucca`: production environment for customers.

          - `ilucca-test`: test environment for customers.

          - `ilucca-demo`: demo environment for prospects.


          Regions:

          - `.ch` for Swiss located accounts.

          - `.net` for the others.


          Regarding sandboxes, the pattern differs:
          `https://{account}-{sandboxName}.sandbox.{server}.luccasoftware.com`,
          where:

          - `{sandboxName}` is automatically generated upon creation.

          - `{server}` may be "eu1", "eu2" or "ch1".
security: []
tags:
  - name: TimeEntries
    description: TimeEntries are the actual working hours observed by a user.
  - name: Workflow
    description: All actions regarding the approval process of timesheets.
  - name: TimePunches
    description: TimePunches are the clock-ins and clock-outs of employees.
paths:
  /timmi-timesheet/api/time-punches/{id}:
    parameters:
      - $ref: '#/components/parameters/Authorization'
      - name: id
        in: path
        required: true
        description: Unique identifier of the time-punch.
        schema:
          type: string
    patch:
      tags:
        - TimePunches
      summary: Archive or restore a time-punch
      description: >-
        Archive a time-punch, for instance one sent by mistake, or restore an
        archived one.


        Archived time-punches are no longer taken into account to compute worked
        time, but remain visible in the history. The API key must have the "Edit
        time-punches" permission on the employee.
      operationId: patch-timmi-timesheet-api-time-punch
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                isArchived:
                  type: boolean
                  description: '`true` to archive the time-punch, `false` to restore it.'
              required:
                - isArchived
            examples:
              Archive:
                value:
                  isArchived: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TimePunch'
        '400':
          description: Bad Request. `isArchived` is missing.
        '401':
          description: Unauthorized. The API key is missing or invalid.
        '404':
          description: >-
            Not Found. The time-punch does not exist, or the API key does not
            have the "Edit time-punches" permission on its employee.
        '409':
          description: >-
            Conflict. The time-punch cannot be restored, because the same
            time-punch was sent again since it was archived.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
components:
  parameters:
    Authorization:
      name: Authorization
      required: true
      description: 'API key. Value must be formatted like so: `lucca application={api_key}`.'
      in: header
      schema:
        type: string
  schemas:
    TimePunch:
      title: TimePunch
      type: object
      description: A clock-in or clock-out of an employee.
      properties:
        id:
          type: string
          description: Unique identifier of the time-punch.
          example: '93874'
        type:
          type: string
          const: time-punch
        url:
          type: string
          format: uri
          example: https://example.ilucca.net/timmi-timesheet/api/time-punches/93874
        employee:
          type: object
          description: The employee who clocked in or out.
          properties:
            id:
              type: string
              example: '416'
            type:
              type: string
              const: employee
            url:
              type: string
              format: uri
              example: https://example.ilucca.net/lucca-api/employees/416
        resolvedTime:
          type: string
          format: date-time
          example: '2026-10-22T08:04:23+02:00'
          description: >-
            The date and time when the employee clocked in or out, with the
            offset of the time zone of the employee's establishment. For a
            time-punch created with an API key, it is the `clientWalledTime`
            sent, resolved in that time zone.
        direction:
          type: string
          enum:
            - in
            - out
          description: Whether the time-punch is a clock-in (`in`) or a clock-out (`out`).
        source:
          type: string
          enum:
            - integration
            - desktop
            - mobileApp
            - lucca
          description: >-
            The system the time-punch came from:

            - `integration`: a punch clock integrated with an API key, such as
            your own.

            - `desktop`: Lucca virtual punch clock, from a web browser.

            - `mobileApp`: Lucca virtual punch clock, from the mobile app.

            - `lucca`: a Lucca punch clock.
        isManual:
          type: boolean
          description: >-
            Whether the time-punch was entered by hand rather than produced by a
            punch clock.
        isArchived:
          type: boolean
          description: >-
            Whether the time-punch is archived. Archived time-punches are no
            longer taken into account to compute worked time.
        createdAt:
          type: string
          format: date-time
          example: '2026-10-22T06:04:25.1234567+00:00'
          description: Date and time the time-punch was created in Lucca, with offset.
    ProblemDetails:
      title: ProblemDetails
      type: object
      description: Error details.
      properties:
        title:
          type: string
        status:
          type: integer
        detail:
          type: string
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string

````

## Related topics

- [Create a time-punch](https://developers.luccasoftware.com/api-reference/legacy/timmi-timesheet/time-punches/create-time-punch.md)
- [Get a time-punch](https://developers.luccasoftware.com/api-reference/legacy/timmi-timesheet/time-punches/get-time-punch.md)
- [List time-punches](https://developers.luccasoftware.com/api-reference/legacy/timmi-timesheet/time-punches/list-time-punches.md)
- [The time-punch resource](https://developers.luccasoftware.com/api-reference/legacy/timmi-timesheet/time-punches/time-punch.md)
- [How to Send Time-Punches from Your Own Punch Clock](https://developers.luccasoftware.com/api-reference/legacy/timmi-timesheet/guides/send-time-punches.md)
