Create media

Uploads a new media file.

Files can be uploaded either as base64-encoded data or by providing a URL to fetch the file from.

Body Fields

FieldTypeRequiredDescription
namestringYesFile name with extension
mimestringYesMIME type (e.g., image/png, application/pdf)
folderstringYesFolder/category for organization
filestringNo*Base64-encoded file data (data URI format)
fromUrlstringNo*URL to fetch the file from

*Either file or fromUrl must be provided.

Supported MIME Types

CategoryMIME Types
Imagesimage/jpeg, image/png, image/gif, image/webp, image/svg+xml
Documentsapplication/pdf
OtherDepends on server configuration

Base64 File Format

The file field should be in data URI format:

data:<mime-type>;base64,<base64-encoded-data>

Example for a PDF:

data:application/pdf;base64,JVBERi0xLjQK...

Response Fields

FieldTypeDescription
idintegerNewly created media unique identifier
namestringFile name
urlstringPublic URL to access the file
mimestringMIME type
folderstringFolder/category
pathstringStorage path
thumbnailstringThumbnail URL (generated for images)
thumbPathstringThumbnail storage path
createdAtdatetimeCreation timestamp
updatedAtdatetimeLast update timestamp

Response

  • 201 Created: Media successfully uploaded
  • 400 Bad Request: Invalid request body, unsupported file type, or missing file data
  • 401 Unauthorized: Invalid or missing API key
Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params
string
string
string
string
Responses
201

Resource created

400

Bad request

401

Unauthorized

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here!