# update_site (/kya/reference/update-site)



Send `name`, `origins` or both. `origins` replaces the whole list; see [Origins](/kya/data#origins).

## PATCH https://api.finic.ai/v1/kya/sites/{id}

Renames a site or replaces its [origins](/kya/data#origins): send `name`, `origins` or both. Its key stays the same. A change to its origins takes up to a minute to apply to reports.

Authorization: `Bearer <API key>` (see [Authentication](/authentication)).
- Path parameter `id`: The site's `id`.

### Request body (application/json)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string |  | A new name. |
| `origins` | array of string |  | Optional. The origins whose pages reports are taken from, each a scheme and host such as `https://www.example.com`; up to 20. With none, reports are taken from any page. See [Origins](/kya/data#origins). |

Example:

```json
{
  "origins": [
    "https://www.example.com",
    "https://shop.example.com"
  ]
}
```

### Responses

- **200**: The site, as changed.

| Field | Type | Always | Description |
| --- | --- | --- | --- |
| `id` | string | yes | The site's id, `kst_…`. |
| `name` | string | yes | Its name. Empty if none was given. |
| `key` | string | yes | Its public key, `gpk_…`: the `data-site` of the script tag. Not a secret. |
| `origins` | array of string | yes | The origins reports are taken from. Empty means any page. |
| `snippet` | string |  | The script tag to paste into your pages. Only when the site is created. |
| `created_at` | string | yes | When the site was created. |
| `request_id` | string |  | `req_…`, the same as the `X-Request-Id` header. |

```json
{
  "id": "kst_01M4Z1X3G5P8D2F6J0YA4SMQNC",
  "name": "Storefront",
  "key": "gpk_Zk3vQ8mT1xR7bN2cYw5LpA9d",
  "origins": [
    "https://www.example.com",
    "https://shop.example.com"
  ],
  "created_at": "2026-12-01T17:01:52.310447Z",
  "request_id": "req_01M4Z2M1T6W9E3R7Y5VA8PKGHB"
}
```

- **400**: `invalid_request`: the body isn't a JSON object or has an unknown field; `name` is over 100 characters; `origins` has more than 20 entries, or one that isn't a site's address.

- **401**: `authentication_error`: the API key is missing, unknown, revoked or expired.

- **404**: `not_found`: no site with this `id` in your organization.

- **429**: `rate_limited`: over KYA's [request rate](/kya/reference#limits) for the organization, 50 a second. Retry with backoff.
