# Update a sitemap rule

**Publié le** : 2026-05-08
**Catégorie** : SEO & Analytics

## `PUT /sitemap/rules/:id`

**Update a sitemap rule**

Updates an existing sitemap rule.

Required permissions: `sitemap.update`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | Yes | Unique identifier |


### Request Body

Content-Type: `application/json`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `sourceType` | "content_type" \| "category" \| "tag" \| "path_pattern" | No | One of: content_type, category, tag, path_pattern |
| `sourceValue` | string | No | 1-255 characters |
| `priority` | number | No | Between 0 and 1 |
| `changefreq` | "always" \| "hourly" \| "daily" \| "weekly" \| "monthly" \| "yearly" \| "never" | No | One of: always, hourly, daily, weekly, monthly, yearly, never |
| `ruleOrder` | number | No | Number |


### Responses

| Status | Description |
| --- | --- |
| `200` | Successful response |
| `401` | Unauthorized — invalid or missing API token |
| `403` | Forbidden — insufficient permissions |
| `404` | Not found |
| `422` | Validation error |


### Response Example

```json
{
  "data": {
    "id": 1,
    "pattern": "/old-blog/*",
    "replacement": "/blog/*",
    "isActive": true,
    "createdAt": "2025-02-01T10:00:00.000Z",
    "updatedAt": "2025-04-06T12:00:00.000Z"
  }
}
```

---