How Kozak Records AI connects to YouTube (OAuth 2.0 flow)
1. Owner starts the connection
The channel owner sends /youtube to the App's private Telegram bot and opens the Google sign-in link it returns.
2. Google consent screen
Google shows the consent screen of the app "Kozak Records AI" with the requested scopes: youtube.upload, youtube.force-ssl (comments), youtube.readonly, yt-analytics.readonly. The owner can click Cancel to abort; nothing is stored.
3. Callback
After approval Google redirects to https://api.kozakempire.com/youtube/callback. The App exchanges the code for a refresh token and stores it encrypted in Google Cloud.
4. What the App then does
Uploads our finished 4K music videos and Shorts (videos.insert), sets thumbnails, schedules publication, reads our channel statistics and replies to comments on our own videos. Daily statistics and a weekly report are shown to the owner in Telegram/email (internal dashboard).
5. Revoking access
https://security.google.com/settings/security/permissions – remove "Kozak Records AI". The App then stops all API calls and deletes stored tokens.