{"openapi":"3.1.0","info":{"title":"Companify API","version":"1.0.0-alpha","description":"会社法人の設立と、その後の運営に必要な最低限のバックオフィス業務をプログラムから扱う API です。対象は Companify 本体と同じで、会社 1 件を Company Document（JSON）として出し入れします。現在は設立の範囲（会社の情報、設立登記の書類、設立後の届出）を提供しており、運営に関わる操作は順次追加します。認証は API キー（Authorization: Bearer）。書類の確定を含め、すべての操作を API から行えます。"},"servers":[{"url":"https://companify.app/api/v1"}],"externalDocs":{"url":"https://companify.app/docs/api","description":"API リファレンス"},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"ログイン後のアカウント設定（`/account/settings`）で作成する API キー。スコープ: company:read, company:write, document:generate, document:confirm, filing:write。利用者が作成するキーにはスコープが付かず、すべての操作ができます"}},"schemas":{"CompanyDocument":{"type":"object","properties":{"$schema":{"type":"string"},"company":{"type":"object","properties":{"tradeName":{"type":"string","maxLength":200},"tradeNameKana":{"type":"string","maxLength":200},"tradeNameRoman":{"type":"string","maxLength":200},"businessPurposes":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":500}},"headOfficeAddress":{"type":"object","properties":{"postalCode":{"type":"string","maxLength":200},"prefecture":{"type":"string","maxLength":200},"city":{"type":"string","maxLength":200},"street":{"type":"string","maxLength":200},"building":{"type":"string","maxLength":200}},"required":["postalCode","prefecture","city","street"],"additionalProperties":false},"capitalAmount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"fiscalYearStartMonth":{"type":"integer","minimum":1,"maximum":12},"plannedIncorporationDate":{"type":"string"},"articlesDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["tradeName","tradeNameKana","businessPurposes","headOfficeAddress","capitalAmount","fiscalYearStartMonth","plannedIncorporationDate","articlesDate"],"additionalProperties":false},"members":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"familyName":{"type":"string","maxLength":200},"givenName":{"type":"string","maxLength":200},"familyNameKana":{"type":"string","maxLength":200},"givenNameKana":{"type":"string","maxLength":200},"address":{"type":"object","properties":{"postalCode":{"type":"string","maxLength":200},"prefecture":{"type":"string","maxLength":200},"city":{"type":"string","maxLength":200},"street":{"type":"string","maxLength":200},"building":{"type":"string","maxLength":200}},"required":["postalCode","prefecture","city","street"],"additionalProperties":false},"investmentAmount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"isManagingMember":{"type":"boolean"},"isRepresentative":{"type":"boolean"},"paidAmount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"paidAt":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["familyName","givenName","familyNameKana","givenNameKana","address","investmentAmount","isManagingMember","isRepresentative","paidAmount","paidAt"],"additionalProperties":false}},"teikanOptions":{"type":"object","properties":{"publicNotice":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"official_gazette"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"electronic"},"url":{"type":"string","format":"uri"}},"required":["kind","url"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"newspaper"},"name":{"type":"string","minLength":1}},"required":["kind","name"],"additionalProperties":false}]},"representativeSelection":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"mutual_election"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"designated_in_articles"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"all_members"}},"required":["kind"],"additionalProperties":false}]},"memberChangeRule":{"type":"string","enum":["unanimous","managing_majority"]},"profitDistribution":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"by_investment"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"custom"},"text":{"type":"string","minLength":1}},"required":["kind","text"],"additionalProperties":false}]},"inheritanceSuccession":{"type":"boolean"},"managingMemberTerm":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"none"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"fixed"},"years":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["kind","years"],"additionalProperties":false}]},"managingMemberCompensation":{"type":"string","enum":["not_specified","unanimous_consent"]},"executionDecisionMethod":{"type":"string","enum":["majority","unanimous","individual"]},"includeAmendmentDissolutionChapter":{"type":"boolean"}},"required":["publicNotice","representativeSelection","memberChangeRule","profitDistribution","inheritanceSuccession","managingMemberTerm","managingMemberCompensation","executionDecisionMethod","includeAmendmentDissolutionChapter"],"additionalProperties":false},"filingAnswers":{"type":"object","properties":{"paysSalary":{"type":"string","enum":["yes","no","unknown"]},"under10Payees":{"type":"string","enum":["yes","no","unknown"]},"hiresEmployees":{"type":"string","enum":["yes","no","unknown"]},"businessCustomers":{"type":"string","enum":["yes","no","unknown"]}},"additionalProperties":false},"confirmations":{"type":"array","items":{}},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["company","members","teikanOptions"],"additionalProperties":false},"DocumentPayload":{"type":"object","description":"Company Document のうち company / members / teikanOptions","properties":{"company":{"type":"object","properties":{"tradeName":{"type":"string","maxLength":200},"tradeNameKana":{"type":"string","maxLength":200},"tradeNameRoman":{"type":"string","maxLength":200},"businessPurposes":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":500}},"headOfficeAddress":{"type":"object","properties":{"postalCode":{"type":"string","maxLength":200},"prefecture":{"type":"string","maxLength":200},"city":{"type":"string","maxLength":200},"street":{"type":"string","maxLength":200},"building":{"type":"string","maxLength":200}},"required":["postalCode","prefecture","city","street"],"additionalProperties":false},"capitalAmount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"fiscalYearStartMonth":{"type":"integer","minimum":1,"maximum":12},"plannedIncorporationDate":{"type":"string"},"articlesDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["tradeName","tradeNameKana","businessPurposes","headOfficeAddress","capitalAmount","fiscalYearStartMonth","plannedIncorporationDate","articlesDate"],"additionalProperties":false},"members":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"familyName":{"type":"string","maxLength":200},"givenName":{"type":"string","maxLength":200},"familyNameKana":{"type":"string","maxLength":200},"givenNameKana":{"type":"string","maxLength":200},"address":{"type":"object","properties":{"postalCode":{"type":"string","maxLength":200},"prefecture":{"type":"string","maxLength":200},"city":{"type":"string","maxLength":200},"street":{"type":"string","maxLength":200},"building":{"type":"string","maxLength":200}},"required":["postalCode","prefecture","city","street"],"additionalProperties":false},"investmentAmount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"isManagingMember":{"type":"boolean"},"isRepresentative":{"type":"boolean"},"paidAmount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"paidAt":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["familyName","givenName","familyNameKana","givenNameKana","address","investmentAmount","isManagingMember","isRepresentative","paidAmount","paidAt"],"additionalProperties":false}},"teikanOptions":{"type":"object","properties":{"publicNotice":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"official_gazette"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"electronic"},"url":{"type":"string","format":"uri"}},"required":["kind","url"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"newspaper"},"name":{"type":"string","minLength":1}},"required":["kind","name"],"additionalProperties":false}]},"representativeSelection":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"mutual_election"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"designated_in_articles"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"all_members"}},"required":["kind"],"additionalProperties":false}]},"memberChangeRule":{"type":"string","enum":["unanimous","managing_majority"]},"profitDistribution":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"by_investment"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"custom"},"text":{"type":"string","minLength":1}},"required":["kind","text"],"additionalProperties":false}]},"inheritanceSuccession":{"type":"boolean"},"managingMemberTerm":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"none"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"fixed"},"years":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["kind","years"],"additionalProperties":false}]},"managingMemberCompensation":{"type":"string","enum":["not_specified","unanimous_consent"]},"executionDecisionMethod":{"type":"string","enum":["majority","unanimous","individual"]},"includeAmendmentDissolutionChapter":{"type":"boolean"}},"required":["publicNotice","representativeSelection","memberChangeRule","profitDistribution","inheritanceSuccession","managingMemberTerm","managingMemberCompensation","executionDecisionMethod","includeAmendmentDissolutionChapter"],"additionalProperties":false}},"required":["company","members","teikanOptions"]},"Me":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"displayName":{"type":"string"},"email":{"type":"string"}}},"companies":{"type":"array","items":{"$ref":"#/components/schemas/CompanySummary"}},"scopes":{"type":"array","items":{"type":"string","enum":["company:read","company:write","document:generate","document:confirm","filing:write"]}}}},"CompanySummary":{"type":"object","properties":{"id":{"type":"string"},"tradeName":{"type":"string"},"status":{"type":"string","enum":["planning","incorporating","active"]},"role":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"}}},"CompanyList":{"type":"object","properties":{"companies":{"type":"array","items":{"$ref":"#/components/schemas/CompanySummary"}}}},"Check":{"type":"object","properties":{"complete":{"type":"boolean"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"Company Document 内の位置（例: members.0.address.city）"},"message":{"type":"string"}},"required":["path","message"]}},"confirmations":{"type":"array","items":{"type":"object","properties":{"documentType":{"type":"string","enum":["teikan","kettei","shunin"]},"state":{"type":"string","enum":["unconfirmed","confirmed","stale"]}}}},"progress":{"type":"object","properties":{"stage":{"type":"string","enum":["company","members","documents","payments","incorporation","filings"]},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"done":{"type":"boolean"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"Company Document 内の位置（例: members.0.address.city）"},"message":{"type":"string"}},"required":["path","message"]}}}}}}}}},"Validation":{"type":"object","properties":{"complete":{"type":"boolean"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"Company Document 内の位置（例: members.0.address.city）"},"message":{"type":"string"}},"required":["path","message"]}}}},"Filings":{"type":"object","properties":{"answers":{"type":"object","properties":{"paysSalary":{"type":"string","enum":["yes","no","unknown"]},"under10Payees":{"type":"string","enum":["yes","no","unknown"]},"hiresEmployees":{"type":"string","enum":["yes","no","unknown"]},"businessCustomers":{"type":"string","enum":["yes","no","unknown"]}},"additionalProperties":false},"filings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"agency":{"type":"string"},"status":{"type":"string","enum":["required","recommended","excluded"]},"reason":{"type":"string"},"dueDate":{"type":["string","null"],"format":"date"},"requiresCorporateNumber":{"type":"boolean"},"completed":{"type":["object","null"],"properties":{"completedAt":{"type":"string","format":"date-time"},"dueDate":{"type":["string","null"],"format":"date"}}}}}}}},"Events":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"eventType":{"type":"string"},"actorType":{"type":"string","enum":["user","api"]},"actorId":{"type":["string","null"]},"entityType":{"type":["string","null"]},"entityId":{"type":["string","null"]},"payload":{"type":"object"},"recordedAt":{"type":"string","format":"date-time"}}}},"nextCursor":{"type":["string","null"]}}},"ConfirmRequest":{"type":"object","properties":{"articlesDate":{"type":"string","format":"date","description":"定款作成日。定款を初めて確定するときだけ使われる"}}},"ConfirmResult":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]},"documentType":{"type":"string"}},"required":["ok","documentType"]},"Problem":{"type":"object","description":"application/problem+json（RFC 9457）。入力した値（氏名・住所・商号）は含まれません","properties":{"type":{"type":"string","description":"`https://companify.app/docs/api#error-<slug>`"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}},"paths":{"/me":{"get":{"operationId":"getMe","summary":"自分の情報と、操作できる会社の一覧","description":"API キーの持ち主の情報と、その人が社員になっている会社の一覧を返します。`scopes` はこのキーで許可されている操作です。スコープの無いキーではすべての操作が並びます。","security":[{"apiKey":["company:read"]}],"x-companify-scope":"company:read","responses":{"200":{"description":"自分の情報と会社の一覧","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"401":{"description":"認証が必要です。キーが無いか、失効しています","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"このキーのスコープでは許可されていない操作です","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/companies":{"get":{"operationId":"listCompanies","summary":"会社の一覧","description":"自分が社員になっている会社を、作成が新しい順に返します。会社の内容は `GET /companies/{id}` で取得します。","security":[{"apiKey":["company:read"]}],"x-companify-scope":"company:read","responses":{"200":{"description":"会社の一覧","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyList"}}}},"401":{"description":"認証が必要です。キーが無いか、失効しています","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"このキーのスコープでは許可されていない操作です","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/companies/{id}":{"get":{"operationId":"getCompany","summary":"会社を Company Document 形式で取得（エクスポート）","description":"会社・社員・定款オプション・届出の問診の答えに、読み取り専用の `confirmations`（書類の確定記録）と `meta`（id や状態）を添えて返します。","parameters":[{"name":"id","in":"path","required":true,"description":"会社の id。`GET /companies` または `GET /me` で取得できます","schema":{"type":"string"}}],"security":[{"apiKey":["company:read"]}],"x-companify-scope":"company:read","responses":{"200":{"description":"Company Document","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyDocument"}}}},"401":{"description":"認証が必要です。キーが無いか、失効しています","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"このキーのスコープでは許可されていない操作です","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"会社・届出・書類の種別が見つかりません。他人の会社もこの応答になります","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/companies/{id}/check":{"get":{"operationId":"checkCompany","summary":"入力の不足・書類の確定状態・進捗","description":"書類を生成できる状態か（`complete` と不足している項目）、定款・決定書・就任承諾書の確定が有効か、次に進む段階を返します。画面のダッシュボードと同じ判定です。","parameters":[{"name":"id","in":"path","required":true,"description":"会社の id。`GET /companies` または `GET /me` で取得できます","schema":{"type":"string"}}],"security":[{"apiKey":["company:read"]}],"x-companify-scope":"company:read","responses":{"200":{"description":"判定の結果","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Check"}}}},"401":{"description":"認証が必要です。キーが無いか、失効しています","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"このキーのスコープでは許可されていない操作です","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"会社・届出・書類の種別が見つかりません。他人の会社もこの応答になります","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/companies/{id}/filings":{"get":{"operationId":"listFilings","summary":"設立後の届出の一覧と期日・提出状況","description":"問診の答えと、この会社に必要な届出の一覧を返します。`dueDate` は設立日から計算できるものだけに入り、自治体ごとに異なるものは null です。設立日が未記録ならすべて null になります。","parameters":[{"name":"id","in":"path","required":true,"description":"会社の id。`GET /companies` または `GET /me` で取得できます","schema":{"type":"string"}}],"security":[{"apiKey":["company:read"]}],"x-companify-scope":"company:read","responses":{"200":{"description":"届出の一覧","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Filings"}}}},"401":{"description":"認証が必要です。キーが無いか、失効しています","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"このキーのスコープでは許可されていない操作です","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"会社・届出・書類の種別が見つかりません。他人の会社もこの応答になります","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/companies/{id}/events":{"get":{"operationId":"listEvents","summary":"操作履歴の取得","description":"新しい順に返します。`nextCursor` が返ったら `?cursor=` に渡すと続きを取得できます。`payload` に氏名や住所は含まれません。","parameters":[{"name":"id","in":"path","required":true,"description":"会社の id。`GET /companies` または `GET /me` で取得できます","schema":{"type":"string"}},{"name":"cursor","in":"query","description":"前の応答で返った `nextCursor`","schema":{"type":"string"}},{"name":"type","in":"query","description":"イベントの種別で絞り込みます（例: `company.updated`）","schema":{"type":"string"}},{"name":"limit","in":"query","description":"1 回に返す件数。1〜200、省略時は 50","schema":{"type":"integer","minimum":1,"maximum":200}}],"security":[{"apiKey":["company:read"]}],"x-companify-scope":"company:read","responses":{"200":{"description":"操作履歴","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Events"}}}},"401":{"description":"認証が必要です。キーが無いか、失効しています","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"このキーのスコープでは許可されていない操作です","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"会社・届出・書類の種別が見つかりません。他人の会社もこの応答になります","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/companies/{id}/documents/{type}":{"post":{"operationId":"generateCompanyDocument","summary":"保存済みの会社から PDF を生成","description":"リクエスト本文は不要です。入力が揃っていなければ 400 と不足している項目を返します。生成すると操作履歴に `document.generated` が残ります。`?preview=1` を付けない場合は、先に定款作成日が確定している必要があります。","parameters":[{"name":"id","in":"path","required":true,"description":"会社の id。`GET /companies` または `GET /me` で取得できます","schema":{"type":"string"}},{"name":"type","in":"path","required":true,"description":"書類の種別。teikan = 定款、kettei = 決定書、shunin = 就任承諾書、haraikomi = 払込証明書","schema":{"type":"string","enum":["teikan","kettei","shunin","haraikomi"]}},{"name":"preview","in":"query","description":"`1` を指定するとプレビューになります。定款作成日が未確定でも当日の日付で生成し、ファイル名に「プレビュー」が付きます","schema":{"type":"string","enum":["1"]}}],"security":[{"apiKey":["document:generate"]}],"x-companify-scope":"document:generate","responses":{"200":{"description":"PDF（application/pdf）"},"400":{"description":"リクエスト本文の形式が正しくないか、入力が揃っていません","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"認証が必要です。キーが無いか、失効しています","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"このキーのスコープでは許可されていない操作です","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"会社・届出・書類の種別が見つかりません。他人の会社もこの応答になります","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/companies/{id}/documents/{type}/confirm":{"post":{"operationId":"confirmCompanyDocument","summary":"書類を確定","description":"いまの入力内容のハッシュを記録して、その書類を確定します。先に `?preview=1` で PDF を、または Company Document を確認してから呼んでください。確定後に入力を変えると確定は失効します（`/check` の `stale`）。定款を初めて確定するときは `articlesDate`（定款作成日）を渡します。決定書と就任承諾書は定款の確定後にしか確定できません。","parameters":[{"name":"id","in":"path","required":true,"description":"会社の id。`GET /companies` または `GET /me` で取得できます","schema":{"type":"string"}},{"name":"type","in":"path","required":true,"description":"確定する書類。teikan = 定款、kettei = 決定書、shunin = 就任承諾書","schema":{"type":"string","enum":["teikan","kettei","shunin"]}}],"requestBody":{"required":true,"description":"定款を初めて確定するときの定款作成日（YYYY-MM-DD）。省略可","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmRequest"}}}},"security":[{"apiKey":["document:confirm"]}],"x-companify-scope":"document:confirm","responses":{"200":{"description":"確定した","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmResult"}}}},"400":{"description":"前提を満たしていない（入力が揃っていない、定款が未確定、日付が不正）。detail に理由","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"認証が必要です。キーが無いか、失効しています","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"このキーのスコープでは許可されていない操作です","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"会社・届出・書類の種別が見つかりません。他人の会社もこの応答になります","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/documents/{type}":{"post":{"operationId":"generateDocument","summary":"リクエスト本文から PDF を生成（認証不要）","description":"サーバに保存されている情報は使いません。リクエスト本文は Company Document の `company` / `members` / `teikanOptions` で、64KB まで、`Content-Type: application/json` が必須です。失敗時は理由をテキスト（text/plain）で返します。このエンドポイントだけ problem+json ではないのは、登録前の下書きプレビューと互換にするためです。","parameters":[{"name":"type","in":"path","required":true,"description":"書類の種別。teikan = 定款、kettei = 決定書、shunin = 就任承諾書、haraikomi = 払込証明書","schema":{"type":"string","enum":["teikan","kettei","shunin","haraikomi"]}},{"name":"preview","in":"query","description":"`1` を指定するとプレビューになります。定款作成日が未確定でも当日の日付で生成し、ファイル名に「プレビュー」が付きます","schema":{"type":"string","enum":["1"]}}],"requestBody":{"required":true,"description":"生成に必要な値","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentPayload"}}}},"security":[],"x-companify-scope":null,"responses":{"200":{"description":"PDF（application/pdf）"},"400":{"description":"リクエスト本文の形式が正しくないか、入力が揃っていません（text/plain）"},"404":{"description":"書類の種別が見つかりません"},"413":{"description":"リクエスト本文が 64KB を超えています"},"415":{"description":"Content-Type が application/json ではありません"}}}},"/validate":{"post":{"operationId":"validateDocument","summary":"Company Document の入力が揃っているかを検査（認証不要）","description":"サーバに保存されている情報は使いません。書類を生成できる状態かと、不足している項目を返します。","requestBody":{"required":true,"description":"Company Document","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyDocument"}}}},"security":[],"x-companify-scope":null,"responses":{"200":{"description":"判定の結果","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Validation"}}}},"400":{"description":"リクエスト本文の形式が正しくないか、入力が揃っていません","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"413":{"description":"リクエスト本文が 64KB を超えています","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"415":{"description":"Content-Type が application/json ではありません","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/openapi.json":{"get":{"operationId":"getOpenApi","summary":"OpenAPI 3.1 の定義","description":"この API の機械可読な定義です。リファレンス `/docs/api` はこの定義から生成しています。","security":[],"x-companify-scope":null,"responses":{"200":{"description":"OpenAPI 3.1 の JSON"}}}}}}