{"openapi":"3.1.0","x-private-features":{"receivedDocumentLibrary":"ReceivedDocumentSave is a private workspace-scoped read-only library reference. Saving never changes signer identity, document ownership, API key scopes or /v1 visibility.","mcp":"McpConnection, McpCredential and McpSendIntent are private OAuth records, never exposed through /v1 serializers. MCP grants connect an account to the workspace IDs approved at consent, recheck current owner/admin membership per operation and bind send approval to one workspace. MCP workspace_id does not change REST API-key workspace scoping.","shop":"ShopSupplier, ShopProduct, ShopOption, ShopOrder and /api/shop, /api/admin/shop, /api/partner are not exposed through /v1 or API keys. Partner access is scoped to one order, expires and can be revoked.","documentAccessRequests":"DocumentAccessRequest is account-bound and private to /api/document-access-requests. Approval grants read-only access through /api/documents/{docId}/shared-view only, not workspace membership, /v1 API access, editing or signing. Request identities and messages are not serialized in the public API."},"info":{"title":"Pactery API","version":"1.1.0","description":"팩터리 전자서명 REST API. AI와 자동화에서는 POST /signature_requests 한 번으로 HTML 문서 생성부터 서명 요청 이메일 발송까지 처리할 수 있습니다. 인증은 Bearer API 키(sk_live_/sk_test_)이며 테스트 키는 실제 이메일을 보내지 않습니다. 모든 응답에 RateLimit-Limit/Remaining/Reset 헤더가 포함되고 POST는 Idempotency-Key 헤더로 멱등 처리됩니다. 충전 크레딧은 웹 AI 작성과 공유하는 소수점 잔액이며, 보유 크레딧으로 국내 서명 1건을 처리하려면 1크레딧 이상이 필요합니다. 무료·구독 포함 서명량의 우선 사용은 유지됩니다. AI 작성 기능 자체는 공개 REST API에 포함되지 않습니다. 문서 작업 성공 응답은 작성자용 document_url을 포함합니다. AI는 작업 후 이 바로가기를 사용자에게 전달해야 합니다. AI 가이드: https://pactery.com/developers/ai. 단순 작성 요청은 POST /documents로 초안을 저장하며 발송은 별도 허용이 필요합니다.","contact":{"name":"Pactery","url":"https://pactery.com/docs/api"}},"servers":[{"url":"https://api.pactery.com/v1","description":"베이스 URL. 현재는 https://pactery.com/v1 로도 접근 가능(서브도메인 매핑 예정)."}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Documents","description":"문서 생성·조회·발송"},{"name":"Participants","description":"서명자와 서명 필드"},{"name":"Files","description":"PDF 업로드"},{"name":"Templates & Seals","description":"템플릿과 법인 도장"},{"name":"Organization","description":"조직·멤버·이벤트"},{"name":"Webhooks","description":"웹훅 엔드포인트와 서명"}],"paths":{"/signature_requests":{"post":{"tags":["Documents"],"summary":"문서 생성과 서명 요청 이메일 발송","description":"AI 에이전트와 자동화용 원자적 워크플로입니다. HTML 또는 텍스트를 안전한 문서로 변환하고, 받는 분 서명란·서명자·고정 버전을 만든 뒤 이메일을 발송합니다. sk_test_ 키는 문서와 서명 링크만 만들고 이메일 발송을 시뮬레이션합니다.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"작업마다 고유한 8~255자 키. 같은 키와 같은 본문을 재전송하면 같은 결과를 반환하며 문서와 이메일이 중복 생성되지 않습니다.","schema":{"type":"string","minLength":8,"maxLength":255,"pattern":"^[A-Za-z0-9._:-]+$","example":"agent-task-20260901-001"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignatureRequestCreate"},"example":{"title":"합의서","content":"<p><strong>합의서</strong></p><p>블라블라</p>","content_format":"html","recipient":{"email":"ksk@yeyul.com","name":"서명자"},"expires_in_days":30}}}},"responses":{"201":{"description":"문서와 서명 요청이 생성되고 이메일이 발송 또는 시뮬레이션됨","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignatureRequest"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"500":{"$ref":"#/components/responses/Error"}}}},"/documents":{"post":{"tags":["Documents"],"summary":"문서 생성","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentCreate"}}}},"responses":{"201":{"description":"생성됨","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"400":{"$ref":"#/components/responses/Error"}}},"get":{"tags":["Documents"],"summary":"문서 목록","parameters":[{"name":"status","in":"query","schema":{"$ref":"#/components/schemas/DocumentStatus"}},{"name":"created_after","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"limit","in":"query","schema":{"type":"integer","default":20,"maximum":100}},{"name":"starting_after","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"목록","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentList"}}}}}}},"/documents/{id}":{"parameters":[{"$ref":"#/components/parameters/DocumentId"}],"get":{"tags":["Documents"],"summary":"문서 조회","description":"현재 TipTap 본문 content와 동시 수정 방지용 content_version을 포함합니다. content_version은 PATCH의 If-Match에 전달할 수 있습니다.","responses":{"200":{"description":"문서","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"404":{"$ref":"#/components/responses/Error"}}},"patch":{"tags":["Documents"],"summary":"문서 수정(draft)","parameters":[{"name":"If-Match","in":"header","required":false,"schema":{"type":"string"},"description":"GET 문서 응답의 content_version. 변경된 경우 409 document_changed."}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpdate"}}}},"responses":{"200":{"description":"수정됨","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"409":{"$ref":"#/components/responses/Error"}}},"delete":{"tags":["Documents"],"summary":"문서 삭제(휴지통)","responses":{"200":{"description":"삭제됨","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentLink"}}}}}}},"/documents/{id}/duplicate":{"parameters":[{"$ref":"#/components/parameters/DocumentId"}],"post":{"tags":["Documents"],"summary":"문서 복제","responses":{"201":{"description":"복제됨","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}}}}},"/documents/{id}/cancel":{"parameters":[{"$ref":"#/components/parameters/DocumentId"}],"post":{"tags":["Documents"],"summary":"발송 취소","responses":{"200":{"description":"취소됨","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"409":{"$ref":"#/components/responses/Error"}}}},"/documents/{id}/file":{"parameters":[{"$ref":"#/components/parameters/DocumentId"}],"get":{"tags":["Documents"],"summary":"문서 PDF 내려받기","parameters":[{"name":"audit","in":"query","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"PDF","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}},"headers":{"Link":{"description":"작성자용 문서 바로가기, rel=\"related\".","schema":{"type":"string"},"example":"<https://pactery.com/app/docs/abc123/manage>; rel=\"related\""}}}},"description":"업로드/서명완료 PDF는 그대로, 콘텐츠(HTML) 문서는 본문으로 PDF를 즉석 생성해 반환(200)."}},"/documents/{id}/audit":{"parameters":[{"$ref":"#/components/parameters/DocumentId"}],"get":{"tags":["Documents"],"summary":"감사추적 조회","responses":{"200":{"description":"감사 로그","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentLink"}}}}}}},"/documents/{id}/fields":{"parameters":[{"$ref":"#/components/parameters/DocumentId"}],"put":{"tags":["Participants"],"summary":"서명 필드 일괄 배치","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"fields":{"type":"array","items":{"$ref":"#/components/schemas/Field"}}}}}}},"responses":{"200":{"description":"배치됨","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentLink"}}}}}}},"/documents/{id}/participants":{"parameters":[{"$ref":"#/components/parameters/DocumentId"}],"post":{"tags":["Participants"],"summary":"서명자 추가","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParticipantCreate"}}}},"responses":{"201":{"description":"추가됨","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Participant"},{"$ref":"#/components/schemas/DocumentLink"}]}}}}}},"get":{"tags":["Documents"],"summary":"서명자 목록","parameters":[],"responses":{"200":{"description":"서명자 목록 및 작성자용 문서 바로가기","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/DocumentLink"},{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Participant"}},"has_more":{"type":"boolean"}}}]}}}}}}},"/documents/{id}/participants/batch":{"parameters":[{"$ref":"#/components/parameters/DocumentId"}],"post":{"tags":["Participants"],"summary":"서명자 일괄 등록","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"participants":{"type":"array","items":{"$ref":"#/components/schemas/ParticipantCreate"}}}}}}},"responses":{"201":{"description":"추가됨","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentLink"}}}}}}},"/documents/{id}/participants/{participant_id}":{"parameters":[{"$ref":"#/components/parameters/DocumentId"},{"name":"participant_id","in":"path","required":true,"schema":{"type":"string"}}],"delete":{"tags":["Participants"],"summary":"서명자 삭제","responses":{"200":{"description":"삭제됨","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentLink"}}}}}},"get":{"tags":["Participants"],"summary":"서명자 단건","responses":{"200":{"description":"서명자","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Participant"},{"$ref":"#/components/schemas/DocumentLink"}]}}}},"404":{"$ref":"#/components/responses/Error"}}},"patch":{"tags":["Participants"],"summary":"서명자 수정(발송 전)","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParticipantCreate"}}}},"responses":{"200":{"description":"수정됨","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Participant"},{"$ref":"#/components/schemas/DocumentLink"}]}}}},"409":{"$ref":"#/components/responses/Error"}}}},"/documents/{id}/send":{"parameters":[{"$ref":"#/components/parameters/DocumentId"}],"post":{"tags":["Documents"],"summary":"서명 요청 발송","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"expires_in_days":{"type":"integer"},"message":{"type":"string"}}}}}},"responses":{"200":{"description":"발송됨","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"400":{"$ref":"#/components/responses/Error"}}}},"/documents/{id}/remind":{"parameters":[{"$ref":"#/components/parameters/DocumentId"}],"post":{"tags":["Documents"],"summary":"리마인더 발송","responses":{"200":{"description":"발송됨","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentLink"}}}},"429":{"$ref":"#/components/responses/Error"}}}},"/files":{"post":{"tags":["Files"],"summary":"PDF 업로드","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","description":"base64 또는 data URL"},"content_type":{"type":"string"},"filename":{"type":"string"}}}}}},"responses":{"201":{"description":"업로드됨","content":{"application/json":{"schema":{"$ref":"#/components/schemas/File"}}}}}}},"/templates":{"post":{"tags":["Templates & Seals"],"summary":"반복어가 포함된 템플릿 생성","description":"content의 {{key}}를 편집기 반복어로 저장합니다. 개인/팀 범위만 지원하며 실제 서명값은 보존하지 않습니다.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateCreate"}}}},"responses":{"201":{"description":"생성된 템플릿","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateDetail"}}}},"400":{"$ref":"#/components/responses/Error"}}},"get":{"tags":["Templates & Seals"],"summary":"템플릿 목록","responses":{"200":{"description":"목록"}}}},"/seals":{"get":{"tags":["Templates & Seals"],"summary":"도장 목록","responses":{"200":{"description":"목록"}}},"post":{"tags":["Templates & Seals"],"summary":"도장 생성","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SealCreate"}}}},"responses":{"201":{"description":"생성됨","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Seal"}}}}}}},"/organization":{"get":{"tags":["Organization"],"summary":"조직 조회","description":"API 키가 속한 워크스페이스만 반환합니다. workspace_kind는 personal(기존 기본 공간) 또는 team(추가 공간)입니다. 팀 생성·초대 수락은 로그인한 사용자가 /app/workspace에서 관리하며 조직 API 키로 다른 공간에 가입할 수 없습니다.","responses":{"200":{"description":"조직","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["organization"]},"name":{"type":"string"},"workspace_kind":{"type":"string","enum":["personal","team"],"readOnly":true},"plan":{"type":"string"}}}}}}}}},"/workspaces":{"get":{"tags":["Organization"],"summary":"작업공간 연결 안내","description":"현재 키 발급자가 가입을 완료한 작업공간의 이름·ID만 최대100개 반환합니다. 다른 작업공간의 문서·템플릿·키·멤버 정보는 반환하지 않습니다. API 키는 원래 작업공간에 계속 고정되며, 전환하려면 대시보드에서 해당 작업공간의 API 키를 발급해 연결합니다. 발급자가 없는 레거시 키는 목록이 비어 있습니다. has_more=true이면 웹의 작업공간 목록을 확인하세요.","responses":{"200":{"description":"가입 작업공간 안내 (Cache-Control: private, no-store)","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/WorkspaceHint"}},"has_more":{"type":"boolean"},"current_workspace":{"$ref":"#/components/schemas/WorkspaceHint"},"explain":{"type":"string"},"next_action":{"$ref":"#/components/schemas/WorkspaceNextAction"}}}}}}}}},"/members":{"get":{"tags":["Organization"],"summary":"멤버 목록","responses":{"200":{"description":"목록"}}}},"/events":{"get":{"tags":["Organization"],"summary":"이벤트 조회","parameters":[{"name":"type","in":"query","schema":{"type":"string"}},{"name":"document_id","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"목록"}}}},"/events/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["Organization"],"summary":"이벤트 단건","responses":{"200":{"description":"이벤트"}}}},"/webhook_endpoints":{"post":{"tags":["Webhooks"],"summary":"웹훅 등록","description":"서명 헤더 Pactery-Signature: t=<unix>,v1=HMAC_SHA256(secret, `${t}.${body}`)","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointCreate"}}}},"responses":{"201":{"description":"등록됨(secret 1회 노출)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}}}},"get":{"tags":["Webhooks"],"summary":"웹훅 목록","responses":{"200":{"description":"목록"}}}},"/webhook_endpoints/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["Webhooks"],"summary":"웹훅 조회","responses":{"200":{"description":"웹훅"},"404":{"$ref":"#/components/responses/Error"}}},"patch":{"tags":["Webhooks"],"summary":"웹훅 수정","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointCreate"}}}},"responses":{"200":{"description":"수정됨"}}},"delete":{"tags":["Webhooks"],"summary":"웹훅 삭제","responses":{"200":{"description":"삭제됨"}}}},"/seals/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["Templates & Seals"],"summary":"도장 단건","responses":{"200":{"description":"도장","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Seal"}}}},"404":{"$ref":"#/components/responses/Error"}}},"delete":{"tags":["Templates & Seals"],"summary":"도장 삭제","responses":{"200":{"description":"삭제됨"},"404":{"$ref":"#/components/responses/Error"}}}},"/templates/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["Templates & Seals"],"summary":"템플릿 단건","responses":{"200":{"description":"본문·반복어 목록·내용 해시가 포함된 템플릿","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateDetail"}}}},"404":{"$ref":"#/components/responses/Error"}}},"patch":{"tags":["Templates & Seals"],"summary":"내 작업공간의 본문형 템플릿 수정","description":"가입한 member 이상 권한으로 수정합니다. 개인 템플릿은 발급자 본인 소유만 허용하며 공개 프리셋은 수정할 수 없습니다. 원본 문서와 이미 생성한 계약서에는 소급 적용하지 않습니다. 기본 템플릿 버전도 함께 갱신합니다.","parameters":[{"name":"If-Match","in":"header","required":true,"description":"GET 응답의 content_hash","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"minProperties":1,"properties":{"title":{"type":"string","maxLength":200},"description":{"type":"string","maxLength":2000},"content":{"type":"string","maxLength":200000,"description":"HTML 또는 JSON 문자열"},"variable_schema":{"type":"array","maxItems":100,"items":{"$ref":"#/components/schemas/TemplateVariable"}}}}}}},"responses":{"200":{"description":"수정된 템플릿","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateDetail"}}}},"400":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"}}}},"/templates/{id}/render":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"tags":["Templates & Seals"],"summary":"변수 값을 채운 템플릿 미리보기","description":"문서 생성·이메일·사용량 차감 없이 HTML과 content_hash를 반환합니다. 필수 변수 누락 및 알 수 없는 key는 400입니다. 첨부 PDF·좌표 필드 템플릿은 지원하지 않습니다.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"variables":{"$ref":"#/components/schemas/TemplateValues"}},"additionalProperties":false}}}},"responses":{"200":{"description":"렌더링 결과","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"template_render"},"template_id":{"type":"string"},"content":{"type":"string"},"content_format":{"const":"html"},"content_hash":{"type":"string"},"variables":{"type":"array","items":{"$ref":"#/components/schemas/TemplateVariable"}}}}}}},"400":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/webhook_endpoints/{id}/deliveries":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["Webhooks"],"summary":"웹훅 전송 기록","description":"event_type/status(succeeded|failed|exhausted)/attempts/response_status/next_retry_at","responses":{"200":{"description":"목록"},"404":{"$ref":"#/components/responses/Error"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API 키. Authorization: Bearer sk_live_... (테스트는 sk_test_...)."}},"parameters":{"DocumentId":{"name":"id","in":"path","required":true,"schema":{"type":"string"},"example":"doc_8sK2"}},"responses":{"WorkspaceHint":{"type":"object","required":["id","name","workspace_kind","current"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"workspace_kind":{"type":"string","enum":["personal","team"]},"current":{"type":"boolean"}}},"WorkspaceNextAction":{"type":"object","properties":{"code":{"type":"string","enum":["use_workspace_api_key"]},"url":{"type":"string","format":"uri","example":"https://pactery.com/app/settings/api-keys"}}},"Error":{"description":"에러","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"DocumentStatus":{"type":"string","enum":["draft","sent","completed","canceled"]},"SignatureRequestCreate":{"type":"object","required":["title","recipient"],"oneOf":[{"required":["content"],"not":{"required":["from_template"]}},{"required":["from_template"],"not":{"required":["content"]}}],"properties":{"document_id":{"type":"string","format":"uuid","description":"기존 미발송 초안을 같은 문서로 발송. document_version과 현재 title/content가 필요합니다. 이미 공유·발송·잠긴 문서, PDF 첨부 및 작성자 서명 필수 문서는 지원하지 않습니다."},"document_version":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"document_id 사용 시 필수. GET /documents/{id}의 content_version. 변경 시 409."},"from_template":{"type":"string","description":"템플릿 ID. content와 동시 지정 불가. variables에 GET /templates/{id}의 variables[].key별 값을 지정합니다."},"template_content_hash":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"선택 사항. 미리보기의 content_hash를 전달하면 템플릿 변경 시 409 template_changed. 재시도는 최초 문서 스냅샷을 재사용합니다."},"title":{"type":"string","maxLength":200},"content":{"oneOf":[{"type":"string","maxLength":200000},{"type":"object","description":"TipTap JSON 문서(type=doc)"}],"description":"계약 본문. HTML은 허용된 문서 서식만 보존하고 스크립트와 위험한 속성은 제거합니다."},"content_format":{"type":"string","enum":["auto","html","text"],"default":"auto"},"variables":{"type":"object","additionalProperties":true,"description":"본문의 {{key}} 값을 치환합니다. HTML 본문에서도 변수 값은 텍스트로만 삽입됩니다."},"recipient":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email"},"name":{"type":"string","maxLength":100},"phone":{"type":"string","description":"미리 아는 경우 지정. 없으면 받는 분이 서명할 때 휴대폰 본인인증을 진행합니다."}}},"author_name":{"type":"string","maxLength":100},"message":{"type":"string","maxLength":2000,"description":"이메일 본문 상단의 요청 안내문"},"expires_in_days":{"type":"integer","minimum":1,"maximum":365,"default":30},"append_signature_field":{"type":"boolean","default":true,"description":"본문에 받는 분 서명란이 없으면 끝에 자동으로 추가합니다."},"require_creator_signature":{"type":"boolean","default":false,"description":"true이면 받는 분 서명 후에도 작성자 서명이 완료되어야 최종 체결됩니다."},"metadata":{"type":"object","additionalProperties":true}}},"TemplateVariable":{"type":"object","required":["key","label"],"properties":{"key":{"type":"string","pattern":"^[A-Za-z0-9_.-]{1,100}$"},"label":{"type":"string","maxLength":100},"required":{"type":"boolean","default":true}},"additionalProperties":false},"TemplateValues":{"type":"object","additionalProperties":{"oneOf":[{"type":"string","maxLength":10000},{"type":"number"},{"type":"boolean"}]}},"TemplateCreate":{"type":"object","required":["title","content"],"properties":{"title":{"type":"string","maxLength":200},"content":{"oneOf":[{"type":"string","maxLength":200000},{"type":"object","description":"TipTap doc JSON"}]},"content_format":{"type":"string","enum":["auto","html","text"],"default":"auto"},"description":{"type":"string","maxLength":2000},"scope":{"type":"string","enum":["personal","team"],"default":"personal"},"variable_schema":{"type":"array","maxItems":100,"items":{"$ref":"#/components/schemas/TemplateVariable"}}},"additionalProperties":false},"TemplateDetail":{"type":"object","properties":{"id":{"type":"string"},"object":{"const":"template"},"title":{"type":"string"},"category":{"type":["string","null"]},"description":{"type":["string","null"]},"scope":{"type":"string"},"created_at":{"type":["string","null"]},"content":{"type":"string"},"content_format":{"const":"html"},"content_hash":{"type":"string"},"variables":{"type":"array","items":{"$ref":"#/components/schemas/TemplateVariable"}}}},"SignatureRequest":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"signature_request"},"document":{"$ref":"#/components/schemas/Document"},"recipient":{"$ref":"#/components/schemas/Participant"},"sign_url":{"type":"string","format":"uri","description":"Recipient bearer URL. Live deliveries with a known sender use an opaque /s/{code} redirect without referral query parameters. Treat as opaque; do not reconstruct or parse it.","example":"https://pactery.com/s/Ab3dEf6hJk9m"},"delivery":{"type":"object","properties":{"channel":{"type":"string","const":"email"},"status":{"type":"string","enum":["sent","simulated"]},"message_id":{"type":"string"},"attempted_at":{"type":"string","format":"date-time"}}},"livemode":{"type":"boolean"},"expires_at":{"type":"string","format":"date-time"},"created_at":{"type":"string","format":"date-time"},"document_url":{"type":["string","null"],"format":"uri","description":"로그인한 작성자/워크스페이스 권한자용 바로가기. AI는 작업 완료 후 이 링크를 사용자에게 전달합니다. 공개 열람 또는 서명 권한을 부여하지 않습니다. 삭제되었거나 short_id가 없는 문서는 null.","example":"https://pactery.com/app/docs/abc123/manage"}},"required":["document_url"]},"DocumentCreate":{"type":"object","required":["title"],"properties":{"allow_incomplete_variables":{"type":"boolean","default":false,"description":"from_template 초안 생성 시에만 필수 반복어의 미입력을 허용합니다. 미입력 작성자 칸은 그대로 남으며 담당자가 확인·완성한 뒤 발송해야 합니다. /render와 /signature_requests에는 적용되지 않습니다."},"require_creator_signature":{"type":"boolean","default":true,"description":"작성자 서명 필요 여부. false이면 받는 분 서명으로 체결합니다."},"title":{"type":"string"},"content":{"oneOf":[{"type":"string"},{"type":"object"}],"description":"계약 본문 HTML, 일반 텍스트 또는 TipTap JSON(file_url과 택일)"},"content_format":{"type":"string","enum":["auto","html","text"],"default":"auto"},"file_url":{"type":"string","description":"업로드 PDF URL(content와 택일)"},"from_template":{"type":"string"},"variables":{"type":"object","additionalProperties":true},"author_name":{"type":"string"},"metadata":{"type":"object","additionalProperties":true}}},"DocumentUpdate":{"type":"object","properties":{"title":{"type":"string"},"content":{"oneOf":[{"type":"string"},{"type":"object"}]},"content_format":{"type":"string","enum":["auto","html","text"],"default":"auto"},"variables":{"type":"object","additionalProperties":true},"author_name":{"type":"string"},"metadata":{"type":"object","additionalProperties":true}}},"Document":{"type":"object","properties":{"content":{"type":"object","nullable":true,"description":"상세 GET에서 반환하는 현재 TipTap JSON 본문. PDF 파일 내용은 포함하지 않습니다."},"content_version":{"type":"string","description":"상세 GET에서 반환하는 현재 문서 버전 해시. PATCH If-Match 및 기존 초안 발송에 사용합니다."},"id":{"type":"string","example":"doc_8sK2"},"object":{"type":"string","example":"document"},"title":{"type":"string"},"status":{"$ref":"#/components/schemas/DocumentStatus"},"document_type":{"type":"string","enum":["general","signing"],"readOnly":true,"description":"문서 종류. 기존 문서는 signing입니다. general 문서는 서명 발송이 불가능하며 종류 변경은 Pactery 작성 화면에서 수행합니다."},"edit_locked_at":{"type":"string","format":"date-time","nullable":true,"readOnly":true,"description":"편집 잠금 시각. 잠긴 문서의 내용·필드 수정은 409 document_edit_locked. 완료 계약 및 추가 서명 가능 여부와 별개입니다."},"recipient_verification":{"type":"object","readOnly":true,"description":"문서 설정에 따른 /d 공유 링크의 기본 수신자 인증 정책. 해외 문서는 이메일 OTP가 기본이며 지원 국가의 SMS를 선택할 수 있습니다. 서버가 해외 SMS 발송 실패를 확인한 경우에만 조건부로 signature_only 대체 경로를 제공합니다(available_methods 기본 목록과 별개). signature_only는 이름·서명 이미지·동의를 받고 별도 본인 인증을 수행하지 않는 방식입니다. 인증 코드·인증 증명은 공개 API로 노출하지 않습니다. 별도 참여자 토큰의 인증 정책은 변경하지 않습니다. English 버튼은 언어만 변경합니다.","properties":{"international":{"type":"boolean"},"default_method":{"type":"string","enum":["email_otp","sms_pin","signature_only"]},"available_methods":{"type":"array","items":{"type":"string","enum":["email_otp","sms_pin","signature_only"]}}}},"author_name":{"type":"string"},"participants":{"type":"array","items":{"$ref":"#/components/schemas/Participant"}},"fields":{"type":"array","items":{"$ref":"#/components/schemas/Field"}},"created_at":{"type":"string","format":"date-time"},"completed_at":{"type":"string","format":"date-time","nullable":true},"document_url":{"type":["string","null"],"format":"uri","description":"로그인한 작성자/워크스페이스 권한자용 바로가기. AI는 작업 완료 후 이 링크를 사용자에게 전달합니다. 공개 열람 또는 서명 권한을 부여하지 않습니다. 삭제되었거나 short_id가 없는 문서는 null.","example":"https://pactery.com/app/docs/abc123/manage"}},"required":["document_url"]},"DocumentList":{"type":"object","properties":{"object":{"type":"string","example":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Document"}},"has_more":{"type":"boolean"}}},"ParticipantCreate":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"phone":{"type":"string"},"email":{"type":"string","format":"email"},"role":{"type":"string","enum":["signer","cc"],"default":"signer"},"signing_order":{"type":"integer"},"auth":{"type":"string","enum":["sms_pin","none"],"default":"sms_pin"}}},"Participant":{"type":"object","properties":{"id":{"type":"string","example":"par_1a2b"},"object":{"type":"string","example":"participant"},"name":{"type":"string"},"role":{"type":"string","enum":["signer","cc"]},"signing_order":{"type":"integer"},"auth":{"type":"string","enum":["sms_pin","none"]},"status":{"type":"string","enum":["pending","signed","rejected"]},"signed_at":{"type":"string","format":"date-time","nullable":true}}},"Field":{"type":"object","required":["participant_id","type","page","x","y","width","height"],"properties":{"participant_id":{"type":"string"},"type":{"type":"string","enum":["signature","seal"]},"page":{"type":"integer","minimum":1},"x":{"type":"number","minimum":0,"maximum":100,"description":"문서 너비/높이 대비 백분율(0~100)"},"y":{"type":"number","minimum":0,"maximum":100,"description":"문서 너비/높이 대비 백분율(0~100)"},"width":{"type":"number","minimum":0,"maximum":100,"description":"문서 너비/높이 대비 백분율(0~100)"},"height":{"type":"number","minimum":0,"maximum":100,"description":"문서 너비/높이 대비 백분율(0~100)"},"required":{"type":"boolean","default":true},"upload_only":{"type":"boolean","default":false}}},"SealCreate":{"type":"object","required":["name","source"],"properties":{"name":{"type":"string"},"type":{"type":"string","enum":["corporate","usage"],"default":"usage"},"source":{"type":"string","enum":["generated","uploaded"]},"company_name":{"type":"string"},"image":{"type":"string","description":"uploaded일 때 base64 data URL"}}},"Seal":{"type":"object","properties":{"id":{"type":"string","example":"seal_4c"},"object":{"type":"string","example":"seal"},"name":{"type":"string"},"type":{"type":"string","enum":["corporate","usage"]},"source":{"type":"string","enum":["generated","uploaded"]},"restricted":{"type":"boolean"}}},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string","enum":["authentication_error","permission_error","invalid_request_error","not_found_error","conflict_error","rate_limit_error","api_error"]},"code":{"type":"string"},"message":{"type":"string"},"param":{"type":"string"},"explain":{"type":"string","description":"인증 후 리소스404에서 ID·작업공간 확인 방법을 설명합니다. 리소스가 다른 공간에 존재하는지는 확인하거나 공개하지 않습니다."},"current_workspace":{"$ref":"#/components/schemas/WorkspaceHint"},"workspaces":{"type":"array","items":{"$ref":"#/components/schemas/WorkspaceHint"}},"has_more_workspaces":{"type":"boolean"},"next_action":{"$ref":"#/components/schemas/WorkspaceNextAction"}}}}},"File":{"type":"object","properties":{"object":{"type":"string","example":"file"},"key":{"type":"string"},"content_type":{"type":"string"},"size":{"type":"integer"},"filename":{"type":"string","nullable":true},"url":{"type":"string","nullable":true,"description":"임시 presigned URL"}}},"WebhookEndpointCreate":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri","description":"공개 HTTPS URL(443 포트). 사설·루프백·링크 로컬·예약 IP, URL 인증정보 및 리다이렉트는 허용하지 않습니다. 등록·변경·재전송 시 DNS를 검증합니다."},"events":{"type":"array","items":{"type":"string"},"description":"구독 이벤트(빈 배열=전체). 예: document.completed"},"enabled":{"type":"boolean","default":true}}},"WebhookEndpoint":{"type":"object","properties":{"id":{"type":"string","example":"whe_1a2b"},"object":{"type":"string","example":"webhook_endpoint"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"secret":{"type":"string","description":"whsec_... 등록 응답에서만 노출"},"created_at":{"type":"string","format":"date-time"}}},"DocumentLink":{"type":"object","required":["document_url"],"properties":{"document_url":{"type":["string","null"],"format":"uri","description":"로그인한 작성자/워크스페이스 권한자용 바로가기. AI는 작업 완료 후 이 링크를 사용자에게 전달합니다. 공개 열람 또는 서명 권한을 부여하지 않습니다. 삭제되었거나 short_id가 없는 문서는 null.","example":"https://pactery.com/app/docs/abc123/manage"}}}}},"externalDocs":{"description":"AI 에이전트: API 등록·문서 작업·바로가기 전달 가이드","url":"https://pactery.com/developers/ai"}}