PacteryDevelopers

문서 수정

PATCH /v1/documents/{id}

draft 문서의 속성을 부분 수정합니다. 발송 후(sent 이상)에는 수정할 수 없습니다(409 document_not_editable).

본문 파라미터

파라미터 타입 설명
title string 문서 제목
content string 계약 본문 HTML
author_name string 발송 주체 표시명
metadata object 메타데이터(기존 값과 병합)

전달한 필드만 바뀌고, 생략한 필드는 유지됩니다.

요청 예시

curl https://api.pactery.com/v1/documents/doc_8sK2... \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -X PATCH \
  -d '{ "title": "업무 위탁 계약서 (개정)" }'

응답 (200)

수정된 문서 객체를 반환합니다.

{ "id": "doc_8sK2...", "object": "document", "status": "draft", "title": "업무 위탁 계약서 (개정)" }

에러

code 의미
document_not_found 문서 없음
document_not_editable 이미 발송되어 수정 불가