Upload File
curl --request POST \
--url https://api.navtalk.ai/api/open/v1/file/upload \
--header 'Content-Type: multipart/form-data' \
--header 'license: <api-key>' \
--form file='@example-file'import requests
url = "https://api.navtalk.ai/api/open/v1/file/upload"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"license": "<api-key>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {license: '<api-key>'}};
options.body = form;
fetch('https://api.navtalk.ai/api/open/v1/file/upload', 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.navtalk.ai/api/open/v1/file/upload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"license: <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.navtalk.ai/api/open/v1/file/upload"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("license", "<api-key>")
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.navtalk.ai/api/open/v1/file/upload")
.header("license", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.navtalk.ai/api/open/v1/file/upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["license"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"code": 200,
"message": "SUCCESS",
"data": {
"fileName": "img.png",
"fileUrl": "/uploadFiles/2026-02-19/eb836cdb-6a07-4424-bedd-0ddd5b28eb67.png",
"suffix": "png",
"fileType": "image/png"
}
}
File
Upload File
Upload an image or video file to the NavTalk storage.
Supported formats:
- Images: jpg, jpeg, png, gif, webp, bmp
- Videos: mp4, mov, webm, m4v, avi
Limitations:
- Maximum file size: 20 MB
- Only image and video files are accepted
Note for avatar training (/api/open/v1/avatar/add):
- Video minimum duration:
2seconds - Video maximum resolution:
1920x1080
Returns the uploaded file’s metadata including accessible URL.
POST
/
api
/
open
/
v1
/
file
/
upload
Upload File
curl --request POST \
--url https://api.navtalk.ai/api/open/v1/file/upload \
--header 'Content-Type: multipart/form-data' \
--header 'license: <api-key>' \
--form file='@example-file'import requests
url = "https://api.navtalk.ai/api/open/v1/file/upload"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"license": "<api-key>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {license: '<api-key>'}};
options.body = form;
fetch('https://api.navtalk.ai/api/open/v1/file/upload', 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.navtalk.ai/api/open/v1/file/upload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"license: <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.navtalk.ai/api/open/v1/file/upload"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("license", "<api-key>")
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.navtalk.ai/api/open/v1/file/upload")
.header("license", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.navtalk.ai/api/open/v1/file/upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["license"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"code": 200,
"message": "SUCCESS",
"data": {
"fileName": "img.png",
"fileUrl": "/uploadFiles/2026-02-19/eb836cdb-6a07-4424-bedd-0ddd5b28eb67.png",
"suffix": "png",
"fileType": "image/png"
}
}
Notes for Avatar Training
This endpoint only uploads files and returns a file URL. If the uploaded video URL is later used inPOST /api/open/v1/avatar/add, the backend will enforce:
- Minimum video duration: 2 seconds
- Maximum video resolution: 1920x1080
⌘I