> ## Documentation Index
> Fetch the complete documentation index at: https://traceroot.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Edit a project

> 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.



## OpenAPI

````yaml /api-reference/openapi.json patch /api/v1/public/projects/{project_id}
openapi: 3.1.0
info:
  title: TraceRoot Public API
  version: 0.1.0
servers:
  - description: TraceRoot Cloud
    url: https://app.traceroot.ai
  - description: Self-hosted
    url: '{baseUrl}'
    variables:
      baseUrl:
        default: http://localhost:8000
        description: Your TraceRoot backend URL
security: []
paths:
  /api/v1/public/projects/{project_id}:
    patch:
      tags:
        - Account
      summary: Edit a project
      description: >-
        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.
      operationId: update_project
      parameters:
        - in: path
          name: project_id
          required: true
          schema:
            title: Project Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateProjectRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateProjectResponse'
          description: Successful Response
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Invalid request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Authentication failed or session revoked
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Insufficient role or wrong credential kind
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Name already in use
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Write service unavailable
      security:
        - BearerAuth: []
components:
  schemas:
    UpdateProjectRequest:
      additionalProperties: false
      description: Body for editing a project (requires ADMIN in its workspace).
      properties:
        name:
          title: Name
          type: string
        trace_ttl_days:
          anyOf:
            - type: integer
            - type: 'null'
          description: Trace retention in days (1-365); null returns to the plan default
          title: Trace Ttl Days
      title: UpdateProjectRequest
      type: object
    UpdateProjectResponse:
      description: The updated project.
      properties:
        changed:
          items:
            type: string
          title: Changed
          type: array
        project:
          $ref: '#/components/schemas/ProjectRow'
        updated:
          title: Updated
          type: boolean
      required:
        - updated
        - changed
        - project
      title: UpdateProjectResponse
      type: object
    ErrorResponse:
      description: >-
        The canonical public error envelope (matches the gateway's normalized
        shape).
      properties:
        detail:
          title: Detail
          type: string
      required:
        - detail
      title: ErrorResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ProjectRow:
      description: A project as the write service returns it.
      properties:
        id:
          title: Id
          type: string
        name:
          title: Name
          type: string
        workspace_id:
          title: Workspace Id
          type: string
      required:
        - id
        - name
        - workspace_id
      title: ProjectRow
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    BearerAuth:
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.