---
title: "Update session"
method: PATCH
path: "/api/session/{sessionID}"
tags: ["session"]
---

# Update session

`PATCH /api/session/{sessionID}`

## Request

- Base URL: `https://opencode.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://opencode.ai/api/session/{sessionID}`
- Auth: none required

Update mutable session properties.

## Path parameters

- `sessionID` string, required

## Request body

- object
  - `title` string, nullable
  - `metadata` SessionMetadata
  - `permissions` PermissionRule[]
    - `action` string, required
    - `resource` string, required
    - `effect` 'allow' | 'deny' | 'ask', required
  - `archived` boolean, nullable: Archive the session with true or restore it with false. Repeating the current state is a no-op.

## Response `204`

<No Content>

## Other responses

- `400`: InvalidRequestError
- `401`: UnauthorizedError
- `404`: SessionNotFoundError | LocationNotFoundError

## Changes

> 50 revisions in range; 1 not diffed.

- **2026-10-20** `7d8042ed3561`: 1 info
  - added the new optional request property `archived`

[Operation history](https://skmtc.dev/kaaass/apis/opencode/changes/api/session/:sessionID/patch.md)

---

[API](https://skmtc.dev/kaaass/apis/opencode.md) - [All operations](https://skmtc.dev/kaaass/apis/opencode/llms.txt) - [OpenAPI document](https://skmtc.dev/kaaass/apis/opencode/revisions/4e083d954707?raw)
