> ## 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 average position (aggregate + time series)

> Mean best position of each brand in the AI answers it appears in: per answer the brand's highest listing counts once. 1.00 = always listed first; lower is better, and rank 1 is the lowest average. `value` is null for brands with no appearances in the window.



## OpenAPI

````yaml /api-reference/openapi.json get /api/v2/brands/{brand_id}/prompts/{prompt_id}/{region_id}/average_position
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}/average_position:
    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 average position (aggregate + time series)
      description: >-
        Mean best position of each brand in the AI answers it appears in: per
        answer the brand's highest listing counts once. 1.00 = always listed
        first; lower is better, and rank 1 is the lowest average. `value` is
        null for brands with no appearances in the window.
      operationId: get_brand_prompt_region_average_position
      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
        '403':
          description: >-
            organization access revoked (ORGANIZATION_ACCESS_REVOKED): the
            access token's organization is no longer one of the user's
            memberships (they left, were removed, or the organization was
            deleted). The session itself is still valid: drop the organization's
            client state and refresh the session, which moves it to another
            organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: >-
            brand not found (NOT_FOUND): no such brand, or it belongs to another
            organization (the two are indistinguishable by design).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '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
            - average_position
        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
              description: Stable machine-readable reason; see `error_code`.
            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.
        domain:
          type: string
          nullable: true
          description: >-
            The company's domain as a bare hostname ("redsift.com") — scheme,
            www and path stripped — for the row's logo. Derived from the
            competitor record or the brand's attached domain, so it is null for
            a mapping that matches no tracked entity or one with no domain on
            file. Do not guess a logo from `brand_name` when this is null: a
            name search answers with whoever matches (core#453).
        value:
          type: number
          nullable: true
          minimum: 0
          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. `average_position`
            is the brand's mean BEST position in the answers it appears in (>=
            1, lower is better), null when it has no appearances 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; for `average_position` 1 = LOWEST, i.e. best). Present on
            aggregate rows; null when unranked.
      required:
        - value
        - is_target
        - domain
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-KEY

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.