---
title: "Put instruction entry"
method: PUT
path: "/api/experimental/session/{sessionID}/instructions/entries/{key}"
tags: ["session"]
---

# Put instruction entry

`PUT /api/experimental/session/{sessionID}/instructions/entries/{key}`

## Request

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

Attach or replace one durable instruction entry. Changes announce as updates at the next step boundary.

## Path parameters

- `sessionID` string, required
- `key` string, required: Instruction entry key (lowercase alphanumerics plus . _ -)

## Request body

- object
  - `value` unknown, required

## Response `204`

<No Content>

## Other responses

- `400`: InvalidRequestError
- `401`: UnauthorizedError
- `404`: SessionNotFoundError
- `413`: InstructionEntryValueTooLargeError

## Changes

> 50 revisions in range; 1 not diffed.

- **2026-10-25** `7565a68e48f6`: 1 breaking, 4 info
  - the response's body type changed from no type to `object` for status `404`
  - removed `#/components/schemas/SessionNotFoundErrorEncoded, #/components/schemas/LocationNotFoundErrorEncoded` from the response body `anyOf` list for the response status `404`
  - added the required property `_tag` to the response with the `404` status
  - added the required property `message` to the response with the `404` status
  - …1 more

[Operation history](https://skmtc.dev/kaaass/apis/opencode/changes/api/experimental/session/:sessionID/instructions/entries/:key/put.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)
