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

> POST /patterns/{pattern_id}/pins  {action: merge_into|exclude_issue|include_issue|split, …}
-> 201 {pin_id}

API-IMPLEMENTATION-SPEC.md §6.4: pins are hard constraints the loop-anchor
stage honors on every subsequent engine run (pin > majority vote) — the
auditable replacement for /issues/{id}/link-pattern, /unlink-pattern, and
the old ad-hoc merge. Pins are ALSO events (`pin.created`).



## OpenAPI

````yaml /openapi.json post /v1/patterns/{pattern_id}/pins
openapi: 3.1.0
info:
  description: Causeloop Platform Backend
  title: Causeloop API
  version: 1.0.0
servers: []
security: []
paths:
  /v1/patterns/{pattern_id}/pins:
    post:
      tags:
        - patterns
      summary: Create Pattern Pin
      description: >-
        POST /patterns/{pattern_id}/pins  {action:
        merge_into|exclude_issue|include_issue|split, …}

        -> 201 {pin_id}


        API-IMPLEMENTATION-SPEC.md §6.4: pins are hard constraints the
        loop-anchor

        stage honors on every subsequent engine run (pin > majority vote) — the

        auditable replacement for /issues/{id}/link-pattern, /unlink-pattern,
        and

        the old ad-hoc merge. Pins are ALSO events (`pin.created`).
      operationId: create_pattern_pin_v1_patterns__pattern_id__pins_post
      parameters:
        - in: path
          name: pattern_id
          required: true
          schema:
            title: Pattern Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PinCreateRequest'
        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:
    PinCreateRequest:
      properties:
        action:
          enum:
            - merge_into
            - exclude_issue
            - include_issue
            - split
          title: Action
          type: string
        issue_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Issue Id
        member_ids_out:
          items:
            type: string
          title: Member Ids Out
          type: array
        target_pattern_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Target Pattern Id
      required:
        - action
      title: PinCreateRequest
      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

````