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

# Update a reconciliation story

> Update the story name and/or replace its links. If `links` is provided, all existing links are replaced with the new chain. If `links` is omitted, only the name is updated.



## OpenAPI

````yaml /openapi.json patch /reconciliation_stories/{id}
openapi: 3.1.0
info:
  title: End Close API
  description: REST API is used to interact with the End Close platform.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.endclose.com/v1
security:
  - ApiKeyAuth: []
paths:
  /reconciliation_stories/{id}:
    patch:
      summary: Update a reconciliation story
      description: >-
        Update the story name and/or replace its links. If `links` is provided,
        all existing links are replaced with the new chain. If `links` is
        omitted, only the name is updated.
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                links:
                  type: array
                  description: Replace the entire chain. Omit to leave links unchanged.
                  items:
                    type: object
                    required:
                      - reconciliation_id
                      - position
                    properties:
                      reconciliation_id:
                        type: string
                      position:
                        type: integer
                      role:
                        type: string
                        enum:
                          - origin
                          - continuation
                      shared_data_stream_id:
                        type: string
                        nullable: true
      responses:
        '200':
          description: Story updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReconciliationStory'
        '404':
          description: Story not found
        '422':
          description: Validation error
components:
  schemas:
    ReconciliationStory:
      type: object
      required:
        - name
      description: >-
        A reconciliation story groups related reconciliations into an ordered
        chain so end-to-end flow can be tracked. Each link points to a
        reconciliation; non-origin links must specify the data stream that
        connects them to the previous reconciliation in the chain.
      properties:
        id:
          type: integer
        name:
          type: string
          description: Human readable name for the story
        created_at:
          type: string
          format: date-time
        links:
          type: array
          description: Ordered list of reconciliations participating in the story
          items:
            $ref: '#/components/schemas/ReconciliationStoryLink'
    ReconciliationStoryLink:
      type: object
      required:
        - reconciliation_id
        - position
        - role
      properties:
        id:
          type: integer
        position:
          type: integer
          description: 1-indexed position in the chain. Must be unique within a story.
        role:
          type: string
          enum:
            - origin
            - continuation
          description: >-
            The first link is the 'origin'. All subsequent links are
            'continuation' and must set shared_data_stream_id.
        reconciliation_id:
          type: integer
          description: The reconciliation this link points to
        reconciliation_name:
          type: string
        shared_data_stream_id:
          type: integer
          nullable: true
          description: >-
            The data stream that connects this link to the previous link in the
            chain. Required for continuation links, null for origin.
        shared_data_stream_name:
          type: string
          nullable: true
        side_a_streams:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
              name:
                type: string
        side_b_streams:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
              name:
                type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````