> ## 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.

# Structure a parsed policy document into a semantic folder tree

> Build (or return cached) folder tree for a parsed document.

Requires the document to have been parsed first via POST /v1/policy/parse.
Pass `rebuild: true` to recompute even when a cached tree exists.



## OpenAPI

````yaml /docs/openapi.client.json post /v1/policy/structure
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/structure:
    post:
      tags:
        - policy
      summary: Structure a parsed policy document into a semantic folder tree
      description: >-
        Build (or return cached) folder tree for a parsed document.


        Requires the document to have been parsed first via POST
        /v1/policy/parse.

        Pass `rebuild: true` to recompute even when a cached tree exists.
      operationId: structure_policy_v1_policy_structure_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/PolicyStructureRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PolicyStructureResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    PolicyStructureRequest:
      properties:
        document_id:
          title: Document Id
          type: string
        rebuild:
          default: false
          description: >-
            Rebuild even if a cached tree exists (default: return cached when
            present)
          title: Rebuild
          type: boolean
        user_uid:
          title: User Uid
          type: string
      required:
        - user_uid
        - document_id
      title: PolicyStructureRequest
      type: object
    PolicyStructureResponse:
      properties:
        built_with:
          default: deterministic
          description: '''deterministic'' or an LLM model id'
          title: Built With
          type: string
        document_id:
          title: Document Id
          type: string
        folders:
          items:
            $ref: '#/components/schemas/StructureFolder'
          title: Folders
          type: array
        metadata:
          $ref: '#/components/schemas/StructureMetadata'
        user_uid:
          title: User Uid
          type: string
      required:
        - document_id
        - user_uid
      title: PolicyStructureResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    StructureFolder:
      properties:
        files:
          items:
            $ref: '#/components/schemas/StructureFile'
          title: Files
          type: array
        key:
          description: Taxonomy folder key, e.g. 'reimbursement'
          title: Key
          type: string
        label:
          description: Display label, e.g. 'Reimbursement'
          title: Label
          type: string
        summary:
          default: ''
          description: One-line description of the folder
          title: Summary
          type: string
      required:
        - key
        - label
      title: StructureFolder
      type: object
    StructureMetadata:
      properties:
        chapter:
          anyOf:
            - type: string
            - type: 'null'
          title: Chapter
        effective_date:
          anyOf:
            - type: string
            - type: 'null'
          description: ISO date
          title: Effective Date
        line_of_business:
          anyOf:
            - type: string
            - type: 'null'
          description: Medicare / Medicaid / Commercial
          title: Line Of Business
        manual:
          anyOf:
            - type: string
            - type: 'null'
          description: e.g. Medicare Claims Processing Manual
          title: Manual
        provider_types:
          description: e.g. RHC, FQHC
          items:
            type: string
          title: Provider Types
          type: array
        publisher:
          anyOf:
            - type: string
            - type: 'null'
          description: e.g. CMS
          title: Publisher
        revision:
          anyOf:
            - type: string
            - type: 'null'
          description: Publisher revision id, e.g. 13264
          title: Revision
        source_pages:
          default: 0
          description: Total source pages covered
          title: Source Pages
          type: integer
        source_pdf:
          default: ''
          description: Original filename
          title: Source Pdf
          type: string
        title:
          default: ''
          description: Document title
          title: Title
          type: string
      title: StructureMetadata
      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
    StructureFile:
      properties:
        citations:
          items:
            $ref: '#/components/schemas/StructureCitation'
          title: Citations
          type: array
        cross_references:
          description: Referenced sections/URLs found in the text
          items:
            type: string
          title: Cross References
          type: array
        entities:
          $ref: '#/components/schemas/StructureEntities'
        excerpt:
          default: ''
          description: Representative source excerpt (truncated)
          title: Excerpt
          type: string
        facts:
          items:
            $ref: '#/components/schemas/StructureFact'
          title: Facts
          type: array
        id:
          description: Stable id for this file within the tree
          title: Id
          type: string
        native_section:
          anyOf:
            - type: string
            - type: 'null'
          description: The document's own section number, e.g. '40.1'
          title: Native Section
        summary:
          default: ''
          description: Short summary of the file's content
          title: Summary
          type: string
        title:
          description: Human-readable file title (from the source heading)
          title: Title
          type: string
      required:
        - id
        - title
      title: StructureFile
      type: object
    StructureCitation:
      properties:
        chunk_id:
          description: Source policy_chunks.chunk_id backing this file
          title: Chunk Id
          type: string
        page_end:
          description: Last source PDF page (1-based)
          title: Page End
          type: integer
        page_start:
          description: First source PDF page (1-based)
          title: Page Start
          type: integer
      required:
        - chunk_id
        - page_start
        - page_end
      title: StructureCitation
      type: object
    StructureEntities:
      properties:
        claim_formats:
          description: e.g. 837I, CMS-1450
          items:
            type: string
          title: Claim Formats
          type: array
        codes:
          description: CPT/HCPCS/G-codes referenced
          items:
            type: string
          title: Codes
          type: array
        modifiers:
          items:
            type: string
          title: Modifiers
          type: array
        payment_systems:
          description: e.g. AIR, PPS
          items:
            type: string
          title: Payment Systems
          type: array
        revenue_codes:
          items:
            type: string
          title: Revenue Codes
          type: array
        tob:
          description: Type-of-Bill codes
          items:
            type: string
          title: Tob
          type: array
      title: StructureEntities
      type: object
    StructureFact:
      properties:
        applies_to:
          anyOf:
            - type: string
            - type: 'null'
          description: Entity the fact applies to, e.g. RHC / FQHC / both (null if general)
          title: Applies To
        effective_date:
          anyOf:
            - type: string
            - type: 'null'
          description: ISO date the fact takes effect
          title: Effective Date
        statement:
          description: Normalized, self-contained policy statement
          title: Statement
          type: string
        value:
          anyOf:
            - type: string
            - type: 'null'
          description: Extracted value, e.g. '20%', '365 days'
          title: Value
      required:
        - statement
      title: StructureFact
      type: object

````