The bot API is an internal interface consumed by the Yoink Discord bot. All endpoints require aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/coah80/yoink/llms.txt
Use this file to discover all available pages before exploring further.
Bearer token matching the BOT_SECRET environment variable. Requests without a valid token receive 401 Unauthorized.
Unlike the web download endpoints, all bot jobs are fully asynchronous — every request returns a jobId immediately. Poll GET /api/bot/status/{jobId} to track progress and retrieve the downloadToken when the job completes. Tokens expire after 5 minutes (BotDownloadExpiry). Playlist tokens last longer; they use the same 12-hour expiry as the web playlist API.
If
BOT_SECRET is not set, checkBotAuth always returns false and every bot request receives 401 Unauthorized. The bot API will be completely non-functional until BOT_SECRET is configured. Always set this variable in production.Authentication
Every request to/api/bot/* must include the following header:
POST /api/bot/download
Downloads a single video or audio track from any yt-dlp-supported URL and makes the result available via a short-lived download token.Body Fields
URL of the media to download.
video or audio.Target resolution. One of
2160p, 1440p, 1080p, 720p, 480p, 360p.Video container. One of
mp4, webm, mkv, mov.Audio format when
format=audio. One of mp3, m4a, opus, wav, flac.Download as playlist. For large playlist jobs prefer
POST /api/bot/download-playlist which returns richer per-video status.Response
curl Example
POST /api/bot/download-playlist
Downloads an entire playlist asynchronously, zips the results, and stores the archive for retrieval.Body Fields
URL of the playlist.
video or audio.Target resolution for video downloads.
Video container format.
Audio format when
format=audio.Audio bitrate in kbps. One of
64, 96, 128, 192, 256, 320.1-based playlist index to start from. Use for chunked processing of large playlists.
Response
POST /api/bot/convert
Downloads a file from a Discord CDN URL and converts it to the specified format.Body Fields
Discord CDN URL of the file to convert (e.g.
https://cdn.discordapp.com/attachments/...).Target format. Video:
mp4, webm, mkv, mov. Audio: mp3, m4a, opus, wav, flac.Response
curl Example
POST /api/bot/compress
Compresses a video to a target file size. The source can be a Discord CDN URL or adownloadToken from a previous bot job (e.g. chain a download then compress it).
Body Fields
Discord CDN URL of the video to compress. Mutually exclusive with
downloadToken.Token from a previous bot job. Allows chaining: download a video, then compress the result without re-downloading.
Target output size in megabytes. Discord’s default file limit is 25 MB (Nitro: 500 MB).
Encoding speed preset. One of
fast, balanced, quality.Response
curl Example
GET /api/bot/status/
Returns the current state of any bot job (download, playlist, convert, or compress).Response Fields
Job state:
starting, downloading, processing, complete, error.Completion percentage, 0–100.
Human-readable status message.
Error message. Present when
status=error.Output filename (present when
status=complete).Output file size in bytes (present when
status=complete).Short-lived token for
GET /api/bot/download/{token} (present when status=complete).Download speed string (e.g.
"5.2MiB/s"), present during active downloads.Estimated time remaining (e.g.
"00:01:23"), present during active downloads.For playlist jobs: number of videos successfully downloaded so far.
For playlist jobs: total videos in the playlist.
For playlist jobs: 1-based index of the first video downloaded in this run (reflects
resumeFrom).For playlist jobs: array of
{ num, title, reason } objects for failed videos.curl Example
GET /api/bot/download/
Streams the completed file. The token comes from thedownloadToken field in the status response. No authentication header is required for this endpoint.
Response
Streams the binary file withContent-Type and Content-Disposition: attachment headers appropriate for the file type.
curl Example
GET /api/download/
Serves a simple HTML download page for the file identified bytoken. This is used as a fallback link in Discord messages — when a file is too large to attach directly, the bot sends this URL so the user can click it in a browser to trigger the download.
<iframe> within 2 seconds and displays a progress spinner.