> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.coperniq.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.coperniq.io/_mcp/server.

## Sites endpoints

Full CRUD support for site records via the public API.

Sites are address/location records that belong to an account. A single account may have multiple sites.

### Endpoints

| Method   | Path                   | Description                                       |
| -------- | ---------------------- | ------------------------------------------------- |
| `GET`    | `/sites`               | List all sites. Optionally filter by `accountId`. |
| `POST`   | `/sites`               | Create a new site.                                |
| `GET`    | `/sites/{siteId}`      | Get a site by ID.                                 |
| `PATCH`  | `/sites/{siteId}`      | Update a site.                                    |
| `DELETE` | `/sites/{siteId}`      | Delete a site.                                    |
| `POST`   | `/sites/{siteId}/move` | Move a site to a different account.               |

### Create a site

`accountId` is required. Either `fullAddress` or `geoLocation` must also be provided. The backend automatically geocodes `fullAddress` and checks for duplicate addresses — if a site with the same address already exists for the same account, the existing site is returned (`200`) instead of creating a duplicate.

```
POST /sites
```

```json
{
  "accountId": 714570,
  "fullAddress": "123 Main St, San Francisco, CA 94105",
  "title": "Main Office",
  "timezone": "America/Los_Angeles"
}
```

### List sites by account

```
GET /sites?accountId=714570
```

### Update a site

All fields are optional. Updating `fullAddress` triggers re-geocoding. To move a site to a different account, use `POST /sites/{siteId}/move`.

```
PATCH /sites/9876
```

```json
{
  "title": "Updated Office Name",
  "fullAddress": "456 Oak Ave, San Francisco, CA 94107"
}
```

### Move a site to a different account

Moves the site and all associated records to a different account. The original site is permanently deleted and a new site is created on the target account. ⚠️ This operation is irreversible.

```
POST /sites/9876/move
```

```json
{
  "accountId": 789224
}
```