> ## Documentation Index
> Fetch the complete documentation index at: https://docs.irisagent.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get sentiment

> Get AI-powered sentiment analysis for a support conversation



## OpenAPI

````yaml /api-reference/openapi.json post /v1/sentiment
openapi: 3.0.3
info:
  title: IrisAgent's API Reference
  description: >
    IrisAgent service can be used as an API to power intelligent conversations
    and search, index, and connect with your internal and external knowledge
    articles, tickets, community forums, product documentation,

    and other informational content.
  version: 1.2.0
servers:
  - url: https://api1.irisagent.com
security:
  - bearerAuth: []
paths:
  /v1/sentiment:
    post:
      summary: Get sentiment
      description: Get AI-powered sentiment analysis for a support conversation
      operationId: analyzeSentiment
      parameters:
        - $ref: '#/components/parameters/LanguageIsoCode'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SentimentRequest'
      responses:
        '200':
          $ref: '#/components/responses/SentimentResponse'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '408':
          $ref: '#/components/responses/408'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
        '504':
          $ref: '#/components/responses/504'
components:
  parameters:
    LanguageIsoCode:
      name: X-Language-Iso-Code
      in: header
      description: |
        This optional header allows you to specify the desired language.
        If not provided, automatic language detection will be used.
      schema:
        type: string
        format: iso-639-1
  schemas:
    SentimentRequest:
      type: object
      properties:
        conversationId:
          description: Unique ticket or chat id
          type: string
          x-oapi-codegen-extra-tags:
            validate: required,gte=1
        message:
          description: Support conversation that needs AI-powered sentiment analysis
          type: string
          x-oapi-codegen-extra-tags:
            validate: required,gte=1
      required:
        - conversationId
        - message
    SentimentResponseItem:
      type: object
      properties:
        sentiment:
          description: >-
            AI-generated sentiment score ranging from -100 (very negative) to
            100 (very positive)
          type: integer
          maximum: 100
          minimum: -100
          nullable: true
    Error:
      type: object
      properties:
        error:
          description: Error message
          type: string
        code:
          description: HTTP status code for the error
          type: integer
        status:
          description: Status text corresponding to the error
          type: string
      required:
        - error
        - code
        - status
  responses:
    '400':
      description: >-
        Bad Request - The server cannot process the request due to client error.
        This includes missing required fields, invalid data types, malformed
        JSON, or requests exceeding size limits.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '401':
      description: >-
        Unauthorized - Authentication is required and has failed or has not been
        provided. Your API key may be invalid or missing.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '408':
      description: >-
        Request Timeout - The server timed out waiting for the request to
        complete. The request may be retried.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '429':
      description: >-
        Too Many Requests - You have sent too many requests in a given amount of
        time.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '500':
      description: >-
        Internal Server Error - The server encountered an unexpected condition
        that prevented it from fulfilling the request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '504':
      description: >-
        Gateway Timeout - The server, while acting as a gateway or proxy, did
        not receive a timely response from an upstream server.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    SentimentResponse:
      description: The AI-generated sentiment score for the conversation
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SentimentResponseItem'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |
        The `Authorization` header is required to authenticate API requests.
        It should contain a bearer token obtained through the IrisAgent portal.

````