---
title: "Create a new session"
method: POST
path: "/session"
tags: ["session"]
---

# Create a new session

`POST /session`

## Request body

- object
  - `id` string
  - `project_id` string, required
  - `user` string, required
  - `start_time` string, date-time, required
  - `end_time` string, date-time

## Response `201`

Session created

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

## Changes

- **2024-08-13** `e5fd519e47a7` — 1 warning, 1 info
  - removed the request property `session_id`
  - added the new optional request property `id`
- **2024-08-12** `5800c68dedbb` — 3 breaking, 1 warning, 2 info
  - the request property `user` became required
  - the `project_id` request property's 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 request property `project_id`
  - the `project_id` request property's maxLength was set to `36`
  - …2 more

[Change history](https://skmtc.dev/defra/apis/twiki-api/changes/session/post.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)
