API Documentation
The complete reference for integrating Telegraph into your applications. Fast, scalable, and decentralized.
Getting Started
Telegraph provides a high-performance REST API for uploading and managing images, GIFs, and videos via our Telegram-backed edge storage. Our storage is 100% free, decentralized, and infinitely scalable.
Quick Start
All API responses are in JSON format. Use the endpoints below to start building immediately.
/api/v1/upload
Upload images, videos, or GIFs. Returns a direct CDN link.
Parameters (multipart/form-data)
- file REQUIREDThe file buffer or payload to upload.
- customId OPTIONALA custom slug for your URL instead of a random string.
- password OPTIONALEncrypt the link with a password. Only users with the password can decrypt and view it.
- expiration OPTIONALSelf-destruct timer. Valid values:
1h,12h,24h,3d,1w,1m,never.
/api/v1/upload
Upload text, code snippets, or configuration files. The server detects text documents using their file extensions.
CRITICAL: When uploading plain text directly from strings/buffers instead of physical files, you MUST provide a dummy file name ending in .txt or similar (e.g. snippet.txt) so the API server handles the extension correctly.
Parameters (multipart/form-data)
- file REQUIREDThe text file buffer. Must end in .txt, .js, .md, etc.
- customId OPTIONALA custom slug for your URL.
- password OPTIONALEncrypt the text snippet with a password.
- expiration OPTIONALValid values:
1h,12h,24h,3d,1w,1m,never.