---
title: "Rename a workspace"
method: PATCH
path: "/api/v1/public/workspaces/{workspace_id}"
tags: ["Account"]
---

# Rename a workspace

`PATCH /api/v1/public/workspaces/{workspace_id}`

## Request

- Base URL: `https://app.traceroot.ai`
- URL: `https://app.traceroot.ai/api/v1/public/workspaces/{workspace_id}`
- Auth: HTTP bearer

Rename a workspace the authenticated user administers.

Requires ADMIN role in the workspace (the write service decides).
Workspace membership is the tenancy here, so a workspace outside the
caller's memberships is a 403 rather than a 404, as on the project
create; a name the caller already administers a workspace under is a
409.

Args:
    request (Request): Incoming request (rate-limit plumbing).
    response (Response): Outgoing response (rate-limit plumbing).
    auth (AccountStampedAuth): Account-scope user auth (session token or
        CLI access JWT); its resolved ``user_id`` becomes the actor.
    workspace_id (str): The workspace to edit.
    payload (UpdateWorkspaceRequest): The fields to change.
    _live (None): Write-path liveness gate (blocks a revoked JWT session).

Returns:
    UpdateWorkspaceResponse: The updated workspace and the changed fields.

Raises:
    HTTPException: The write service's 400/403/404/409 verbatim, or a
        503 when its response is ambiguous.

## Path parameters

- `workspace_id` string, required

## Request body

- UpdateWorkspaceRequest: Body for renaming a workspace the caller administers.
  - `name` string

## Response `200`

Successful Response

- UpdateWorkspaceResponse: The updated workspace.
  - `changed` string[], required
  - `updated` boolean, required
  - `workspace` WorkspaceRow, required: A workspace as the write service returns it: id, name, the caller's role.
    - `id` string, required
    - `name` string, required
    - `role` string, required

## Other responses

- `400`: Invalid request
- `401`: Authentication failed or session revoked
- `403`: Insufficient role or wrong credential kind
- `404`: Not found
- `409`: Name already in use
- `422`: Validation Error
- `503`: Write service unavailable

---

[API](https://skmtc.dev/traceroot/apis/traceroot-public-api.md) - [All operations](https://skmtc.dev/traceroot/apis/traceroot-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/traceroot/apis/traceroot-public-api/revisions/ce6aef96c0d6?raw)
