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

# Get policy

> Returns a policy with its current version plus PV2 editor context (versionState, selectedVersion, permissions, actions).



## OpenAPI

````yaml /api/openapi.json get /v1/policies/{id}
openapi: 3.1.0
info:
  title: MeshQu API
  description: >-
    Governance infrastructure for policy-aware AI decisions. MeshQu does not run
    tools. It governs decisions about them.
  version: 1.9.0
  contact:
    name: MeshQu Support
    email: support@meshqu.com
  license:
    name: Proprietary
servers:
  - url: https://api.meshqu.com
    description: Deployed environment
security:
  - apiKey: []
    tenantId: []
tags:
  - name: Operations
    description: Health, readiness, metrics, and signing keys
  - name: Policies
    description: Policy management
  - name: Policy Groups
    description: Policy group management
  - name: Decisions
    description: Policy evaluation and recording
  - name: Chains
    description: Decision chain verification and sealing
  - name: Receipts
    description: Public receipt and bundle retrieval
  - name: Forms
    description: Attestation forms and public submission
  - name: Alerts
    description: Alert management and webhooks
  - name: Audit
    description: Audit log retrieval and verification
  - name: API Keys
    description: API key administration
  - name: Admin
    description: Tenant and platform administration
  - name: Dashboard
    description: Console dashboard data
  - name: Metrics
    description: Decision and overview metrics
  - name: Fields
    description: Field catalogue
  - name: Settings
    description: Tenant settings
  - name: Rule Creation Logs
    description: Rule authoring telemetry
paths:
  /v1/policies/{id}:
    get:
      tags:
        - Policies
      summary: Get policy
      description: >-
        Returns a policy with its current version plus PV2 editor context
        (versionState, selectedVersion, permissions, actions).
      operationId: getV1PoliciesById
      parameters:
        - schema:
            pattern: ^(active|draft|latest|[1-9][0-9]*)$
            type: string
          in: query
          name: version
          required: false
          description: >-
            Which version to surface. **Default since 2026-05-17: "latest"** —
            the version the editor should open: draft if one exists (in-flight
            work), else the active ratified, else the highest version number.
            Only 404 if the policy has no versions at all. "active" — the
            ratified+active version, 404 if none exists (use this for
            compliance/audit consumers that must distinguish "ratified" from
            "merely exists"). "draft" — the first draft, 404 if none exists.
            Numeric — that exact version, 404 if missing.
        - schema:
            format: uuid
            type: string
          in: path
          name: id
          required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    format: uuid
                    type: string
                  tenant_id:
                    format: uuid
                    type: string
                  code:
                    type: string
                  name:
                    type: string
                  description:
                    anyOf:
                      - type: string
                      - type: 'null'
                  decision_type:
                    type: string
                  current_version:
                    type: integer
                  is_active:
                    type: boolean
                  shadow_mode:
                    description: When true, violations are logged but DENY becomes ALERT
                    type: boolean
                  policy_group_id:
                    description: Policy group this policy belongs to
                    anyOf:
                      - format: uuid
                        type: string
                      - type: 'null'
                  regulatory_refs:
                    description: Regulatory references this policy implements
                    anyOf:
                      - type: array
                        items:
                          type: string
                      - type: 'null'
                  regulatory_refs_warnings:
                    description: >-
                      Warnings for regulatory_refs entries not found in the
                      clause registry. Informational only — the save proceeded.
                    type: array
                    items:
                      type: object
                      properties:
                        ref:
                          type: string
                        reason:
                          type: string
                          enum:
                            - unknown_clause_id
                      required:
                        - ref
                        - reason
                  created_at:
                    format: date-time
                    type: string
                  created_by:
                    anyOf:
                      - type: string
                      - type: 'null'
                  updated_at:
                    format: date-time
                    type: string
                  version:
                    type: object
                    properties:
                      id:
                        format: uuid
                        type: string
                      policy_id:
                        format: uuid
                        type: string
                      version:
                        type: integer
                      rules:
                        type: array
                        items:
                          type: object
                          properties:
                            code:
                              minLength: 1
                              maxLength: 50
                              type: string
                            name:
                              minLength: 1
                              maxLength: 200
                              type: string
                            description:
                              maxLength: 1000
                              type: string
                            rule_type:
                              anyOf:
                                - type: string
                                  enum:
                                    - presence
                                - type: string
                                  enum:
                                    - temporal
                                - type: string
                                  enum:
                                    - threshold
                                - type: string
                                  enum:
                                    - list
                                - type: string
                                  enum:
                                    - expression
                            condition:
                              anyOf:
                                - additionalProperties: true
                                  type: object
                                  properties:
                                    required_fields:
                                      type: array
                                      items:
                                        type: string
                                    forbidden_fields:
                                      type: array
                                      items:
                                        type: string
                                    min_length:
                                      type: object
                                      additionalProperties:
                                        type: integer
                                - additionalProperties: true
                                  type: object
                                  properties:
                                    field:
                                      type: string
                                    not_expired:
                                      type: boolean
                                    not_future:
                                      type: boolean
                                    reference_field:
                                      type: string
                                    max_days_after:
                                      type: integer
                                    min_days_before:
                                      type: integer
                                - additionalProperties: true
                                  type: object
                                  properties:
                                    field:
                                      type: string
                                    min:
                                      type: number
                                    max:
                                      type: number
                                    greater_than:
                                      type: number
                                    less_than:
                                      type: number
                                - additionalProperties: true
                                  type: object
                                  properties:
                                    field:
                                      type: string
                                    allowed:
                                      type: array
                                      items:
                                        type: string
                                    forbidden:
                                      type: array
                                      items:
                                        type: string
                                    case_sensitive:
                                      type: boolean
                                - additionalProperties: true
                                  type: object
                                  properties:
                                    expression:
                                      type: string
                            severity:
                              anyOf:
                                - type: string
                                  enum:
                                    - low
                                - type: string
                                  enum:
                                    - medium
                                - type: string
                                  enum:
                                    - high
                                - type: string
                                  enum:
                                    - critical
                            is_active:
                              default: true
                              type: boolean
                            when:
                              anyOf:
                                - additionalProperties: false
                                  type: object
                                  properties:
                                    field:
                                      type: string
                                    equals:
                                      anyOf:
                                        - type: string
                                        - type: number
                                        - type: boolean
                                  required:
                                    - field
                                    - equals
                                - additionalProperties: false
                                  type: object
                                  properties:
                                    field:
                                      type: string
                                    in:
                                      type: array
                                      items:
                                        anyOf:
                                          - type: string
                                          - type: number
                                  required:
                                    - field
                                    - in
                                - additionalProperties: false
                                  type: object
                                  properties:
                                    field:
                                      type: string
                                    exists:
                                      type: boolean
                                  required:
                                    - field
                                    - exists
                                - additionalProperties: false
                                  type: object
                                  properties:
                                    all:
                                      type: array
                                      items: 83abff0b-e22a-4f98-ae9c-b4e78ccc21bb
                                  required:
                                    - all
                                - additionalProperties: false
                                  type: object
                                  properties:
                                    any:
                                      type: array
                                      items: 83abff0b-e22a-4f98-ae9c-b4e78ccc21bb
                                  required:
                                    - any
                            source_ref:
                              type: object
                              properties:
                                document:
                                  maxLength: 500
                                  type: string
                                section:
                                  maxLength: 200
                                  type: string
                                url:
                                  maxLength: 2000
                                  type: string
                            replaces_rule_code:
                              maxLength: 50
                              description: >-
                                Advisory lineage: rule code this replaces (not
                                included in snapshot hash)
                              type: string
                          required:
                            - code
                            - name
                            - rule_type
                            - condition
                            - severity
                      is_active:
                        type: boolean
                      status:
                        description: >-
                          Lifecycle status: draft → submitted → ratified →
                          superseded (or back to draft on reject)
                        anyOf:
                          - type: string
                            enum:
                              - draft
                          - type: string
                            enum:
                              - submitted
                          - type: string
                            enum:
                              - ratified
                          - type: string
                            enum:
                              - superseded
                      ratified_by:
                        type: string
                      ratified_at:
                        format: date-time
                        type: string
                      submitted_by:
                        type: string
                      submitted_at:
                        format: date-time
                        type: string
                      rejected_by:
                        type: string
                      rejected_at:
                        format: date-time
                        type: string
                      rejection_reason:
                        type: string
                      created_at:
                        format: date-time
                        type: string
                      created_by:
                        anyOf:
                          - type: string
                          - type: 'null'
                      change_reason:
                        anyOf:
                          - type: string
                          - type: 'null'
                    required:
                      - id
                      - policy_id
                      - version
                      - rules
                      - is_active
                      - status
                      - created_at
                      - created_by
                      - change_reason
                  versionState:
                    description: >-
                      Lifecycle state of the selected version. "submitted" is
                      reserved for PV2-020; today the server only emits active |
                      draft | historical.
                    anyOf:
                      - type: string
                        enum:
                          - active
                      - type: string
                        enum:
                          - draft
                      - type: string
                        enum:
                          - submitted
                      - type: string
                        enum:
                          - historical
                  selectedVersion:
                    type: integer
                  permissions:
                    description: >-
                      Convenience permission flags. Clients MUST use actions[]
                      as the source of truth for availability; permissions are
                      for disable-state/tooltip hints only.
                    type: object
                    properties:
                      canEdit:
                        type: boolean
                      canSubmit:
                        type: boolean
                      canApprove:
                        type: boolean
                      canReject:
                        type: boolean
                      canDiscard:
                        type: boolean
                      canRestore:
                        type: boolean
                      canCompare:
                        type: boolean
                    required:
                      - canEdit
                      - canSubmit
                      - canApprove
                      - canReject
                      - canDiscard
                      - canRestore
                      - canCompare
                  actions:
                    type: array
                    items:
                      description: >-
                        Header action. actions[] is server-computed; the client
                        renders one button per entry in order. Unavailable
                        actions are OMITTED, not disabled.
                      type: object
                      properties:
                        kind:
                          anyOf:
                            - type: string
                              enum:
                                - start_editing
                            - type: string
                              enum:
                                - continue_editing
                            - type: string
                              enum:
                                - continue_reviewing
                            - type: string
                              enum:
                                - discard
                            - type: string
                              enum:
                                - submit
                            - type: string
                              enum:
                                - recall
                            - type: string
                              enum:
                                - approve
                            - type: string
                              enum:
                                - reject
                            - type: string
                              enum:
                                - restore
                            - type: string
                              enum:
                                - compare
                        label:
                          type: string
                        disabledReason:
                          type: string
                      required:
                        - kind
                required:
                  - id
                  - tenant_id
                  - code
                  - name
                  - description
                  - decision_type
                  - current_version
                  - is_active
                  - shadow_mode
                  - policy_group_id
                  - created_at
                  - created_by
                  - updated_at
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        description: Error code
                        type: string
                      message:
                        description: Human-readable message
                        type: string
                      details:
                        description: Additional error details
                    required:
                      - code
                      - message
                  correlation_id:
                    description: Request correlation ID
                    type: string
                required:
                  - error
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: mqu_<token>
      description: >-
        MeshQu API key passed as a bearer token: `Authorization: Bearer mqu_…`.
        Mint one in the console (Settings → API keys).
    tenantId:
      type: apiKey
      name: X-MeshQu-Tenant-Id
      in: header
      description: >-
        Tenant UUID for multi-tenant isolation. Required on all authenticated
        routes — validated before authentication (middleware/tenant.ts), so a
        missing or non-UUID header returns 400 (MISSING_TENANT_ID /
        INVALID_TENANT_ID) before the API key is checked.

````