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

# Get Brand Segments

> Segment configuration and the complete 1w comparison, sorted with Default first.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/brands/{brand_id}/segments
openapi: 3.1.0
info:
  description: >-
    Read-only access to one organization's brands, as the member who created the
    API key. Each key may make 120 requests a minute. Every error is an RFC 9457
    problem (`application/problem+json`) whose `code` names it.
  summary: Read your brands' AI visibility in Heralded.
  title: Heralded API
  version: '1'
servers:
  - url: https://api.heralded.ai
security: []
paths:
  /v1/brands/{brand_id}/segments:
    get:
      tags:
        - v1
      summary: Get Brand Segments
      description: >-
        Segment configuration and the complete 1w comparison, sorted with
        Default first.
      operationId: getBrandSegments
      parameters:
        - in: path
          name: brand_id
          required: true
          schema:
            format: uuid
            title: Brand Id
            type: string
        - description: Include only scans up to this completed scan id.
          in: query
          name: as_of
          required: false
          schema:
            anyOf:
              - format: uuid
                type: string
              - type: 'null'
            description: Include only scans up to this completed scan id.
            title: As Of
        - in: query
          name: include_retired
          required: false
          schema:
            default: false
            title: Include Retired
            type: boolean
        - in: query
          name: sort
          required: false
          schema:
            default: mentioned
            enum:
              - mentioned
              - recommended
              - prompts
              - change
            title: Sort
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V1Segments'
          description: Successful Response
        '400':
          content:
            application/problem+json:
              example:
                code: invalid_cursor
                detail: The cursor is invalid or belongs to a different query.
                instance: example-request-id
                status: 400
                title: Bad Request
                type: about:blank
              schema:
                $ref: '#/components/schemas/Problem'
          description: The cursor is invalid or belongs to a different query.
        '401':
          content:
            application/problem+json:
              example:
                code: invalid_token
                detail: >-
                  The Authorization header carries no API key Heralded knows: it
                  is missing, mistyped, revoked or expired.
                instance: example-request-id
                status: 401
                title: Unauthorized
                type: about:blank
              schema:
                $ref: '#/components/schemas/Problem'
          description: No API key, or one that is unknown, revoked or expired.
          headers:
            WWW-Authenticate:
              schema:
                example: Bearer
                type: string
        '404':
          content:
            application/problem+json:
              example:
                code: not_found
                detail: Nothing here that this API key can read.
                instance: example-request-id
                status: 404
                title: Not Found
                type: about:blank
              schema:
                $ref: '#/components/schemas/Problem'
          description: No such brand or answer, or the key's owner cannot read it.
        '409':
          content:
            application/problem+json:
              example:
                code: workspace_archived
                detail: The API key's organization is archived.
                instance: example-request-id
                status: 409
                title: Conflict
                type: about:blank
              schema:
                $ref: '#/components/schemas/Problem'
          description: The API key's organization is archived.
        '422':
          content:
            application/problem+json:
              example:
                code: invalid_request
                detail: The request's parameters are invalid; `errors` names each one.
                errors:
                  - loc:
                      - query
                      - limit
                    msg: Input should be less than or equal to 100
                    type: less_than_equal
                instance: example-request-id
                status: 422
                title: Unprocessable Content
                type: about:blank
              schema:
                $ref: '#/components/schemas/ValidationProblem'
          description: A path or query parameter is invalid.
        '429':
          content:
            application/problem+json:
              example:
                code: rate_limited
                detail: >-
                  This caller is past its requests for the minute. Retry after
                  the seconds in Retry-After.
                instance: example-request-id
                rate_limit:
                  limit: 120
                  remaining: 0
                  reset: 60
                  window: 60
                status: 429
                title: Too Many Requests
                type: about:blank
              schema:
                $ref: '#/components/schemas/RateLimitProblem'
          description: The API key made more than 120 requests in the minute.
          headers:
            Retry-After:
              description: Seconds until the key may call again.
              schema:
                example: 60
                type: integer
      security:
        - apiKey: []
components:
  schemas:
    V1Segments:
      properties:
        comparison:
          anyOf:
            - $ref: '#/components/schemas/SegmentsTable'
            - type: 'null'
        meta:
          $ref: '#/components/schemas/Meta'
          description: Normalized query and newest included scan.
        personas:
          items:
            $ref: '#/components/schemas/PersonaRow'
          title: Personas
          type: array
        segment_limit:
          title: Segment Limit
          type: integer
        segment_limit_note:
          anyOf:
            - type: string
            - type: 'null'
          title: Segment Limit Note
        segments:
          items:
            $ref: '#/components/schemas/SegmentRow'
          title: Segments
          type: array
        vocabulary:
          $ref: '#/components/schemas/SegmentVocabulary'
      required:
        - meta
        - segments
        - personas
        - vocabulary
        - segment_limit
        - segment_limit_note
        - comparison
      title: V1Segments
      type: object
    Problem:
      description: |-
        An RFC 9457 problem. `type` is always `about:blank`, so `title` is the
        status's name, and `code` is what a client branches on.
      properties:
        code:
          title: Code
          type: string
        detail:
          title: Detail
          type: string
        instance:
          default: ''
          title: Instance
          type: string
        status:
          title: Status
          type: integer
        title:
          title: Title
          type: string
        type:
          const: about:blank
          default: about:blank
          title: Type
          type: string
      required:
        - type
        - title
        - status
        - detail
        - code
        - instance
      title: Problem
      type: object
    ValidationProblem:
      properties:
        code:
          title: Code
          type: string
        detail:
          title: Detail
          type: string
        errors:
          items:
            $ref: '#/components/schemas/ValidationIssue'
          title: Errors
          type: array
        instance:
          default: ''
          title: Instance
          type: string
        status:
          title: Status
          type: integer
        title:
          title: Title
          type: string
        type:
          const: about:blank
          default: about:blank
          title: Type
          type: string
      required:
        - type
        - title
        - status
        - detail
        - code
        - instance
        - errors
      title: ValidationProblem
      type: object
    RateLimitProblem:
      properties:
        code:
          title: Code
          type: string
        detail:
          title: Detail
          type: string
        instance:
          default: ''
          title: Instance
          type: string
        rate_limit:
          $ref: '#/components/schemas/RateLimitValues'
        status:
          title: Status
          type: integer
        title:
          title: Title
          type: string
        type:
          const: about:blank
          default: about:blank
          title: Type
          type: string
      required:
        - type
        - title
        - status
        - detail
        - code
        - instance
        - rate_limit
      title: RateLimitProblem
      type: object
    SegmentsTable:
      properties:
        rows:
          items:
            $ref: '#/components/schemas/SegmentTableRow'
          title: Rows
          type: array
        total:
          default: 0
          title: Total
          type: integer
      required:
        - rows
        - total
      title: SegmentsTable
      type: object
    Meta:
      properties:
        data_as_of:
          anyOf:
            - $ref: '#/components/schemas/DataAsOf'
            - type: 'null'
        query:
          additionalProperties:
            $ref: '#/components/schemas/JsonValue'
          title: Query
          type: object
      required:
        - query
        - data_as_of
      title: Meta
      type: object
    PersonaRow:
      properties:
        ai_generated:
          title: Ai Generated
          type: boolean
        audience_type:
          title: Audience Type
          type: string
        description:
          title: Description
          type: string
        fields:
          additionalProperties: true
          title: Fields
          type: object
        id:
          format: uuid
          title: Id
          type: string
        name:
          title: Name
          type: string
      required:
        - id
        - name
        - description
        - audience_type
        - fields
        - ai_generated
      title: PersonaRow
      type: object
    SegmentRow:
      properties:
        config_version:
          anyOf:
            - type: integer
            - type: 'null'
          title: Config Version
        country:
          anyOf:
            - type: string
            - type: 'null'
          title: Country
        engine_selection:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Engine Selection
        engine_vocabulary:
          items:
            $ref: '#/components/schemas/EngineVocabulary'
          title: Engine Vocabulary
          type: array
        engines:
          items:
            type: string
          title: Engines
          type: array
        id:
          format: uuid
          title: Id
          type: string
        is_default:
          title: Is Default
          type: boolean
        label:
          title: Label
          type: string
        language:
          title: Language
          type: string
        name:
          title: Name
          type: string
        persona_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          title: Persona Id
        prompt_count:
          default: 0
          title: Prompt Count
          type: integer
        retired:
          title: Retired
          type: boolean
        subregion:
          anyOf:
            - type: string
            - type: 'null'
          title: Subregion
      required:
        - engine_vocabulary
        - id
        - label
        - name
        - persona_id
        - language
        - country
        - subregion
        - engine_selection
        - engines
        - is_default
        - retired
        - config_version
        - prompt_count
      title: SegmentRow
      type: object
    SegmentVocabulary:
      properties:
        languages:
          additionalProperties:
            type: string
          title: Languages
          type: object
        markets:
          additionalProperties:
            type: string
          title: Markets
          type: object
        optional_engines:
          items:
            type: string
          title: Optional Engines
          type: array
        standard_engines:
          items:
            type: string
          title: Standard Engines
          type: array
        subregions:
          additionalProperties:
            additionalProperties:
              type: string
            type: object
          title: Subregions
          type: object
      required:
        - markets
        - subregions
        - languages
        - standard_engines
        - optional_engines
      title: SegmentVocabulary
      type: object
    ValidationIssue:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Loc
          type: array
        msg:
          title: Msg
          type: string
        type:
          title: Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationIssue
      type: object
    RateLimitValues:
      properties:
        limit:
          title: Limit
          type: integer
        remaining:
          title: Remaining
          type: integer
        reset:
          title: Reset
          type: integer
        window:
          title: Window
          type: integer
      required:
        - limit
        - window
        - remaining
        - reset
      title: RateLimitValues
      type: object
    SegmentTableRow:
      description: One row of the comparison table (SU-4).
      properties:
        axes:
          items:
            $ref: '#/components/schemas/SegmentAxis'
          title: Axes
          type: array
        chips:
          $ref: '#/components/schemas/SegmentChips'
        is_default:
          title: Is Default
          type: boolean
        label:
          title: Label
          type: string
        name:
          title: Name
          type: string
        prompt_count:
          title: Prompt Count
          type: integer
        retired:
          title: Retired
          type: boolean
        score:
          anyOf:
            - type: integer
            - type: 'null'
          title: Score
        score_change:
          anyOf:
            - $ref: '#/components/schemas/PairedChange'
            - type: 'null'
        segment_id:
          title: Segment Id
          type: string
      required:
        - segment_id
        - label
        - name
        - is_default
        - retired
        - chips
        - prompt_count
        - score
        - score_change
        - axes
      title: SegmentTableRow
      type: object
    DataAsOf:
      properties:
        completed_at:
          format: date-time
          title: Completed At
          type: string
        id:
          format: uuid
          title: Id
          type: string
      required:
        - id
        - completed_at
      title: DataAsOf
      type: object
    JsonValue: {}
    EngineVocabulary:
      properties:
        display_name:
          title: Display Name
          type: string
        engine_id:
          title: Engine Id
          type: string
        sort_order:
          title: Sort Order
          type: integer
      required:
        - engine_id
        - display_name
        - sort_order
      title: EngineVocabulary
      type: object
    SegmentAxis:
      description: |-
        One axis of one segment over the last week, with its move beside it.

        `value` is `null` where the week could not measure the axis, which is a
        gap. `change` is the figures read's paired change over the segment's
        answers, and is `null` where no earlier week read them: a first read has
        moved from nothing.
      properties:
        axis:
          title: Axis
          type: string
        change:
          anyOf:
            - $ref: '#/components/schemas/PairedChange'
            - type: 'null'
        label:
          title: Label
          type: string
        population:
          title: Population
          type: string
        value:
          anyOf:
            - type: integer
            - type: 'null'
          title: Value
      required:
        - axis
        - label
        - population
        - value
        - change
      title: SegmentAxis
      type: object
    SegmentChips:
      description: >-
        The three dimensions a segment fixes, as the row and the pane head draw

        them. `claude` is the fourth chip and only appears once a segment adds
        it

        (SU-12).
      properties:
        claude:
          default: false
          title: Claude
          type: boolean
        language:
          title: Language
          type: string
        market:
          title: Market
          type: string
        persona:
          title: Persona
          type: string
      required:
        - market
        - language
        - persona
        - claude
      title: SegmentChips
      type: object
    PairedChange:
      description: |-
        A figure's change over the selected window, in points, with its 95%
        range (`app.scans.scoring.axes.change_payload`). `real` is whether the
        paired test over the prompt × engine cells both reads measured says it
        moved; a surface announces only a real change.
      properties:
        delta:
          title: Delta
          type: number
        high:
          title: High
          type: number
        low:
          title: Low
          type: number
        real:
          title: Real
          type: boolean
      required:
        - delta
        - low
        - high
        - real
      title: PairedChange
      type: object
  securitySchemes:
    apiKey:
      description: 'An API key, sent as `Authorization: Bearer hrld_...`.'
      scheme: bearer
      type: http

````

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