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

# Retrieve ranked policy chunks for a question



## OpenAPI

````yaml /docs/openapi.client.json post /v1/policy/retrieve
openapi: 3.1.0
info:
  description: >-
    Client API for RCIntel. Authenticate with X-API-Key. See Guides → Which API
    to use.
  summary: Multi-tenant knowledge API for healthcare revenue cycle management.
  title: Healthcare Knowledge Layer
  version: 0.1.0
servers: []
security: []
tags:
  - description: >-
      Cited payer policy lookup — GET /v1/policies and GET /v1/policies/changes.
      Medicare FFS returns NCDs/LCDs/MACs; commercial payers return that payer's
      documents only. Query payer, code, state, plan_type.
    name: policies
  - description: >-
      Payer-policy PDF parse and retrieve for Workspace / Payer Knowledge.
      Service-authenticated (X-Admin-Secret); chunks stored in Postgres.
    name: policy
  - description: >-
      Manufacturer 340B contract-pharmacy policy, fail-closed access, and the
      change feed. Different API from GET /v1/policies.
    name: 340B Policy
  - description: CRD-style prior authorization check, documentation, and vendors.
    name: prior-auth
  - description: Public payer directory (no API key on list/detail).
    name: payers-public
  - description: >-
      Payer network directory — search payers, check prior auth requirements,
      view filing rules, denial patterns, and appeal levels.
    name: payers
  - description: >-
      Resolve healthcare billing knowledge across the L1-L6 layer stack.
      Includes payment calculation, billing guidance, and per-layer queries.
    name: knowledge
  - description: >-
      CMS Fee Schedule lookups — OPPS (Addendum B / APC), DMEPOS (state-level
      pricing), and Clinical Lab Fee Schedule (CLFS).
    name: fee-schedules
  - description: >-
      NCCI (National Correct Coding Initiative) — dedicated MUE limits, PTP
      bundling edits, add-on code edits, and code pair validation.
    name: ncci
  - description: >-
      Service code intelligence — CPT/HCPCS lookup, RVU data, NCCI edits,
      payment calculation, implant/GUDID search, and service group
      classification.
    name: codes
  - description: >-
      Submit asynchronous AI agent jobs for code research, medical necessity,
      and denial resolution. Poll for results and retrieve reasoning traces.
    name: agents
  - description: >-
      Register and manage healthcare facilities by CCN (Medicare Provider
      Number). Each facility is the root entity for knowledge resolution.
    name: facilities
  - description: >-
      NPI Registry — live search against CMS NPPES API for provider and
      organization National Provider Identifiers.
    name: npi
  - description: >-
      OpenFDA drug product lookup by NDC. Includes product-level fields with
      normalized ingredient and package detail.
    name: drugs
  - name: encounter
  - name: mcp
  - description: Health checks, service metadata, and Prometheus metrics.
    name: system
paths:
  /v1/policy/retrieve:
    post:
      tags:
        - policy
      summary: Retrieve ranked policy chunks for a question
      operationId: retrieve_policy_v1_policy_retrieve_post
      parameters:
        - description: >-
            Admin bootstrap secret required for privileged
            bootstrap/provisioning operations.
          in: header
          name: x-admin-secret
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Admin-Secret
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PolicyRetrieveRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PolicyRetrieveResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    PolicyRetrieveRequest:
      properties:
        document_id:
          anyOf:
            - type: string
            - type: 'null'
          description: Legacy single-doc id — merged into document_ids when both are sent
          title: Document Id
        document_ids:
          description: One or more workspace document ids in the review scope (max 20)
          items:
            type: string
          title: Document Ids
          type: array
        package:
          anyOf:
            - type: string
            - type: 'null'
          title: Package
        query:
          title: Query
          type: string
        top_n:
          default: 20
          maximum: 100
          minimum: 1
          title: Top N
          type: integer
        user_uid:
          title: User Uid
          type: string
      required:
        - user_uid
        - query
      title: PolicyRetrieveRequest
      type: object
    PolicyRetrieveResponse:
      properties:
        candidate_count:
          default: 0
          description: Chunks considered for this document before top_n truncation
          title: Candidate Count
          type: integer
        chunks:
          items:
            $ref: '#/components/schemas/PolicyChunkResponse'
          title: Chunks
          type: array
        max_query_score:
          default: 0
          description: Highest query_score among all candidates (not just returned top_n)
          title: Max Query Score
          type: integer
      title: PolicyRetrieveResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    PolicyChunkResponse:
      properties:
        chunk_id:
          title: Chunk Id
          type: string
        document_id:
          default: ''
          title: Document Id
          type: string
        heading:
          default: ''
          title: Heading
          type: string
        heading_level:
          anyOf:
            - type: integer
            - type: 'null'
          title: Heading Level
        matched_keywords:
          items:
            type: string
          title: Matched Keywords
          type: array
        page_end:
          title: Page End
          type: integer
        page_start:
          title: Page Start
          type: integer
        priority:
          default: false
          title: Priority
          type: boolean
        query_score:
          default: 0
          description: Ask-time overlap score for this query (0 = no overlap)
          title: Query Score
          type: integer
        relevance_score:
          default: 0
          title: Relevance Score
          type: integer
        section_path:
          items:
            type: string
          title: Section Path
          type: array
        segmentation:
          title: Segmentation
          type: string
        source_pdf:
          title: Source Pdf
          type: string
        tables:
          items:
            additionalProperties: true
            type: object
          title: Tables
          type: array
        text:
          title: Text
          type: string
      required:
        - chunk_id
        - source_pdf
        - page_start
        - page_end
        - text
        - segmentation
      title: PolicyChunkResponse
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object

````