Dust Conversations API

Conversations

OpenAPI Specification

dust-tt-conversations-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Dust Agents Conversations API
  version: 1.0.2
  description: Manage Dust agent configurations — list, retrieve, update, archive, search, and export agents as YAML.
  contact:
    name: Dust Support
    url: https://docs.dust.tt
  license:
    name: MIT
    url: https://github.com/dust-tt/dust/blob/main/LICENSE
servers:
- url: https://dust.tt
  description: Dust.tt API (us-central1)
- url: https://eu.dust.tt
  description: Dust.tt API (europe-west1)
tags:
- name: Conversations
  description: Conversations
paths:
  /api/v1/w/{wId}/assistant/conversations/{cId}/cancel:
    post:
      tags:
      - Conversations
      summary: Cancel Message Generation in a Conversation
      parameters:
      - name: wId
        in: path
        required: true
        schema:
          type: string
        description: Workspace ID
      - name: cId
        in: path
        required: true
        schema:
          type: string
        description: Conversation ID
      security:
      - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - messageIds
              properties:
                messageIds:
                  type: array
                  description: List of message IDs to cancel generation for
                  items:
                    type: string
      responses:
        '200':
          description: Message generation successfully canceled
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Indicates if the cancellation was successful
        '400':
          description: Invalid request (invalid query parameters or request body)
        '405':
          description: Method not supported
  /api/v1/w/{wId}/assistant/conversations/{cId}/content_fragments:
    post:
      summary: Create a Content Fragment
      description: Create a new content fragment in the workspace identified by {wId}.
      tags:
      - Conversations
      parameters:
      - in: path
        name: wId
        required: true
        description: ID of the workspace
        schema:
          type: string
      - in: path
        name: cId
        required: true
        description: ID of the conversation
        schema:
          type: string
      security:
      - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContentFragment'
      responses:
        '200':
          description: Content fragment created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContentFragment'
        '400':
          description: Bad Request. Missing or invalid parameters.
        '401':
          description: Unauthorized. Invalid or missing authentication token.
        '500':
          description: Internal Server Error.
  /api/v1/w/{wId}/assistant/conversations/{cId}/events:
    get:
      summary: Get the Events for a Conversation
      description: Get the events for a conversation in the workspace identified by {wId}.
      tags:
      - Conversations
      parameters:
      - in: path
        name: wId
        required: true
        description: ID of the workspace
        schema:
          type: string
      - in: path
        name: cId
        required: true
        description: ID of the conversation
        schema:
          type: string
      - in: query
        name: lastEventId
        required: false
        description: ID of the last event
        schema:
          type: string
      security:
      - BearerAuth: []
      responses:
        '200':
          description: Events for the conversation, view the "Events" page from this documentation for more information.
        '400':
          description: Bad Request. Missing or invalid parameters.
        '401':
          description: Unauthorized. Invalid or missing authentication token.
        '404':
          description: Conversation not found.
        '405':
          description: Method not supported. Only GET is expected.
        '500':
          description: Internal Server Error.
  /api/v1/w/{wId}/assistant/conversations/{cId}/files/{rel}:
    get:
      tags:
      - Conversations
      summary: Download a Conversation-Scoped File by Path
      description: 'Download a file from a conversation''s file system by its scoped path. The path must

        be conversation-scoped, i.e. start with `conversation/` (as surfaced by agent file

        system tools). The file content is streamed directly from the conversation mount.

        '
      parameters:
      - name: wId
        in: path
        required: true
        description: ID of the workspace
        schema:
          type: string
      - name: cId
        in: path
        required: true
        description: ID of the conversation
        schema:
          type: string
      - name: rel
        in: path
        required: true
        description: 'Conversation-scoped file path, e.g. `conversation/foo.pdf` or

          `conversation/subdir/foo.pdf`. The `conversation/` prefix is required; any other

          scope prefix is rejected. Path traversal segments (`..`) are rejected.

          '
        schema:
          type: string
      security:
      - BearerAuth: []
      responses:
        '200':
          description: File content streamed directly.
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '400':
          description: Missing or invalid path parameters (e.g. missing or wrong scope prefix).
        '403':
          description: Resolved path is outside the conversation scope.
        '404':
          description: Conversation or file not found.
        '405':
          description: Method not supported.
  /api/v1/w/{wId}/assistant/conversations/{cId}:
    get:
      summary: Get a Conversation
      description: Get a conversation in the workspace identified by {wId}. Supports optional pagination of message content via limit and lastValue query parameters.
      tags:
      - Conversations
      security:
      - BearerAuth: []
      parameters:
      - in: path
        name: wId
        required: true
        description: ID of the workspace
        schema:
          type: string
      - in: path
        name: cId
        required: true
        description: ID of the conversation
        schema:
          type: string
      - in: query
        name: limit
        required: false
        description: Maximum number of messages to return. When omitted, all messages are returned.
        schema:
          type: integer
      - in: query
        name: lastValue
        required: false
        description: Cursor value (message rank) from a previous response to fetch the next page of messages.
        schema:
          type: string
      responses:
        '200':
          description: Conversation retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Conversation'
        '400':
          description: Bad Request. Missing or invalid parameters.
        '401':
          description: Unauthorized. Invalid or missing authentication token.
        '404':
          description: Conversation not found.
        '405':
          description: Method not supported. Only GET is expected.
        '500':
          description: Internal Server Error.
    patch:
      summary: Update Conversation Read Status
      description: Mark a conversation as read or unread in the workspace identified by {wId}.
      tags:
      - Conversations
      security:
      - BearerAuth: []
      parameters:
      - in: path
        name: wId
        required: true
        description: ID of the workspace
        schema:
          type: string
      - in: path
        name: cId
        required: true
        description: ID of the conversation
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                read:
                  type: boolean
      responses:
        '200':
          description: Conversation marked as read successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
        '400':
          description: Bad Request. Invalid or missing parameters.
        '401':
          description: Unauthorized. Invalid or missing authentication token.
        '404':
          description: Conversation not found.
        '405':
          description: Method not supported. Only GET or PATCH is expected.
        '500':
          description: Internal Server Error.
  /api/v1/w/{wId}/assistant/conversations/{cId}/messages/{mId}/answer-question:
    post:
      summary: Answer a User Question in a Conversation Message
      description: Submits an answer to a question asked by an agent in a specific message
      tags:
      - Conversations
      parameters:
      - in: path
        name: wId
        required: true
        schema:
          type: string
        description: Workspace ID
      - in: path
        name: cId
        required: true
        schema:
          type: string
        description: Conversation ID
      - in: path
        name: mId
        required: true
        schema:
          type: string
        description: Message ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - actionId
              - answer
              properties:
                actionId:
                  type: string
                  description: ID of the action to answer
                answer:
                  type: object
                  required:
                  - selectedOptions
                  properties:
                    selectedOptions:
                      type: array
                      items:
                        type: integer
                      description: Indices of selected options
                    customResponse:
                      type: string
                      description: Optional free-text response
      responses:
        '200':
          description: Answer submitted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
        '400':
          description: Invalid request body or action not blocked
        '403':
          description: User not authorized to answer this question
        '404':
          description: Conversation, message, or action not found
        '405':
          description: Method not allowed
        '500':
          description: Internal server error
      security:
      - BearerAuth: []
  /api/v1/w/{wId}/assistant/conversations/{cId}/messages/{mId}/edit:
    post:
      tags:
      - Conversations
      summary: Edit an Existing Message in a Conversation
      parameters:
      - name: wId
        in: path
        required: true
        schema:
          type: string
        description: Workspace ID
      - name: cId
        in: path
        required: true
        schema:
          type: string
        description: Conversation ID
      - name: mId
        in: path
        required: true
        schema:
          type: string
        description: Message ID to edit
      security:
      - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - content
              - mentions
              properties:
                content:
                  type: string
                  description: New content for the message
                mentions:
                  type: array
                  description: List of agent mentions in the message
                  items:
                    type: object
                    required:
                    - configurationId
                    properties:
                      configurationId:
                        type: string
                        description: ID of the mentioned agent configuration
      responses:
        '200':
          description: Message successfully edited
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: object
                    description: The edited user message
                  agentMessages:
                    type: array
                    description: Optional array of agent messages generated in response
        '400':
          description: Invalid request (message not found or not a user message)
        '405':
          description: Method not supported
  /api/v1/w/{wId}/assistant/conversations/{cId}/messages/{mId}/events:
    get:
      summary: Get Events for a Message
      description: Get events for a message in the workspace identified by {wId}.
      tags:
      - Conversations
      parameters:
      - in: path
        name: wId
        required: true
        description: ID of the workspace
        schema:
          type: string
      - in: path
        name: cId
        required: true
        description: ID of the conversation
        schema:
          type: string
      - in: path
        name: mId
        required: true
        description: ID of the message
        schema:
          type: string
      - in: query
        name: lastEventId
        description: ID of the last event received
        schema:
          type: string
      security:
      - BearerAuth: []
      responses:
        '200':
          description: The events
          content:
            application/json:
              schema:
                type: object
                properties:
                  events:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: ID of the event
                        type:
                          type: string
                          description: Type of the event
                        data:
                          $ref: '#/components/schemas/Message'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '404':
          description: Not Found
        '500':
          description: Internal Server Error
  /api/v1/w/{wId}/assistant/conversations/{cId}/messages/{mId}/validate-action:
    post:
      summary: Validate an Action in a Conversation Message
      description: Approves or rejects an action taken in a specific message in a conversation
      tags:
      - Conversations
      parameters:
      - in: path
        name: wId
        required: true
        schema:
          type: string
        description: Workspace ID
      - in: path
        name: cId
        required: true
        schema:
          type: string
        description: Conversation ID
      - in: path
        name: mId
        required: true
        schema:
          type: string
        description: Message ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - actionId
              - approved
              properties:
                actionId:
                  type: string
                  description: ID of the action to validate
                approved:
                  type: boolean
                  description: Whether the action is approved or rejected
      responses:
        '200':
          description: Action validation successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
        '400':
          description: Invalid request body
        '404':
          description: Conversation, message, or workspace not found
        '405':
          description: Method not allowed
        '500':
          description: Internal server error
      security:
      - BearerAuth: []
  /api/v1/w/{wId}/assistant/conversations/{cId}/messages:
    post:
      summary: Create a Message
      description: Create a message in the workspace identified by {wId} in the conversation identified by {cId}.
      tags:
      - Conversations
      parameters:
      - in: path
        name: wId
        required: true
        description: ID of the workspace
        schema:
          type: string
      - in: path
        name: cId
        required: true
        description: ID of the conversation
        schema:
          type: string
      security:
      - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Message'
      responses:
        '200':
          description: Message created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Message'
        '400':
          description: Bad Request. Missing or invalid parameters.
        '401':
          description: Unauthorized. Invalid or missing authentication token.
        '403':
          description: Forbidden. Workspace or usage limits exceeded, or access denied.
        '429':
          description: Rate limit exceeded.
        '500':
          description: Internal Server Error.
  /api/v1/w/{wId}/assistant/conversations:
    post:
      summary: Create a New Conversation
      description: Create a new conversation in the workspace identified by {wId}.
      tags:
      - Conversations
      parameters:
      - in: path
        name: wId
        required: true
        description: ID of the workspace
        schema:
          type: string
      security:
      - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - message
              properties:
                message:
                  $ref: '#/components/schemas/Message'
                contentFragments:
                  type: array
                  items:
                    $ref: '#/components/schemas/ContentFragment'
                  description: The list of content fragments to attach to this conversation (optional)
                title:
                  type: string
                  description: The title of the conversation
                  example: My conversation
                skipToolsValidation:
                  type: boolean
                  description: Whether to skip the tools validation of the agent messages triggered by this user message (optional, defaults to false)
                  example: false
                blocking:
                  type: boolean
                  description: Whether to wait for the agent to generate the initial message. If true the query will wait for the agent's answer. If false (default), the API will return a conversation ID directly and you will need to use streaming events to get the messages.
                  example: true
                spaceId:
                  type: string
                  description: The sId of the space (project) in which to create the conversation (optional). If not provided, the conversation is created outside projects
                  example: space_abc123
      responses:
        '200':
          description: Conversation created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Conversation'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '429':
          description: Rate limit exceeded.
        '500':
          description: Internal Server Error
  /api/v1/w/{wId}/files:
    post:
      tags:
      - Conversations
      summary: Create a File Upload URL
      parameters:
      - name: wId
        in: path
        required: true
        description: ID of the workspace
        schema:
          type: string
      security:
      - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - contentType
              - fileName
              - fileSize
              - useCase
              - useCaseMetadata
              properties:
                contentType:
                  type: string
                  description: MIME type of the file
                fileName:
                  type: string
                  description: Name of the file
                fileSize:
                  type: integer
                  description: Size of the file in bytes
                useCase:
                  type: string
                  description: Intended use case for the file, use "conversation"
                useCaseMetadata:
                  type: string
                  description: (optional) Metadata for the use case, for conversation useCase should be dictionary with conversationId stringified
      responses:
        '200':
          description: File upload URL created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  file:
                    type: object
                    properties:
                      sId:
                        type: string
                        description: Unique string identifier for the file
                      uploadUrl:
                        type: string
                        description: Upload URL for the file
        '400':
          description: Invalid request or unsupported file type
        '401':
          description: Unauthorized
        '429':
          description: Rate limit exceeded
components:
  schemas:
    Message:
      type: object
      required:
      - content
      - mentions
      properties:
        content:
          type: string
          description: The content of the message. Should not be empty.
          example: This is my message
        mentions:
          type: array
          description: Empty array is accepted but won't trigger any agent.
          items:
            $ref: '#/components/schemas/Mention'
        context:
          $ref: '#/components/schemas/Context'
    AgentConfiguration:
      type: object
      properties:
        id:
          type: integer
          example: 12345
        sId:
          type: string
          description: Unique string identifier for the agent configuration
          example: 7f3a9c2b1e
        version:
          type: integer
          example: 2
        versionCreatedAt:
          type: string
          nullable: true
          description: Timestamp of when the version was created
          example: '2023-06-15T14:30:00Z'
        versionAuthorId:
          type: string
          nullable: true
          description: ID of the user who created this version
          example: 0ec9852c2f
        name:
          type: string
          description: Name of the agent configuration
          example: Customer Support Agent
        description:
          type: string
          description: Description of the agent configuration
          example: An AI agent designed to handle customer support inquiries
        instructions:
          type: string
          nullable: true
          description: Instructions for the agent
          example: Always greet the customer politely and try to resolve their issue efficiently.
        pictureUrl:
          type: string
          description: URL of the agent's picture
          example: https://example.com/agent-images/support-agent.png
        status:
          type: string
          description: Current status of the agent configuration
          example: active
        scope:
          type: string
          description: Scope of the agent configuration
          example: workspace
        userFavorite:
          type: boolean
          description: Status of the user favorite for this configuration
          example: true
        model:
          type: object
          properties:
            providerId:
              type: string
              description: ID of the model provider
              example: openai
            modelId:
              type: string
              description: ID of the specific model
              example: gpt-4
            temperature:
              type: number
              example: 0.7
        actions:
          type: array
          example: []
        maxStepsPerRun:
          type: integer
          example: 10
        templateId:
          type: string
          nullable: true
          description: ID of the template used for this configuration
          example: b4e2f1a9c7
    User:
      type: object
      properties:
        sId:
          type: string
          description: Unique string identifier for the user
          example: 0ec9852c2f
        id:
          type: integer
          example: 12345
        createdAt:
          type: integer
          example: 1625097600
        username:
          type: string
          description: User's chosen username
          example: johndoe
        email:
          type: string
          description: User's email address
          example: john.doe@example.com
        firstName:
          type: string
          description: User's first name
          example: John
        lastName:
          type: string
          description: User's last name
          example: Doe
        fullName:
          type: string
          description: User's full name
          example: John Doe
        provider:
          type: string
          description: Authentication provider used by the user
          example: google
        image:
          type: string
          description: URL of the user's profile image
          example: https://example.com/profile/johndoe.jpg
    Mention:
      type: object
      properties:
        configurationId:
          type: string
          description: ID of the mentioned agent configuration
          example: 7f3a9c2b1e
    Workspace:
      type: object
      required:
      - regionalModelsOnly
      properties:
        id:
          type: integer
          example: 67890
        sId:
          type: string
          description: Unique string identifier for the workspace
          example: dQFf9l5FQY
        name:
          type: string
          description: Name of the workspace
          example: My Awesome Workspace
        role:
          type: string
          description: User's role in the workspace
          example: admin
        segmentation:
          type: string
          nullable: true
          description: Segmentation information for the workspace
          example: enterprise
        flags:
          type: array
          items:
            type: string
            description: Feature flags enabled for the workspace
          example:
          - advanced_analytics
          - beta_features
        ssoEnforced:
          type: boolean
          example: true
        regionalModelsOnly:
          type: boolean
          description: When true, only models whose regionalAvailability includes the workspace's region are usable.
          example: false
        whiteListedProviders:
          type: array
          items:
            type: string
            description: List of allowed authentication providers
          example:
          - google
          - github
        defaultEmbeddingProvider:
          type: string
          nullable: true
          description: Default provider for embeddings in the workspace
          example: openai
    ContentFragment:
      type: object
      required:
      - title
      properties:
        title:
          type: string
          description: The title of the content fragment
          example: My content fragment
        content:
          type: string
          description: The content of the content fragment (optional if `fileId` is set)
          example: This is my content fragment extracted text
        contentType:
          type: string
          description: The content type of the content fragment (optional if `fileId` is set)
          example: text/plain
        url:
          type: string
          description: The URL of the content fragment
          example: https://example.com/content
        fileId:
          type: string
          description: The id of the previously uploaded file (optional if `content` and `contentType` are set)
          example: fil_123456
        path:
          type: string
          nullable: true
          description: Path of this file inside the sandbox conversation mount.
          example: conversation/report.csv
        skipFileProcessing:
          type: boolean
          description: Whether upload-time file processing was skipped.
        nodeId:
          type: string
          description: The id of the content node (optional if `content` and `contentType` are set)
          example: node_123456
        nodeDataSourceViewId:
          type: string
          description: The id of the data source view (optional if `content` and `contentType` are set)
          example: dsv_123456
        context:
          $ref: '#/components/schemas/Context'
    Context:
      type: object
      required:
      - username
      - timezone
      properties:
        username:
          type: string
          description: Username in the current context
          example: johndoe123
        timezone:
          type: string
          description: User's timezone
          example: America/New_York
        fullName:
          type: string
          description: User's full name in the current context
          example: John Doe
        email:
          type: string
          description: User's email in the current context
          example: john.doe@example.com
        profilePictureUrl:
          type: string
          description: URL of the user's profile picture
          example: https://example.com/profiles/johndoe123.jpg
        agenticMessageData:
          type: object
          properties:
            type:
              type: string
              enum:
              - run_agent
              - agent_handover
              description: Type of the agentic message
            originMessageId:
              type: string
              description: ID of the origin message
              example: 2b8e4f6a0c
    Conversation:
      type: object
      properties:
        conversation:
          type: object
          properties:
            id:
              type: integer
              example: 67890
            created:
              type: integer
              example: 1625097600
            sId:
              type: string
              description: Unique string identifier for the conversation
              example: 3d8f6a2c1b
            owner:
              $ref: '#/components/schemas/Workspace'
            title:
              type: string
              description: Title of the conversation
              example: 'Customer Inquiry #1234'
            visibility:
              type: string
              description: Visibility setting of the conversation
              example: private
            content:
              type: array
              items:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: integer
                      example: 1
                    sId:
                      type: string
                      description: Unique string identifier for the message
                      example: 9e7d5c3a1f
                    type:
                    

# --- truncated at 32 KB (34 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/dust-tt/refs/heads/main/openapi/dust-tt-conversations-api-openapi.yml