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

# Redirect Insights

> Whether agents that ask for the old address are now redirected: what Agent Analytics recorded at the old address in the 14 days before the redirect went live and since, agent visits to the new page, the eval fix that redirects the same address, and AI citations of both addresses.



## OpenAPI

````yaml /openapi.json get /v2/library/redirects/{redirect_id}/insights
openapi: 3.1.0
info:
  title: Lightsage Public API
  description: Public API for Lightsage CLI and external integrations.
  version: 1.0.0
servers:
  - url: https://api.lightsage.com
    description: Production
security: []
tags:
  - name: Status
    description: Check API availability and validate the calling API key.
  - name: Visibility
    description: >-
      Measure visibility, citations, competitors, and prompt performance across
      answer platforms.
  - name: Prompts
    description: Manage tracked prompts and topics, and inspect their stored runs.
  - name: Opportunities
    description: Review ranked opportunities computed from prompt visibility results.
  - name: Tasks
    description: Manage the persisted action queue and task lifecycle.
  - name: Library
    description: >-
      Track the pages you publish and the redirects you set up: their AI answer
      citations and agent visits per day, and whether each is helping.
  - name: Site Audits
    description: Review website audit results and page-level findings.
  - name: Agent Analytics
    description: >-
      See which coding agents, AI bots, and people visit your tracked sites,
      which pages they read, which pages return errors, and where the visits
      come from.
  - name: Evals
    description: Define eval tasks, judges, subjects, and saved configurations.
  - name: Eval Templates
    description: >-
      Select reusable judges, targets, schedules, metadata, and runtime settings
      with `POST /v2/eval-templates`, then copy only those settings into
      prompt-specific evals with `POST /v2/evals/batch`. Templates never contain
      prompts and remain independent from evals created from them.
  - name: Eval Runs
    description: Start eval runs and inspect their lifecycle state.
  - name: Eval Results
    description: Review completed eval outcomes and diagnostic details.
  - name: Agent Preference
    description: >-
      Compare your company head-to-head with a tracked competitor. Create a
      comparison with `POST /v2/agent-preference/evals`, run it with `POST
      /v2/eval-runs`, then read which company agents recommended.
  - name: Plugin Evals
    description: >-
      Download a day's ChatGPT plugin eval results: every run with and without
      the plugin, plus its insights report.
  - name: Agents
    description: List runnable coding-agent harness and model combinations.
  - name: Repositories
    description: Manage reusable Git repository workspaces.
  - name: Environments
    description: List reusable runtime environments without exposing secret values.
  - name: MCP Servers
    description: List reusable MCP server integrations without exposing credentials.
  - name: CLIs
    description: List reusable command-line interfaces without exposing setup commands.
  - name: Skills
    description: List reusable skills available to workflows and evals.
paths:
  /v2/library/redirects/{redirect_id}/insights:
    get:
      tags:
        - Library
      summary: Redirect Insights
      description: >-
        Whether agents that ask for the old address are now redirected: what
        Agent Analytics recorded at the old address in the 14 days before the
        redirect went live and since, agent visits to the new page, the eval fix
        that redirects the same address, and AI citations of both addresses.
      operationId: v2_library_redirects_insights
      parameters:
        - name: redirect_id
          in: path
          required: true
          schema:
            type: string
            title: Redirect Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LibraryRedirectInsights'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - LightsageApiKeyAuth: []
components:
  schemas:
    LibraryRedirectInsights:
      properties:
        id:
          type: string
          title: Id
          description: Library redirect ID.
        title:
          type: string
          title: Title
        from_url:
          type: string
          title: From Url
          description: The old address, which now redirects.
        to_url:
          type: string
          title: To Url
          description: Where the old address now sends visitors and agents.
        live_on:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Live On
          description: Day the redirect went live.
        task_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Task Id
        added_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Added At
        updated_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Updated At
        status:
          type: string
          enum:
            - working
            - not_working
            - checking
            - cant_check
          title: Status
          description: >-
            Whether agents that ask for the old address are now redirected, from
            what Agent Analytics recorded at the old address since the redirect
            went live. `not_working` when requests that still got an error or
            the old page are at least as many as requests that were redirected
            (this can show before 7 days). Otherwise `checking` until it has
            been live 7 days and at least one agent has asked for the old
            address, then `working` (redirected requests outnumber the rest;
            `answer` says so when some still fail). `cant_check` when the old
            address is on a site Agent Analytics does not track. Only 301, 302,
            303, 307 and 308 count as redirected. Agent Analytics does not
            record where a redirect points, so `working` means agents are sent
            on, not that they reach `to_url`.
        label:
          type: string
          title: Label
          description: 'The status as shown: Working, Not working, Checking or Can''t check.'
        headline:
          type: string
          title: Headline
          description: The one number behind the status, such as `41 agent errors stopped`.
        reason:
          type: string
          title: Reason
          description: One sentence on what it means or what to do.
        answer:
          type: string
          title: Answer
          description: The status as a sentence, for the top of the redirect's page.
        lede:
          type: string
          title: Lede
          description: The numbers behind it, in a sentence or two.
        days_live:
          type: integer
          title: Days Live
        tracked:
          type: boolean
          title: Tracked
          description: Whether the old address is on a site Agent Analytics tracks.
        host:
          type: string
          title: Host
        numbers:
          $ref: '#/components/schemas/LibraryRedirectNumbers'
        eval:
          anyOf:
            - $ref: '#/components/schemas/LibraryRedirectEval'
            - type: 'null'
        daily:
          items:
            $ref: '#/components/schemas/LibraryRedirectDay'
          type: array
          title: Daily
          description: >-
            Agent requests to the old address per day, 14 days before it went
            live through today.
        citations:
          $ref: '#/components/schemas/LibraryRedirectCitations'
        latest_requests:
          items:
            $ref: '#/components/schemas/LibraryRedirectRequest'
          type: array
          title: Latest Requests
      type: object
      required:
        - id
        - title
        - from_url
        - to_url
        - status
        - label
        - headline
        - reason
        - answer
        - lede
        - days_live
        - tracked
        - host
        - numbers
        - citations
      title: LibraryRedirectInsights
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    LibraryRedirectNumbers:
      properties:
        requests_before:
          type: integer
          title: Requests Before
          description: >-
            Agent requests to the old address in the 14 days before it went
            live.
        errors_before:
          type: integer
          title: Errors Before
          description: Of those, how many got an error.
        requests_after:
          type: integer
          title: Requests After
          description: Agent requests to the old address since it went live.
        redirected_after:
          type: integer
          title: Redirected After
          description: Of those, how many were redirected.
        failing_after:
          type: integer
          title: Failing After
          description: Of those, how many still got an error or the old page.
        visits_per_day_before:
          anyOf:
            - type: number
            - type: 'null'
          title: Visits Per Day Before
          description: >-
            Agent visits a day to the new address before. Null where its site is
            not tracked.
        visits_per_day_after:
          anyOf:
            - type: number
            - type: 'null'
          title: Visits Per Day After
      type: object
      required:
        - requests_before
        - errors_before
        - requests_after
        - redirected_after
        - failing_after
      title: LibraryRedirectNumbers
    LibraryRedirectEval:
      properties:
        matches_destination:
          type: boolean
          title: Matches Destination
          default: true
        name:
          type: string
          title: Name
        endpoint_id:
          type: string
          title: Endpoint Id
        lineage_id:
          type: string
          title: Lineage Id
          description: The fix it matched.
        task_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Task Id
        tested:
          type: boolean
          title: Tested
        passed_before:
          anyOf:
            - type: integer
            - type: 'null'
          title: Passed Before
        runs_before:
          anyOf:
            - type: integer
            - type: 'null'
          title: Runs Before
        passed_after:
          anyOf:
            - type: integer
            - type: 'null'
          title: Passed After
        runs_after:
          anyOf:
            - type: integer
            - type: 'null'
          title: Runs After
        tool_calls_before:
          anyOf:
            - type: number
            - type: 'null'
          title: Tool Calls Before
        tool_calls_after:
          anyOf:
            - type: number
            - type: 'null'
          title: Tool Calls After
        time_ms_before:
          anyOf:
            - type: number
            - type: 'null'
          title: Time Ms Before
        time_ms_after:
          anyOf:
            - type: number
            - type: 'null'
          title: Time Ms After
      type: object
      required:
        - name
        - endpoint_id
        - lineage_id
        - tested
      title: LibraryRedirectEval
      description: >-
        The eval fix that redirects the same old address to the same new one,
        and its latest finished test.
    LibraryRedirectDay:
      properties:
        date:
          type: string
          format: date
          title: Date
        errored:
          type: integer
          title: Errored
        redirected:
          type: integer
          title: Redirected
        served:
          type: integer
          title: Served
          description: >-
            Requests that still got the old page: a 2xx, or a 304 telling the
            agent to reuse its copy.
      type: object
      required:
        - date
        - errored
        - redirected
        - served
      title: LibraryRedirectDay
    LibraryRedirectCitations:
      properties:
        old_before:
          type: integer
          title: Old Before
        old_after:
          type: integer
          title: Old After
          description: >-
            Answers still citing the old address; the redirect is what catches
            them.
        new_before:
          type: integer
          title: New Before
        new_after:
          type: integer
          title: New After
      type: object
      required:
        - old_before
        - old_after
        - new_before
        - new_after
      title: LibraryRedirectCitations
      description: >-
        AI answer citations in the 14 days before it went live and since, for
        both addresses.
    LibraryRedirectRequest:
      properties:
        requested_at:
          type: string
          title: Requested At
        agent:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent
        path:
          type: string
          title: Path
          description: The exact path asked for, with its query string.
        status_code:
          type: integer
          title: Status Code
      type: object
      required:
        - requested_at
        - path
        - status_code
      title: LibraryRedirectRequest
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    LightsageApiKeyAuth:
      type: apiKey
      in: header
      name: X-Lightsage-Api-Key

````

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