Rename Folder
curl --request POST \
--url https://api.memories.ai/serve/api/v1/folders/rename \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data folder_id=671631448308117500 \
--data new_name=renamed-projectimport requests
url = "https://api.memories.ai/serve/api/v1/folders/rename"
payload = {
"folder_id": "671631448308117500",
"new_name": "renamed-project"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<api-key>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({folder_id: '671631448308117500', new_name: 'renamed-project'})
};
fetch('https://api.memories.ai/serve/api/v1/folders/rename', 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://api.memories.ai/serve/api/v1/folders/rename",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "folder_id=671631448308117500&new_name=renamed-project",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/x-www-form-urlencoded"
],
]);
$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://api.memories.ai/serve/api/v1/folders/rename"
payload := strings.NewReader("folder_id=671631448308117500&new_name=renamed-project")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.memories.ai/serve/api/v1/folders/rename")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("folder_id=671631448308117500&new_name=renamed-project")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.memories.ai/serve/api/v1/folders/rename")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "folder_id=671631448308117500&new_name=renamed-project"
response = http.request(request)
puts response.read_body{
"code": "0000",
"msg": "success",
"data": {
"folder_id": 671631448308117500,
"folder_name": "my-project"
}
}Folder Management
Rename Folder
Rename an existing folder in your Private Video Library.
POST
/
serve
/
api
/
v1
/
folders
/
rename
Rename Folder
curl --request POST \
--url https://api.memories.ai/serve/api/v1/folders/rename \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data folder_id=671631448308117500 \
--data new_name=renamed-projectimport requests
url = "https://api.memories.ai/serve/api/v1/folders/rename"
payload = {
"folder_id": "671631448308117500",
"new_name": "renamed-project"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<api-key>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({folder_id: '671631448308117500', new_name: 'renamed-project'})
};
fetch('https://api.memories.ai/serve/api/v1/folders/rename', 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://api.memories.ai/serve/api/v1/folders/rename",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "folder_id=671631448308117500&new_name=renamed-project",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/x-www-form-urlencoded"
],
]);
$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://api.memories.ai/serve/api/v1/folders/rename"
payload := strings.NewReader("folder_id=671631448308117500&new_name=renamed-project")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.memories.ai/serve/api/v1/folders/rename")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("folder_id=671631448308117500&new_name=renamed-project")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.memories.ai/serve/api/v1/folders/rename")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "folder_id=671631448308117500&new_name=renamed-project"
response = http.request(request)
puts response.read_body{
"code": "0000",
"msg": "success",
"data": {
"folder_id": 671631448308117500,
"folder_name": "my-project"
}
}Product: Visual Search
Use case: Organize your indexed videos into folders and scope uploads/searches to a folder
Host:
https://api.memories.ai/serve/api/v1
Auth: Authorization: sk-mavi-... (no Bearer prefix)-1) and the legacy API folder (-2) cannot.
Prerequisites
- You have created a memories.ai API key.
- You have a folder id from List Folders or Create Folder.
Request Example
Uses
application/x-www-form-urlencoded — send folder_id and new_name as form fields.import requests
headers = {"Authorization": "sk-mavi-..."}
response = requests.post(
"https://api.memories.ai/serve/api/v1/folders/rename",
headers=headers,
data={"folder_id": 671631448308117504, "new_name": "renamed-project"},
)
print(response.json())
cURL
curl -X POST "https://api.memories.ai/serve/api/v1/folders/rename" \
-H "Authorization: sk-mavi-..." \
-d "folder_id=671631448308117504" \
-d "new_name=renamed-project"
Parameters
integer
required
Id of the folder to rename. Must be > 0 and belong to your account. The Default folder (
-1) and legacy API folder (-2) cannot be renamed.string
required
New folder name. Maximum 100 characters. Must not collide with an existing folder name in your account.
Response Example
{
"code": "0000",
"msg": "success",
"data": {
"folder_id": 671631448308117504,
"folder_name": "renamed-project"
}
}
Response Fields
string
Business status code.
0000 indicates success.string
Human-readable status message.
integer
Identifier of the renamed folder (unchanged).
string
The new folder name.
Notes & Limits
- Passing
folder_id<= 0returns an error — the default/virtual folders are not renamable. - A folder that does not belong to your account returns
Folder does not exist or does not belong to the current user. - Renaming to an existing name returns
Folder with this name already exists.
Authorizations
Body
application/x-www-form-urlencoded
