---
search:
  tags:
    - Time tracking
    - POST
seo:
  description: >-
    Clocks out the member's open session (today first, then any leftover open…
    Reference for the POST /time-tracking/sessions/stop endpoint in the Fuxam
    API v4.
sidebar:
  label: Stop time tracking
  badge: POST
title: Stop time tracking
type: openapi-operation
---
Clocks out the member's open session (today first, then any leftover open session). Open pauses on that session are closed at the same punch time. Open sessions from an earlier institution-local day are closed at the end of their start day, their open pauses are closed at that same end-of-day, and each close is audited the same way as a start leftover close. An `at` strictly before the session start is **422** and writes nothing. The write is the half-open interval `[sessionStart, stop)`. Returns **409** `conflictingLog` when that interval overlaps another log for the member. The session being stopped is excluded. A stop exactly at the next log `startTime` does not overlap and returns **200**. Nothing is written on **409**. The Fuxam UI stop path does not apply this check. A **503** (`Retry-After: 1`) means the database is busy and does not consume the `Idempotency-Key`. Requires `Idempotency-Key`.

`POST /time-tracking/sessions/stop`

**Request body** (`application/json`, required)

- `userId` (string)
- `email` (string<email>)
- `code` (string)
- `at` (string<date-time>) — Optional punch time with timezone offset (ISO-8601). Defaults to server now. Use this for delayed or offline terminal events.

Request body example, Clock out by badge code:

```json
{
  "code": "STU-001"
}
```

Request body example, Offline clock-out with timezone offset:

```json
{
  "code": "STU-001",
  "at": "2026-09-21T16:30:00.000+02:00"
}
```

**Responses**

- `200` — Session stopped
- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `409` — The interval \`\[sessionStart, stop)\` overlaps another log. \`conflictingLog\` is that log. The open session is not stopped.
- `422` — Unprocessable Entity — validation or business rule error
- `429` — Too Many Requests — 1000 requests per minute per institution. Includes \`X-RateLimit-Limit\`, \`X-RateLimit-Remaining\`, \`X-RateLimit-Reset\` (ISO-8601), and \`Retry-After\` (seconds).
- `500` — Internal Server Error
- `503` — Service unavailable — idempotency store temporarily unreachable, or the database is busy (lock wait, transaction timeout, or exhausted serialization/deadlock retries). Database contention includes \`Retry-After: 1\`. The idempotency key is released. Retry the same key (\`service\_unavailable\`).

Response example, 200:

```json
{
  "data": {
    "id": "clxttlogjane20260921",
    "userId": "user_abc123",
    "startTime": "2026-09-21T06:00:00.000Z",
    "endTime": "2026-09-21T14:30:00.000Z",
    "autoStopped": false,
    "autoStoppedAt": null,
    "isManuallyAdjusted": false,
    "createdAt": "2026-09-21T06:00:00.412Z",
    "updatedAt": "2026-09-21T14:30:00.188Z",
    "pauses": [
      {
        "id": "clxttpauselunch",
        "startTime": "2026-09-21T10:00:00.000Z",
        "endTime": "2026-09-21T10:30:00.000Z",
        "createdAt": "2026-09-21T10:00:00.210Z",
        "updatedAt": "2026-09-21T10:30:00.090Z"
      }
    ],
    "timestamps": [
      {
        "id": "clxtttsproject",
        "templateId": "clxtttmplproject",
        "label": "Project work",
        "timestamp": "2026-09-21T07:15:00.000Z",
        "createdAt": "2026-09-21T07:15:00.102Z",
        "updatedAt": "2026-09-21T07:15:00.102Z"
      }
    ]
  },
  "meta": {
    "requestId": "req_abc123",
    "timestamp": "2026-06-26T00:00:00.000Z",
    "version": "v4"
  }
}
```

Response example, 409:

```json
{
  "type": "error",
  "code": "conflict",
  "title": "Conflict",
  "status": 409,
  "detail": "Time tracking entry overlaps an existing log",
  "conflictingLog": {
    "id": "clxttlogclosed",
    "startTime": "2026-10-08T06:00:00.000Z",
    "endTime": "2026-10-08T12:00:00.000Z"
  }
}
```
