# client.projects.sites

> client.projects.sites — the projects.sites operations.

`client.projects.sites` — the `projects.sites` operations.

On `AsyncKindgi` every method is the same, awaited.

## `client.projects.sites.list()`

```python signature
list(
    project_id: str | UUID,
    /,
    *,
    limit: int | None = None,
    cursor: str | None = None,
    include_unregistered: bool | None = None,
    timeout: float | None = None,
) -> SiteCollectionPage
```

List the project's sites. `GET /v1/projects/{projectId}/sites`

The sites that sign their own people in to this project. Tenant admins only: a site creates people in the workspace. `includeUnregistered=true` lists unregistered ones too. Mounted when the deployment supplies a `SiteBinding`.

## `client.projects.sites.register()`

```python signature
register(
    project_id: str | UUID,
    body: RegisterSiteBody | Mapping[str, Any] | None = None,
    /,
    *,
    idempotency_key: str | None = None,
    timeout: float | None = None,
    **fields: Any,
) -> RegisterSiteResult
```

Register a site. `POST /v1/projects/{projectId}/sites`

A site that will sign its own people in to this project, and a one-time enrollment code for it, shown once: the site posts it with its public key (`POST /v1/auth/sites/enroll`). Until then it has no key and signs nobody in. A role map gives no reviewer role above `reviewerCeiling`, and names only `allowedRoles`; nothing it gives reaches above the project. Tenant admins only.

## `client.projects.sites.get()`

```python signature
get(
    project_id: str | UUID,
    site_id: str | UUID,
    /,
    *,
    timeout: float | None = None,
) -> Site
```

Read a site. `GET /v1/projects/{projectId}/sites/{siteId}`

Its settings and its keys (ids and thumbprints only). Tenant admins only.

## `client.projects.sites.update()`

```python signature
update(
    project_id: str | UUID,
    site_id: str | UUID,
    body: UpdateSiteBody | Mapping[str, Any] | None = None,
    /,
    *,
    idempotency_key: str | None = None,
    timeout: float | None = None,
    **fields: Any,
) -> Site
```

Change a site's settings. `PATCH /v1/projects/{projectId}/sites/{siteId}`

The settings given; the rest stay. A person's grants follow the new settings the next time the site signs them in. Tenant admins only.

## `client.projects.sites.pause()`

```python signature
pause(
    project_id: str | UUID,
    site_id: str | UUID,
    /,
    *,
    idempotency_key: str | None = None,
    timeout: float | None = None,
) -> Site
```

Stop a site's sign-ins. `POST /v1/projects/{projectId}/sites/{siteId}/pause`

The site's statements are refused until it's resumed, and its live sessions end now. Tenant admins only.

## `client.projects.sites.resume()`

```python signature
resume(
    project_id: str | UUID,
    site_id: str | UUID,
    /,
    *,
    idempotency_key: str | None = None,
    timeout: float | None = None,
) -> Site
```

Start a paused site's sign-ins again. `POST /v1/projects/{projectId}/sites/{siteId}/resume`

Tenant admins only.

## `client.projects.sites.unregister()`

```python signature
unregister(
    project_id: str | UUID,
    site_id: str | UUID,
    /,
    *,
    idempotency_key: str | None = None,
    timeout: float | None = None,
) -> Site
```

Unregister a site. `POST /v1/projects/{projectId}/sites/{siteId}/unregister`

Tombstoned: its sign-ins stop and its live sessions end. The people it signed in stay, with their records. Tenant admins only.

## `client.projects.sites.enrollment_code()`

```python signature
enrollment_code(
    project_id: str | UUID,
    site_id: str | UUID,
    /,
    *,
    idempotency_key: str | None = None,
    timeout: float | None = None,
) -> SiteEnrollmentCode
```

A new enrollment code for a site. `POST /v1/projects/{projectId}/sites/{siteId}/enrollment-codes`

How a site's key is replaced: the site posts a new key with this code, which replaces every key it had and ends its live sessions. An earlier unused code stops working. Shown once. Tenant admins only.

## `client.projects.sites.revoke_key()`

```python signature
revoke_key(
    project_id: str | UUID,
    site_id: str | UUID,
    kid: str,
    /,
    *,
    idempotency_key: str | None = None,
    timeout: float | None = None,
) -> Site
```

Revoke one of a site's keys. `POST /v1/projects/{projectId}/sites/{siteId}/keys/{kid}/revoke`

Statements signed with it are refused from now on, and Kindgi won't enroll it again, for this site or another site in the workspace at the same address. The site's live sessions end. Tenant admins only.

## `client.projects.sites.restore_person()`

```python signature
restore_person(
    project_id: str | UUID,
    site_id: str | UUID,
    user_id: str | UUID,
    /,
    *,
    idempotency_key: str | None = None,
    timeout: float | None = None,
) -> SitePersonRestoreResult
```

Let a person removed in Kindgi back in, through their site. `POST /v1/projects/{projectId}/sites/{siteId}/people/{userId}/restore`

For one of the site's people removed in Kindgi (`POST /v1/identity/users/{userId}/unregister`) while the site still knows them: they're in the workspace again, the same person, with their history, and their next sign-in through the site is theirs again. Their grants come back with that sign-in, from the site's role map then; their API keys and sessions stay gone. Refused, with nothing changed (`409 site-person-restore-refused`, `details.reason`): `not-removed` for someone in the workspace whose site still knows them; `left` when their site said they left it, removed in Kindgi too or not: a site forgets a person who leaves, and signs them in as a new person if they come back; `linked-elsewhere` when they also sign in another way (through another site, or the workspace's own sign-in), which letting them back in would open too: add them again instead, as a new person. A paused site's people can be let back in; an unregistered site's can't. Tenant admins only. Mounted when the deployment's site binding can let people back in.
