{
"openapi": "3.1.2",
"info": {
"title": "Media2URL Developer Platform REST API",
"version": "1.0.0",
"description": "Official REST API for Media2URL external developers and authenticated automation clients. Provides direct Cloudflare R2 presigned file uploads with temporary-to-final object promotion, transactional quota reservations, asset management, version history, duplicate detection, and remote URL imports.",
"contact": {
"name": "Media2URL Developer Platform",
"url": "https://media2url.com/contact",
"email": "[email protected]"
},
"license": {
"name": "Proprietary",
"url": "https://media2url.com/terms"
}
},
"servers": [
{
"url": "https://api.media2url.com/v1",
"description": "Production API v1"
}
],
"security": [
{
"BearerAuth": []
}
],
"paths": {
"/usage": {
"get": {
"operationId": "getUsage",
"summary": "Retrieve Account & API Usage",
"description": "Returns authoritative usage metrics for storage, bandwidth, and monthly upload counts.",
"security": [
{
"BearerAuth": [
"usage:read"
]
}
],
"responses": {
"200": {
"description": "Authoritative usage metrics",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UsageResponse"
}
}
}
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"429": {
"$ref": "#/components/responses/RateLimited"
}
}
}
},
"/uploads/presign": {
"post": {
"operationId": "presignUpload",
"summary": "Request Direct R2 Upload URL",
"description": "Validates file metadata against account quotas, atomically reserves storage capacity, and generates a short-lived presigned PUT URL targeting a temporary R2 key.",
"security": [
{
"BearerAuth": [
"uploads:write"
]
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PresignUploadRequest"
}
}
}
},
"responses": {
"201": {
"description": "Temporary upload URL generated",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PresignUploadResponse"
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"429": {
"$ref": "#/components/responses/RateLimited"
}
}
}
},
"/uploads/finalize": {
"post": {
"operationId": "finalizeUpload",
"summary": "Finalize Upload & Promote Asset",
"description": "Atomically consumes the upload session, validates temporary R2 object size, content type, magic bytes, and blocked fingerprints, promotes the validated bytes into a non-presigned final key, commits quota, and returns the canonical asset links.",
"security": [
{
"BearerAuth": [
"uploads:write"
]
}
],
"parameters": [
{
"name": "Idempotency-Key",
"in": "header",
"required": false,
"schema": {
"type": "string",
"maxLength": 128
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FinalizeUploadRequest"
}
}
}
},
"responses": {
"201": {
"description": "Asset created and promoted",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AssetResource"
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"409": {
"$ref": "#/components/responses/Conflict"
},
"410": {
"$ref": "#/components/responses/Gone"
},
"429": {
"$ref": "#/components/responses/RateLimited"
}
}
}
},
"/uploads/check-duplicate": {
"post": {
"operationId": "checkDuplicate",
"summary": "Check for Duplicate Asset",
"description": "Searches within the authenticated account's scope for an existing asset matching the given SHA-256 checksum and optional byte size.",
"security": [
{
"BearerAuth": [
"assets:read"
]
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CheckDuplicateRequest"
}
}
}
},
"responses": {
"200": {
"description": "Duplicate detection result",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CheckDuplicateResponse"
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
}
}
}
},
"/assets": {
"get": {
"operationId": "listAssets",
"summary": "List Assets",
"description": "Returns a cursor-paginated list of assets owned by the authenticated account.",
"security": [
{
"BearerAuth": [
"assets:read"
]
}
],
"parameters": [
{
"name": "limit",
"in": "query",
"schema": {
"type": "integer",
"default": 20,
"maximum": 100
}
},
{
"name": "cursor"
}
]
}
}
},
"_note": "Response truncated for documentation purposes"
}
curl --location --request GET 'https://zylalabs.com/api/14137/media2url+cloud+media+ingestion+api/34981/check+api+and+edge+storage+health' --header 'Authorization: Bearer YOUR_API_KEY'
After signing up, every developer is assigned a personal API access key, a unique combination of letters and digits provided to access to our API endpoint. To authenticate with the Media2URL Cloud Media Ingestion API simply include your bearer token in the Authorization header.
| Header | Description |
|---|---|
Authorization
|
Required
Should be Bearer access_key. See "Your API Access Key" above when you are subscribed.
|
No long-term commitment. Upgrade, downgrade, or cancel anytime. Free Trial includes up to 50 requests.
Media2URL is a high-performance developer media ingestion and permanent edge CDN link generation REST API for images, video, audio, PDF, and files.
Each endpoint returns JSON data. For example, the "Check API and Edge Storage Health" endpoint provides operational status and API specifications, while the "List Hosted Media Assets" endpoint returns a paginated list of media files, including their IDs, filenames, MIME types, sizes, and public URLs.
Key fields include "id" (file identifier), "filename" (name of the file), "mimeType" (file type), "sizeBytes" (file size in bytes), and "publicUrl" (permanent CDN link). These fields help identify and access media assets effectively.
Parameters vary by endpoint. For instance, the "List Hosted Media Assets" endpoint supports pagination parameters like "cursor" for navigating through results. The "Initialize Presigned R2 Media Upload" endpoint may require file metadata such as file type and size for generating upload URLs.
Response data is structured in JSON format, typically containing an "ok" status field indicating success, followed by relevant data fields. For example, the "Get Media Asset Metadata" endpoint returns metadata about a specific file, including its ID, filename, MIME type, and public URL.
The data originates from user uploads to the Media2URL platform. Each media asset is processed and stored in Cloudflare R2, ensuring reliable access and management. The API maintains data accuracy through automated checks during upload and retrieval processes.
Typical use cases include managing media assets for websites, generating CDN links for fast content delivery, and integrating media uploads into applications. Developers can automate media handling and ensure efficient access to various file types.
Users can utilize returned data by integrating it into their applications for displaying media, managing assets, or creating links for sharing. For example, the "publicUrl" field can be used to embed images or videos directly into web pages or applications.
When handling partial or empty results, check the "nextCursor" field in paginated responses. If it is null, there are no more results. Implement logic to manage empty responses gracefully, such as displaying a message indicating no media assets are available.
To obtain your API key, first sign in to your account and navigate to the API you want to use. From the API's Pricing section, choose a plan and complete the subscription process. Once subscribed, return to the API page and you will see your API Access Key displayed at the top of the documentation page. You can use this key to authenticate your requests.
You can’t switch APIs during the free trial. If you subscribe to a different API, your trial will end and the new subscription will start as a paid plan.
The free trial lasts for 7 days and allows you to make up to 50 API requests.
No, the free trial is available only once, so we recommend using it on the API that interests you the most. Most of our APIs offer a free trial, but some may not include this option.
Yes. If the API offers a free trial, you will see a "Free 7-Day Trial" option in its Pricing section. The trial lasts for 7 days and allows up to 50 API requests, enabling you to evaluate the API before subscribing to a paid plan.
Zyla API Hub is like a big store for APIs, where you can find thousands of them all in one place. We also offer dedicated support and real-time monitoring of all APIs. Once you sign up, you can pick and choose which APIs you want to use. Just remember, each API needs its own subscription. But if you subscribe to multiple ones, you'll use the same key for all of them, making things easier for you.
You can monitor your API usage through the response headers included with every request:
x-zyla-api-calls-monthly-used: Shows the total number of API requests you have used during the current billing period.
x-zyla-api-calls-monthly-remaining: Shows the number of API requests you have remaining for the current billing period.
Yes, you can cancel your subscription at any time. Simply go to the Pricing section of the API you're subscribed to and click the "Unsubscribe" button.
Please note that upgrades, downgrades, and cancellations take effect immediately. Once your subscription is canceled, access to the service will end immediately, regardless of any remaining API calls in your quota.
Please have a look at our Refund Policy: https://zylalabs.com/terms#refund