Update file namespace assignments
curl --request PUT \
--url https://api.vidnavigator.com/v1/file/{file_id}/namespaces \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"namespace_ids": [
"64a1b2c3d4e5f6789..."
]
}
'import requests
url = "https://api.vidnavigator.com/v1/file/{file_id}/namespaces"
payload = { "namespace_ids": ["64a1b2c3d4e5f6789..."] }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({namespace_ids: ['64a1b2c3d4e5f6789...']})
};
fetch('https://api.vidnavigator.com/v1/file/{file_id}/namespaces', 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.vidnavigator.com/v1/file/{file_id}/namespaces",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'namespace_ids' => [
'64a1b2c3d4e5f6789...'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.vidnavigator.com/v1/file/{file_id}/namespaces"
payload := strings.NewReader("{\n \"namespace_ids\": [\n \"64a1b2c3d4e5f6789...\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.put("https://api.vidnavigator.com/v1/file/{file_id}/namespaces")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"namespace_ids\": [\n \"64a1b2c3d4e5f6789...\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vidnavigator.com/v1/file/{file_id}/namespaces")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"namespace_ids\": [\n \"64a1b2c3d4e5f6789...\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "<string>",
"data": {
"namespace_ids": [
"<string>"
],
"namespaces": [
{
"id": "<string>",
"name": "<string>"
}
]
}
}{
"status": "error",
"error": "<string>",
"message": "<string>"
}{
"status": "error",
"error": "file_not_found",
"message": "<string>"
}{
"status": "error",
"error": "internal_server_error",
"message": "<string>"
}Local Files
Update File Namespaces
Set the namespaces a file belongs to. Replaces any existing namespace assignments. The ‘default’ namespace is always preserved.
PUT
/
file
/
{file_id}
/
namespaces
Update file namespace assignments
curl --request PUT \
--url https://api.vidnavigator.com/v1/file/{file_id}/namespaces \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"namespace_ids": [
"64a1b2c3d4e5f6789..."
]
}
'import requests
url = "https://api.vidnavigator.com/v1/file/{file_id}/namespaces"
payload = { "namespace_ids": ["64a1b2c3d4e5f6789..."] }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({namespace_ids: ['64a1b2c3d4e5f6789...']})
};
fetch('https://api.vidnavigator.com/v1/file/{file_id}/namespaces', 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.vidnavigator.com/v1/file/{file_id}/namespaces",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'namespace_ids' => [
'64a1b2c3d4e5f6789...'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.vidnavigator.com/v1/file/{file_id}/namespaces"
payload := strings.NewReader("{\n \"namespace_ids\": [\n \"64a1b2c3d4e5f6789...\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.put("https://api.vidnavigator.com/v1/file/{file_id}/namespaces")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"namespace_ids\": [\n \"64a1b2c3d4e5f6789...\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vidnavigator.com/v1/file/{file_id}/namespaces")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"namespace_ids\": [\n \"64a1b2c3d4e5f6789...\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "<string>",
"data": {
"namespace_ids": [
"<string>"
],
"namespaces": [
{
"id": "<string>",
"name": "<string>"
}
]
}
}{
"status": "error",
"error": "<string>",
"message": "<string>"
}{
"status": "error",
"error": "file_not_found",
"message": "<string>"
}{
"status": "error",
"error": "internal_server_error",
"message": "<string>"
}Set which namespaces a file belongs to. This replaces any existing namespace assignments for the file. The
default namespace is always preserved.
Overview
Use this endpoint to move a file between namespaces or assign it to multiple namespaces at once. The response returns the updatednamespace_ids and resolved namespaces reflecting the new assignments.
Example Request
curl -X PUT "https://api.vidnavigator.com/v1/file/file_abc123/namespaces" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"namespace_ids": ["64a1b2c3d4e5f6789abc0002", "64a1b2c3d4e5f6789abc0003"]
}'
import requests
file_id = "file_abc123"
url = f"https://api.vidnavigator.com/v1/file/{file_id}/namespaces"
headers = {
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"namespace_ids": ["64a1b2c3d4e5f6789abc0002", "64a1b2c3d4e5f6789abc0003"]
}
response = requests.put(url, headers=headers, json=data)
result = response.json()
const fileId = 'file_abc123';
const response = await fetch(`https://api.vidnavigator.com/v1/file/${fileId}/namespaces`, {
method: 'PUT',
headers: {
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
namespace_ids: ['64a1b2c3d4e5f6789abc0002', '64a1b2c3d4e5f6789abc0003']
})
});
const result = await response.json();
Success Response
{
"status": "success",
"message": "File namespaces updated successfully",
"data": {
"namespace_ids": ["64a1b2c3d4e5f6789abc0001", "64a1b2c3d4e5f6789abc0002", "64a1b2c3d4e5f6789abc0003"],
"namespaces": [
{ "id": "64a1b2c3d4e5f6789abc0001", "name": "default" },
{ "id": "64a1b2c3d4e5f6789abc0002", "name": "Client Calls" },
{ "id": "64a1b2c3d4e5f6789abc0003", "name": "Product Demos" }
]
}
}
The
default namespace is always preserved in the response, even if not explicitly included in namespace_ids.Authorizations
API key authentication. Include your VidNavigator API key in the X-API-Key header.
Path Parameters
The ID of the file to update
Body
application/json
List of namespace IDs to assign to this file
Example:
["64a1b2c3d4e5f6789..."]
⌘I

