---
title: "Rename model"
method: PATCH
path: "/v1/models/{modelId}"
tags: ["Models"]
---

# Rename model

`PATCH /v1/models/{modelId}`

<Warning>
  Workbook models and query models cannot be renamed via this endpoint.
</Warning>

Rename a model. This endpoint allows you to programmatically rename models without using the UI, which is particularly useful for bulk operations on shared extension models created via `POST /api/v1/models`.

The new name must be unique among active models with the same `modelKind` and `baseModelId`.

**Branch-specific constraints:**

- Name must match git-compatible regex: `[\w\-/]+`
- No git ref path conflicts (e.g., cannot rename to `team` if `team/project` exists)
- Cannot rename branches with an open pull request (when `pullRequestUrl` is set) — renaming would desync Omni from the git remote

## Path parameters

- `modelId` string, uuid, required

## Request body

- object
  - `name` string, required — The new name for the model.

## Response `200`

Model renamed successfully

- Model
  - `id` string, uuid — ID of the model.
  - `baseModelId` string, uuid, nullable — ID of the base model, if applicable.
  - `connectionId` string, uuid, nullable — ID of the connection the model is based on.
  - `modelKind` string, nullable — The type of model.
  - `name` string, nullable — The name of the model.
  - `createdAt` string, date-time — The time the model was created.
  - `updatedAt` string, date-time — The time the model was last updated.
  - `deletedAt` string, date-time, nullable — The time the model was deleted, if applicable.

## Other responses

- `400` — Bad Request Possible error messages: - `Bad Request: Cannot rename models of kind WORKBOOK` - `Bad Request: Cannot rename models of kind QUERY` - `Bad Request: Model name must be unique` - `Bad Request: Branch name must match git-compatible regex [\w\-/]+` - `Bad Request: Branch name would create git ref path conflict` - `Bad Request: Cannot rename branch with open pull request`
- `403` — Forbidden - Insufficient permissions
- `404` — Not Found Possible error messages: - `Model not found`
- `429` — Too Many Requests - Rate limit exceeded (60 requests/minute)

---

[API](https://skmtc.net/omni/apis/omni-api.md) · [All operations](https://skmtc.net/omni/apis/omni-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/omni/omni-api/revisions/6b02f7349d0e/schema)
