---
title: "Change a site's rules"
description: "Replace which pages of a site are imported and its schedule, then synchronise it."
canonical: "https://lookio.app/docs/api/resources/update-site-rules"
updated: "2026-10-29"
---

# Change a site's rules

Requires `resources:write`.

`PUT` replaces **all** the rules. Send the complete set under `rules`: patterns sent anywhere else are refused with `unknown_field`. Omit `rules` to keep the current ones, for example to change only the schedule; send `{}` to import the whole site. Omit `schedule` to keep the site's current interval.

Use `manual`, `daily`, `weekly`, `monthly`, or an interval such as `every_3_days`, `every_2_weeks` or `every_1_month`. Intervals range from 1 to 90 days, 1 to 52 weeks or 1 to 12 months. Recurring schedules require a paid plan; Free workspaces can use `manual`. The API returns `feature_not_available` if a Free workspace requests a recurring schedule.

The site is synchronised right away: pages the new rules leave out are removed, and new ones are imported. The resource must be a site, or the call fails with `conflict`.

Patterns apply to the path of a page. See [Rules](/docs/platform/websites#rules) for the syntax. Use [Preview a site](/docs/api/sites/preview-site) to try rules before you commit.

```http
PUT https://api.lookio.app/v1/resources/{resource_id}/rules
```

## Authorizations

- `Authorization` (bearer, in header, required)

## Path parameters

- `resource_id` (`string`, required, pattern: `^res_[abcdefghjkmnpqrstuvwxyz23456789]{12}$`)

## Body

`application/json`, required

- `rules` (`object`): The complete new rules, which replace the old ones. Omit to keep the current rules, for example to change only the schedule. Send `{}` to import the whole site.
- `rules.include` (`string[]`, default: `[]`, items: `≤ 50 items`): Path patterns to keep, such as `/docs/**`. `*` is one level, `**` everything below. Empty keeps the whole site.
- `rules.exclude` (`string[]`, default: `[]`, items: `≤ 50 items`): Path patterns to leave out, such as `/blog/**`.
- `rules.regex` (`string`, length: `≤ 500 chars`): Advanced: a regular expression on the path; matching pages are left out.
- `rules.excluded_urls` (`string[]`, default: `[]`, items: `≤ 5000 items`): Single pages to leave out, by full address.
- `schedule` (`string`, length: `≤ 40 chars`, pattern: `^(?:manual|daily|weekly|monthly|every_\d+_(?:day|days|week|weeks|month|months))$`): Omit to keep the site's current schedule. Recurring schedules require a paid plan.

## Response

**200**: Change which pages of a site are imported

- `data` (`object`, required)
- `data.id` (`string`, required, pattern: `^res_[abcdefghjkmnpqrstuvwxyz23456789]{12}$`)
- `data.title` (`string`, required)
- `data.type` (`enum<string>`, required, one of: `text, file, url, site`)
- `data.status` (`enum<string>`, required, one of: `queued, processing, ready, failed, stale, ready_simulated`): `queued` and `processing`: being read and indexed (pass `wait=true` or poll until it changes). `ready`: searchable. `failed`: see `status_detail`, then fix and call reindex.
- `data.status_detail` (`string,null`, required)
- `data.tags` (`string[]`, required)
- `data.source_url` (`string,null`, required): The page or site address, for `url` and `site` resources.
- `data.source` (`string,null`, required): Where it comes from, as shown with its citations.
- `data.site` (`object | null`, required): A site's page rules and schedule; null for other types.
- `data.site.rules` (`object`, required, default: `{"include":[],"exclude":[],"excluded_urls":[]}`)
- `data.site.rules.include` (`string[]`, required, default: `[]`, items: `≤ 50 items`): Path patterns to keep, such as `/docs/**`. `*` is one level, `**` everything below. Empty keeps the whole site.
- `data.site.rules.exclude` (`string[]`, required, default: `[]`, items: `≤ 50 items`): Path patterns to leave out, such as `/blog/**`.
- `data.site.rules.regex` (`string`, length: `≤ 500 chars`): Advanced: a regular expression on the path; matching pages are left out.
- `data.site.rules.excluded_urls` (`string[]`, required, default: `[]`, items: `≤ 5000 items`): Single pages to leave out, by full address.
- `data.site.schedule` (`string`, required, length: `≤ 40 chars`, pattern: `^(?:manual|daily|weekly|monthly|every_\d+_(?:day|days|week|weeks|month|months))$`): `manual` syncs only on request. Recurring schedules accept `daily`, `weekly`, `monthly`, or `every_N_days`, `every_N_weeks` and `every_N_months` (1-90 days, 1-52 weeks, 1-12 months). Recurring schedules require a paid plan.
- `data.site.last_synced_at` (`string,null`, required)
- `data.created_at` (`string`, required)
- `data.updated_at` (`string`, required)
- `request_id` (`string`, required)

```json
{
  "data": {
    "id": "<string>",
    "title": "<string>",
    "type": "text",
    "status": "queued",
    "status_detail": null,
    "tags": [
      "<string>"
    ],
    "source_url": null,
    "source": null,
    "site": {
      "rules": {
        "include": [],
        "exclude": [],
        "excluded_urls": []
      },
      "schedule": "<string>",
      "last_synced_at": null
    },
    "created_at": "<string>",
    "updated_at": "<string>"
  },
  "request_id": "<string>"
}
```

**400**: Possible codes: invalid_request, unknown_field, invalid_parameter, invalid_cursor

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>"
  },
  "request_id": "<string>"
}
```

**401**: Possible codes: authentication_required, invalid_api_key, api_key_expired, api_key_revoked, invalid_access_key

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>"
  },
  "request_id": "<string>"
}
```

**403**: Possible codes: insufficient_scope, feature_not_available, admin_required, permission_denied

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>"
  },
  "request_id": "<string>"
}
```

**404**: Possible codes: resource_not_found

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>"
  },
  "request_id": "<string>"
}
```

**409**: Possible codes: conflict, assistant_has_no_resources

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>"
  },
  "request_id": "<string>"
}
```

**413**: Possible codes: request_too_large

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>"
  },
  "request_id": "<string>"
}
```

**429**: Possible codes: rate_limited

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>"
  },
  "request_id": "<string>"
}
```

**500**: Possible codes: internal_error

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>"
  },
  "request_id": "<string>"
}
```

**503**: Possible codes: service_unavailable

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>"
  },
  "request_id": "<string>"
}
```

**Example request**

```bash
curl --request PUT \
  --url 'https://api.lookio.app/v1/resources/<resource_id>/rules' \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "rules": {
    "include": [],
    "exclude": [],
    "regex": "<string>",
    "excluded_urls": []
  },
  "schedule": "<string>"
}'
```
