curl --request POST \
--url https://postonce.to/api/public/v1/media/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filename": "launch-image.png",
"content_type": "image/png"
}
'
{
"data": {
"content_type": "image/png",
"media_id": "cHVibGljLWFwaS91c2VyLTEyMy8xNzQzNDM0NTY3LWxhdW5jaC1pbWFnZS5wbmc",
"path": "public-api/user-123/1743434567-launch-image.png",
"upload": {
"path": "public-api/user-123/1743434567-launch-image.png",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"signedUrl": "https://swgrcbzlaeshsmygubik.supabase.co/storage/v1/object/upload/sign/social-media/public-api/user-123/1743434567-launch-image.png?token=..."
}
}
}{
"error": {
"code": "invalid_filename",
"message": "filename is required."
}
}{
"error": {
"code": "invalid_api_key",
"message": "Invalid API key.",
"hint": "<string>"
}
}Media
Create upload URL
Creates a signed upload URL and media_id. The file’s raw bytes are uploaded with PUT to data.upload.signedUrl; creating the URL alone does not upload anything. Once uploaded, the media_id resolves to a public URL that posts and drafts accept as media[].url. The signed URL is a temporary upload credential.
POST
https://postonce.to/api/public
/
v1
/
media
/
uploads
curl --request POST \
--url https://postonce.to/api/public/v1/media/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filename": "launch-image.png",
"content_type": "image/png"
}
'
{
"data": {
"content_type": "image/png",
"media_id": "cHVibGljLWFwaS91c2VyLTEyMy8xNzQzNDM0NTY3LWxhdW5jaC1pbWFnZS5wbmc",
"path": "public-api/user-123/1743434567-launch-image.png",
"upload": {
"path": "public-api/user-123/1743434567-launch-image.png",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"signedUrl": "https://swgrcbzlaeshsmygubik.supabase.co/storage/v1/object/upload/sign/social-media/public-api/user-123/1743434567-launch-image.png?token=..."
}
}
}{
"error": {
"code": "invalid_filename",
"message": "filename is required."
}
}{
"error": {
"code": "invalid_api_key",
"message": "Invalid API key.",
"hint": "<string>"
}
}Authorizations
Body
application/json
