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

# Score a highlight

> Score an individual highlight.



## OpenAPI

````yaml https://app.stainlessapi.com/api/spec/documented/hyperspell.yaml post /evaluate/highlight/{highlight_id}
openapi: 3.1.0
info:
  title: Hyperspell API
  summary: >-
    Hyperspell is the memory layer for AI apps and agents. Through the API, you
    can add memories, connect data sources to index them in real-time, and
    search memories with our natural language query engine.
  termsOfService: https://hyperspell.com/blog/tos
  contact:
    name: Hyperspell
    url: https://hyperspell.com/
    email: hello@hyperspell.com
  version: 0.32.1
servers:
  - url: https://api.hyperspell.com
    description: Production
security:
  - APIKey: []
    AsUser: []
paths:
  /evaluate/highlight/{highlight_id}:
    post:
      tags:
        - Evaluation
      summary: Score a highlight
      description: Score an individual highlight.
      operationId: create_chunk_feedback_evaluate_highlight__highlight_id__post
      parameters:
        - name: highlight_id
          in: path
          required: true
          schema:
            type: string
            title: Highlight Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HighlightFeedbackRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeedbackResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKey: []
        - AsUser: []
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Hyperspell from '@hyperspell/hyperspell';


            const client = new Hyperspell({
              apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted
            });


            const response = await
            client.evaluate.scoreHighlight('highlight_id');


            console.log(response.message);
        - lang: Python
          source: |-
            import os
            from hyperspell import Hyperspell

            client = Hyperspell(
                api_key=os.environ.get("HYPERSPELL_API_KEY"),  # This is the default and can be omitted
            )
            response = client.evaluate.score_highlight(
                highlight_id="highlight_id",
            )
            print(response.message)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/hyperspell/hyperspell-go\"\n\t\"github.com/hyperspell/hyperspell-go/option\"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Evaluate.ScoreHighlight(\n\t\tcontext.TODO(),\n\t\t\"highlight_id\",\n\t\thyperspell.EvaluateScoreHighlightParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Message)\n}\n"
        - lang: CLI
          source: |-
            hyperspell evaluate score-highlight \
              --api-key 'My API Key' \
              --highlight-id highlight_id
components:
  schemas:
    HighlightFeedbackRequest:
      properties:
        score:
          type: number
          maximum: 1
          minimum: -1
          title: Score
          description: Rating of the chunk from -1 (bad) to +1 (good).
          default: 0
        comment:
          anyOf:
            - type: string
            - type: 'null'
          title: Comment
          description: Comment on the chunk
      type: object
      title: HighlightFeedbackRequest
    FeedbackResponse:
      properties:
        success:
          type: boolean
          title: Success
          description: Whether the feedback was successfully saved.
        message:
          type: string
          title: Message
          description: A message describing the result.
      type: object
      required:
        - success
        - message
      title: FeedbackResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKey:
      type: http
      description: >-
        API Key or JWT User Token. If using an API Key, set the X-As-User header
        to act as a specific user. A JWT User Token is always scoped to a
        specific user.
      scheme: bearer
      bearerFormat: Bearer <token>
    AsUser:
      type: apiKey
      description: >-
        Optionally set this header to act as a specific user when using an API
        Key, equivalent to first exchanging the API Key for a User Token
      in: header
      name: X-As-User

````