Create a content fragment
curl --request POST \
--url https://dust.tt/api/v1/w/{wId}/assistant/conversations/{cId}/content_fragments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "My content fragment",
"content": "This is my content fragment extracted text",
"contentType": "text/plain",
"url": "https://example.com/content",
"fileId": "fil_123456",
"path": "conversation/report.csv",
"processedPath": "conversation/voice.processed.txt",
"skipFileProcessing": true,
"nodeId": "node_123456",
"nodeDataSourceViewId": "dsv_123456"
}
'import requests
url = "https://dust.tt/api/v1/w/{wId}/assistant/conversations/{cId}/content_fragments"
payload = {
"title": "My content fragment",
"content": "This is my content fragment extracted text",
"contentType": "text/plain",
"url": "https://example.com/content",
"fileId": "fil_123456",
"path": "conversation/report.csv",
"processedPath": "conversation/voice.processed.txt",
"skipFileProcessing": True,
"nodeId": "node_123456",
"nodeDataSourceViewId": "dsv_123456"
}
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({
title: 'My content fragment',
content: 'This is my content fragment extracted text',
contentType: 'text/plain',
url: 'https://example.com/content',
fileId: 'fil_123456',
path: 'conversation/report.csv',
processedPath: 'conversation/voice.processed.txt',
skipFileProcessing: true,
nodeId: 'node_123456',
nodeDataSourceViewId: 'dsv_123456'
})
};
fetch('https://dust.tt/api/v1/w/{wId}/assistant/conversations/{cId}/content_fragments', 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://dust.tt/api/v1/w/{wId}/assistant/conversations/{cId}/content_fragments",
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([
'title' => 'My content fragment',
'content' => 'This is my content fragment extracted text',
'contentType' => 'text/plain',
'url' => 'https://example.com/content',
'fileId' => 'fil_123456',
'path' => 'conversation/report.csv',
'processedPath' => 'conversation/voice.processed.txt',
'skipFileProcessing' => true,
'nodeId' => 'node_123456',
'nodeDataSourceViewId' => 'dsv_123456'
]),
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://dust.tt/api/v1/w/{wId}/assistant/conversations/{cId}/content_fragments"
payload := strings.NewReader("{\n \"title\": \"My content fragment\",\n \"content\": \"This is my content fragment extracted text\",\n \"contentType\": \"text/plain\",\n \"url\": \"https://example.com/content\",\n \"fileId\": \"fil_123456\",\n \"path\": \"conversation/report.csv\",\n \"processedPath\": \"conversation/voice.processed.txt\",\n \"skipFileProcessing\": true,\n \"nodeId\": \"node_123456\",\n \"nodeDataSourceViewId\": \"dsv_123456\"\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://dust.tt/api/v1/w/{wId}/assistant/conversations/{cId}/content_fragments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"My content fragment\",\n \"content\": \"This is my content fragment extracted text\",\n \"contentType\": \"text/plain\",\n \"url\": \"https://example.com/content\",\n \"fileId\": \"fil_123456\",\n \"path\": \"conversation/report.csv\",\n \"processedPath\": \"conversation/voice.processed.txt\",\n \"skipFileProcessing\": true,\n \"nodeId\": \"node_123456\",\n \"nodeDataSourceViewId\": \"dsv_123456\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dust.tt/api/v1/w/{wId}/assistant/conversations/{cId}/content_fragments")
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 \"title\": \"My content fragment\",\n \"content\": \"This is my content fragment extracted text\",\n \"contentType\": \"text/plain\",\n \"url\": \"https://example.com/content\",\n \"fileId\": \"fil_123456\",\n \"path\": \"conversation/report.csv\",\n \"processedPath\": \"conversation/voice.processed.txt\",\n \"skipFileProcessing\": true,\n \"nodeId\": \"node_123456\",\n \"nodeDataSourceViewId\": \"dsv_123456\"\n}"
response = http.request(request)
puts response.read_body{
"title": "My content fragment",
"content": "This is my content fragment extracted text",
"contentType": "text/plain",
"url": "https://example.com/content",
"fileId": "fil_123456",
"path": "conversation/report.csv",
"processedPath": "conversation/voice.processed.txt",
"skipFileProcessing": true,
"nodeId": "node_123456",
"nodeDataSourceViewId": "dsv_123456",
"context": {
"username": "johndoe123",
"timezone": "America/New_York",
"fullName": "John Doe",
"email": "john.doe@example.com",
"profilePictureUrl": "https://example.com/profiles/johndoe123.jpg",
"excludedRetrievalTags": [
"<string>"
],
"hostSelection": "<string>",
"hostDocument": {
"name": "<string>",
"url": "<string>"
},
"authMethod": "<string>",
"agenticMessageData": {
"type": "run_agent",
"originMessageId": "2b8e4f6a0c"
}
}
}Conversations
Create a content fragment
Create a new content fragment in the workspace identified by .
POST
/
api
/
v1
/
w
/
{wId}
/
assistant
/
conversations
/
{cId}
/
content_fragments
Create a content fragment
curl --request POST \
--url https://dust.tt/api/v1/w/{wId}/assistant/conversations/{cId}/content_fragments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "My content fragment",
"content": "This is my content fragment extracted text",
"contentType": "text/plain",
"url": "https://example.com/content",
"fileId": "fil_123456",
"path": "conversation/report.csv",
"processedPath": "conversation/voice.processed.txt",
"skipFileProcessing": true,
"nodeId": "node_123456",
"nodeDataSourceViewId": "dsv_123456"
}
'import requests
url = "https://dust.tt/api/v1/w/{wId}/assistant/conversations/{cId}/content_fragments"
payload = {
"title": "My content fragment",
"content": "This is my content fragment extracted text",
"contentType": "text/plain",
"url": "https://example.com/content",
"fileId": "fil_123456",
"path": "conversation/report.csv",
"processedPath": "conversation/voice.processed.txt",
"skipFileProcessing": True,
"nodeId": "node_123456",
"nodeDataSourceViewId": "dsv_123456"
}
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({
title: 'My content fragment',
content: 'This is my content fragment extracted text',
contentType: 'text/plain',
url: 'https://example.com/content',
fileId: 'fil_123456',
path: 'conversation/report.csv',
processedPath: 'conversation/voice.processed.txt',
skipFileProcessing: true,
nodeId: 'node_123456',
nodeDataSourceViewId: 'dsv_123456'
})
};
fetch('https://dust.tt/api/v1/w/{wId}/assistant/conversations/{cId}/content_fragments', 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://dust.tt/api/v1/w/{wId}/assistant/conversations/{cId}/content_fragments",
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([
'title' => 'My content fragment',
'content' => 'This is my content fragment extracted text',
'contentType' => 'text/plain',
'url' => 'https://example.com/content',
'fileId' => 'fil_123456',
'path' => 'conversation/report.csv',
'processedPath' => 'conversation/voice.processed.txt',
'skipFileProcessing' => true,
'nodeId' => 'node_123456',
'nodeDataSourceViewId' => 'dsv_123456'
]),
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://dust.tt/api/v1/w/{wId}/assistant/conversations/{cId}/content_fragments"
payload := strings.NewReader("{\n \"title\": \"My content fragment\",\n \"content\": \"This is my content fragment extracted text\",\n \"contentType\": \"text/plain\",\n \"url\": \"https://example.com/content\",\n \"fileId\": \"fil_123456\",\n \"path\": \"conversation/report.csv\",\n \"processedPath\": \"conversation/voice.processed.txt\",\n \"skipFileProcessing\": true,\n \"nodeId\": \"node_123456\",\n \"nodeDataSourceViewId\": \"dsv_123456\"\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://dust.tt/api/v1/w/{wId}/assistant/conversations/{cId}/content_fragments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"My content fragment\",\n \"content\": \"This is my content fragment extracted text\",\n \"contentType\": \"text/plain\",\n \"url\": \"https://example.com/content\",\n \"fileId\": \"fil_123456\",\n \"path\": \"conversation/report.csv\",\n \"processedPath\": \"conversation/voice.processed.txt\",\n \"skipFileProcessing\": true,\n \"nodeId\": \"node_123456\",\n \"nodeDataSourceViewId\": \"dsv_123456\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dust.tt/api/v1/w/{wId}/assistant/conversations/{cId}/content_fragments")
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 \"title\": \"My content fragment\",\n \"content\": \"This is my content fragment extracted text\",\n \"contentType\": \"text/plain\",\n \"url\": \"https://example.com/content\",\n \"fileId\": \"fil_123456\",\n \"path\": \"conversation/report.csv\",\n \"processedPath\": \"conversation/voice.processed.txt\",\n \"skipFileProcessing\": true,\n \"nodeId\": \"node_123456\",\n \"nodeDataSourceViewId\": \"dsv_123456\"\n}"
response = http.request(request)
puts response.read_body{
"title": "My content fragment",
"content": "This is my content fragment extracted text",
"contentType": "text/plain",
"url": "https://example.com/content",
"fileId": "fil_123456",
"path": "conversation/report.csv",
"processedPath": "conversation/voice.processed.txt",
"skipFileProcessing": true,
"nodeId": "node_123456",
"nodeDataSourceViewId": "dsv_123456",
"context": {
"username": "johndoe123",
"timezone": "America/New_York",
"fullName": "John Doe",
"email": "john.doe@example.com",
"profilePictureUrl": "https://example.com/profiles/johndoe123.jpg",
"excludedRetrievalTags": [
"<string>"
],
"hostSelection": "<string>",
"hostDocument": {
"name": "<string>",
"url": "<string>"
},
"authMethod": "<string>",
"agenticMessageData": {
"type": "run_agent",
"originMessageId": "2b8e4f6a0c"
}
}
}Body
application/json
Response
Content fragment created successfully.