> ## Documentation Index
> Fetch the complete documentation index at: https://wordsmithai.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Repository

> Rename a repository or change its description.

> [!NOTE]
>
> **Preview.** This endpoint is available to organisations in the Wordsmith MCP pilot. Other organisations receive `403 mcp_not_enabled`. See the [preview overview](/preview).

Changes a repository's name or description. Send only the fields you want to change. Fields you leave out keep their current value. Set `description` to `null` to clear it.

## Authentication

Requires an API key, or an OAuth token with `repositories:write`. The caller also needs edit access to the repository.

## Path parameters

**repository\_id** `string` *required*

The repository id.

## Body parameters

**name** `string`

The new name, up to 200 characters.

**description** `string | null`

The new description, up to 2,000 characters, or `null` to clear it.

## Response

Returns `200` with the updated repository, in the shape [Get Repository](/api-reference/repositories/get-repository) returns.

```bash cURL theme={null}
curl -X PATCH "https://api.wordsmith.ai/api/v1/repositories/b23066a1-44cb-4b31-8b44-c723dc507d9b" \
  -H "Authorization: Bearer sk-ws-api1-your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Commercial leases (UK)",
    "description": "Signed leases for the UK retail and office estate."
  }'
```

```json Response theme={null}
{
  "id": "b23066a1-44cb-4b31-8b44-c723dc507d9b",
  "name": "Commercial leases (UK)",
  "description": "Signed leases for the UK retail and office estate.",
  "document_count": 214,
  "url": "https://app.wordsmith.ai/repositories/b23066a1-44cb-4b31-8b44-c723dc507d9b",
  "created_at": "2026-10-13T08:12:04Z",
  "updated_at": "2026-10-13T10:05:33Z",
  "indexing_status": "idle"
}
```

## Errors

| Status | `error_code` | When |
| - | - | - |
| 400 | `invalid_request_body` | The body sets no field, `name` is null, empty or longer than 200 characters, `description` is longer than 2,000, or the body has an unknown field. |
| 401 | `unauthorized` | The API key or token is missing or invalid. |
| 403 | `mcp_not_enabled` | Your organisation is not in the preview. |
| 403 | `forbidden` | The caller can read the repository but cannot edit it. |
| 404 | `resource_not_found` | No repository with this id, or the caller cannot read it. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.