# Rename a Model

`PATCH /v1/models/{artifact_id}`

Rename one of the account's trained models. The name is for display: the
model's path (its id) does not change.

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

## Parameters

- `artifact_id` (path, string (uuid), required)
- `account_id` (query, string | null (uuid)): The account the model is in (the dashboard's active account), authorized as on /v1/models/list.

## Request body

Required: `application/json` `ModelRenameRequest`

## Responses

- `200` The renamed model: `application/json` `ModelItem`
- `400` No workspace selected: `application/json` `ErrorResponse`
- `401` Invalid or missing API key: `application/json` `ErrorResponse`
- `403` No pipelines:run on the model's workspace
- `404` No such model in the account: `application/json` `ErrorResponse`
- `422` Validation Error: `application/json` `HTTPValidationError`

## Schemas

```yaml
ModelRenameRequest:
  properties:
    display_name:
      description: The model's new name; null or blank restores its default
      maxLength: 120
      type:
        - string
        - "null"
  type: object
  title: ModelRenameRequest
ModelItem:
  properties:
    artifact_id:
      type: string
      format: uuid
      description: Artifact ID
    subtype:
      type: string
      description: Model subtype (vla_model, reward_model)
    path:
      type: string
      description: HuggingFace or local model path
    display_name:
      description: The name the model's owner gave it; null when never renamed
      type:
        - string
        - "null"
    metadata:
      additionalProperties: true
      type: object
    jobs:
      items:
        $ref: "#/components/schemas/JobLink"
      type: array
    created_at:
      type: string
      format: date-time
    updated_at:
      type: string
      format: date-time
  type: object
  required:
    - artifact_id
    - subtype
    - path
    - created_at
    - updated_at
  title: ModelItem
JobLink:
  properties:
    job_id:
      type: string
      format: uuid
    direction:
      type: string
      description: input or output
  type: object
  required:
    - job_id
    - direction
  title: JobLink
ErrorResponse:
  properties:
    detail:
      type: string
      description: Error message describing what went wrong
  type: object
  required:
    - detail
  title: ErrorResponse
  description: Standard error response.
HTTPValidationError:
  properties:
    detail:
      items:
        $ref: "#/components/schemas/ValidationError"
      type: array
  type: object
  title: HTTPValidationError
ValidationError:
  properties:
    loc:
      items:
        type:
          - string
          - integer
      type: array
      title: Location
    msg:
      type: string
      title: Message
    type:
      type: string
      title: Error Type
    input: {}
    ctx:
      type: object
      title: Context
  type: object
  required:
    - loc
    - msg
    - type
  title: ValidationError
```
