SkyLight Chat
API Reference

Media

Upload and manage your image and video library via the API.

Overview

The Media API gives you full programmatic access to your media library — the same files that appear under Media in the SkyLight Chat dashboard. You can list, upload, rename, and delete images and videos.

Strict isolation. Every media endpoint is scoped to your API key. You can only see and modify your own files — it is impossible to access another account's media through the API.

Files are stored on the configured storage backend (local, S3, Wasabi, or DigitalOcean Spaces) and served via a public URL.

AI agents and chat

The media library is the catalog of assets your AI agent can deliver in conversation on supported channels—alongside text—when instructions or product catalog entries point at specific files. Upload and organize files here so automated replies can share the correct image, video, or downloadable document in context.


The MediaFile object

{
  "id": 15,
  "name": "Product Hero Image",
  "original_name": "hero-product-v2.jpg",
  "url": "https://dashboard.skylightchat.com/storage/media/9/images/1741430012_abc123.jpg",
  "file_type": "image",
  "mime_type": "image/jpeg",
  "extension": "jpg",
  "file_size": 204800,
  "formatted_size": "200 KB",
  "metadata": { "width": 1920, "height": 1080 },
  "uploaded_by": "client",
  "is_active": true,
  "created_at": "2026-03-08T10:00:00.000000Z",
  "updated_at": "2026-03-08T10:00:00.000000Z"
}
FieldTypeDescription
idintegerUnique file identifier
namestringDisplay name (editable via PUT)
original_namestringOriginal filename from the upload
urlstringPublicly accessible URL to the file
file_typestringimage or video
mime_typestringFull MIME type (e.g. image/jpeg)
extensionstringFile extension
file_sizeintegerSize in bytes
formatted_sizestringHuman-readable size (e.g. 200 KB)
metadataobject|nullFor images: width and height in pixels
uploaded_bystringclient or admin
is_activebooleanWhether the file is active

List media files

GET /api/v1/media

Returns a paginated list of your media files, ordered newest first.

Query parameters

ParameterTypeDescription
typestringFilter by type: image or video
searchstringSearch by display name or original filename
per_pageintegerResults per page (default: 25, max: 100)
curl "https://dashboard.skylightchat.com/api/v1/media?type=image&per_page=10" \
  -H "X-Api-Key: ••••••••••••"

Upload a file

POST /api/v1/media

Upload a new image or video. This is a multipart/form-data request.

FieldTypeRequiredNotes
filefilejpg, jpeg, png, gif, mp4, avi, mov, wmv, flv, webm — max 50 MB
namestringNoDisplay name. Defaults to the original filename if omitted.
curl -X POST https://dashboard.skylightchat.com/api/v1/media \
  -H "X-Api-Key: ••••••••••••" \
  -F "file=@/path/to/product-hero.jpg" \
  -F "name=Product Hero Image"

Returns 201 Created with the full media object including the public url.

If your subscription plan has a media file limit, uploading beyond the limit returns 403 Forbidden.

Get a file

GET /api/v1/media/{id}

Returns a single media file. Returns 404 if the file does not exist or belongs to a different account.

curl https://dashboard.skylightchat.com/api/v1/media/15 \
  -H "X-Api-Key: ••••••••••••"

Rename a file

PUT /api/v1/media/{id}

Update the display name of a media file. The physical file is not changed.

FieldTypeRequired
namestring
curl -X PUT https://dashboard.skylightchat.com/api/v1/media/15 \
  -H "X-Api-Key: ••••••••••••" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Product Hero — March 2026" }'

Delete a file

DELETE /api/v1/media/{id}

Permanently deletes the media file and its physical storage object. Returns 204 No Content.

Files uploaded by an administrator through the dashboard cannot be deleted via the API. Attempting to do so returns 403 Forbidden.
curl -X DELETE https://dashboard.skylightchat.com/api/v1/media/15 \
  -H "X-Api-Key: ••••••••••••"

Supported file types

CategoryExtensions
Imagesjpg, jpeg, png, gif
Videosmp4, avi, mov, wmv, flv, webm

Maximum file size: 50 MB per upload.