> ## Documentation Index
> Fetch the complete documentation index at: https://domoinc-bradley-turek-pfilter-operators-reference.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Sentiment Analysis - Beta

> Analyze the overall sentiment of text (positive, negative, neutral, or not applicable).



## OpenAPI

````yaml /openapi/product/AI-Services.yaml post /api/ai/v1/sentiment
openapi: 3.1.0
info:
  title: AI Services
  description: >-
    Domo AI Services provide a consistent API to leverage Foundation Models to
    solve common problems such as natural language SQL generation (text-to-SQL),
    Summarization, Classification, Tool Calling and others.
  version: 2.3.3639_master
servers:
  - url: https://{subdomain}.domo.com
    variables:
      subdomain:
        description: The Domo instance subdomain.
        default: subdomain
security: []
tags:
  - name: AI Services - Classification
    description: Domo AI Service Classification APIs
  - name: AI Services - Data Extraction
    description: Domo AI Service Data Extraction APIs
  - name: AI Services - Embedding
    description: Domo AI Service Embedding APIs
  - name: AI Services - Image
    description: Domo AI Service Image APIs
  - name: AI Services - Messages
    description: Domo AI Service Messages APIs
  - name: AI Services - Sentiment Analysis
    description: Domo AI Service Sentiment Analysis APIs
  - name: AI Services - Text
    description: Domo AI Service Text APIs
paths:
  /api/ai/v1/sentiment:
    post:
      tags:
        - AI Services - Sentiment Analysis
      summary: Sentiment Analysis - Beta
      description: >-
        Analyze the overall sentiment of text (positive, negative, neutral, or
        not applicable).
      operationId: messagesSentimentAnalysis
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SentimentAnalysisRequest'
            examples:
              Product Review Sentiment:
                description: Analyze overall sentiment of a text.
                value:
                  input:
                    - type: TEXT
                      text: >-
                        This product is absolutely amazing! The quality exceeded
                        my expectations and the customer service was
                        outstanding. I'm very happy with my purchase.
        required: true
      responses:
        '200':
          description: Successful sentiment analysis response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleSentimentResponse'
              examples:
                Sentiment Analysis Response:
                  description: Sentiment Analysis Response
                  value:
                    type: DEFAULT
                    sentiment: positive
                    model: domo.domo_ai.domogpt-medium-v2.1:anthropic
                    isCustomerModel: false
                    sessionId: 34c1b391-1302-4149-89ad-dd5c9a009e89
                    requestId: 5e2d7a6b-af27-4cf2-9fe8-70cfb90d72c2
                    modelProviderUsage: null
        '403':
          description: Forbidden
          content:
            '*/*':
              schema:
                type: string
        '409':
          description: Conflict
      security:
        - domo-developer-token: []
components:
  schemas:
    SentimentAnalysisRequest:
      type: object
      description: |-
        Request for sentiment analysis using the Messages API.

         <p>Supports two modes:</p>
         <ul>
           <li><b>Simple sentiment</b>: When topics is null/empty, analyzes overall sentiment</li>
           <li><b>Targeted sentiment</b>: When topics provided, analyzes sentiment for each topic</li>
         </ul>

         <p>Validation happens primarily in AIValidator, not in this constructor.</p>
      properties:
        input:
          type: array
          description: The input message content to analyze (text, images, documents, etc.)
          items:
            oneOf:
              - $ref: '#/components/schemas/TextMessageContent'
              - $ref: '#/components/schemas/ImageMessageContent'
              - $ref: '#/components/schemas/DocumentMessageContent'
        topics:
          type: array
          description: >-
            Optional list of topics for targeted sentiment analysis. When
            provided, sentiment is analyzed for each topic individually. When
            omitted or empty, overall sentiment of the content is analyzed.
            Topic names must start with a letter and contain only letters,
            numbers, and underscores (e.g., 'customer_service',
            'productQuality').
          items:
            $ref: '#/components/schemas/SentimentTopic'
          maxLength: 50
        instructions:
          type: string
          description: Optional instructions for sentiment analysis behavior
        model:
          type: string
          description: The ID of the model to use (optional, uses default if not specified)
        modelConfiguration:
          type: object
          additionalProperties: {}
          description: Additional model parameters (temperature, max_tokens, etc.)
        sessionId:
          type: string
          format: uuid
          description: AI session ID for associating with existing session
        reasoningConfig:
          $ref: '#/components/schemas/ReasoningConfig'
          description: Configuration for reasoning behavior
        targetedSentiment:
          type: boolean
          description: Returns true if this is a targeted sentiment request (has topics).
        simpleSentiment:
          type: boolean
          description: Returns true if this is a simple sentiment request (no topics).
      required:
        - input
    SimpleSentimentResponse:
      type: object
      description: Response for simple sentiment analysis containing overall sentiment.
      properties:
        sentiment:
          type: string
          description: >-
            The overall sentiment (POSITIVE, NEGATIVE, NEUTRAL, or
            NOT_APPLICABLE)
          enum:
            - positive
            - negative
            - neutral
            - not_applicable
        model:
          type: string
          description: The ID of the model used
        isCustomerModel:
          type: boolean
          description: Whether the model is a customer model
        sessionId:
          type: string
          format: uuid
          description: The AI session ID
        requestId:
          type: string
          format: uuid
          description: The request ID
        modelProviderUsage:
          $ref: '#/components/schemas/ModelProviderUsage'
          description: Token usage information
    TextMessageContent:
      allOf:
        - $ref: '#/components/schemas/MessageContent'
        - type: object
          properties:
            text:
              type: string
              description: the text content of the message
      description: Text-based message content.
    ImageMessageContent:
      allOf:
        - $ref: '#/components/schemas/MessageContent'
        - type: object
          properties:
            image:
              $ref: '#/components/schemas/Image'
              description: the image data and metadata
      description: Image-based message content.
    DocumentMessageContent:
      allOf:
        - $ref: '#/components/schemas/MessageContent'
        - type: object
          properties:
            document:
              $ref: '#/components/schemas/Document'
              description: the document data and metadata
      description: Document-based message content.
    SentimentTopic:
      type: object
      properties:
        topic:
          type: string
          description: >-
            The topic name to analyze sentiment for. Must start with a letter
            and contain only letters, numbers, and underscores.
          maxLength: 100
          minLength: 1
          pattern: ^[a-zA-Z][a-zA-Z0-9_]*$
        description:
          type: string
          description: >-
            Optional description providing context about the topic to help the
            model identify it in the content
          maxLength: 500
      required:
        - topic
    ReasoningConfig:
      type: object
      properties:
        reasoningEffort:
          type: string
          enum:
            - NONE
            - LOW
            - MEDIUM
            - HIGH
    ModelProviderUsage:
      type: object
      properties:
        inputTokens:
          type: integer
          format: int64
        outputTokens:
          type: integer
          format: int64
        totalTokens:
          type: integer
          format: int64
        reasoningTokens:
          type: integer
          format: int64
    MessageContent:
      description: Base interface for multi-modal message content
      discriminator:
        propertyName: type
      properties:
        type:
          type: string
      required:
        - type
    Image:
      type: object
      description: Image data and metadata.
      properties:
        data:
          type: string
          description: the base64 encoded image data
        type:
          type: string
          description: the image type e.g. "base64"
        mediaType:
          type: string
          description: the media type of the image e.g. "image/png"
    Document:
      type: object
      description: Document data and metadata.
      properties:
        data:
          type: string
          description: the base64-encoded document data
        type:
          type: string
          description: the document type e.g. "base64"
        mediaType:
          type: string
          description: the media type of the document e.g. "application/pdf"
        name:
          type: string
          description: the name of the document
  securitySchemes:
    domo-developer-token:
      type: apiKey
      name: X-DOMO-Developer-Token
      in: header

````