---
title: "Update a session by ID"
method: PATCH
path: "/session/{sessionId}"
tags: ["session"]
---

# Update a session by ID

`PATCH /session/{sessionId}`

## Path parameters

- `sessionId` string, required

## Request body

- object
  - `end_time` string, date-time

## Response `200`

Session updated

- Session
  - `id` string
  - `project_id` string
  - `user` string
  - `start_time` string, date-time
  - `end_time` string, date-time

## Changes

- **2024-08-12** `5800c68dedbb` — 2 breaking, 1 warning, 1 info
  - for the `path` request parameter `sessionId`, the minLength was increased from `0` to `36`
  - added the pattern `^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$` to the `path` request parameter `sessionId`
  - for the `path` request parameter `sessionId`, the maxLength was set to `36`
  - the `id` response's property pattern `^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$` was added for the status `200`

[Change history](https://skmtc.dev/defra/apis/twiki-api/changes/session/:sessionId/patch.md)

---

[API](https://skmtc.dev/defra/apis/twiki-api.md) · [All operations](https://skmtc.dev/defra/apis/twiki-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/defra/twiki-api/revisions/c3ab20af61ef/schema)
