---
title: "Widget on/off history"
method: GET
path: "/v1/sites/{site_id}/widgets/{widget_id}/history"
tags: ["Widgets"]
---

# Widget on/off history

`GET /v1/sites/{site_id}/widgets/{widget_id}/history`

## Request

- Base URL: `https://api.getsitecontrol.com`
- URL: `https://api.getsitecontrol.com/v1/sites/{site_id}/widgets/{widget_id}/history`
- Auth: HTTP bearer

Every time the widget was turned on or off, oldest first; `order=newest` gives the latest first. Deleting or restoring an active widget, or suspending the account, is recorded as a switch with a `reason`.

## Path parameters

- `site_id` integer, required
- `widget_id` integer, required

## Query parameters

- `cursor` string: `next_cursor` of the previous page, sent with the same `order`; omit for the first
- `limit` integer: Items per page
- `fields` string: Comma-separated fields to keep in each item, for example `id,name`; each item then carries only those fields and `id`. Omit for every field
- `order` 'oldest' | 'newest': Order of a list. oldest: the oldest item first; newest: the newest item first, for the latest items without paging through the history.

## Response `200`

Successful Response

- WidgetHistoryPage: One page of a list; `next_cursor` is null on the last page.
  - `items` WidgetHistoryEntry[], required
    - `id` integer, required
    - `occurred_at` string, date-time, required
    - `is_active` boolean, required: The state the widget was put in
    - `source` 'ui' | 'api' | 'mcp' | 'system' | 'support', required: Who made a change. ui: the admin; api: an API key; mcp: an AI assistant; system: done automatically; support: GetSiteControl support.
    - `reason` 'deleted' | 'restored' | 'account_suspended': deleted: turned off because the widget was deleted. restored: turned back on when the widget was restored. account_suspended: turned off because the account was suspended.
    - `api_key_id` integer, nullable: The key that made the switch, for source api
    - `author` Author: A user of the account, as the admin shows them.
      - `id` integer, nullable: null for Support or for a user who was deleted
      - `name` string, nullable: null when the user has no name
      - `email` string, nullable: The user's sign-in e-mail; null for Support
  - `next_cursor` string, nullable

## Other responses

- `400`: Unsupported GSC-Version
- `401`: Missing or invalid API key or access token
- `403`: Access denied
- `404`: Not found
- `422`: Validation failed
- `429`: Rate limited
- `503`: Temporarily unavailable; retry later

---

[API](https://skmtc.dev/getsitecontrol/apis/getsitecontrol-public-api.md) - [All operations](https://skmtc.dev/getsitecontrol/apis/getsitecontrol-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/getsitecontrol/apis/getsitecontrol-public-api/revisions/084fcad80e75?raw)
