# JSON Ledger APIで管理する

> JSON Ledger APIでuserと権利、identity providerとparty、DARとpackageのvettingを管理するHTTPのエンドポイントを、章の中の図解で追います。

- URL: https://cardene.dev/diagrams/canton-json-admin-endpoints
- 公開日: 2026-11-23
- 更新日: 2026-11-23
- トピック: Blockchain
- タグ: Canton
- 親の図解: [Canton Networkの全体像](https://cardene.dev/diagrams/canton-network.md): トランザクションの中身を関わるpartyにだけ見せるCanton Networkについて、部品ごとの役割と、1つのトランザクションが部品の間をどう流れるかを段ごとに追います。
- 子の図解: [JSON APIでuserの権利を扱う](https://cardene.dev/diagrams/canton-json-users.md): JSON Ledger APIでuserを一覧にして取得し、更新し、identity providerを移し、消す呼び出しと、userの権利を読んで取り消す呼び出しを、欄の決まりまで追います。
- 子の図解: [認証の発行元とpartyを直す](https://cardene.dev/diagrams/canton-json-idp-party.md): JSON Ledger APIでidentity providerの設定とpartyの詳細を読み、更新して消す呼び出しと、版を比べて古いpartyの更新を拒む形を、欄の決まりまで追います。
- 子の図解: [partyを割り当てて認証を設定する](https://cardene.dev/diagrams/canton-json-party-allocation.md): JSON Ledger APIで、Participant Nodeにpartyを割り当てる呼び出しと、JWTを出すidentity providerの設定を作る呼び出しを、必須と任意の欄と応答の形まで追います。
- 子の図解: [JSONでvettingを確かめ変える](https://cardene.dev/diagrams/canton-json-package-vetting.md): JSON Ledger APIでDARを上げて検証し、vettingの更新と一覧の4つのエンドポイントで、どのpackageをどの期間vettingするかを確かめて変える呼び出しを追います。

前の章「JSON Ledger APIの読み出し」では、JSON Ledger APIで台帳から読む側を追いました。
この章では、同じJSON Ledger APIで、userとpartyとidentity providerとpackageを管理するHTTPのエンドポイントを追います。
gRPCのLedger APIで同じことを書いたのは、章「userと権利」と章「partyの割り当てとhost」と章「packageのuploadとvetting」なので、仕組みはその章の頁を指し、この章はJSONの呼び方と欄の形を書きます。
HTTPは、ブラウザやプログラムがWebのサーバーと要求と応答をやり取りする決まりです。

:::details gRPC
gRPCは、Googleが開発した、ネットワーク越しに別のプログラムの処理を呼び出すための通信の仕組みです。
:::

:::details JSON
JSONは、データを文字で表すための形式で、Webのプログラムどうしのデータのやり取りに広く使われています。
:::

https://cardene.dev/diagrams/canton-ledger-user-rights

https://cardene.dev/diagrams/canton-party-allocation-hosting

https://cardene.dev/diagrams/canton-package-upload-vetting

まず、userと権利を扱うエンドポイントを見ます。
userを頁ごとに一覧にして取得し、更新し、消す呼び出しと、userの割り当て先のidentity providerを変える呼び出しと、権利を読んで取り消す呼び出しを追います。

https://cardene.dev/diagrams/canton-json-users

次に、identity providerの設定とpartyの詳細を直すエンドポイントを見ます。
設定とpartyの詳細を読む呼び出しと、partyの更新で、読んだ版を更新の要求に添えた時に版を比べて古い更新を拒む形を追います。

https://cardene.dev/diagrams/canton-json-idp-party

続いて、partyを割り当てるエンドポイントと、identity providerの設定を作るエンドポイントを見ます。
割り当ての本文の欄と、割り当てた後の応答と、設定を作る時の決まりを追います。

https://cardene.dev/diagrams/canton-json-party-allocation

最後に、DARを検証してアップロードするエンドポイントと、packageのvettingを照会して更新するエンドポイントを見ます。
vettingの期間と、変更を適用せずに試すドライランの指定と、vettingの一覧を頁ごとに取る形を追います。

https://cardene.dev/diagrams/canton-json-package-vetting

この章の図に出る語は、次の文で短く説明します。

partyは、Damlの台帳とやり取りする物で、userか組織を表します。
identity providerは、userを認証する仕組みです。
DARは、main packageと、それが依存する全てのpackageからなるファイルです。
vettingは、Participant Nodeが他のParticipant Nodeに、どのpackageを支えるかを伝える手段です。

頁「認証の発行元とpartyを直す」の題の「認証の発行元」は、identity providerのことで、図ではidentity providerと書きます。
詳しい説明は、userを頁「JSON APIでuserの権利を扱う」が、identity providerとpartyの詳細を頁「認証の発行元とpartyを直す」が、DARとvettingを頁「JSONでvettingを確かめ変える」が持ちます。

下の図は、この章の4つの頁が扱う呼び出しを、アプリからJSON Ledger APIの順に置き、JSON Ledger APIの中は、userとpartyの管理の箱と、DARとvettingの管理の箱に分けます。
各階の箱は、JSON Ledger APIが持つ物の内部ではなく、呼び出しを分けた区分です。
userとpartyの管理の中には、userと権利の箱と、identity providerとpartyの箱を置き、identity providerとpartyの中には、設定とpartyの詳細の箱と、割り当てと設定の作成の箱を置きます。

虫眼鏡の印が付いた部品を押すと、その部品の中へ入ります。
上の全体の図からも、虫眼鏡の印が付いた部品へ移れます。

外側へ戻る時は、右上の「戻る」か、上に並んだ名前を押します。
全体の図の「APIの管理」からも、外側の階へ直接戻れます。
中を持たない箱では、箱の下に頁の題が出て、押すとその頁を開きます。

```dragon
architecture アプリからJSON Ledger APIの管理へ
group Top as APIの管理 [icon: net]
  box App as アプリ [note: 管理のエンドポイントを呼ぶ, color: blue, icon: app]
  box Json as JSON Ledger API [note: HTTPで受ける, color: slate, icon: server]
end
group JsonIn as JSON Ledger APIの中 [color: slate, icon: server]
  box Ident as userとpartyの管理 [note: userとidentity providerとpartyの呼び出し, icon: user]
  box Pkg as DARとvettingの管理 [note: DARの検証とアップロード、vettingの照会と更新, icon: card, link: /diagrams/canton-json-package-vetting]
end
group IdentIn as userとpartyの管理の中 [color: slate, icon: user]
  box Users as userと権利 [note: userの取得と更新と削除、権利の読み取りと取り消し, icon: user, link: /diagrams/canton-json-users]
  box IdpParty as identity providerとparty [note: 設定とpartyの詳細の呼び出し、partyの割り当て, icon: db]
end
group IdpIn as identity providerとpartyの中 [color: slate, icon: db]
  box Fix as 設定とpartyの詳細 [note: 設定とpartyの詳細を読んで更新する, icon: refresh, link: /diagrams/canton-json-idp-party]
  box Alloc as 割り当てと設定の作成 [note: 新しいpartyの割り当てと、新しいidentity providerの設定の作成, icon: card, link: /diagrams/canton-json-party-allocation]
end

step APIの管理
  say アプリは、userとidentity providerとpartyを管理する呼び出しと、DARとvettingを管理する呼び出しを、HTTPでJSON Ledger APIへ送ります。
  App -> Json: 管理を呼ぶ
  source CantonのGET /v2/users [url: https://docs.canton.network/reference/json-api-reference/get-v2users]
  source CantonのGET /v2/users/:user-id [url: https://docs.canton.network/reference/json-api-reference/get-v2users:user-id]
  source CantonのGET /v2/authenticated-user [url: https://docs.canton.network/reference/json-api-reference/get-v2authenticated-user]
  source CantonのPATCH /v2/users/:user-id [url: https://docs.canton.network/reference/json-api-reference/patch-v2users:user-id]
  source CantonのPATCH /v2/users/:user-id/identity-provider-id [url: https://docs.canton.network/reference/json-api-reference/patch-v2users:user-ididentity-provider-id]
  source CantonのGET /v2/users/:user-id/rights [url: https://docs.canton.network/reference/json-api-reference/get-v2users:user-idrights]
  source CantonのPATCH /v2/users/:user-id/rights [url: https://docs.canton.network/reference/json-api-reference/patch-v2users:user-idrights]
  source CantonのDELETE /v2/users/:user-id [url: https://docs.canton.network/reference/json-api-reference/delete-v2users:user-id]
  source CantonのGET /v2/idps [url: https://docs.canton.network/reference/json-api-reference/get-v2idps]
  source CantonのGET /v2/idps/:idp-id [url: https://docs.canton.network/reference/json-api-reference/get-v2idps:idp-id]
  source CantonのPATCH /v2/idps/:idp-id [url: https://docs.canton.network/reference/json-api-reference/patch-v2idps:idp-id]
  source CantonのDELETE /v2/idps/:idp-id [url: https://docs.canton.network/reference/json-api-reference/delete-v2idps:idp-id]
  source CantonのGET /v2/parties [url: https://docs.canton.network/reference/json-api-reference/get-v2parties]
  source CantonのGET /v2/parties/:party [url: https://docs.canton.network/reference/json-api-reference/get-v2parties:party]
  source CantonのGET /v2/parties/participant-id [url: https://docs.canton.network/reference/json-api-reference/get-v2partiesparticipant-id]
  source CantonのPATCH /v2/parties/:party [url: https://docs.canton.network/reference/json-api-reference/patch-v2parties:party]
  source CantonのPOST /v2/parties [url: https://docs.canton.network/reference/json-api-reference/post-v2parties]
  source CantonのPOST /v2/idps [url: https://docs.canton.network/reference/json-api-reference/post-v2idps]
  source CantonのPOST /v2/dars [url: https://docs.canton.network/reference/json-api-reference/post-v2dars]
  source CantonのPOST /v2/dars/validate [url: https://docs.canton.network/reference/json-api-reference/post-v2darsvalidate]
  source CantonのPOST /v2/package-vetting/update [url: https://docs.canton.network/reference/json-api-reference/post-v2package-vettingupdate]
  source CantonのPOST /v2/package-vetting/list [url: https://docs.canton.network/reference/json-api-reference/post-v2package-vettinglist]
  source CantonのPOST /v2/package-vetting [url: https://docs.canton.network/reference/json-api-reference/post-v2package-vetting]

step JSON Ledger APIの中
  say JSON Ledger APIは、userとidentity providerとpartyを管理する呼び出しと、DARを検証してアップロードし、vettingを照会して更新する呼び出しを受け付けます。vettingの更新は、変更を適用せずに試せます。
  act Ident: userとpartyを管理する
  act Pkg: DARとvettingを扱う
  source CantonのGET /v2/users [url: https://docs.canton.network/reference/json-api-reference/get-v2users]
  source CantonのGET /v2/users/:user-id [url: https://docs.canton.network/reference/json-api-reference/get-v2users:user-id]
  source CantonのGET /v2/authenticated-user [url: https://docs.canton.network/reference/json-api-reference/get-v2authenticated-user]
  source CantonのPATCH /v2/users/:user-id [url: https://docs.canton.network/reference/json-api-reference/patch-v2users:user-id]
  source CantonのPATCH /v2/users/:user-id/identity-provider-id [url: https://docs.canton.network/reference/json-api-reference/patch-v2users:user-ididentity-provider-id]
  source CantonのGET /v2/users/:user-id/rights [url: https://docs.canton.network/reference/json-api-reference/get-v2users:user-idrights]
  source CantonのPATCH /v2/users/:user-id/rights [url: https://docs.canton.network/reference/json-api-reference/patch-v2users:user-idrights]
  source CantonのDELETE /v2/users/:user-id [url: https://docs.canton.network/reference/json-api-reference/delete-v2users:user-id]
  source CantonのPOST /v2/dars [url: https://docs.canton.network/reference/json-api-reference/post-v2dars]
  source CantonのPOST /v2/dars/validate [url: https://docs.canton.network/reference/json-api-reference/post-v2darsvalidate]
  source CantonのPOST /v2/package-vetting/update [url: https://docs.canton.network/reference/json-api-reference/post-v2package-vettingupdate]
  source CantonのPOST /v2/package-vetting/list [url: https://docs.canton.network/reference/json-api-reference/post-v2package-vettinglist]
  source CantonのPOST /v2/package-vetting [url: https://docs.canton.network/reference/json-api-reference/post-v2package-vetting]
  source CantonのGET /v2/idps [url: https://docs.canton.network/reference/json-api-reference/get-v2idps]
  source CantonのGET /v2/idps/:idp-id [url: https://docs.canton.network/reference/json-api-reference/get-v2idps:idp-id]
  source CantonのPATCH /v2/idps/:idp-id [url: https://docs.canton.network/reference/json-api-reference/patch-v2idps:idp-id]
  source CantonのDELETE /v2/idps/:idp-id [url: https://docs.canton.network/reference/json-api-reference/delete-v2idps:idp-id]
  source CantonのGET /v2/parties [url: https://docs.canton.network/reference/json-api-reference/get-v2parties]
  source CantonのGET /v2/parties/:party [url: https://docs.canton.network/reference/json-api-reference/get-v2parties:party]
  source CantonのGET /v2/parties/participant-id [url: https://docs.canton.network/reference/json-api-reference/get-v2partiesparticipant-id]
  source CantonのPATCH /v2/parties/:party [url: https://docs.canton.network/reference/json-api-reference/patch-v2parties:party]
  source CantonのPOST /v2/parties [url: https://docs.canton.network/reference/json-api-reference/post-v2parties]
  source CantonのPOST /v2/idps [url: https://docs.canton.network/reference/json-api-reference/post-v2idps]

step userとpartyの管理の中
  say userのエンドポイントは、userを一覧にして取得し、更新し、消し、userの割り当て先のidentity providerを変え、権利を読んで取り消します。identity providerとpartyのエンドポイントは、identity providerの設定とpartyの詳細を読んで更新し、partyの割り当てと設定の作成は別の呼び出しで行います。
  act Users: userと権利を扱う
  act IdpParty: 設定とpartyを扱う
  source CantonのGET /v2/users [url: https://docs.canton.network/reference/json-api-reference/get-v2users]
  source CantonのGET /v2/users/:user-id [url: https://docs.canton.network/reference/json-api-reference/get-v2users:user-id]
  source CantonのGET /v2/authenticated-user [url: https://docs.canton.network/reference/json-api-reference/get-v2authenticated-user]
  source CantonのPATCH /v2/users/:user-id [url: https://docs.canton.network/reference/json-api-reference/patch-v2users:user-id]
  source CantonのPATCH /v2/users/:user-id/identity-provider-id [url: https://docs.canton.network/reference/json-api-reference/patch-v2users:user-ididentity-provider-id]
  source CantonのGET /v2/users/:user-id/rights [url: https://docs.canton.network/reference/json-api-reference/get-v2users:user-idrights]
  source CantonのPATCH /v2/users/:user-id/rights [url: https://docs.canton.network/reference/json-api-reference/patch-v2users:user-idrights]
  source CantonのDELETE /v2/users/:user-id [url: https://docs.canton.network/reference/json-api-reference/delete-v2users:user-id]
  source CantonのGET /v2/idps [url: https://docs.canton.network/reference/json-api-reference/get-v2idps]
  source CantonのGET /v2/idps/:idp-id [url: https://docs.canton.network/reference/json-api-reference/get-v2idps:idp-id]
  source CantonのPATCH /v2/idps/:idp-id [url: https://docs.canton.network/reference/json-api-reference/patch-v2idps:idp-id]
  source CantonのDELETE /v2/idps/:idp-id [url: https://docs.canton.network/reference/json-api-reference/delete-v2idps:idp-id]
  source CantonのGET /v2/parties [url: https://docs.canton.network/reference/json-api-reference/get-v2parties]
  source CantonのGET /v2/parties/:party [url: https://docs.canton.network/reference/json-api-reference/get-v2parties:party]
  source CantonのGET /v2/parties/participant-id [url: https://docs.canton.network/reference/json-api-reference/get-v2partiesparticipant-id]
  source CantonのPATCH /v2/parties/:party [url: https://docs.canton.network/reference/json-api-reference/patch-v2parties:party]
  source CantonのPOST /v2/parties [url: https://docs.canton.network/reference/json-api-reference/post-v2parties]
  source CantonのPOST /v2/idps [url: https://docs.canton.network/reference/json-api-reference/post-v2idps]

step identity providerとpartyの中
  say identity providerの設定は読み、更新し、消し、partyの詳細は、Participant Nodeが知るpartyを読み、ホストするpartyの手元の情報を更新します。更新で古い版を拒むのは、読んだ版を更新の要求に添えた時だけです。partyの割り当ては新しいpartyを割り当て、設定の作成は新しいidentity providerの設定を作ります。
  act Fix: 設定とpartyを直す
  act Alloc: partyと設定を作る
  source CantonのGET /v2/authenticated-user [url: https://docs.canton.network/reference/json-api-reference/get-v2authenticated-user]
  source CantonのGET /v2/idps [url: https://docs.canton.network/reference/json-api-reference/get-v2idps]
  source CantonのGET /v2/idps/:idp-id [url: https://docs.canton.network/reference/json-api-reference/get-v2idps:idp-id]
  source CantonのPATCH /v2/idps/:idp-id [url: https://docs.canton.network/reference/json-api-reference/patch-v2idps:idp-id]
  source CantonのDELETE /v2/idps/:idp-id [url: https://docs.canton.network/reference/json-api-reference/delete-v2idps:idp-id]
  source CantonのGET /v2/parties [url: https://docs.canton.network/reference/json-api-reference/get-v2parties]
  source CantonのGET /v2/parties/:party [url: https://docs.canton.network/reference/json-api-reference/get-v2parties:party]
  source CantonのGET /v2/parties/participant-id [url: https://docs.canton.network/reference/json-api-reference/get-v2partiesparticipant-id]
  source CantonのPATCH /v2/parties/:party [url: https://docs.canton.network/reference/json-api-reference/patch-v2parties:party]
  source CantonのPOST /v2/parties [url: https://docs.canton.network/reference/json-api-reference/post-v2parties]
  source CantonのPOST /v2/idps [url: https://docs.canton.network/reference/json-api-reference/post-v2idps]
```

一番外の階では、アプリがuserとidentity providerとpartyを管理する呼び出しと、DARとvettingを管理する呼び出しを、HTTPでJSON Ledger APIへ送ります。
JSON Ledger APIの中では、userとpartyの管理の箱と、DARとvettingの管理の箱を置きます。

userとpartyの管理の中では、userと権利を頁「JSON APIでuserの権利を扱う」が追い、identity providerとpartyの箱の中へ入ります。
identity providerとpartyの中では、設定とpartyの詳細を頁「認証の発行元とpartyを直す」が、割り当てと設定の作成を頁「partyを割り当てて認証を設定する」が追います。
DARとvettingの管理は、頁「JSONでvettingを確かめ変える」が追います。

この図では、JSON Ledger APIからアプリへ返る向きの線を引かず、返る応答は各頁の図に任せます。
この図では、userとpartyの管理の箱とidentity providerとpartyの箱を、頁をまとめるために置く箱として置きます。

## 出典

https://docs.canton.network/reference/json-api-reference/get-v2users

https://docs.canton.network/reference/json-api-reference/get-v2users:user-id

https://docs.canton.network/reference/json-api-reference/get-v2authenticated-user

https://docs.canton.network/reference/json-api-reference/patch-v2users:user-id

https://docs.canton.network/reference/json-api-reference/patch-v2users:user-ididentity-provider-id

https://docs.canton.network/reference/json-api-reference/get-v2users:user-idrights

https://docs.canton.network/reference/json-api-reference/patch-v2users:user-idrights

https://docs.canton.network/reference/json-api-reference/delete-v2users:user-id

https://docs.canton.network/reference/json-api-reference/get-v2idps

https://docs.canton.network/reference/json-api-reference/get-v2idps:idp-id

https://docs.canton.network/reference/json-api-reference/patch-v2idps:idp-id

https://docs.canton.network/reference/json-api-reference/delete-v2idps:idp-id

https://docs.canton.network/reference/json-api-reference/get-v2parties

https://docs.canton.network/reference/json-api-reference/get-v2parties:party

https://docs.canton.network/reference/json-api-reference/get-v2partiesparticipant-id

https://docs.canton.network/reference/json-api-reference/patch-v2parties:party

https://docs.canton.network/reference/json-api-reference/post-v2parties

https://docs.canton.network/reference/json-api-reference/post-v2idps

https://docs.canton.network/reference/json-api-reference/post-v2dars

https://docs.canton.network/reference/json-api-reference/post-v2darsvalidate

https://docs.canton.network/reference/json-api-reference/post-v2package-vettingupdate

https://docs.canton.network/reference/json-api-reference/post-v2package-vettinglist

https://docs.canton.network/reference/json-api-reference/post-v2package-vetting
