---
title: "Create chat session"
method: POST
path: "/ocs/v2.php/apps/assistant/chat/sessions"
tags: ["chat_api"]
---

# Create chat session

`POST /ocs/v2.php/apps/assistant/chat/sessions`

Create a new chat session, add a system message with user instructions

## Headers

- `OCS-APIRequest` boolean, required

## Request body

- object
  - `timestamp` integer, nullable — The session creation date
  - `title` string, nullable — The session title

## Response `200`

Chat session has been successfully created

- object
  - `session` ChatSession, required
    - `id` integer, required
    - `user_id` string, required
    - `title` string, nullable, required
    - `timestamp` integer, nullable, required
    - `agency_conversation_token` string, nullable, required
    - `agency_pending_actions` string, nullable, required
    - `summary` string, nullable, required
    - `is_remembered` boolean, required
    - `is_summary_up_to_date` boolean, required
    - `assignment_id` integer, nullable, required

## Other responses

- `401` — User is either not logged in or not found
- `500`

## Changes

> 51 revisions in range; 1 could not be searched.

- **2026-06-02** `4482cc378685` — 3 info
  - request body became optional
  - the request property `timestamp` became nullable
  - the request property `timestamp` became optional
- **2026-05-07** `20f0608853de` — 1 info
  - added the required property `session/assignment_id` to the response with the `200` status
- **2025-12-11** `efafd8e94fd1` — 1 info
  - endpoint added
- **2024-04-15** `baf79495237b` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/nextcloud/apis/assistant/changes/ocs/v2.php/apps/assistant/chat/sessions/post.md)

---

[API](https://skmtc.dev/nextcloud/apis/assistant.md) · [All operations](https://skmtc.dev/nextcloud/apis/assistant/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/nextcloud/assistant/revisions/9146d4951875/schema)
