---
title: "Create a content fragment"
method: POST
path: "/api/v1/w/{wId}/assistant/conversations/{cId}/content_fragments"
tags: ["Conversations"]
---

# Create a content fragment

`POST /api/v1/w/{wId}/assistant/conversations/{cId}/content_fragments`

## Request

- Base URL: `https://dust.tt`
- URL: `https://dust.tt/api/v1/w/{wId}/assistant/conversations/{cId}/content_fragments`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/dust-tt/apis/dust-api-documentation/docs/api/v1/w/:wId/assistant/conversations/:cId/content_fragments/post.ts> (a function with typed inputs; its response is checked against the schema)

Create a new content fragment in the workspace identified by {wId}.

## Path parameters

- `wId` string, required
- `cId` string, required

## Request body

- ContentFragment
  - `title` string, required: The title of the content fragment
  - `content` string: The content of the content fragment (optional if `fileId` is set)
  - `contentType` string: The content type of the content fragment (optional if `fileId` is set)
  - `url` string: The URL of the content fragment
  - `fileId` string: The id of the previously uploaded file (optional if `content` and `contentType` are set)
  - `path` string, nullable: Path of this file inside the sandbox conversation mount.
  - `processedPath` string, nullable: Path of the plain-text sibling of this file inside the sandbox conversation mount (e.g. an audio transcript), when it has one.
  - `skipFileProcessing` boolean: Whether upload-time file processing was skipped.
  - `nodeId` string: The id of the content node (optional if `content` and `contentType` are set)
  - `nodeDataSourceViewId` string: The id of the data source view (optional if `content` and `contentType` are set)
  - `context` Context
    - `username` string, required: Username in the current context
    - `timezone` string, required: User's timezone
    - `fullName` string: User's full name in the current context
    - `email` string: User's email in the current context
    - `profilePictureUrl` string: URL of the user's profile picture
    - `selectedSpaceIds` string[]
    - `excludedRetrievalTags` string[], nullable: Data source tags to exclude from retrieval for this run, as opaque `key:value` strings.
    - `hostSelection` string, nullable: What the user had selected in the app hosting Dust when sending the message, e.g. `Sheet1!C5:D6` in Excel. Stored with the message and shown to the agent in that message's metadata.
    - `agenticMessageData` object
      - `type` 'run_agent' | 'agent_handover': Type of the agentic message
      - `originMessageId` string: ID of the origin message

## Response `200`

Content fragment created successfully.

- ContentFragment
  - `title` string, required: The title of the content fragment
  - `content` string: The content of the content fragment (optional if `fileId` is set)
  - `contentType` string: The content type of the content fragment (optional if `fileId` is set)
  - `url` string: The URL of the content fragment
  - `fileId` string: The id of the previously uploaded file (optional if `content` and `contentType` are set)
  - `path` string, nullable: Path of this file inside the sandbox conversation mount.
  - `processedPath` string, nullable: Path of the plain-text sibling of this file inside the sandbox conversation mount (e.g. an audio transcript), when it has one.
  - `skipFileProcessing` boolean: Whether upload-time file processing was skipped.
  - `nodeId` string: The id of the content node (optional if `content` and `contentType` are set)
  - `nodeDataSourceViewId` string: The id of the data source view (optional if `content` and `contentType` are set)
  - `context` Context
    - `username` string, required: Username in the current context
    - `timezone` string, required: User's timezone
    - `fullName` string: User's full name in the current context
    - `email` string: User's email in the current context
    - `profilePictureUrl` string: URL of the user's profile picture
    - `selectedSpaceIds` string[]
    - `excludedRetrievalTags` string[], nullable: Data source tags to exclude from retrieval for this run, as opaque `key:value` strings.
    - `hostSelection` string, nullable: What the user had selected in the app hosting Dust when sending the message, e.g. `Sheet1!C5:D6` in Excel. Stored with the message and shown to the agent in that message's metadata.
    - `agenticMessageData` object
      - `type` 'run_agent' | 'agent_handover': Type of the agentic message
      - `originMessageId` string: ID of the origin message

## Other responses

- `400`: Bad Request. Missing or invalid parameters.
- `401`: Unauthorized. Invalid or missing authentication token.
- `500`: Internal Server Error.

## Changes

- **2026-10-21** `abb1c0993938`: 2 info
  - added the new optional request property `context/hostSelection`
  - added the optional property `context/hostSelection` to the response with the `200` status
- **2026-10-20** `1b8b5232a3e1`: 2 info
  - added the new optional request property `context/excludedRetrievalTags`
  - added the optional property `context/excludedRetrievalTags` to the response with the `200` status
- **2026-08-06** `5834d690c29d`: 2 warning
  - removed the request property `skipDataSourceIndexing`
  - removed the optional property `skipDataSourceIndexing` from the response with the `200` status
- **2026-07-31** `baec3b07fb01`: 2 info
  - added the new optional request property `processedPath`
  - added the optional property `processedPath` to the response with the `200` status
- **2026-07-20** `89dbf1251af2`: 2 info
  - added the new optional request property `context/selectedSpaceIds`
  - added the optional property `context/selectedSpaceIds` to the response with the `200` status

[Operation history](https://skmtc.dev/dust-tt/apis/dust-api-documentation/changes/api/v1/w/:wId/assistant/conversations/:cId/content_fragments/post.md)

---

[API](https://skmtc.dev/dust-tt/apis/dust-api-documentation.md) - [All operations](https://skmtc.dev/dust-tt/apis/dust-api-documentation/llms.txt) - [OpenAPI document](https://skmtc.dev/dust-tt/apis/dust-api-documentation/revisions/abb1c0993938?raw)
