curl --request POST \
--url https://cool.jobmojito.com/functions/v1/media-folders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"action": "create",
"folder": "Crew life",
"merchant_id": "28106cba-1c27-4e53-b149-32113e5e8e31",
"to": "Life on board"
}
'import requests
url = "https://cool.jobmojito.com/functions/v1/media-folders"
payload = {
"action": "create",
"folder": "Crew life",
"merchant_id": "28106cba-1c27-4e53-b149-32113e5e8e31",
"to": "Life on board"
}
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({
action: 'create',
folder: 'Crew life',
merchant_id: '28106cba-1c27-4e53-b149-32113e5e8e31',
to: 'Life on board'
})
};
fetch('https://cool.jobmojito.com/functions/v1/media-folders', 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-folders",
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([
'action' => 'create',
'folder' => 'Crew life',
'merchant_id' => '28106cba-1c27-4e53-b149-32113e5e8e31',
'to' => 'Life on board'
]),
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-folders"
payload := strings.NewReader("{\n \"action\": \"create\",\n \"folder\": \"Crew life\",\n \"merchant_id\": \"28106cba-1c27-4e53-b149-32113e5e8e31\",\n \"to\": \"Life on board\"\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-folders")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"action\": \"create\",\n \"folder\": \"Crew life\",\n \"merchant_id\": \"28106cba-1c27-4e53-b149-32113e5e8e31\",\n \"to\": \"Life on board\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cool.jobmojito.com/functions/v1/media-folders")
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 \"action\": \"create\",\n \"folder\": \"Crew life\",\n \"merchant_id\": \"28106cba-1c27-4e53-b149-32113e5e8e31\",\n \"to\": \"Life on board\"\n}"
response = http.request(request)
puts response.read_body{
"folder": "<string>",
"moved": 123,
"drafts_updated": 123,
"warnings": [
"<string>"
]
}{
"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"
}Create, rename or delete a media library folder
Creates an empty folder (creating one that exists is fine), renames a folder, or deletes an empty one. Renaming moves every file in the folder: each gets a new address, the old address keeps working for published pages, and page drafts move to the new one. Files still uploading stay where they are. A folder name has 1 to 60 characters: letters, digits, spaces, ”-”, "", ”.”, ”(” and ”)”; it cannot start with ”.”, "" or a space, end with a space, or be “profile”.
curl --request POST \
--url https://cool.jobmojito.com/functions/v1/media-folders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"action": "create",
"folder": "Crew life",
"merchant_id": "28106cba-1c27-4e53-b149-32113e5e8e31",
"to": "Life on board"
}
'import requests
url = "https://cool.jobmojito.com/functions/v1/media-folders"
payload = {
"action": "create",
"folder": "Crew life",
"merchant_id": "28106cba-1c27-4e53-b149-32113e5e8e31",
"to": "Life on board"
}
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({
action: 'create',
folder: 'Crew life',
merchant_id: '28106cba-1c27-4e53-b149-32113e5e8e31',
to: 'Life on board'
})
};
fetch('https://cool.jobmojito.com/functions/v1/media-folders', 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-folders",
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([
'action' => 'create',
'folder' => 'Crew life',
'merchant_id' => '28106cba-1c27-4e53-b149-32113e5e8e31',
'to' => 'Life on board'
]),
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-folders"
payload := strings.NewReader("{\n \"action\": \"create\",\n \"folder\": \"Crew life\",\n \"merchant_id\": \"28106cba-1c27-4e53-b149-32113e5e8e31\",\n \"to\": \"Life on board\"\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-folders")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"action\": \"create\",\n \"folder\": \"Crew life\",\n \"merchant_id\": \"28106cba-1c27-4e53-b149-32113e5e8e31\",\n \"to\": \"Life on board\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cool.jobmojito.com/functions/v1/media-folders")
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 \"action\": \"create\",\n \"folder\": \"Crew life\",\n \"merchant_id\": \"28106cba-1c27-4e53-b149-32113e5e8e31\",\n \"to\": \"Life on board\"\n}"
response = http.request(request)
puts response.read_body{
"folder": "<string>",
"moved": 123,
"drafts_updated": 123,
"warnings": [
"<string>"
]
}{
"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
create an empty folder, rename one with every file in it, or delete an empty one.
create, rename, delete "create"
The folder to create, rename or delete.
"Crew life"
Optional company. Admins and sub-merchant operators only; other callers always use their token's company.
"28106cba-1c27-4e53-b149-32113e5e8e31"
The new name. Required to rename.
"Life on board"
Response
Done.
The folder as it is now: the new name after a rename.
Rename only: files moved to the new folder.
Rename only: page drafts moved to the new addresses. Published pages keep the old ones until they are published again.
Rename only: things worth telling the person. The folder was renamed.