{
  "openapi": "3.1.0",
  "info": {
    "title": "Donatty public API",
    "version": "1.0.0",
    "summary": "Read-only data of one Donatty streamer: profile, donations, goals, top donors, totals and events of the linked Twitch account.",
    "description": "Every route returns data of exactly the streamer who issued the key; there is no way to ask for another streamer. Authentication: `Authorization: Bearer dnt_...` only \u2014 a secret key `dnt_pat_...` (servers, bots) or the public key `dnt_pk_...` (static sites: profile, goals and statistics, accepted from the streamer's allowed site Origins only). Keys in the query string are rejected with `400 token_in_query`; cookies are ignored.\n\nFormats: ids are `<prefix>_<uuid>` strings; time is RFC 3339 in UTC; money is `{value, currency}` with a decimal string and an ISO 4217 code. Clients must ignore unknown fields and enum values: v1 only adds.\n\nErrors are `application/problem+json` (RFC 9457) with `type`, `title`, `status`, `detail` and `code`.\n\nRate limits (per minute): `app-user` 600 (app \u00d7 streamer), `app` 6000 (app over all streamers), `user` 1200 (streamer over all apps), `publishable-ip` 60 (public key \u00d7 client address). `app-user`, `app` and `user` are counted separately for the secret keys and for the public key; all secret keys of a streamer share one budget. Responses after successful key authentication carry `RateLimit-Policy` and `RateLimit` (draft-ietf-httpapi-ratelimit-headers-08); responses before it (401, `wrong_token_type`, `token_in_query`, `origin_not_allowed`) and this document do not."
  },
  "x-donatty-access": {
    "secretKeyLifetimeDays": [
      30,
      90,
      365
    ],
    "maxActiveKeys": 20
  },
  "servers": [
    {
      "url": "https://api.donatty.com"
    }
  ],
  "tags": [
    {
      "name": "v1",
      "description": "Public API v1"
    }
  ],
  "paths": {
    "/v1/streamer": {
      "get": {
        "operationId": "getStreamer",
        "summary": "Streamer profile",
        "description": "Your public profile: nickname, name, avatar and the donation page link.",
        "tags": [
          "v1"
        ],
        "security": [
          {
            "personalToken": [
              "profile:read"
            ]
          },
          {
            "publishableKey": [
              "profile:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Streamer"
                },
                "example": {
                  "id": "str_5b0c2f4e-8d61-4f43-9a7e-2f1d3c6b9a10",
                  "slug": "teststreamer",
                  "displayName": "Test Streamer",
                  "avatarUrl": "https://storage.donatty.com/avatars/teststreamer.png",
                  "donatePageUrl": "https://donatty.com/teststreamer"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is invalid, or the key was sent in the request address.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-invalid-parameter": {
                    "$ref": "#/components/examples/error-invalid-parameter"
                  },
                  "error-token-in-query": {
                    "$ref": "#/components/examples/error-token-in-query"
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, unknown, deleted or expired.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-missing-token": {
                    "$ref": "#/components/examples/error-missing-token"
                  },
                  "error-invalid-token": {
                    "$ref": "#/components/examples/error-invalid-token"
                  },
                  "error-token-expired": {
                    "$ref": "#/components/examples/error-token-expired"
                  }
                }
              }
            },
            "headers": {
              "WWW-Authenticate": {
                "$ref": "#/components/headers/WWW-Authenticate"
              }
            }
          },
          "403": {
            "description": "Wrong kind of key, the key lacks the `profile:read` scope, or the public key came from an address that is not in its list.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-wrong-token-type": {
                    "$ref": "#/components/examples/error-wrong-token-type"
                  },
                  "error-insufficient-scope": {
                    "$ref": "#/components/examples/error-insufficient-scope"
                  },
                  "error-origin-not-allowed": {
                    "$ref": "#/components/examples/error-origin-not-allowed"
                  }
                }
              }
            },
            "headers": {
              "WWW-Authenticate": {
                "$ref": "#/components/headers/WWW-Authenticate"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-rate-limited": {
                    "$ref": "#/components/examples/error-rate-limited"
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            }
          },
          "500": {
            "description": "The request failed on our side.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-internal-error": {
                    "$ref": "#/components/examples/error-internal-error"
                  }
                }
              }
            }
          },
          "503": {
            "description": "The API is temporarily unavailable.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-service-unavailable": {
                    "$ref": "#/components/examples/error-service-unavailable"
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        }
      }
    },
    "/v1/donations": {
      "get": {
        "operationId": "listDonations",
        "summary": "Donations",
        "description": "Your donations, newest first: from Donatty and from Donation Alerts when it is connected. Without a filter you get every donation with its full text, including ones rejected by moderation or still waiting for a decision. To get only what can be shown on stream, add `moderation=PASSED,NONE`. The response has no donor contacts, order or service fee; of the payment details it has only `feeCompensation` (the extra amount the donor paid to cover the fee) and `paymentMethod` (`CARD`, `SBP` or `null`).",
        "tags": [
          "v1"
        ],
        "security": [
          {
            "personalToken": [
              "donations:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          },
          {
            "$ref": "#/components/parameters/since"
          },
          {
            "$ref": "#/components/parameters/source"
          },
          {
            "$ref": "#/components/parameters/moderation"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DonationPage"
                },
                "example": {
                  "items": [
                    {
                      "id": "don_5d2e8f31-6a47-4c19-9b0e-7f3a2d1c8e46",
                      "createdAt": "2026-11-09T10:21:47Z",
                      "source": "DONATTY",
                      "donorName": "\u0410\u043b\u0435\u043a\u0441\u0435\u0439",
                      "message": "\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0441\u0442\u0440\u0438\u043c!",
                      "amount": {
                        "value": "500.00",
                        "currency": "RUB"
                      },
                      "feeCompensation": {
                        "value": "27.00",
                        "currency": "RUB"
                      },
                      "paymentMethod": "CARD",
                      "goal": null,
                      "moderation": {
                        "status": "PASSED",
                        "deadline": null
                      },
                      "media": null
                    },
                    {
                      "id": "don_0f6e2a4c-91b3-4d7a-8c5e-3b2a1f0e9d84",
                      "createdAt": "2026-11-09T10:15:30.123456Z",
                      "source": "DONATTY",
                      "donorName": "Alex",
                      "message": "Thanks for the stream!",
                      "amount": {
                        "value": "500.00",
                        "currency": "RUB"
                      },
                      "feeCompensation": null,
                      "paymentMethod": "SBP",
                      "goal": {
                        "id": "goal_7e3a9c10-4b2d-4f8e-a1c6-0d9b8e7f6a52",
                        "title": "New microphone"
                      },
                      "moderation": {
                        "status": "PENDING",
                        "deadline": "2026-11-09T10:16:30Z"
                      },
                      "media": {
                        "title": "Song of the day",
                        "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
                        "provider": "YOUTUBE",
                        "durationSeconds": 212,
                        "moderation": {
                          "status": "PENDING",
                          "deadline": "2026-11-09T10:16:30Z"
                        }
                      }
                    },
                    {
                      "id": "don_3c9d7b21-5e84-4a6f-b0d2-8e1f4a7c6b35",
                      "createdAt": "2026-11-09T10:02:11Z",
                      "source": "DONATTY",
                      "donorName": "Anonymous",
                      "message": "This text was rejected by moderation but is returned in full.",
                      "amount": {
                        "value": "150.50",
                        "currency": "RUB"
                      },
                      "feeCompensation": null,
                      "paymentMethod": "CARD",
                      "goal": null,
                      "moderation": {
                        "status": "BLOCKED",
                        "deadline": null
                      },
                      "media": null
                    },
                    {
                      "id": "don_9a1b2c3d-4e5f-4a6b-8c7d-0e1f2a3b4c5d",
                      "createdAt": "2026-11-09T09:58:00Z",
                      "source": "DONATION_ALERTS",
                      "donorName": "Maria",
                      "message": "Hi from Donation Alerts",
                      "amount": {
                        "value": "5.00",
                        "currency": "USD"
                      },
                      "feeCompensation": null,
                      "paymentMethod": null,
                      "goal": null,
                      "moderation": {
                        "status": "NONE",
                        "deadline": null
                      },
                      "media": null
                    }
                  ],
                  "nextCursor": "MTc5NDIxODI4MDAwMDAwMC45YTFiMmMzZC00ZTVmLTRhNmItOGM3ZC0wZTFmMmEzYjRjNWQ"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is invalid, or the key was sent in the request address.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-invalid-parameter": {
                    "$ref": "#/components/examples/error-invalid-parameter"
                  },
                  "error-token-in-query": {
                    "$ref": "#/components/examples/error-token-in-query"
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, unknown, deleted or expired.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-missing-token": {
                    "$ref": "#/components/examples/error-missing-token"
                  },
                  "error-invalid-token": {
                    "$ref": "#/components/examples/error-invalid-token"
                  },
                  "error-token-expired": {
                    "$ref": "#/components/examples/error-token-expired"
                  }
                }
              }
            },
            "headers": {
              "WWW-Authenticate": {
                "$ref": "#/components/headers/WWW-Authenticate"
              }
            }
          },
          "403": {
            "description": "Wrong kind of key, or the key lacks the `donations:read` scope. The public key never has it.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-wrong-token-type": {
                    "$ref": "#/components/examples/error-wrong-token-type"
                  },
                  "error-insufficient-scope": {
                    "$ref": "#/components/examples/error-insufficient-scope"
                  }
                }
              }
            },
            "headers": {
              "WWW-Authenticate": {
                "$ref": "#/components/headers/WWW-Authenticate"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-rate-limited": {
                    "$ref": "#/components/examples/error-rate-limited"
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            }
          },
          "500": {
            "description": "The request failed on our side.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-internal-error": {
                    "$ref": "#/components/examples/error-internal-error"
                  }
                }
              }
            }
          },
          "503": {
            "description": "The API is temporarily unavailable.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-service-unavailable": {
                    "$ref": "#/components/examples/error-service-unavailable"
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        }
      }
    },
    "/v1/goals": {
      "get": {
        "operationId": "listGoals",
        "summary": "Fundraising goals",
        "description": "Your fundraising goals, newest first. `raised` includes the amount you started the goal with (the \u00ab\u041d\u0430\u0447\u0430\u0442\u044c \u0441\u0431\u043e\u0440 \u0441\u00bb (Start collecting from) field) and every Donatty donation to the goal, including ones rejected by moderation. Donation Alerts goals and widget settings are not counted, so the amount may differ from what the widget shows on stream.",
        "tags": [
          "v1"
        ],
        "security": [
          {
            "personalToken": [
              "goals:read"
            ]
          },
          {
            "publishableKey": [
              "goals:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/goalStatus"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GoalPage"
                },
                "example": {
                  "items": [
                    {
                      "id": "goal_7e3a9c10-4b2d-4f8e-a1c6-0d9b8e7f6a52",
                      "title": "New microphone",
                      "target": {
                        "value": "15000.00",
                        "currency": "RUB"
                      },
                      "raised": {
                        "value": "6420.50",
                        "currency": "RUB"
                      },
                      "status": "ACTIVE",
                      "endsAt": "2026-12-31T21:00:00Z",
                      "createdAt": "2026-10-01T12:00:00Z"
                    }
                  ],
                  "nextCursor": "MTc5MDg1NjAwMDAwMDAwMC43ZTNhOWMxMC00YjJkLTRmOGUtYTFjNi0wZDliOGU3ZjZhNTI"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is invalid, or the key was sent in the request address.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-invalid-parameter": {
                    "$ref": "#/components/examples/error-invalid-parameter"
                  },
                  "error-token-in-query": {
                    "$ref": "#/components/examples/error-token-in-query"
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, unknown, deleted or expired.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-missing-token": {
                    "$ref": "#/components/examples/error-missing-token"
                  },
                  "error-invalid-token": {
                    "$ref": "#/components/examples/error-invalid-token"
                  },
                  "error-token-expired": {
                    "$ref": "#/components/examples/error-token-expired"
                  }
                }
              }
            },
            "headers": {
              "WWW-Authenticate": {
                "$ref": "#/components/headers/WWW-Authenticate"
              }
            }
          },
          "403": {
            "description": "Wrong kind of key, the key lacks the `goals:read` scope, or the public key came from an address that is not in its list.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-wrong-token-type": {
                    "$ref": "#/components/examples/error-wrong-token-type"
                  },
                  "error-insufficient-scope": {
                    "$ref": "#/components/examples/error-insufficient-scope"
                  },
                  "error-origin-not-allowed": {
                    "$ref": "#/components/examples/error-origin-not-allowed"
                  }
                }
              }
            },
            "headers": {
              "WWW-Authenticate": {
                "$ref": "#/components/headers/WWW-Authenticate"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-rate-limited": {
                    "$ref": "#/components/examples/error-rate-limited"
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            }
          },
          "500": {
            "description": "The request failed on our side.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-internal-error": {
                    "$ref": "#/components/examples/error-internal-error"
                  }
                }
              }
            }
          },
          "503": {
            "description": "The API is temporarily unavailable.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-service-unavailable": {
                    "$ref": "#/components/examples/error-service-unavailable"
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        }
      }
    },
    "/v1/stats/top": {
      "get": {
        "operationId": "getStatsTop",
        "summary": "Top donors",
        "description": "The donors with the largest totals for today, this week, month, year or all time. Donations from all connected sources are counted and converted to rubles. Donors with the same name in different sources are counted as one.",
        "tags": [
          "v1"
        ],
        "security": [
          {
            "personalToken": [
              "stats:read"
            ]
          },
          {
            "publishableKey": [
              "stats:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/topPeriod"
          },
          {
            "$ref": "#/components/parameters/topLimit"
          },
          {
            "$ref": "#/components/parameters/timeZone"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Top"
                },
                "example": {
                  "period": "WEEK",
                  "from": "2026-11-08T21:00:00Z",
                  "to": "2026-11-15T21:00:00Z",
                  "items": [
                    {
                      "rank": 1,
                      "name": "Alex",
                      "total": {
                        "value": "12500.00",
                        "currency": "RUB"
                      }
                    },
                    {
                      "rank": 2,
                      "name": "Maria",
                      "total": {
                        "value": "4300.75",
                        "currency": "RUB"
                      }
                    },
                    {
                      "rank": 3,
                      "name": "Ivan",
                      "total": {
                        "value": "1000.00",
                        "currency": "RUB"
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "A parameter is invalid, or the key was sent in the request address.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-invalid-parameter": {
                    "$ref": "#/components/examples/error-invalid-parameter"
                  },
                  "error-token-in-query": {
                    "$ref": "#/components/examples/error-token-in-query"
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, unknown, deleted or expired.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-missing-token": {
                    "$ref": "#/components/examples/error-missing-token"
                  },
                  "error-invalid-token": {
                    "$ref": "#/components/examples/error-invalid-token"
                  },
                  "error-token-expired": {
                    "$ref": "#/components/examples/error-token-expired"
                  }
                }
              }
            },
            "headers": {
              "WWW-Authenticate": {
                "$ref": "#/components/headers/WWW-Authenticate"
              }
            }
          },
          "403": {
            "description": "Wrong kind of key, the key lacks the `stats:read` scope, or the public key came from an address that is not in its list.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-wrong-token-type": {
                    "$ref": "#/components/examples/error-wrong-token-type"
                  },
                  "error-insufficient-scope": {
                    "$ref": "#/components/examples/error-insufficient-scope"
                  },
                  "error-origin-not-allowed": {
                    "$ref": "#/components/examples/error-origin-not-allowed"
                  }
                }
              }
            },
            "headers": {
              "WWW-Authenticate": {
                "$ref": "#/components/headers/WWW-Authenticate"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-rate-limited": {
                    "$ref": "#/components/examples/error-rate-limited"
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            }
          },
          "500": {
            "description": "The request failed on our side.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-internal-error": {
                    "$ref": "#/components/examples/error-internal-error"
                  }
                }
              }
            }
          },
          "503": {
            "description": "The API is temporarily unavailable.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-service-unavailable": {
                    "$ref": "#/components/examples/error-service-unavailable"
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        }
      }
    },
    "/v1/stats/total": {
      "get": {
        "operationId": "getStatsTotal",
        "summary": "Total donated",
        "description": "The total donated for today, this week, month, year or all time. Donations from all connected sources are counted, including ones rejected by moderation, and converted to rubles.",
        "tags": [
          "v1"
        ],
        "security": [
          {
            "personalToken": [
              "stats:read"
            ]
          },
          {
            "publishableKey": [
              "stats:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/totalPeriod"
          },
          {
            "$ref": "#/components/parameters/totalTimeZone"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Total"
                },
                "example": {
                  "period": "DAY",
                  "from": "2026-11-09T17:00:00Z",
                  "to": "2026-11-10T17:00:00Z",
                  "total": {
                    "value": "18250.25",
                    "currency": "RUB"
                  }
                }
              }
            }
          },
          "400": {
            "description": "A parameter is invalid, or the key was sent in the request address.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-invalid-parameter": {
                    "$ref": "#/components/examples/error-invalid-parameter"
                  },
                  "error-token-in-query": {
                    "$ref": "#/components/examples/error-token-in-query"
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, unknown, deleted or expired.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-missing-token": {
                    "$ref": "#/components/examples/error-missing-token"
                  },
                  "error-invalid-token": {
                    "$ref": "#/components/examples/error-invalid-token"
                  },
                  "error-token-expired": {
                    "$ref": "#/components/examples/error-token-expired"
                  }
                }
              }
            },
            "headers": {
              "WWW-Authenticate": {
                "$ref": "#/components/headers/WWW-Authenticate"
              }
            }
          },
          "403": {
            "description": "Wrong kind of key, the key lacks the `stats:read` scope, or the public key came from an address that is not in its list.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-wrong-token-type": {
                    "$ref": "#/components/examples/error-wrong-token-type"
                  },
                  "error-insufficient-scope": {
                    "$ref": "#/components/examples/error-insufficient-scope"
                  },
                  "error-origin-not-allowed": {
                    "$ref": "#/components/examples/error-origin-not-allowed"
                  }
                }
              }
            },
            "headers": {
              "WWW-Authenticate": {
                "$ref": "#/components/headers/WWW-Authenticate"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-rate-limited": {
                    "$ref": "#/components/examples/error-rate-limited"
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            }
          },
          "500": {
            "description": "The request failed on our side.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-internal-error": {
                    "$ref": "#/components/examples/error-internal-error"
                  }
                }
              }
            }
          },
          "503": {
            "description": "The API is temporarily unavailable.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-service-unavailable": {
                    "$ref": "#/components/examples/error-service-unavailable"
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        }
      }
    },
    "/v1/platform-events": {
      "get": {
        "operationId": "listPlatformEvents",
        "summary": "Platform events",
        "description": "Events of your linked Twitch and YouTube accounts, newest first: the same objects as `data` of the `twitch.*` and `youtube.*` live events. With `twitch:read`: follows, subscriptions and gifted subscriptions, cheers, raids, channel points rewards and hype train levels. With `youtube:read`: new subscribers, channel members, Super Chats and Super Stickers. Either scope is enough. Without `platform` and `type` filters, results include every platform allowed by the key. Each page is checked against the key; a cursor cannot grant access to more platforms.\n\nOnly events Donatty received are listed. Donatty subscribes to Twitch events while a connection with the `twitch` live channel is open or a Twitch widget is used, and polls YouTube while a connection with the `youtube` channel is open or a YouTube widget is used. Earlier events may therefore be missing; no retention period is promised.\n\nTo catch up after a gap in live events, request `order=asc` with `since` set to `recordedAt` of the last event you handled minus a few minutes. Follow `nextCursor` to the end of the pass and discard events whose `id` you have already handled.\n\nSubscription matching usually adds 15\u201325 seconds to `twitch.subscription` built from `channel.subscribe`, and to `twitch.subscription.received` and `twitch.subscription.gift`; a subscription with a message can arrive sooner. YouTube events arrive with the polling delay, which grows when many streamers share the daily YouTube quota. The delay from the action on the platform has no hard bound under failures or load: `recordedAt` is when Donatty recorded the event.",
        "tags": [
          "v1"
        ],
        "security": [
          {
            "personalToken": [
              "twitch:read"
            ]
          },
          {
            "personalToken": [
              "youtube:read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          },
          {
            "$ref": "#/components/parameters/platformSince"
          },
          {
            "$ref": "#/components/parameters/platform"
          },
          {
            "$ref": "#/components/parameters/platformEventType"
          },
          {
            "$ref": "#/components/parameters/order"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlatformEventPage"
                },
                "example": {
                  "items": [
                    {
                      "id": "pevt_40ab6ec8-b253-4d9f-a74a-8bcf50bd3269",
                      "platform": "YOUTUBE",
                      "type": "youtube.super_sticker",
                      "accountId": "104857306182736450192",
                      "occurredAt": "2026-11-09T10:26:33.490Z",
                      "recordedAt": "2026-11-09T10:26:41.027519Z",
                      "actor": {
                        "id": "UCp5Lk8Jh2Gf6Ds9Az3Xc7Vb",
                        "login": null,
                        "displayName": "Sticker Fan",
                        "avatarUrl": "https://yt3.ggpht.com/a/UCp5Lk8Jh2Gf6Ds9Az3Xc7Vb=s88-c-k"
                      },
                      "message": null,
                      "isTest": false,
                      "details": {
                        "amount": {
                          "value": "500",
                          "currency": "JPY"
                        },
                        "superChatId": "Cg0KC3N1cGVyc3RpY2tlcg",
                        "tier": 1,
                        "sticker": {
                          "id": "sticker_cat_wave",
                          "altText": "A cat waving its paw"
                        }
                      }
                    },
                    {
                      "id": "pevt_3f9a5db7-a142-4c8e-9639-7abe4fac2158",
                      "platform": "YOUTUBE",
                      "type": "youtube.super_chat",
                      "accountId": "104857306182736450192",
                      "occurredAt": "2026-11-09T10:25:03.112Z",
                      "recordedAt": "2026-11-09T10:25:12.640833Z",
                      "actor": {
                        "id": "UCz1Xc4VbN7mQ0Ws3Ed6Rf9T",
                        "login": null,
                        "displayName": "Generous Viewer",
                        "avatarUrl": "https://yt3.ggpht.com/a/UCz1Xc4VbN7mQ0Ws3Ed6Rf9T=s88-c-k"
                      },
                      "message": "Great stream!",
                      "isTest": false,
                      "details": {
                        "amount": {
                          "value": "5.00",
                          "currency": "USD"
                        },
                        "superChatId": "Cg0KC3N1cGVyY2hhdC0x",
                        "tier": 2
                      }
                    },
                    {
                      "id": "pevt_7c1e5a38-4196-4fac-9257-0ae2c6b9f145",
                      "platform": "TWITCH",
                      "type": "twitch.cheer",
                      "accountId": "141981764",
                      "occurredAt": null,
                      "recordedAt": "2026-11-09T10:24:05.733018Z",
                      "actor": {
                        "id": "5678901",
                        "login": "cool_cheerer",
                        "displayName": "Cool_Cheerer",
                        "avatarUrl": null
                      },
                      "message": "Cheer100 pogchamp",
                      "isTest": false,
                      "details": {
                        "bits": {
                          "unit": "BITS",
                          "quantity": 100
                        },
                        "isAnonymous": false
                      }
                    }
                  ],
                  "nextCursor": "MTc5NDIxOTg0NTczMzAxOC43YzFlNWEzOC00MTk2LTRmYWMtOTI1Ny0wYWUyYzZiOWYxNDU"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is invalid (for example, `type` of another platform than `platform`), or the key was sent in the request address.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-invalid-parameter": {
                    "$ref": "#/components/examples/error-invalid-parameter"
                  },
                  "error-token-in-query": {
                    "$ref": "#/components/examples/error-token-in-query"
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, unknown, deleted or expired.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-missing-token": {
                    "$ref": "#/components/examples/error-missing-token"
                  },
                  "error-invalid-token": {
                    "$ref": "#/components/examples/error-invalid-token"
                  },
                  "error-token-expired": {
                    "$ref": "#/components/examples/error-token-expired"
                  }
                }
              }
            },
            "headers": {
              "WWW-Authenticate": {
                "$ref": "#/components/headers/WWW-Authenticate"
              }
            }
          },
          "403": {
            "description": "Wrong kind of key, the key has neither `twitch:read` nor `youtube:read`, or `platform` or `type` asks for a platform whose scope the key lacks. The public key never has them.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-wrong-token-type": {
                    "$ref": "#/components/examples/error-wrong-token-type"
                  },
                  "error-insufficient-scope": {
                    "$ref": "#/components/examples/error-insufficient-scope"
                  }
                }
              }
            },
            "headers": {
              "WWW-Authenticate": {
                "$ref": "#/components/headers/WWW-Authenticate"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-rate-limited": {
                    "$ref": "#/components/examples/error-rate-limited"
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            }
          },
          "500": {
            "description": "The request failed on our side.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-internal-error": {
                    "$ref": "#/components/examples/error-internal-error"
                  }
                }
              }
            }
          },
          "503": {
            "description": "The API is temporarily unavailable.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-service-unavailable": {
                    "$ref": "#/components/examples/error-service-unavailable"
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        }
      }
    },
    "/v1/event-sources": {
      "get": {
        "operationId": "listEventSources",
        "summary": "Event sources",
        "description": "Sources of your events and their status: the linked Donation Alerts account when the key has `donations:read`, the linked Twitch account when it has `twitch:read`, the linked YouTube channels when it has `youtube:read`; any of these scopes is enough. Each item is the same object as `data` of the `source.status_changed` live event, which Donatty publishes to the `donations` channel for Donation Alerts, to the `twitch` channel for Twitch and to the `youtube` channel for YouTube when the status or `unavailableTypes` change. A source is listed as `IDLE` while nothing is received for apps. `READY` means the platform confirmed delivery to Donatty; for YouTube, that polling of every available required type keeps making progress, with no fixed delay. Events of a source that is not `READY` may be missed: when it becomes `READY` again, read the gap from the REST API starting a few minutes before `gapSince`. The API server stores the current status in memory and keeps no separate history of status changes. After an API server restart, `since` is the time that server first observes the source.",
        "tags": [
          "v1"
        ],
        "security": [
          {
            "personalToken": [
              "donations:read"
            ]
          },
          {
            "personalToken": [
              "twitch:read"
            ]
          },
          {
            "personalToken": [
              "youtube:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceStatusList"
                },
                "example": {
                  "items": [
                    {
                      "id": "src_da_9817342",
                      "platform": "DONATION_ALERTS",
                      "accountId": "9817342",
                      "status": "READY",
                      "since": "2026-11-09T10:00:04.318275Z",
                      "gapSince": null,
                      "unavailableTypes": []
                    },
                    {
                      "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"
                      ]
                    },
                    {
                      "id": "src_youtube_104857306182736450192",
                      "platform": "YOUTUBE",
                      "accountId": "104857306182736450192",
                      "status": "READY",
                      "since": "2026-11-09T10:19:47.215064Z",
                      "gapSince": null,
                      "unavailableTypes": [
                        "youtube.member"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The key was sent in the request address.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-token-in-query": {
                    "$ref": "#/components/examples/error-token-in-query"
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, unknown, deleted or expired.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-missing-token": {
                    "$ref": "#/components/examples/error-missing-token"
                  },
                  "error-invalid-token": {
                    "$ref": "#/components/examples/error-invalid-token"
                  },
                  "error-token-expired": {
                    "$ref": "#/components/examples/error-token-expired"
                  }
                }
              }
            },
            "headers": {
              "WWW-Authenticate": {
                "$ref": "#/components/headers/WWW-Authenticate"
              }
            }
          },
          "403": {
            "description": "Wrong kind of key, or the key has none of the `donations:read`, `twitch:read` and `youtube:read` scopes. The public key never has them.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-wrong-token-type": {
                    "$ref": "#/components/examples/error-wrong-token-type"
                  },
                  "error-insufficient-scope": {
                    "$ref": "#/components/examples/error-insufficient-scope"
                  }
                }
              }
            },
            "headers": {
              "WWW-Authenticate": {
                "$ref": "#/components/headers/WWW-Authenticate"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-rate-limited": {
                    "$ref": "#/components/examples/error-rate-limited"
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            }
          },
          "500": {
            "description": "The request failed on our side.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-internal-error": {
                    "$ref": "#/components/examples/error-internal-error"
                  }
                }
              }
            }
          },
          "503": {
            "description": "The API is temporarily unavailable.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "error-service-unavailable": {
                    "$ref": "#/components/examples/error-service-unavailable"
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "personalToken": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "dnt_pat_...",
        "description": "Secret key: chosen scopes, 30/90/365 days, shown once. For servers and bots; keep it secret."
      },
      "publishableKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "dnt_pk_...",
        "description": "Public key: profile:read, goals:read, stats:read; accepted only with an `Origin` header of the streamer's allowed sites. Visible to site visitors."
      }
    },
    "parameters": {
      "limit": {
        "name": "limit",
        "in": "query",
        "description": "How many records to return per page: 1 to 100, 20 by default.",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100,
          "default": 20
        }
      },
      "topLimit": {
        "name": "limit",
        "in": "query",
        "description": "How many donors to return: 1 to 100, 10 by default.",
        "example": 3,
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100,
          "default": 10
        }
      },
      "cursor": {
        "name": "cursor",
        "in": "query",
        "description": "`nextCursor` from the previous response; returns the next page.",
        "schema": {
          "type": "string"
        }
      },
      "since": {
        "name": "since",
        "in": "query",
        "description": "Only donations created at or after this moment, for example `2026-11-09T10:00:00Z`.",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "source": {
        "name": "source",
        "in": "query",
        "description": "Which sources to return, comma-separated. Without it, all sources.",
        "style": "form",
        "explode": false,
        "schema": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "DONATTY",
              "DONATION_ALERTS"
            ]
          }
        }
      },
      "moderation": {
        "name": "moderation",
        "in": "query",
        "description": "Which moderation statuses to return, comma-separated. For showing on stream use `PASSED,NONE`. Without it you get every donation, rejected ones included.",
        "style": "form",
        "explode": false,
        "schema": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "PENDING",
              "PASSED",
              "BLOCKED",
              "NONE"
            ]
          }
        }
      },
      "goalStatus": {
        "name": "status",
        "in": "query",
        "description": "`ACTIVE` \u2014 the goal is running, `CLOSED` \u2014 it is finished. Without it, all goals.",
        "schema": {
          "type": "string",
          "enum": [
            "ACTIVE",
            "CLOSED"
          ]
        }
      },
      "topPeriod": {
        "name": "period",
        "in": "query",
        "description": "`DAY` \u2014 today from 00:00, `WEEK` \u2014 this week from Monday, `MONTH` \u2014 this month, `YEAR` \u2014 this year, `ALL_TIME` \u2014 all time. Boundaries follow `timeZone`. `ALL_TIME` by default.",
        "example": "WEEK",
        "schema": {
          "type": "string",
          "enum": [
            "DAY",
            "WEEK",
            "MONTH",
            "YEAR",
            "ALL_TIME"
          ],
          "default": "ALL_TIME"
        }
      },
      "totalPeriod": {
        "name": "period",
        "in": "query",
        "description": "`DAY` \u2014 today from 00:00, `WEEK` \u2014 this week from Monday, `MONTH` \u2014 this month, `YEAR` \u2014 this year, `ALL_TIME` \u2014 all time. Boundaries follow `timeZone`. `ALL_TIME` by default.",
        "example": "DAY",
        "schema": {
          "type": "string",
          "enum": [
            "DAY",
            "WEEK",
            "MONTH",
            "YEAR",
            "ALL_TIME"
          ],
          "default": "ALL_TIME"
        }
      },
      "timeZone": {
        "name": "timeZone",
        "in": "query",
        "description": "The time zone used for period boundaries, for example `Asia/Novosibirsk`. `Europe/Moscow` by default.",
        "schema": {
          "type": "string",
          "default": "Europe/Moscow",
          "examples": [
            "Asia/Novosibirsk"
          ]
        }
      },
      "totalTimeZone": {
        "name": "timeZone",
        "in": "query",
        "description": "The time zone used for period boundaries, for example `Asia/Novosibirsk`. `Europe/Moscow` by default.",
        "example": "Asia/Novosibirsk",
        "schema": {
          "type": "string",
          "default": "Europe/Moscow",
          "examples": [
            "Asia/Novosibirsk"
          ]
        }
      },
      "platformSince": {
        "name": "since",
        "in": "query",
        "description": "Only events recorded at or after this moment (`recordedAt`), for example `2026-11-09T10:00:00Z`.",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "platform": {
        "name": "platform",
        "in": "query",
        "description": "Platform of the events: `TWITCH` or `YOUTUBE`. Without it, the events of every platform the key has a scope for. A platform whose scope the key lacks is refused with `403 insufficient_scope`, an unknown value with `400 invalid_parameter`.",
        "schema": {
          "type": "string",
          "enum": [
            "TWITCH",
            "YOUTUBE"
          ]
        }
      },
      "platformEventType": {
        "name": "type",
        "in": "query",
        "description": "Which event types to return, comma-separated. Without it, all types of the platforms the key has a scope for. A type whose scope the key lacks is refused with `403 insufficient_scope`, a type of another platform than `platform` with `400 invalid_parameter`.",
        "style": "form",
        "explode": false,
        "schema": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "twitch.follow",
              "twitch.subscription",
              "twitch.subscription.gift",
              "twitch.subscription.received",
              "twitch.cheer",
              "twitch.raid",
              "twitch.reward.redeemed",
              "twitch.hype_train.level_changed",
              "youtube.subscriber",
              "youtube.member",
              "youtube.super_chat",
              "youtube.super_sticker"
            ]
          }
        }
      },
      "order": {
        "name": "order",
        "in": "query",
        "description": "`desc` \u2014 history, newest first. `asc` \u2014 catch-up from `since`, oldest first. An `asc` pass includes events whose `recordedAt` is no later than the first page request. Events recorded later arrive through the stream or in the next pass. A `cursor` works only with the `order` that returned it.",
        "schema": {
          "type": "string",
          "enum": [
            "desc",
            "asc"
          ],
          "default": "desc"
        }
      }
    },
    "headers": {
      "RateLimit-Policy": {
        "description": "Active levels: `\"<level>\";q=<quota>;w=<window seconds>`.",
        "schema": {
          "type": "string"
        }
      },
      "RateLimit": {
        "description": "Remaining per level: `\"<level>\";r=<remaining>;t=<seconds to reset>`.",
        "schema": {
          "type": "string"
        }
      },
      "Retry-After": {
        "description": "Seconds to wait.",
        "schema": {
          "type": "integer"
        }
      },
      "WWW-Authenticate": {
        "description": "`Bearer resource_metadata=\"...\"` on 401; `Bearer error=\"insufficient_scope\", scope=\"...\"` on 403.",
        "schema": {
          "type": "string"
        }
      }
    },
    "schemas": {
      "Money": {
        "type": "object",
        "required": [
          "value",
          "currency"
        ],
        "additionalProperties": false,
        "properties": {
          "value": {
            "type": "string",
            "pattern": "^-?\\d+\\.\\d{2}$",
            "description": "Decimal amount with two fraction digits.",
            "examples": [
              "500.00"
            ]
          },
          "currency": {
            "type": "string",
            "description": "ISO 4217 code.",
            "examples": [
              "RUB"
            ]
          }
        }
      },
      "ExactMoney": {
        "type": "object",
        "description": "An exact amount of a platform, never rounded: unlike `Money`, the fraction is not cut to two digits. It has at least the minor units of the currency (`5.00` USD, `500` JPY, `1.500` KWD) and more digits when the platform sent more.",
        "required": [
          "value",
          "currency"
        ],
        "additionalProperties": false,
        "properties": {
          "value": {
            "type": "string",
            "pattern": "^-?\\d+(\\.\\d{1,6})?$",
            "description": "Decimal amount, up to six fraction digits, never rounded.",
            "examples": [
              "5.00"
            ]
          },
          "currency": {
            "type": "string",
            "description": "Currency code as the platform sent it: ISO 4217 for YouTube. The amount is never converted.",
            "examples": [
              "USD"
            ]
          }
        }
      },
      "Moderation": {
        "type": "object",
        "required": [
          "status",
          "deadline"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "PENDING",
              "PASSED",
              "BLOCKED",
              "NONE"
            ],
            "description": "`PENDING` \u2014 moderation in progress; `PASSED` \u2014 approved (including \u00ab\u041f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u043d\u0430 \u0441\u0442\u0440\u0438\u043c\u0435\u00bb (Repeat on stream)); `BLOCKED` \u2014 rejected; `NONE` \u2014 no moderation (disabled, nobody online, Donation Alerts)."
          },
          "deadline": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Only for `PENDING`: when the default decision applies."
          }
        }
      },
      "Streamer": {
        "type": "object",
        "required": [
          "id",
          "slug",
          "displayName",
          "avatarUrl",
          "donatePageUrl"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^str_[0-9a-f-]{36}$",
            "description": "Streamer identifier, `str_\u2026`."
          },
          "slug": {
            "type": "string",
            "description": "Nickname: the last part of the donation page address."
          },
          "displayName": {
            "type": "string",
            "description": "The name donors see."
          },
          "avatarUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Avatar link; `null` when there is no avatar."
          },
          "donatePageUrl": {
            "type": "string",
            "format": "uri",
            "description": "Donation page link."
          }
        }
      },
      "Donation": {
        "type": "object",
        "required": [
          "id",
          "createdAt",
          "source",
          "donorName",
          "message",
          "amount",
          "feeCompensation",
          "paymentMethod",
          "goal",
          "moderation",
          "media"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^don_[0-9a-f-]{36}$",
            "description": "Donation identifier, `don_\u2026`."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the donation was created; for a Donatty donation, when the payment was confirmed."
          },
          "source": {
            "type": "string",
            "enum": [
              "DONATTY",
              "DONATION_ALERTS"
            ],
            "description": "Where the donation came from: `DONATTY` or `DONATION_ALERTS`."
          },
          "donorName": {
            "type": "string",
            "description": "The name the donor entered. If they left it empty, a Donatty donation has `Anonymous`."
          },
          "message": {
            "type": "string",
            "description": "The donor's full message; an empty string if they wrote nothing. Widget filters are not applied."
          },
          "amount": {
            "$ref": "#/components/schemas/Money",
            "description": "The donation amount in its currency, without the donor's extra payment for the fee."
          },
          "feeCompensation": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "The extra amount the donor paid to cover the service fee, in the currency of `amount`; the donor was charged `amount` plus `feeCompensation`. `null` when the donor did not pay it, and always for `DONATION_ALERTS`."
          },
          "paymentMethod": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "string",
                "enum": [
                  "CARD",
                  "SBP"
                ]
              }
            ],
            "description": "How the donor paid: `SBP` (Faster Payments System) or `CARD` \u2014 every other way, including Apple Pay and Google Pay and older donations with no recorded method. `null` for `DONATION_ALERTS`."
          },
          "goal": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "required": [
                  "id",
                  "title"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^goal_[0-9a-f-]{36}$"
                  },
                  "title": {
                    "type": "string"
                  }
                }
              }
            ],
            "description": "The goal the donation went to: `id` and `title`. `null` when there is none."
          },
          "moderation": {
            "$ref": "#/components/schemas/Moderation",
            "description": "Moderation of the message: status and deadline."
          },
          "media": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "required": [
                  "title",
                  "url",
                  "provider",
                  "durationSeconds",
                  "moderation"
                ],
                "properties": {
                  "title": {
                    "type": "string"
                  },
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "provider": {
                    "type": "string",
                    "description": "YOUTUBE, VK, RUTUBE, TWITCH; new values may appear."
                  },
                  "durationSeconds": {
                    "type": "integer"
                  },
                  "moderation": {
                    "$ref": "#/components/schemas/Moderation"
                  }
                }
              }
            ],
            "description": "The video attached to the donation: `title`, `url`, `provider`, `durationSeconds` and its own `moderation`. `null` when there is none."
          }
        }
      },
      "DonationPage": {
        "type": "object",
        "required": [
          "items",
          "nextCursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Donation"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to get the next page; `null` \u2014 last page."
          }
        }
      },
      "Goal": {
        "type": "object",
        "required": [
          "id",
          "title",
          "target",
          "raised",
          "status",
          "endsAt",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^goal_[0-9a-f-]{36}$",
            "description": "Goal identifier, `goal_\u2026`."
          },
          "title": {
            "type": "string",
            "description": "Goal title."
          },
          "target": {
            "$ref": "#/components/schemas/Money",
            "description": "The amount to raise."
          },
          "raised": {
            "$ref": "#/components/schemas/Money",
            "description": "The amount raised: the amount you started the goal with (the \u00ab\u041d\u0430\u0447\u0430\u0442\u044c \u0441\u0431\u043e\u0440 \u0441\u00bb (Start collecting from) field) plus Donatty donations to this goal, including ones rejected by moderation."
          },
          "status": {
            "type": "string",
            "enum": [
              "ACTIVE",
              "CLOSED"
            ],
            "description": "`ACTIVE` \u2014 running, `CLOSED` \u2014 finished."
          },
          "endsAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the goal ends; `null` when no end is set."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the goal was created."
          }
        }
      },
      "GoalPage": {
        "type": "object",
        "required": [
          "items",
          "nextCursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Goal"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to get the next page; `null` \u2014 last page."
          }
        }
      },
      "Top": {
        "type": "object",
        "required": [
          "period",
          "from",
          "to",
          "items"
        ],
        "properties": {
          "period": {
            "type": "string",
            "enum": [
              "DAY",
              "WEEK",
              "MONTH",
              "YEAR",
              "ALL_TIME"
            ],
            "description": "The period from the request."
          },
          "from": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the period. For `ALL_TIME`, `1970-01-01T00:00:00Z`."
          },
          "to": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the next period; that moment itself is not included. For `ALL_TIME`, the moment of the response."
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "rank",
                "name",
                "total"
              ],
              "properties": {
                "rank": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "Position in the top, starting from 1."
                },
                "name": {
                  "type": "string",
                  "description": "Donor name."
                },
                "total": {
                  "$ref": "#/components/schemas/Money",
                  "description": "The donor's total for the period, in rubles."
                }
              }
            }
          }
        }
      },
      "Total": {
        "type": "object",
        "required": [
          "period",
          "from",
          "to",
          "total"
        ],
        "properties": {
          "period": {
            "type": "string",
            "enum": [
              "DAY",
              "WEEK",
              "MONTH",
              "YEAR",
              "ALL_TIME"
            ],
            "description": "The period from the request."
          },
          "from": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the period. For `ALL_TIME`, `1970-01-01T00:00:00Z`."
          },
          "to": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the next period; that moment itself is not included. For `ALL_TIME`, the moment of the response."
          },
          "total": {
            "$ref": "#/components/schemas/Money",
            "description": "The total donated for the period, in rubles."
          }
        }
      },
      "Problem": {
        "type": "object",
        "required": [
          "type",
          "title",
          "status",
          "detail",
          "code"
        ],
        "properties": {
          "type": {
            "type": "string",
            "format": "uri",
            "description": "https://developers.donatty.com/errors/<code>"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "enum": [
              "missing_token",
              "invalid_token",
              "token_expired",
              "token_in_query",
              "wrong_token_type",
              "insufficient_scope",
              "origin_not_allowed",
              "invalid_parameter",
              "not_found",
              "rate_limited",
              "internal_error",
              "service_unavailable"
            ]
          },
          "policy": {
            "type": "string",
            "enum": [
              "app-user",
              "app",
              "user",
              "publishable-ip"
            ],
            "description": "Only for `rate_limited`: the exhausted level."
          }
        }
      },
      "PlatformAccount": {
        "type": "object",
        "required": [
          "id",
          "login",
          "displayName",
          "avatarUrl"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Account identifier on the platform: the Twitch user ID or the YouTube channel ID."
          },
          "login": {
            "type": [
              "string",
              "null"
            ],
            "description": "Login; `null` when the platform did not send it. YouTube has no logins, so it is always `null` there."
          },
          "displayName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Display name; `null` when the platform did not send it."
          },
          "avatarUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Avatar of the account when the platform sends it with the event: YouTube does, Twitch does not, so it is `null` for Twitch events."
          }
        }
      },
      "RaidAccount": {
        "type": "object",
        "required": [
          "id",
          "login",
          "displayName"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Twitch user ID of the raiding channel."
          },
          "login": {
            "type": [
              "string",
              "null"
            ],
            "description": "Login of the raiding channel."
          },
          "displayName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Display name of the raiding channel."
          }
        }
      },
      "Quantity": {
        "type": "object",
        "description": "An amount in the platform's own currency: not money, never converted to rubles.",
        "required": [
          "unit",
          "quantity"
        ],
        "properties": {
          "unit": {
            "type": "string",
            "enum": [
              "BITS",
              "CHANNEL_POINTS"
            ],
            "description": "`BITS` \u2014 Twitch bits; `CHANNEL_POINTS` \u2014 channel points of the streamer."
          },
          "quantity": {
            "type": "integer",
            "minimum": 0,
            "description": "How many units."
          }
        }
      },
      "FollowDetails": {
        "type": "object",
        "description": "`twitch.follow`: no fields; the follower is `actor`.",
        "properties": {}
      },
      "SubscriptionDetails": {
        "type": "object",
        "description": "`twitch.subscription`.",
        "required": [
          "tier",
          "cumulativeMonths",
          "durationMonths",
          "streakMonths",
          "isResub"
        ],
        "properties": {
          "tier": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "string",
                "enum": [
                  "TIER_1",
                  "TIER_2",
                  "TIER_3"
                ]
              }
            ],
            "description": "Subscription tier; `null` when Twitch sent a value this API does not know."
          },
          "cumulativeMonths": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Months subscribed in total, as Twitch reports them; `null` when only `channel.subscribe` came."
          },
          "durationMonths": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Months paid for at once; `null` when only `channel.subscribe` came."
          },
          "streakMonths": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Months in a row; `null` when the viewer does not share it."
          },
          "isResub": {
            "type": "boolean",
            "description": "`true` when the viewer shared a resubscription message."
          }
        }
      },
      "SubscriptionGiftDetails": {
        "type": "object",
        "description": "`twitch.subscription.gift`.",
        "required": [
          "tier",
          "count",
          "cumulativeCount",
          "isAnonymous"
        ],
        "properties": {
          "tier": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "string",
                "enum": [
                  "TIER_1",
                  "TIER_2",
                  "TIER_3"
                ]
              }
            ],
            "description": "Subscription tier; `null` when Twitch sent a value this API does not know."
          },
          "count": {
            "type": "integer",
            "minimum": 1,
            "description": "Subscriptions in this batch."
          },
          "cumulativeCount": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Subscriptions the gifter has gifted in this channel; `null` when Twitch did not send it."
          },
          "isAnonymous": {
            "type": "boolean",
            "description": "`true` for an anonymous gift."
          }
        }
      },
      "SubscriptionReceivedDetails": {
        "type": "object",
        "description": "`twitch.subscription.received`.",
        "required": [
          "recipient",
          "gifter",
          "tier"
        ],
        "properties": {
          "recipient": {
            "$ref": "#/components/schemas/PlatformAccount",
            "description": "Who got the subscription."
          },
          "gifter": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PlatformAccount"
              }
            ],
            "description": "Who gifted it; `null` for an anonymous gift, or when the batch could not be matched for sure (two batches at once)."
          },
          "tier": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "string",
                "enum": [
                  "TIER_1",
                  "TIER_2",
                  "TIER_3"
                ]
              }
            ],
            "description": "Subscription tier; `null` when Twitch sent a value this API does not know."
          }
        }
      },
      "CheerDetails": {
        "type": "object",
        "description": "`twitch.cheer`.",
        "required": [
          "bits",
          "isAnonymous"
        ],
        "properties": {
          "bits": {
            "$ref": "#/components/schemas/Quantity",
            "description": "Bits, `unit` is `BITS`."
          },
          "isAnonymous": {
            "type": "boolean",
            "description": "`true` for an anonymous cheer."
          }
        }
      },
      "RaidDetails": {
        "type": "object",
        "description": "`twitch.raid`.",
        "required": [
          "fromAccount",
          "viewerCount"
        ],
        "properties": {
          "fromAccount": {
            "$ref": "#/components/schemas/RaidAccount",
            "description": "The raiding channel."
          },
          "viewerCount": {
            "type": "integer",
            "minimum": 0,
            "description": "Viewers who came with the raid."
          }
        }
      },
      "RewardDetails": {
        "type": "object",
        "description": "`twitch.reward.redeemed`.",
        "required": [
          "redemptionId",
          "rewardId",
          "title",
          "cost",
          "userInput"
        ],
        "properties": {
          "redemptionId": {
            "type": "string",
            "description": "Twitch ID of this redemption."
          },
          "rewardId": {
            "type": "string",
            "description": "Twitch ID of the reward."
          },
          "title": {
            "type": "string",
            "description": "Reward title."
          },
          "cost": {
            "$ref": "#/components/schemas/Quantity",
            "description": "Cost, `unit` is `CHANNEL_POINTS`."
          },
          "userInput": {
            "type": [
              "string",
              "null"
            ],
            "description": "Text the viewer entered; `null` when the reward asks for none."
          }
        }
      },
      "HypeTrainDetails": {
        "type": "object",
        "description": "`twitch.hype_train.level_changed`.",
        "required": [
          "trainId",
          "level"
        ],
        "properties": {
          "trainId": {
            "type": "string",
            "description": "Twitch ID of the train: the same for all its levels."
          },
          "level": {
            "type": "integer",
            "minimum": 1,
            "description": "The level reached."
          }
        }
      },
      "YoutubeSubscriberDetails": {
        "type": "object",
        "description": "`youtube.subscriber`: no fields; the subscriber is `actor`.",
        "properties": {}
      },
      "YoutubeMemberDetails": {
        "type": "object",
        "description": "`youtube.member`.",
        "required": [
          "level",
          "months",
          "levelSince",
          "isUpgrade"
        ],
        "properties": {
          "level": {
            "type": [
              "string",
              "null"
            ],
            "description": "The highest membership level the member has now: its display name, or its YouTube ID when the level has no name."
          },
          "months": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Months of membership in total over all levels, as YouTube reports them; `null` when YouTube did not send them."
          },
          "levelSince": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Start of the member's continuous access to `level`, RFC 3339 in UTC."
          },
          "isUpgrade": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Always `null` for now: polling does not tell a move to a higher level from a new membership."
          }
        }
      },
      "SuperChatDetails": {
        "type": "object",
        "description": "`youtube.super_chat`.",
        "required": [
          "amount",
          "superChatId",
          "tier"
        ],
        "properties": {
          "amount": {
            "$ref": "#/components/schemas/ExactMoney",
            "description": "What the viewer paid, in their currency, exactly as YouTube reports it."
          },
          "superChatId": {
            "type": "string",
            "description": "YouTube ID of the Super Chat event."
          },
          "tier": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "Tier of the purchase that YouTube derives from the amount; `null` when YouTube did not send it."
          }
        }
      },
      "Sticker": {
        "type": "object",
        "description": "A Super Sticker.",
        "required": [
          "id",
          "altText"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "YouTube ID of the sticker."
          },
          "altText": {
            "type": [
              "string",
              "null"
            ],
            "description": "Description of the sticker, in the language YouTube chose; `null` when YouTube did not send it."
          }
        }
      },
      "SuperStickerDetails": {
        "type": "object",
        "description": "`youtube.super_sticker`.",
        "required": [
          "amount",
          "superChatId",
          "tier",
          "sticker"
        ],
        "properties": {
          "amount": {
            "$ref": "#/components/schemas/ExactMoney",
            "description": "What the viewer paid, in their currency, exactly as YouTube reports it."
          },
          "superChatId": {
            "type": "string",
            "description": "YouTube ID of the Super Sticker event."
          },
          "tier": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "Tier of the purchase that YouTube derives from the amount; `null` when YouTube did not send it."
          },
          "sticker": {
            "$ref": "#/components/schemas/Sticker",
            "description": "The sticker."
          }
        }
      },
      "PlatformEvent": {
        "type": "object",
        "description": "An event from a platform account linked to the streamer. `GET /v1/platform-events` and the `data` field of `twitch.*` and `youtube.*` live events use this same structure.",
        "required": [
          "id",
          "platform",
          "type",
          "accountId",
          "occurredAt",
          "recordedAt",
          "actor",
          "message",
          "isTest",
          "details"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^pevt_[0-9a-f-]{36}$",
            "description": "Event identifier, `pevt_\u2026`: the same in REST and in every live publication of the event. Drop an event whose `id` you have already handled."
          },
          "platform": {
            "type": "string",
            "enum": [
              "TWITCH",
              "YOUTUBE"
            ],
            "description": "The platform."
          },
          "type": {
            "type": "string",
            "enum": [
              "twitch.follow",
              "twitch.subscription",
              "twitch.subscription.gift",
              "twitch.subscription.received",
              "twitch.cheer",
              "twitch.raid",
              "twitch.reward.redeemed",
              "twitch.hype_train.level_changed",
              "youtube.subscriber",
              "youtube.member",
              "youtube.super_chat",
              "youtube.super_sticker"
            ],
            "description": "Event type, the same as CloudEvents `type`; it says which schema `details` follows."
          },
          "accountId": {
            "type": "string",
            "description": "The streamer's account on the platform: the Twitch user ID of the channel; for YouTube, the ID of the Google account the channel is linked through, not the `UC\u2026` channel ID."
          },
          "occurredAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the action happened, when the platform reports it: `followed_at` of a follow, `redeemed_at` of a reward, the start of a hype train for its first level; for YouTube, when the subscription, the Super Chat or the Super Sticker was made and when the member's access to the current level began. `null` otherwise."
          },
          "recordedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When Donatty recorded the event, RFC 3339 in UTC. The list is ordered by it."
          },
          "actor": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PlatformAccount"
              }
            ],
            "description": "Who did it: the follower, subscriber, gifter, gift recipient, cheering viewer, raiding channel, viewer who redeemed the reward, channel member or viewer who bought a Super Chat or Super Sticker. `null` for an anonymous gift or cheer and for a hype train."
          },
          "message": {
            "type": [
              "string",
              "null"
            ],
            "description": "Text the viewer sent with a resubscription, a cheer or a Super Chat; `null` otherwise."
          },
          "isTest": {
            "type": "boolean",
            "description": "Always `false`: test alerts of Twitch and YouTube events are not published."
          },
          "details": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FollowDetails"
              },
              {
                "$ref": "#/components/schemas/SubscriptionDetails"
              },
              {
                "$ref": "#/components/schemas/SubscriptionGiftDetails"
              },
              {
                "$ref": "#/components/schemas/SubscriptionReceivedDetails"
              },
              {
                "$ref": "#/components/schemas/CheerDetails"
              },
              {
                "$ref": "#/components/schemas/RaidDetails"
              },
              {
                "$ref": "#/components/schemas/RewardDetails"
              },
              {
                "$ref": "#/components/schemas/HypeTrainDetails"
              },
              {
                "$ref": "#/components/schemas/YoutubeSubscriberDetails"
              },
              {
                "$ref": "#/components/schemas/YoutubeMemberDetails"
              },
              {
                "$ref": "#/components/schemas/SuperChatDetails"
              },
              {
                "$ref": "#/components/schemas/SuperStickerDetails"
              }
            ],
            "description": "Fields of the `type`: `twitch.follow` \u2014 `FollowDetails`, `twitch.subscription` \u2014 `SubscriptionDetails`, `twitch.subscription.gift` \u2014 `SubscriptionGiftDetails`, `twitch.subscription.received` \u2014 `SubscriptionReceivedDetails`, `twitch.cheer` \u2014 `CheerDetails`, `twitch.raid` \u2014 `RaidDetails`, `twitch.reward.redeemed` \u2014 `RewardDetails`, `twitch.hype_train.level_changed` \u2014 `HypeTrainDetails`, `youtube.subscriber` \u2014 `YoutubeSubscriberDetails`, `youtube.member` \u2014 `YoutubeMemberDetails`, `youtube.super_chat` \u2014 `SuperChatDetails`, `youtube.super_sticker` \u2014 `SuperStickerDetails`."
          }
        }
      },
      "PlatformEventPage": {
        "type": "object",
        "required": [
          "items",
          "nextCursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlatformEvent"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` with the same `order` to get the next page; `null` \u2014 last page (for `order=asc`, the end of the pass)."
          }
        }
      },
      "SourceStatus": {
        "type": "object",
        "description": "A source of the streamer's events and its status: the same object in `GET /v1/event-sources` and in `data` of the `source.status_changed` live event.",
        "required": [
          "id",
          "platform",
          "accountId",
          "status",
          "since",
          "gapSince",
          "unavailableTypes"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^src_[a-z]+_.+$",
            "description": "Source identifier: `src_da_\u2026` for a Donation Alerts account, `src_twitch_\u2026` for a Twitch account, `src_youtube_\u2026` for a YouTube channel. It stays the same while the account is linked."
          },
          "platform": {
            "type": "string",
            "enum": [
              "DONATION_ALERTS",
              "TWITCH",
              "YOUTUBE"
            ],
            "description": "The platform. Clients must accept new values."
          },
          "accountId": {
            "type": "string",
            "description": "The streamer's account on the platform: the Donation Alerts user ID, the Twitch user ID of the channel; for YouTube, the ID of the Google account the channel is linked through, not the `UC\u2026` channel ID."
          },
          "status": {
            "type": "string",
            "enum": [
              "IDLE",
              "STARTING",
              "READY",
              "CAPACITY_LIMITED",
              "QUOTA_LIMITED",
              "REAUTH_REQUIRED",
              "ERROR"
            ],
            "description": "Status of the source. `IDLE` \u2014 nothing is received for apps: no app listens to the source. `STARTING` \u2014 Donatty is connecting to the platform or waiting for it to confirm delivery; for YouTube, the first poll of a required type has not finished. `READY` \u2014 the platform confirmed delivery to Donatty; for YouTube, every available required type is polled and keeps making progress. No fixed delay is promised: under shared load YouTube polling slows down, which is neither `ERROR` nor `QUOTA_LIMITED`. `CAPACITY_LIMITED` (Donation Alerts only) \u2014 all connections Donatty keeps for apps are busy and the source waits in a queue. `QUOTA_LIMITED` (YouTube only) \u2014 Donatty's daily YouTube API quota is used up; polling resumes after midnight Pacific Time. `REAUTH_REQUIRED` \u2014 the platform withdrew Donatty's access: reconnect the account in the Donatty dashboard. `ERROR` \u2014 the platform refused for another reason, or polling of the platform is switched off or stuck. Clients must accept new values."
          },
          "since": {
            "type": "string",
            "format": "date-time",
            "description": "When Donatty saw the source enter the current status, RFC 3339 in UTC; after a Donatty restart, the time of the first check."
          },
          "gapSince": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Start of a possible gap in events, when Donatty knows one: for Donation Alerts, since the source waits for a free connection or lost a working one; for Twitch, since a required subscription stopped working; for YouTube, since an app needs the source and it is not `READY`. `null` when no gap is known; this is not a promise that every gap is known."
          },
          "unavailableTypes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Twitch and YouTube only: event types Donatty knows it cannot receive now, for the reason given by `status`; for YouTube, `youtube.member` when the channel has no memberships or YouTube does not give the member list, and every type when polling is switched off. An empty list means no known unavailable types, not that the source is ready."
          }
        }
      },
      "SourceStatusList": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SourceStatus"
            },
            "description": "Donation Alerts accounts when the key has `donations:read`, Twitch accounts when it has `twitch:read`, YouTube channels when it has `youtube:read`."
          }
        }
      }
    },
    "examples": {
      "error-missing-token": {
        "value": {
          "type": "https://developers.donatty.com/errors/missing_token",
          "title": "Missing token",
          "status": 401,
          "detail": "Send the app token in the Authorization header: Bearer dnt_...",
          "code": "missing_token"
        }
      },
      "error-invalid-token": {
        "value": {
          "type": "https://developers.donatty.com/errors/invalid_token",
          "title": "Invalid token",
          "status": 401,
          "detail": "The token is unknown, deleted or malformed.",
          "code": "invalid_token"
        }
      },
      "error-token-expired": {
        "value": {
          "type": "https://developers.donatty.com/errors/token_expired",
          "title": "Token expired",
          "status": 401,
          "detail": "The token has expired. Issue a new one in the Donatty dashboard.",
          "code": "token_expired"
        }
      },
      "error-token-in-query": {
        "value": {
          "type": "https://developers.donatty.com/errors/token_in_query",
          "title": "Token in query",
          "status": 400,
          "detail": "Tokens are accepted only in the Authorization header. The token from the query string was not used.",
          "code": "token_in_query"
        }
      },
      "error-wrong-token-type": {
        "value": {
          "type": "https://developers.donatty.com/errors/wrong_token_type",
          "title": "Wrong token type",
          "status": 403,
          "detail": "Public API routes accept only Donatty app tokens (dnt_...); other routes never accept them.",
          "code": "wrong_token_type"
        }
      },
      "error-insufficient-scope": {
        "value": {
          "type": "https://developers.donatty.com/errors/insufficient_scope",
          "title": "Insufficient scope",
          "status": 403,
          "detail": "This route requires the donations:read scope.",
          "code": "insufficient_scope"
        }
      },
      "error-origin-not-allowed": {
        "value": {
          "type": "https://developers.donatty.com/errors/origin_not_allowed",
          "title": "Origin not allowed",
          "status": 403,
          "detail": "This publishable key accepts requests only from the origins allowed for its app.",
          "code": "origin_not_allowed"
        }
      },
      "error-invalid-parameter": {
        "value": {
          "type": "https://developers.donatty.com/errors/invalid_parameter",
          "title": "Invalid parameter",
          "status": 400,
          "detail": "The limit parameter must be an integer from 1 to 100.",
          "code": "invalid_parameter"
        }
      },
      "error-not-found": {
        "value": {
          "type": "https://developers.donatty.com/errors/not_found",
          "title": "Not found",
          "status": 404,
          "detail": "There is no such public API route.",
          "code": "not_found"
        }
      },
      "error-rate-limited": {
        "value": {
          "type": "https://developers.donatty.com/errors/rate_limited",
          "title": "Rate limited",
          "status": 429,
          "detail": "The app-user rate limit is exhausted.",
          "code": "rate_limited",
          "policy": "app-user"
        }
      },
      "error-internal-error": {
        "value": {
          "type": "https://developers.donatty.com/errors/internal_error",
          "title": "Internal error",
          "status": 500,
          "detail": "The request failed on the server. Try again later.",
          "code": "internal_error"
        }
      },
      "error-service-unavailable": {
        "value": {
          "type": "https://developers.donatty.com/errors/service_unavailable",
          "title": "Service unavailable",
          "status": 503,
          "detail": "The API is temporarily unavailable. Retry after the delay in Retry-After.",
          "code": "service_unavailable"
        }
      }
    }
  }
}
