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",
"selectedSpaceIds": [
"<string>"
],
"agenticMessageData": {
"type": "run_agent",
"originMessageId": "2b8e4f6a0c"
}
}
}Create a content fragment
Create a new content fragment in the workspace identified by .
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",
"selectedSpaceIds": [
"<string>"
],
"agenticMessageData": {
"type": "run_agent",
"originMessageId": "2b8e4f6a0c"
}
}
}Authorizations
Your DUST API key is a Bearer token.
Body
The title of the content fragment
"My content fragment"
The content of the content fragment (optional if fileId is set)
"This is my content fragment extracted text"
The content type of the content fragment (optional if fileId is set)
"text/plain"
The URL of the content fragment
"https://example.com/content"
The id of the previously uploaded file (optional if content and contentType are set)
"fil_123456"
Path of this file inside the sandbox conversation mount.
"conversation/report.csv"
Path of the plain-text sibling of this file inside the sandbox conversation mount (e.g. an audio transcript), when it has one.
"conversation/voice.processed.txt"
Whether upload-time file processing was skipped.
The id of the content node (optional if content and contentType are set)
"node_123456"
The id of the data source view (optional if content and contentType are set)
"dsv_123456"
Show child attributes
Show child attributes
Response
Content fragment created successfully.
The title of the content fragment
"My content fragment"
The content of the content fragment (optional if fileId is set)
"This is my content fragment extracted text"
The content type of the content fragment (optional if fileId is set)
"text/plain"
The URL of the content fragment
"https://example.com/content"
The id of the previously uploaded file (optional if content and contentType are set)
"fil_123456"
Path of this file inside the sandbox conversation mount.
"conversation/report.csv"
Path of the plain-text sibling of this file inside the sandbox conversation mount (e.g. an audio transcript), when it has one.
"conversation/voice.processed.txt"
Whether upload-time file processing was skipped.
The id of the content node (optional if content and contentType are set)
"node_123456"
The id of the data source view (optional if content and contentType are set)
"dsv_123456"
Show child attributes
Show child attributes