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

# 계약 히스토리 생성

> 계약에 새 텍스트 히스토리를 추가합니다. `member` 미지정 시 작성 멤버는 null로 기록됩니다 (외부 API 호출 컨텍스트). 별도 알림은 발송되지 않습니다.



## OpenAPI

````yaml POST /v1/contract/{contract_id}/history
openapi: 3.1.0
info:
  title: pluuug openapi
  version: 1.0.0
  description: >-
    플러그에서 제공하는 REST API의 상세 내용을 확인하고 직접 테스트할 수 있는 인터페이스입니다.<br>이 문서를 통해 API의
    엔드포인트, 요청 및 응답 형식 등을 확인할 수 있습니다.
servers:
  - url: https://openapi.pluuug.com
security: []
paths:
  /v1/contract/{contract_id}/history:
    post:
      tags:
        - contract
      summary: 계약 히스토리 생성
      description: >-
        계약에 새 텍스트 히스토리를 추가합니다. `member` 미지정 시 작성 멤버는 null로 기록됩니다 (외부 API 호출
        컨텍스트). 별도 알림은 발송되지 않습니다.
      operationId: contract_history_create
      parameters:
        - in: path
          name: contract_id
          schema:
            type: integer
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OpenapiContractTextHistoryListCreateRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/OpenapiContractTextHistoryListCreateRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/OpenapiContractTextHistoryListCreateRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenapiContractTextHistoryListCreate'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/OpenapiContractTextHistoryListCreateValidationError
          description: ''
      security:
        - ApiKeyAuth: []
          Signature: []
components:
  schemas:
    OpenapiContractTextHistoryListCreateRequest:
      type: object
      properties:
        content:
          type: string
          minLength: 1
          description: 내용
          maxLength: 5000
        created:
          type: string
          format: date-time
          description: 생성시간
        member:
          description: 작성 멤버
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/OpenapiNestedMemberRequest'
      required:
        - content
    OpenapiContractTextHistoryListCreate:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        content:
          type: string
          description: 내용
          maxLength: 5000
        created:
          type: string
          format: date-time
          description: 생성시간
        member:
          description: 작성 멤버
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/OpenapiNestedMember'
      required:
        - content
        - id
    OpenapiContractTextHistoryListCreateValidationError:
      type: object
      properties:
        nonField:
          type: array
          items:
            type: string
        content:
          type: array
          items:
            type: string
        created:
          type: array
          items:
            type: string
        member:
          $ref: '#/components/schemas/OpenapiNestedMemberValidationError'
    OpenapiNestedMemberRequest:
      type: object
      description: |-
        nested 아이템이 제공되면 선언된 required 필드를 모두 가져야 함을 강제한다.

        부모 레벨 partial(미전송 필드 생략)은 유지하되, nested 아이템은 object-level
        validate에서 required 필드 존재를 재확인해 누락 시 400을 반환한다.
      properties:
        id:
          type: integer
      required:
        - id
    OpenapiNestedMember:
      type: object
      description: |-
        nested 아이템이 제공되면 선언된 required 필드를 모두 가져야 함을 강제한다.

        부모 레벨 partial(미전송 필드 생략)은 유지하되, nested 아이템은 object-level
        validate에서 required 필드 존재를 재확인해 누락 시 400을 반환한다.
      properties:
        id:
          type: integer
        nickname:
          type:
            - string
            - 'null'
          readOnly: true
          description: 닉네임
        email:
          type: string
          readOnly: true
          description: 이메일
        isActive:
          type: boolean
          readOnly: true
          description: 활성화 여부
        grade:
          allOf:
            - $ref: '#/components/schemas/OpenapiNestedMemberGrade'
          readOnly: true
          description: 등급
      required:
        - email
        - grade
        - id
        - isActive
        - nickname
    OpenapiNestedMemberValidationError:
      type: object
      properties:
        id:
          type: array
          items:
            type: string
    OpenapiNestedMemberGrade:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        title:
          type: string
          readOnly: true
      required:
        - id
        - title
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
    Signature:
      type: apiKey
      in: header
      name: X-Signature
      description: |-
        HMAC-SHA256 방식으로 body를 secret key로 해싱하여 생성한 서명을 넣어야 합니다.
        서버는 X-API-Key와 대응되는 secret key로 서명을 검증합니다.

````