---
title: "Rename Context"
method: PATCH
path: "/v0/project/{project_name}/contexts/{context_name}/rename"
tags: ["Contexts"]
---

# Rename Context

`PATCH /v0/project/{project_name}/contexts/{context_name}/rename`

Rename an existing context within a project.

## Path parameters

- `project_name` string, required
- `context_name` string, required

## Query parameters

- `include_children` boolean — Whether to rename child contexts (which share the same '/' separated prefix). When True, renaming 'A' to 'E' will also rename 'A/B/C' to 'E/B/C', 'A/B/D' to 'E/B/D', etc.

## Request body

- RenameContextRequest — Request model for renaming an existing context.
  - `name` string, required — New name for the context, must meet naming rules

## Response `200`

Context renamed successfully

- unknown

## Other responses

- `400` — Context with new name already exists
- `403` — Forbidden Operation
- `404` — Project or Context Not Found
- `422` — Validation Error

---

[API](https://skmtc.dev/unify/apis/unifyai-http-api-reference.md) · [All operations](https://skmtc.dev/unify/apis/unifyai-http-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/unify/unifyai-http-api-reference/revisions/900377f918b6/schema)
