---
title: "Edit a project"
method: PATCH
path: "/api/v1/public/projects/{project_id}"
tags: ["Account"]
---

# Edit a project

`PATCH /api/v1/public/projects/{project_id}`

## Request

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

Edit a project's name or trace retention.

Requires ADMIN role in the project's workspace (the write service
decides). A null ``trace_ttl_days`` returns retention to the plan default.

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.
    project_id (str): The project to edit.
    payload (UpdateProjectRequest): The fields to change.
    _live (None): Write-path liveness gate (blocks a revoked JWT session).

Returns:
    UpdateProjectResponse: The updated project 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

- `project_id` string, required

## Request body

- UpdateProjectRequest: Body for editing a project (requires ADMIN in its workspace).
  - `name` string
  - `trace_ttl_days` integer, nullable: Trace retention in days (1-365); null returns to the plan default

## Response `200`

Successful Response

- UpdateProjectResponse: The updated project.
  - `changed` string[], required
  - `project` ProjectRow, required: A project as the write service returns it.
    - `id` string, required
    - `name` string, required
    - `workspace_id` string, required
  - `updated` boolean, 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)
