---
title: "Refresh worktrees"
method: POST
path: "/api/worktree/refresh"
tags: ["worktree"]
---

# Refresh worktrees

`POST /api/worktree/refresh`

## Request

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

Load the project's canonical configuration, discover worktrees across known checkout roots using all available strategies, and reconcile saved state.

## Request body

- object
  - `projectID` string, required

## Response `204`

<No Content>

## Other responses

- `400`: WorktreeError | InvalidRequestError
- `401`: UnauthorizedError
- `404`: ProjectNotFoundError

---

[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)
