Upsert Branch File Chunks
curl --request POST \
--url https://api.veryfront.com/projects/{project_reference}/branches/{branchName}/files/{filePath}/chunks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"chunks": [
{
"chunk_index": 1,
"content": "<string>",
"start_offset": 1,
"end_offset": 1,
"token_count": 2,
"metadata": {}
}
]
}
'import requests
url = "https://api.veryfront.com/projects/{project_reference}/branches/{branchName}/files/{filePath}/chunks"
payload = { "chunks": [
{
"chunk_index": 1,
"content": "<string>",
"start_offset": 1,
"end_offset": 1,
"token_count": 2,
"metadata": {}
}
] }
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({
chunks: [
{
chunk_index: 1,
content: '<string>',
start_offset: 1,
end_offset: 1,
token_count: 2,
metadata: {}
}
]
})
};
fetch('https://api.veryfront.com/projects/{project_reference}/branches/{branchName}/files/{filePath}/chunks', 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.veryfront.com/projects/{project_reference}/branches/{branchName}/files/{filePath}/chunks",
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([
'chunks' => [
[
'chunk_index' => 1,
'content' => '<string>',
'start_offset' => 1,
'end_offset' => 1,
'token_count' => 2,
'metadata' => [
]
]
]
]),
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://api.veryfront.com/projects/{project_reference}/branches/{branchName}/files/{filePath}/chunks"
payload := strings.NewReader("{\n \"chunks\": [\n {\n \"chunk_index\": 1,\n \"content\": \"<string>\",\n \"start_offset\": 1,\n \"end_offset\": 1,\n \"token_count\": 2,\n \"metadata\": {}\n }\n ]\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://api.veryfront.com/projects/{project_reference}/branches/{branchName}/files/{filePath}/chunks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"chunks\": [\n {\n \"chunk_index\": 1,\n \"content\": \"<string>\",\n \"start_offset\": 1,\n \"end_offset\": 1,\n \"token_count\": 2,\n \"metadata\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.veryfront.com/projects/{project_reference}/branches/{branchName}/files/{filePath}/chunks")
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 \"chunks\": [\n {\n \"chunk_index\": 1,\n \"content\": \"<string>\",\n \"start_offset\": 1,\n \"end_offset\": 1,\n \"token_count\": 2,\n \"metadata\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"chunks": [
{
"id": "<string>",
"index": 123
}
],
"created": 123,
"updated": 123
}Creates or replaces chunk records for a file on a project branch after verifying project write capability.
POST
/
projects
/
{project_reference}
/
branches
/
{branchName}
/
files
/
{filePath}
/
chunks
Upsert Branch File Chunks
curl --request POST \
--url https://api.veryfront.com/projects/{project_reference}/branches/{branchName}/files/{filePath}/chunks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"chunks": [
{
"chunk_index": 1,
"content": "<string>",
"start_offset": 1,
"end_offset": 1,
"token_count": 2,
"metadata": {}
}
]
}
'import requests
url = "https://api.veryfront.com/projects/{project_reference}/branches/{branchName}/files/{filePath}/chunks"
payload = { "chunks": [
{
"chunk_index": 1,
"content": "<string>",
"start_offset": 1,
"end_offset": 1,
"token_count": 2,
"metadata": {}
}
] }
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({
chunks: [
{
chunk_index: 1,
content: '<string>',
start_offset: 1,
end_offset: 1,
token_count: 2,
metadata: {}
}
]
})
};
fetch('https://api.veryfront.com/projects/{project_reference}/branches/{branchName}/files/{filePath}/chunks', 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.veryfront.com/projects/{project_reference}/branches/{branchName}/files/{filePath}/chunks",
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([
'chunks' => [
[
'chunk_index' => 1,
'content' => '<string>',
'start_offset' => 1,
'end_offset' => 1,
'token_count' => 2,
'metadata' => [
]
]
]
]),
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://api.veryfront.com/projects/{project_reference}/branches/{branchName}/files/{filePath}/chunks"
payload := strings.NewReader("{\n \"chunks\": [\n {\n \"chunk_index\": 1,\n \"content\": \"<string>\",\n \"start_offset\": 1,\n \"end_offset\": 1,\n \"token_count\": 2,\n \"metadata\": {}\n }\n ]\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://api.veryfront.com/projects/{project_reference}/branches/{branchName}/files/{filePath}/chunks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"chunks\": [\n {\n \"chunk_index\": 1,\n \"content\": \"<string>\",\n \"start_offset\": 1,\n \"end_offset\": 1,\n \"token_count\": 2,\n \"metadata\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.veryfront.com/projects/{project_reference}/branches/{branchName}/files/{filePath}/chunks")
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 \"chunks\": [\n {\n \"chunk_index\": 1,\n \"content\": \"<string>\",\n \"start_offset\": 1,\n \"end_offset\": 1,\n \"token_count\": 2,\n \"metadata\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"chunks": [
{
"id": "<string>",
"index": 123
}
],
"created": 123,
"updated": 123
}Authorizations
bearerAuthapiKeyAuth
Use a JWT bearer token or a Veryfront API key in the Authorization header.
Path Parameters
Project ID, slug, or domain from the authenticated context.
Branch name or ID from the route.
URL-encoded file path for the chunked file.
Body
application/json
Chunks to replace the current indexed chunks for the file.
Required array length:
1 - 500 elementsShow child attributes
Show child attributes
⌘I