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

# Knowledge gaps

> What customers ask that memory lacks, which source could record it, the questions it answers every time and the standing answers proposed; counts, never a customer.



## OpenAPI

````yaml openapi/en/cell.json GET /v1/insights/gaps
openapi: 3.1.0
info:
  title: Niadra data API
  version: '1'
  description: >-
    Writing, context, history, objects, identity, privacy and governance of one
    space. Every space has a stable address, with the space and the region in
    its name.
servers:
  - url: https://{space}.{region}.api.niadra.com
    variables:
      space:
        default: acme-prod
        description: The space, which comes in the source key.
      region:
        default: us-east-2
        description: The region of the space, which also comes in the key.
security: []
paths:
  /v1/insights/gaps:
    get:
      summary: Knowledge gaps
      description: >-
        What customers asked that memory had no record of, what agents had to
        ask them for, which source

        could record it, the questions memory answers every time and the
        standing answers proposed.

        People with the analysis or admin role, or keys with the `analytics`
        scope.


        **Authentication.** Source key with the `analytics` scope, or a Console
        person token with the analysis role (or admin). People with the vendor
        role have no access.
      operationId: knowledge_gaps_v1_insights_gaps_get
      parameters:
        - in: query
          name: days
          required: false
          schema:
            default: 30
            maximum: 90
            minimum: 1
            title: Days
            type: integer
          description: The window, in days; the counts count each customer once inside it.
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GapsResponse'
          description: >-
            The gaps, the recurring questions and the proposals of the window,
            with the groups withheld.
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: The request does not match the contract.
      security:
        - sourceKey: []
components:
  schemas:
    GapsResponse:
      additionalProperties: false
      description: >-
        What customers ask that memory cannot answer, and what it answers every
        time. Counts by

        subject and category only, never a customer, a value or a text.
      properties:
        gaps:
          items:
            $ref: '#/components/schemas/GapOut'
          title: Gaps
          type: array
          description: >-
            What customers asked for and memory had no record of, or agents had
            to ask returning customers for.
        proposals:
          items:
            $ref: '#/components/schemas/ProposalOut'
          title: Proposals
          type: array
          description: >-
            Standing answers proposed by rule; nothing reaches the agents until
            the team approves the configuration.
        recurring:
          items:
            $ref: '#/components/schemas/RecurringOut'
          title: Recurring
          type: array
          description: The questions memory answers every time, by subject and category.
        since:
          format: date
          title: Since
          type: string
          description: Start of the window.
        until:
          format: date
          title: Until
          type: string
          description: End of the window.
        withheld_groups:
          description: >-
            Groups left out: fewer customers than the minimum group size, or a
            category the analyst policy denies.
          title: Withheld Groups
          type: integer
      required:
        - since
        - until
        - gaps
        - recurring
        - proposals
        - withheld_groups
      title: GapsResponse
      type: object
    Problem:
      additionalProperties: false
      description: RFC 9457 problem details; `code` comes from the versioned error catalog.
      properties:
        code:
          title: Code
          type: string
        detail:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Detail
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Request Id
        status:
          title: Status
          type: integer
        title:
          title: Title
          type: string
        type:
          default: about:blank
          title: Type
          type: string
      required:
        - title
        - status
        - code
      title: Problem
      type: object
    GapOut:
      additionalProperties: false
      properties:
        answered_share:
          anyOf:
            - type: number
            - type: 'null'
          description: >-
            For a value type, the share of the turns asking for it that memory
            answered.
          title: Answered Share
        could_record:
          description: >-
            Sources that could send it; empty when none does, which is a
            structural gap.
          items:
            $ref: '#/components/schemas/GapSource'
          title: Could Record
          type: array
        customers:
          description: Distinct customers in the window, estimated within about 3%.
          title: Customers
          type: integer
        key:
          description: '`<kind>:<subject>:<category>`; the key of a review.'
          title: Key
          type: string
        kind:
          description: >-
            `no_record`: customers asked for a value type and memory had no
            record of it; `agent_question`: agents had to ask returning
            customers for a predicate memory had no row of.
          enum:
            - no_record
            - agent_question
          title: Kind
          type: string
        review:
          anyOf:
            - $ref: '#/components/schemas/GapReviewOut'
            - type: 'null'
        subject:
          description: A value type (`invoice`, `protocol`...) or a predicate.
          title: Subject
          type: string
        topic:
          description: >-
            The conversation's normalized category; empty when none was
            measured.
          title: Topic
          type: string
        turns:
          title: Turns
          type: integer
      required:
        - key
        - kind
        - subject
        - topic
        - customers
        - turns
        - could_record
      title: GapOut
      type: object
    ProposalOut:
      additionalProperties: false
      properties:
        key:
          description: '`<kind>:<subject>:<category>`; the key of a review.'
          title: Key
          type: string
        kind:
          description: >-
            `not_recorded`: no source records the subject, so its absence must
            never read as the customer's; `settled`: the rules answer the
            question nearly every time.
          enum:
            - not_recorded
            - settled
          title: Kind
          type: string
        review:
          anyOf:
            - $ref: '#/components/schemas/GapReviewOut'
            - type: 'null'
          description: The decision of the team on it, when there is one.
        subject:
          title: Subject
          type: string
          description: A value type or a predicate.
        text:
          description: The standing line proposed, in the space's language.
          title: Text
          type: string
        topic:
          title: Topic
          type: string
          description: The normalized category; empty when none.
      required:
        - key
        - kind
        - subject
        - topic
        - text
      title: ProposalOut
      type: object
      description: A standing line proposed by rule for the space.
    RecurringOut:
      additionalProperties: false
      properties:
        answered_share:
          description: The share of the turns asking for it that memory answered.
          title: Answered Share
          type: number
        customers:
          description: Distinct customers in the window, estimated within about 3%.
          title: Customers
          type: integer
        key:
          description: '`<kind>:<subject>:<category>`; the key of a review.'
          title: Key
          type: string
        review:
          anyOf:
            - $ref: '#/components/schemas/GapReviewOut'
            - type: 'null'
          description: The decision of the team on it, when there is one.
        subject:
          title: Subject
          type: string
          description: A value type or a predicate.
        topic:
          title: Topic
          type: string
          description: >-
            The normalized category of the conversations; empty when none was
            measured.
        turns:
          title: Turns
          type: integer
          description: Turns asking for it in the window.
      required:
        - key
        - subject
        - topic
        - customers
        - turns
        - answered_share
      title: RecurringOut
      type: object
      description: A question customers ask again and again that memory answers.
    GapSource:
      additionalProperties: false
      properties:
        name:
          title: Name
          type: string
          description: The source as the Console names it.
        source_id:
          title: Source Id
          type: string
          description: The source.
        via:
          description: >-
            `mapping`: the source's webhook mapping carries the type; `schema`:
            extraction captures the predicate when a conversation states it.
          enum:
            - mapping
            - schema
          title: Via
          type: string
      required:
        - source_id
        - name
        - via
      title: GapSource
      type: object
      description: A source of the space that could record the missing subject.
    GapReviewOut:
      additionalProperties: false
      properties:
        decided_at:
          format: date-time
          title: Decided At
          type: string
          description: When it was recorded.
        decided_by:
          title: Decided By
          type: string
          description: 'Who recorded it: the person, or the key.'
        decision:
          enum:
            - accepted
            - dismissed
          title: Decision
          type: string
          description: '`accepted` or `dismissed`.'
        note:
          anyOf:
            - type: string
            - type: 'null'
          title: Note
          description: The note left with it.
      required:
        - decision
        - decided_by
        - decided_at
      title: GapReviewOut
      type: object
      description: A decision as recorded.
  securitySchemes:
    sourceKey:
      type: http
      scheme: bearer
      description: nia_sk_...

````