> ## 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 Pattern Comment

> POST /patterns/{pattern_id}/comments {body} -> the created comment.

Author is resolved from the auth token AT POST TIME (auth.user_id) and
stored as a bare user id — the served `author` object is a live
lookup (_serialize_pattern_comment), never a name/email snapshot.
Audit-logged the same way LB6's owner change is (repo.append_event,
surfaced via GET .../events), and broadcasts a REAL WS frame
(app/events.py::emit — see app/ws/stream.py's canonical event contract)
rather than this router's log-only `_emit()` stub, so the drawer can
live-append without a refetch.



## OpenAPI

````yaml /openapi.json post /v1/patterns/{pattern_id}/comments
openapi: 3.1.0
info:
  description: Causeloop Platform Backend
  title: Causeloop API
  version: 1.0.0
servers: []
security: []
paths:
  /v1/patterns/{pattern_id}/comments:
    post:
      tags:
        - patterns
      summary: Create Pattern Comment
      description: |-
        POST /patterns/{pattern_id}/comments {body} -> the created comment.

        Author is resolved from the auth token AT POST TIME (auth.user_id) and
        stored as a bare user id — the served `author` object is a live
        lookup (_serialize_pattern_comment), never a name/email snapshot.
        Audit-logged the same way LB6's owner change is (repo.append_event,
        surfaced via GET .../events), and broadcasts a REAL WS frame
        (app/events.py::emit — see app/ws/stream.py's canonical event contract)
        rather than this router's log-only `_emit()` stub, so the drawer can
        live-append without a refetch.
      operationId: create_pattern_comment_v1_patterns__pattern_id__comments_post
      parameters:
        - in: path
          name: pattern_id
          required: true
          schema:
            title: Pattern Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePatternCommentRequest'
        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:
    CreatePatternCommentRequest:
      properties:
        body:
          maxLength: 4000
          minLength: 1
          title: Body
          type: string
      required:
        - body
      title: CreatePatternCommentRequest
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      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
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http

````