curl --request POST \
--url https://cool.jobmojito.com/functions/v1/media-upload-start \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"file_name": "team-photo.jpg",
"content_type": "image/jpeg",
"size_bytes": 120000,
"merchant_id": "28106cba-1c27-4e53-b149-32113e5e8e31",
"folder": "team",
"replace_media_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://cool.jobmojito.com/functions/v1/media-upload-start"
payload = {
"file_name": "team-photo.jpg",
"content_type": "image/jpeg",
"size_bytes": 120000,
"merchant_id": "28106cba-1c27-4e53-b149-32113e5e8e31",
"folder": "team",
"replace_media_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
file_name: 'team-photo.jpg',
content_type: 'image/jpeg',
size_bytes: 120000,
merchant_id: '28106cba-1c27-4e53-b149-32113e5e8e31',
folder: 'team',
replace_media_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://cool.jobmojito.com/functions/v1/media-upload-start', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://cool.jobmojito.com/functions/v1/media-upload-start",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'file_name' => 'team-photo.jpg',
'content_type' => 'image/jpeg',
'size_bytes' => 120000,
'merchant_id' => '28106cba-1c27-4e53-b149-32113e5e8e31',
'folder' => 'team',
'replace_media_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://cool.jobmojito.com/functions/v1/media-upload-start"
payload := strings.NewReader("{\n \"file_name\": \"team-photo.jpg\",\n \"content_type\": \"image/jpeg\",\n \"size_bytes\": 120000,\n \"merchant_id\": \"28106cba-1c27-4e53-b149-32113e5e8e31\",\n \"folder\": \"team\",\n \"replace_media_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://cool.jobmojito.com/functions/v1/media-upload-start")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"file_name\": \"team-photo.jpg\",\n \"content_type\": \"image/jpeg\",\n \"size_bytes\": 120000,\n \"merchant_id\": \"28106cba-1c27-4e53-b149-32113e5e8e31\",\n \"folder\": \"team\",\n \"replace_media_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cool.jobmojito.com/functions/v1/media-upload-start")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"file_name\": \"team-photo.jpg\",\n \"content_type\": \"image/jpeg\",\n \"size_bytes\": 120000,\n \"merchant_id\": \"28106cba-1c27-4e53-b149-32113e5e8e31\",\n \"folder\": \"team\",\n \"replace_media_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"media_id": "<string>",
"upload_url": "<string>",
"token": "<string>",
"path": "<string>",
"cache_control": 31536000
}{
"error": "Field is required.",
"name": "interview_result_id"
}{
"error": "Field is required.",
"name": "interview_result_id"
}{
"error": "Field is required.",
"name": "interview_result_id"
}{
"error": "Field is required.",
"name": "interview_result_id"
}{
"error": "Field is required.",
"name": "interview_result_id"
}{
"error": "Field is required.",
"name": "interview_result_id"
}{
"error": "Field is required.",
"name": "interview_result_id"
}Start uploading a media file
Starts an upload to the media library. Upload in three steps: call this, PUT the file to upload_url, then call media-upload-finish, which checks the file and makes it usable. Takes JPEG, PNG, WebP, GIF, AVIF, SVG, H.264 MP4, MP3, M4A and WOFF2 up to 50 MB. The file is checked on finish, not here: its real type, the codec of a video, and anything active in an SVG.
curl --request POST \
--url https://cool.jobmojito.com/functions/v1/media-upload-start \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"file_name": "team-photo.jpg",
"content_type": "image/jpeg",
"size_bytes": 120000,
"merchant_id": "28106cba-1c27-4e53-b149-32113e5e8e31",
"folder": "team",
"replace_media_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://cool.jobmojito.com/functions/v1/media-upload-start"
payload = {
"file_name": "team-photo.jpg",
"content_type": "image/jpeg",
"size_bytes": 120000,
"merchant_id": "28106cba-1c27-4e53-b149-32113e5e8e31",
"folder": "team",
"replace_media_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
file_name: 'team-photo.jpg',
content_type: 'image/jpeg',
size_bytes: 120000,
merchant_id: '28106cba-1c27-4e53-b149-32113e5e8e31',
folder: 'team',
replace_media_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://cool.jobmojito.com/functions/v1/media-upload-start', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://cool.jobmojito.com/functions/v1/media-upload-start",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'file_name' => 'team-photo.jpg',
'content_type' => 'image/jpeg',
'size_bytes' => 120000,
'merchant_id' => '28106cba-1c27-4e53-b149-32113e5e8e31',
'folder' => 'team',
'replace_media_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://cool.jobmojito.com/functions/v1/media-upload-start"
payload := strings.NewReader("{\n \"file_name\": \"team-photo.jpg\",\n \"content_type\": \"image/jpeg\",\n \"size_bytes\": 120000,\n \"merchant_id\": \"28106cba-1c27-4e53-b149-32113e5e8e31\",\n \"folder\": \"team\",\n \"replace_media_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://cool.jobmojito.com/functions/v1/media-upload-start")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"file_name\": \"team-photo.jpg\",\n \"content_type\": \"image/jpeg\",\n \"size_bytes\": 120000,\n \"merchant_id\": \"28106cba-1c27-4e53-b149-32113e5e8e31\",\n \"folder\": \"team\",\n \"replace_media_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cool.jobmojito.com/functions/v1/media-upload-start")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"file_name\": \"team-photo.jpg\",\n \"content_type\": \"image/jpeg\",\n \"size_bytes\": 120000,\n \"merchant_id\": \"28106cba-1c27-4e53-b149-32113e5e8e31\",\n \"folder\": \"team\",\n \"replace_media_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"media_id": "<string>",
"upload_url": "<string>",
"token": "<string>",
"path": "<string>",
"cache_control": 31536000
}{
"error": "Field is required.",
"name": "interview_result_id"
}{
"error": "Field is required.",
"name": "interview_result_id"
}{
"error": "Field is required.",
"name": "interview_result_id"
}{
"error": "Field is required.",
"name": "interview_result_id"
}{
"error": "Field is required.",
"name": "interview_result_id"
}{
"error": "Field is required.",
"name": "interview_result_id"
}{
"error": "Field is required.",
"name": "interview_result_id"
}Authorizations
Supabase JWT — Authorization: Bearer <token>.
Body
Display name in the library. It is never part of the address.
"team-photo.jpg"
Type of the file: image/jpeg, image/png, image/webp, image/gif, image/avif, image/svg+xml, video/mp4, audio/mpeg, audio/mp4, audio/x-m4a, font/woff2. Video must be H.264 MP4. Upload the file with this same content type.
image/jpeg, image/png, image/webp, image/gif, image/avif, image/svg+xml, video/mp4, audio/mpeg, audio/mp4, audio/x-m4a, font/woff2 "image/jpeg"
Size of the file in bytes, at most 52428800 (50 MB). A larger file answers 413.
x > 0120000
Optional company to upload for. Admins and sub-merchant operators only; other callers always use their token's company.
"28106cba-1c27-4e53-b149-32113e5e8e31"
Library folder to upload into; default the top (""). The folder need not exist yet. Ignored when replacing: a new version stays in the folder of the file.
"team"
Replace this file instead of adding one. Must be the same kind. The file keeps its id, name and alt text and gets a new address when media-upload-finish accepts it.
1Response
Where to upload the file.
Send this to media-upload-finish after the upload.
Signed address, valid for two hours. PUT the file here with the Content-Type you declared and Cache-Control: max-age=<cache_control>.
The token inside upload_url, for clients that upload with the Supabase library (uploadToSignedUrl).
Object name in the public bucket: <merchant_id>/[/]<media_id>-v..
Seconds to send as the cache lifetime: a file name is never reused, so a year is safe.
31536000