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

# Create Recommendation

> V2 Wave 5A (API-IMPLEMENTATION-SPEC.md §9): `fix_class` + `pattern_id`
are required; `business_case` is computed server-side only (never accepted
from the client — see `RecCreateBody.model_config`) via the pattern's
hazard fit + counterfactual + active rate-card financials.



## OpenAPI

````yaml /openapi.json post /v1/recommendations
openapi: 3.1.0
info:
  description: Causeloop Platform Backend
  title: Causeloop API
  version: 1.0.0
servers: []
security: []
paths:
  /v1/recommendations:
    post:
      tags:
        - recommendations
      summary: Create Recommendation
      description: >-
        V2 Wave 5A (API-IMPLEMENTATION-SPEC.md §9): `fix_class` + `pattern_id`

        are required; `business_case` is computed server-side only (never
        accepted

        from the client — see `RecCreateBody.model_config`) via the pattern's

        hazard fit + counterfactual + active rate-card financials.
      operationId: create_recommendation_v1_recommendations_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RecCreateBody'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema: {}
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    RecCreateBody:
      additionalProperties: false
      properties:
        description:
          default: ''
          maxLength: 5000
          title: Description
          type: string
        effort:
          default: medium
          maxLength: 50
          title: Effort
          type: string
        expected_loops_prevented:
          default: 0
          minimum: 0
          title: Expected Loops Prevented
          type: integer
        fix_class:
          $ref: '#/components/schemas/FixClass'
        impact:
          $ref: '#/components/schemas/RecommendationImpact'
        pattern_id:
          minLength: 1
          title: Pattern Id
          type: string
        patterns:
          default: []
          items:
            additionalProperties: true
            type: object
          title: Patterns
          type: array
        rank:
          anyOf:
            - minimum: 1
              type: integer
            - type: 'null'
          title: Rank
        title:
          maxLength: 300
          minLength: 1
          title: Title
          type: string
        type:
          $ref: '#/components/schemas/RecommendationType'
      required:
        - title
        - type
        - impact
        - fix_class
        - pattern_id
      title: RecCreateBody
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    FixClass:
      description: >-
        V2 Wave 5A (API-IMPLEMENTATION-SPEC.md §9) — required on every

        POST /recommendations; drives the remediation-cost/effort assumptions
        and

        the counterfactual covariate reduction used to compute business_case.
      enum:
        - structural
        - compensating
        - patch
      title: FixClass
      type: string
    RecommendationImpact:
      enum:
        - high
        - medium
        - quick_win
      title: RecommendationImpact
      type: string
    RecommendationType:
      enum:
        - code_fix
        - config_change
        - process
        - monitoring
      title: RecommendationType
      type: string
    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
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http

````