curl --request POST \
--url https://api.example.com/v1/projects/{project_id}/parse/{parse_result_id}/rechunk \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-selected-account-id: <api-key>' \
--data '
{
"chunking_options": {
"strategy": "token_size",
"chunk_size": 512,
"chunk_overlap": 50,
"encoding_name": "cl100k_base"
}
}
'import requests
url = "https://api.example.com/v1/projects/{project_id}/parse/{parse_result_id}/rechunk"
payload = { "chunking_options": {
"strategy": "token_size",
"chunk_size": 512,
"chunk_overlap": 50,
"encoding_name": "cl100k_base"
} }
headers = {
"x-api-key": "<api-key>",
"x-selected-account-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-api-key': '<api-key>',
'x-selected-account-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
chunking_options: {
strategy: 'token_size',
chunk_size: 512,
chunk_overlap: 50,
encoding_name: 'cl100k_base'
}
})
};
fetch('https://api.example.com/v1/projects/{project_id}/parse/{parse_result_id}/rechunk', 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.example.com/v1/projects/{project_id}/parse/{parse_result_id}/rechunk",
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([
'chunking_options' => [
'strategy' => 'token_size',
'chunk_size' => 512,
'chunk_overlap' => 50,
'encoding_name' => 'cl100k_base'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-selected-account-id: <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.example.com/v1/projects/{project_id}/parse/{parse_result_id}/rechunk"
payload := strings.NewReader("{\n \"chunking_options\": {\n \"strategy\": \"token_size\",\n \"chunk_size\": 512,\n \"chunk_overlap\": 50,\n \"encoding_name\": \"cl100k_base\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-selected-account-id", "<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.post("https://api.example.com/v1/projects/{project_id}/parse/{parse_result_id}/rechunk")
.header("x-api-key", "<api-key>")
.header("x-selected-account-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chunking_options\": {\n \"strategy\": \"token_size\",\n \"chunk_size\": 512,\n \"chunk_overlap\": 50,\n \"encoding_name\": \"cl100k_base\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/projects/{project_id}/parse/{parse_result_id}/rechunk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["x-selected-account-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chunking_options\": {\n \"strategy\": \"token_size\",\n \"chunk_size\": 512,\n \"chunk_overlap\": 50,\n \"encoding_name\": \"cl100k_base\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"project_id": "<string>",
"operation": "parse",
"status": "pending",
"created_at": "2023-11-07T05:31:56Z",
"object": "job",
"source_id": "<string>",
"correlation_id": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"result": {},
"progress": {
"total": 123,
"succeeded": 123,
"failed": 123,
"cancelled": 123,
"pending": 123,
"child_jobs": [
{
"source_document_id": "<string>",
"job_id": "<string>",
"status": "pending",
"parse_result_id": "<string>",
"error": "<string>"
}
]
},
"error": "<string>",
"history": [
{
"step": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"duration_ms": 123,
"status": "<string>",
"details": {}
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Create Chunk Job
Rechunk a parse result with a different chunking strategy.
This endpoint initiates rechunking of an existing parse result using the specified chunking strategy. The operation is performed asynchronously via Temporal workflows.
Args: project_id: Project ID that the parse result belongs to parse_result_id: Parse result ID to rechunk request: Rechunk parse result request with chunking strategy and options
Returns: Job entity that can be used to track progress
Raises: HTTPException: If the parse result is not found or other errors occur
curl --request POST \
--url https://api.example.com/v1/projects/{project_id}/parse/{parse_result_id}/rechunk \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-selected-account-id: <api-key>' \
--data '
{
"chunking_options": {
"strategy": "token_size",
"chunk_size": 512,
"chunk_overlap": 50,
"encoding_name": "cl100k_base"
}
}
'import requests
url = "https://api.example.com/v1/projects/{project_id}/parse/{parse_result_id}/rechunk"
payload = { "chunking_options": {
"strategy": "token_size",
"chunk_size": 512,
"chunk_overlap": 50,
"encoding_name": "cl100k_base"
} }
headers = {
"x-api-key": "<api-key>",
"x-selected-account-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-api-key': '<api-key>',
'x-selected-account-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
chunking_options: {
strategy: 'token_size',
chunk_size: 512,
chunk_overlap: 50,
encoding_name: 'cl100k_base'
}
})
};
fetch('https://api.example.com/v1/projects/{project_id}/parse/{parse_result_id}/rechunk', 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.example.com/v1/projects/{project_id}/parse/{parse_result_id}/rechunk",
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([
'chunking_options' => [
'strategy' => 'token_size',
'chunk_size' => 512,
'chunk_overlap' => 50,
'encoding_name' => 'cl100k_base'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-selected-account-id: <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.example.com/v1/projects/{project_id}/parse/{parse_result_id}/rechunk"
payload := strings.NewReader("{\n \"chunking_options\": {\n \"strategy\": \"token_size\",\n \"chunk_size\": 512,\n \"chunk_overlap\": 50,\n \"encoding_name\": \"cl100k_base\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-selected-account-id", "<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.post("https://api.example.com/v1/projects/{project_id}/parse/{parse_result_id}/rechunk")
.header("x-api-key", "<api-key>")
.header("x-selected-account-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chunking_options\": {\n \"strategy\": \"token_size\",\n \"chunk_size\": 512,\n \"chunk_overlap\": 50,\n \"encoding_name\": \"cl100k_base\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/projects/{project_id}/parse/{parse_result_id}/rechunk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["x-selected-account-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chunking_options\": {\n \"strategy\": \"token_size\",\n \"chunk_size\": 512,\n \"chunk_overlap\": 50,\n \"encoding_name\": \"cl100k_base\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"project_id": "<string>",
"operation": "parse",
"status": "pending",
"created_at": "2023-11-07T05:31:56Z",
"object": "job",
"source_id": "<string>",
"correlation_id": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"result": {},
"progress": {
"total": 123,
"succeeded": 123,
"failed": 123,
"cancelled": 123,
"pending": 123,
"child_jobs": [
{
"source_document_id": "<string>",
"job_id": "<string>",
"status": "pending",
"parse_result_id": "<string>",
"error": "<string>"
}
]
},
"error": "<string>",
"history": [
{
"step": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"duration_ms": 123,
"status": "<string>",
"details": {}
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
API key for authentication
Selected Account ID
Body
Request model for rechunking a parse result.
Token-based chunking: Splits text into chunks by token count using a tokenizer (e.g., tiktoken). Best for LLM APIs with token limits, embedding models, and cost optimization. Use when you need precise control over token usage.
- TokenSizeChunkingOptions
- RecursiveChunkingOptions
- PageChunkingOptions
- SectionChunkingOptions
Show child attributes
Show child attributes
Response
Successful Response
Job response model representing an asynchronous operation.
ID of the entity
ID of the project
Operation type (e.g., 'parse')
parse, batch_parse, extract, research, vector_store, chunk, summarization, create_index, update_index Current job status
pending, running, succeeded, partially_succeeded, failed, cancelled When the job was created
"job"Source document/file ID
Request correlation ID for tracing
When the job started processing
When the job completed
Job result payload when completed
Live progress payload (used by batch jobs)
Show child attributes
Show child attributes
Error message if job failed
Timeline of job execution events
Show child attributes
Show child attributes

