---
title: "Revert a chat session to a specific commit"
method: POST
path: "/chat/sessions/{session_id}/revert"
tags: ["chat"]
---

# Revert a chat session to a specific commit

`POST /chat/sessions/{session_id}/revert`

## Path parameters

- `session_id` string, uuid, required

## Request body

- RevertToCommitRequest — Request structure for reverting to a git commit
  - `commit_hash` string, required — The git commit hash to revert to (must be 40 characters)

## Response `200`

Successfully reverted to commit

- RevertToCommitApiResponse — Response structure for reverting to a git commit
  - `commit_hash` string, required — The commit hash that was reverted to
  - `reverted_at` string, date-time, required — Timestamp when the revert occurred

## Other responses

- `400` — Invalid request or commit hash
- `403` — Access denied: insufficient permissions
- `404` — Session or commit not found

---

[API](https://skmtc.net/structifyai/apis/structify.md) · [All operations](https://skmtc.net/structifyai/apis/structify/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/structifyai/structify/versions/1364930b6980/schema)
