# Source status event format

This service event reports a source's status and its `unavailableTypes` list. It arrives in the source's channel: `donations` for Donation Alerts, `twitch` for Twitch, or `youtube` for YouTube. The conditions for sending it are described below; for the meaning of each status, see [Source status](https://developers.donatty.com/en/sources.md#source-status).

## source.status_changed

Reports the observed status and `unavailableTypes` of an event source: a Donation Alerts source in the `donations` channel, a Twitch account in the `twitch` channel, or a YouTube channel in the `youtube` channel. `data` is the same source object returned by `GET /v1/event-sources`. The first observed non-`IDLE` state is published. Further checks send an event when `status` or `unavailableTypes` differs from the last published state; repeated checks with both unchanged send nothing. A source that stays `IDLE` sends nothing. A previously published source that becomes `IDLE` or disappears sends `IDLE` once. After a Donatty restart, the current non-`IDLE` state may be published again. A change to `unavailableTypes` alone does not reset `since`. Events of a source that is not `READY` may be missed: when it becomes `READY`, read the gap over REST starting a few minutes before `gapSince`. REST can return only events Donatty received.

**Channel:** `donations` (scope `donations:read`), `twitch` (scope `twitch:read`), `youtube` (scope `youtube:read`)

| Field | Type | Description |
|---|---|---|
| `id` | string, `evt_…` | Publication identifier: the same when the event is delivered again from the channel history. Every status change is a new event. |
| `type` | string, always `source.status_changed` |  |
| `subject` | string | Source identifier, `src_…`: `data.id`. |
| `dataschema` | string (URI), always [the SourceStatus schema address](https://api.donatty.com/v1/asyncapi.yaml#/components/schemas/SourceStatus) |  |
| `data` | [`SourceStatus`](https://developers.donatty.com/en/structures/event-source.md#sourcestatus) |  |

### Example

```json
{
  "specversion": "1.0",
  "id": "evt_17b2f4d8-ef50-4c84-9cf2-a48c06f9dbe5",
  "type": "source.status_changed",
  "source": "https://api.donatty.com/v1/streamer",
  "subject": "src_twitch_141981764",
  "time": "2026-11-09T10:31:12.533018Z",
  "datacontenttype": "application/json",
  "dataschema": "https://api.donatty.com/v1/asyncapi.yaml#/components/schemas/SourceStatus",
  "data": {
    "id": "src_twitch_141981764",
    "platform": "TWITCH",
    "accountId": "141981764",
    "status": "REAUTH_REQUIRED",
    "since": "2026-11-09T10:31:12.507394Z",
    "gapSince": "2026-11-09T10:31:04.112840Z",
    "unavailableTypes": [
      "twitch.reward.redeemed"
    ]
  }
}
```
