Media Gallery API
Programmatic access to our media organization, storage, and sharing platform. Manage your assets effortlessly from any application.
API Overview
REST API
Access all core functionality through our RESTful API endpoints with standard HTTP methods.
OAuth 2.0
Secure authentication using OAuth 2.0 with support for client credentials and authorization code flows.
Real-time
Stream updates and notifications through WebSocket connections for live applications.
Getting Started
Start using the Media Gallery API in just a few simple steps:
-
1
Get API Key
Visit the developer portal to create your account and obtain your API key.
-
2
Install Client Library
Install our official SDK for your preferred language.
npm install medialibrary-sdk
-
3
Make Your First Request
Use your API key to authenticate and start managing your media assets.
fetch('https://api.medialibrary/v1/files', { headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' } });
Code Examples
JavaScript
const apiKey = 'YOUR_API_KEY';
const sdk = new MediaLibrarySDK({ apiKey });
sdk.listFiles({ folderId: 'F123' })
.then(response => console.log(response))
.catch(error => console.error(error));
Python
import medialibrary
ml = medialibrary.Client(api_key='YOUR_API_KEY')
files = ml.list_files(folder_id='F123')
print(files)
API Reference
The Media Gallery API gives you access to media management and collaboration features, as well as media analytics.
Base URL
https://api.medialibrary
Authentication
All requests must be authenticated with an API key through Bearer token.
Authorization: Bearer YOUR_API_KEY
Media Endpoints
Manage your media files including upload/download, metadata editing, and version control.
Upload Media
POST /v1/files
Get Media Info
GET /v1/files/:fileId
Update Media
PUT /v1/files/:fileId
Delete Media
DELETE /v1/files/:fileId
Folder Endpoints
Create and manage folders for organizing your media files.
Create Folder
POST /v1/folders
List Files
GET /v1/folders/:folderId/files
Update Folder
PUT /v1/folders/:folderId
Rate Limits
Read requests are limited to 1000 per minute.
Write requests are limited to 500 per minute.
Webhooks
Receive notifications about media events in your application.
Supported Events
- media_uploaded
- media_deleted
- folder_created
- user_added
- tag_added
Subscribing
Send a POST request to /v1/webhooks with your desired event types and callback URL.
POST /v1/webhooks
{ "event_types": ["media_uploaded", "media_deleted"], "callback_url": "https://your-service.com/webhook-endpoint" }
Webhook Delivery
When events occur, Media Gallery will send a POST to your callback URL with JSON payload.
POST https://your-service.com/webhook-endpoint
{ "event_type": "media_uploaded", "file_id": "F123456", "file_name": "project_photo.jpg", "folder_id": "FL123", "created_at": "2025-09-17T12:34:56Z" }
Security
Transport Layer Security
All API requests must be made over HTTPS. We require TLSv1.2 or higher for all connections.
If you receive security errors or warnings about our SSL certificate, please submit an issue in our developer community.
Data Protection
All data is protected with enterprise-grade encryption at rest and in transit. All API keys are rotated automatically every 90 days.
We provide optional end-to-end encryption for additional protection of sensitive media files.