# Update Project

`PATCH /v1/projects/{project_id}`

Rename a workspace, or change its description or icon. Only the fields
sent change; a null description clears it, a null icon removes it.

It takes ``spaces:children`` on the workspace's organization, as the
dashboard's workspace settings do: the organization's contributors,
admins and owners. An API key acts as its creator and needs
``projects:write``. A key restricted to workspaces is refused: it does
not change the workspace that bounds it.

- Base URL: `https://api.qualia.dev`
- Authentication: an API key in the `X-API-Key` header, or `Authorization: Bearer …`

## Parameters

- `project_id` (path, string (uuid), required)

## Request body

Required: `application/json` `ProjectUpdateRequest`

## Responses

- `200` The workspace as it is now: `application/json` `ProjectItem`
- `401` Invalid or missing API key: `application/json` `ErrorResponse`
- `403` The caller cannot change the organization's workspaces, or the key is restricted to workspaces: `application/json` `ErrorResponse`
- `404` Project not found: `application/json` `ErrorResponse`
- `422` Nothing to change, or a malformed field

## Schemas

```yaml
ProjectUpdateRequest:
  properties:
    name:
      description: The new name
      maxLength: 255
      minLength: 1
      type:
        - string
        - "null"
    description:
      description: The new description; null clears it
      maxLength: 1000
      type:
        - string
        - "null"
    icon:
      description: An icon name from the dashboard's set; null for none
      pattern: ^[a-z][a-z0-9-]{0,39}$
      type:
        - string
        - "null"
  additionalProperties: false
  type: object
  title: ProjectUpdateRequest
  description: "What ``PATCH /v1/projects/{project_id}`` changes: only the fields sent."
ProjectItem:
  properties:
    project_id:
      type: string
      format: uuid
    name:
      type: string
    description:
      type:
        - string
        - "null"
    created_at:
      type: string
      format: date-time
    updated_at:
      type: string
      format: date-time
    is_default:
      type: boolean
      description: The organization's default workspace; it cannot be deleted
      default: false
    icon:
      description: Its icon, a name from the dashboard's set; null for none
      type:
        - string
        - "null"
    my_role:
      description: The caller's role there (for an API key, its creator's; the key's scopes cap what it may do with it); null when it could not be read
      nullable: true
      type: string
      enum:
        - viewer
        - contributor
        - admin
        - owner
  type: object
  required:
    - project_id
    - name
    - created_at
    - updated_at
  title: ProjectItem
  description: A workspace (a project), as the dashboard's workspace pages show it.
ErrorResponse:
  properties:
    detail:
      type: string
      description: Error message describing what went wrong
  type: object
  required:
    - detail
  title: ErrorResponse
  description: Standard error response.
```
