# create_site (/kya/reference/create-site)



Paste the `snippet` it returns into your pages; see the [Quickstart](/kya/quickstart). List your [origins](/kya/data#origins) so only your pages can report.

## POST https://api.finic.ai/v1/kya/sites

Creates a site: a public key (`gpk_…`) for the [snippet](/kya/quickstart) and the script tag that carries it. The key is not a secret; it goes in your pages. An organization can have 50 sites.

Authorization: `Bearer <API key>` (see [Authentication](/authentication)).

### Request body (application/json)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string |  | Optional. A name for people to recognize the site by. |
| `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
{
  "name": "Storefront",
  "origins": [
    "https://www.example.com"
  ]
}
```

### Responses

- **201**: The site, with its script tag.

| 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"
  ],
  "snippet": "<script async src=\"https://api.finic.ai/kya/agent.js\" data-site=\"gpk_Zk3vQ8mT1xR7bN2cYw5LpA9d\"></script>",
  "created_at": "2026-12-01T17:01:52.310447Z",
  "request_id": "req_01M4Z1X3H2N7Q4B8D6KC9TWEFA"
}
```

- **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.

- **409**: `limit_reached`: the organization already has 50 sites. [Delete one](/kya/reference/delete-site) first.

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