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

# Prompt-level sentiment (aggregate + time series)



## OpenAPI

````yaml /api-reference/openapi.json get /api/v2/brands/{brand_id}/prompts/{prompt_id}/{region_id}/sentiment
openapi: 3.0.1
info:
  title: Cognizo Public API
  version: v1
  description: >-
    Public REST API for Cognizo. Authenticate with an API key via the
    `X-API-KEY` header.
servers:
  - url: https://core.cognizo.ai
security:
  - apiKey: []
paths:
  /api/v2/brands/{brand_id}/prompts/{prompt_id}/{region_id}/sentiment:
    parameters:
      - name: brand_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: prompt_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: region_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
    get:
      tags:
        - Prompts
      summary: Prompt-level sentiment (aggregate + time series)
      operationId: get_brand_prompt_region_sentiment
      parameters:
        - name: filter[target_brand]
          in: query
          required: false
          schema:
            type: string
        - name: filter[ran_at_start]
          in: query
          required: false
          schema:
            type: string
            format: date-time
        - name: filter[ran_at_end]
          in: query
          required: false
          schema:
            type: string
            format: date-time
        - name: filter[granularity]
          in: query
          required: false
          schema:
            type: string
            enum:
              - day
              - week
              - month
        - name: filter[brand_ids]
          in: query
          required: false
          schema:
            type: array
            items:
              type: string
              format: uuid
        - name: filter[provider_ids]
          in: query
          required: false
          schema:
            type: array
            items:
              type: string
              format: uuid
        - name: filter[topic_ids]
          in: query
          required: false
          schema:
            type: array
            items:
              type: string
              format: uuid
        - name: filter[prompt_regions]
          in: query
          required: false
          schema:
            type: array
            items:
              type: string
          description: Extra "prompt_id,region_id" pairs (visibility only)
        - name: page
          in: query
          required: false
          schema:
            type: integer
        - name: page_size
          in: query
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: metric envelope
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/metric_response'
                required:
                  - data
        '500':
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
components:
  schemas:
    metric_response:
      type: object
      properties:
        metric_type:
          type: string
          enum:
            - visibility
            - share_of_voice
            - first_position
            - middle_position
            - last_position
            - sentiment
        date_range:
          type: array
          items:
            type: string
            format: date-time
        aggregate_metrics:
          $ref: '#/components/schemas/time_based_metric'
        time_based_metrics:
          type: array
          items:
            $ref: '#/components/schemas/time_based_metric'
      required:
        - metric_type
        - date_range
        - aggregate_metrics
        - time_based_metrics
    error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type: array
              items:
                $ref: '#/components/schemas/error_detail'
          required:
            - code
            - message
      required:
        - error
    time_based_metric:
      type: object
      properties:
        start_date:
          type: string
        end_date:
          type: string
          nullable: true
        values:
          type: array
          items:
            $ref: '#/components/schemas/metric_value'
      required:
        - start_date
        - values
    error_detail:
      type: object
      properties:
        field:
          type: string
          nullable: true
        code:
          type: string
        message:
          type: string
      required:
        - code
        - message
        - field
    metric_value:
      type: object
      description: >-
        One brand's value for the enclosing metric_type over the date range. The
        unit of `value` depends on metric_type — see the `value` field.
      properties:
        brand_name:
          type: string
          nullable: true
          description: >-
            Display name of the brand this row is for; null for unattributed
            rows.
        found_brand_id:
          type: string
          format: uuid
          nullable: true
          description: >-
            Canonical brand-mapping id; null when the brand isn't resolved to a
            mapping.
        value:
          type: number
          nullable: true
          minimum: 0
          maximum: 100
          description: >-
            Metric value for this brand; the UNIT depends on metric_type.
            `visibility`, `share_of_voice`, and the position metrics
            (`first`/`middle`/`last`) are a 0–100 PERCENTAGE of the brand's runs
            (never null — 0 when there's no data). `sentiment` is the AVERAGE
            sentiment score on a 1–100 scale (NOT a percentage), and is null
            when the brand has no scored runs in the window. It is never a raw
            count — do not re-aggregate it client-side.
        diff:
          type: number
          nullable: true
          description: >-
            Change in `value` vs the previous equal-length period (same unit as
            `value`). Null when a prior value can't be computed.
        is_target:
          type: boolean
          description: >-
            True for the workspace's own brand (the target); false for
            competitors.
        rank:
          type: integer
          nullable: true
          description: >-
            1-based rank of this brand by `value` within the metric (1 =
            highest). Present on aggregate rows; null when unranked.
      required:
        - value
        - is_target
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-KEY

````