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

# Rename a workspace

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



## OpenAPI

````yaml /api-reference/openapi.json patch /api/v1/public/workspaces/{workspace_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/workspaces/{workspace_id}:
    patch:
      tags:
        - Account
      summary: Rename a workspace
      description: |-
        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.
      operationId: update_workspace
      parameters:
        - in: path
          name: workspace_id
          required: true
          schema:
            title: Workspace Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWorkspaceRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateWorkspaceResponse'
          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:
    UpdateWorkspaceRequest:
      additionalProperties: false
      description: Body for renaming a workspace the caller administers.
      properties:
        name:
          title: Name
          type: string
      title: UpdateWorkspaceRequest
      type: object
    UpdateWorkspaceResponse:
      description: The updated workspace.
      properties:
        changed:
          items:
            type: string
          title: Changed
          type: array
        updated:
          title: Updated
          type: boolean
        workspace:
          $ref: '#/components/schemas/WorkspaceRow'
      required:
        - updated
        - changed
        - workspace
      title: UpdateWorkspaceResponse
      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
    WorkspaceRow:
      description: >-
        A workspace as the write service returns it: id, name, the caller's
        role.
      properties:
        id:
          title: Id
          type: string
        name:
          title: Name
          type: string
        role:
          title: Role
          type: string
      required:
        - id
        - name
        - role
      title: WorkspaceRow
      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.