Skyden Send
Sign in
POST https://skyden.kiloconnectrdc.com/api/v1/media

Upload Media

Upload a file and get a media_id to reuse in messages. Files are stored on Cloudflare R2.

API key required application/json
info
Content-Type: multipart/form-data is required for this endpoint.

Body Parameters

file Required
file

The file to upload. Max size depends on your plan (usually 25 MB).

Code Examples

curl -X POST https://skyden.kiloconnectrdc.com/api/v1/media \
  -H 'Authorization: Bearer sks_live_xxxxx' \
  -F 'file=@/path/to/photo.png'
<?php
use Skyden\Send\SkydenSend;

SkydenSend::config('sks_live_xxxxx');

$media = SkydenSend::client()->multipart('/media', [
    ['name' => 'file', 'contents' => fopen('/path/to/photo.png', 'r')]
]);
import { SkydenSend } from 'skyden-send';
import fs from 'node:fs';

SkydenSend.config('sks_live_xxxxx');

const formData = new FormData();
formData.append('file', fs.readFileSync('/path/to/photo.png'), 'photo.png');

const media = await SkydenSend.client().post('/media', formData);

Success Response

201 Created
{
  "success": true,
  "data": {
    "id": "01a094...",
    "filename": "photo.png",
    "mime_type": "image/png",
    "size_bytes": 12345,
    "type": "image"
  }
}