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

# Sanity

> SanityとAdminaをAPIキーで連携する手順です。ユーザー名・メールアドレス・ロールなどを取得し、Adminaからサービスアカウントの作成・削除ができます。

## 連携仕様

<dl />

## 事前準備

### APIトークンの取得方法

1. Sanityの管理画面にログインし、連携するプロジェクトを開きます。左側のメニューで**API**を開き、**Tokens**（トークン）を選択します。

   ![SanityのプロジェクトのAPIメニューで、Tokensが示されている状態](https://mintcdn.com/moneyforwardi/zWOz2tiPZQeF0CxX/images/integrations/sanity/api-tokens-menu.png?fit=max\&auto=format\&n=zWOz2tiPZQeF0CxX\&q=85\&s=8006bfb528abf6db9af6147b4f20a861)

2. 画面右上の**Add API token**（APIトークンを追加）をクリックします。

   ![Tokens画面でAdd API tokenボタンが示されている状態](https://mintcdn.com/moneyforwardi/zWOz2tiPZQeF0CxX/images/integrations/sanity/add-api-token.png?fit=max\&auto=format\&n=zWOz2tiPZQeF0CxX\&q=85\&s=d9a536824a8d4db503c1d29f9d726905)

3. **Name**（名前）に、Adminaで使うことが分かる名前を入力します。**Permissions**（権限）の**Access level**（アクセスレベル）でトークンのロールを選択し、**Add token**（トークンを追加）をクリックします。画像は**Developer**を選択した例です。ユーザーの削除を使う場合は、下の補足をご確認ください。

   ![Add API tokenダイアログで、右下のAdd tokenボタンが示されている状態](https://mintcdn.com/moneyforwardi/zWOz2tiPZQeF0CxX/images/integrations/sanity/add-api-token-dialog.png?fit=max\&auto=format\&n=zWOz2tiPZQeF0CxX\&q=85\&s=b6a5a4c0fdc39aeb3bb5f0860c1c3fa1)

4. 表示されたトークンの右側にあるコピーアイコンをクリックしてコピーし、保存します。トークンはこの画面でのみ表示されるため、必ずこの時点で保存してください。

   ![発行されたトークンのコピーアイコンが示されている状態（トークンの値はマスク済み）](https://mintcdn.com/moneyforwardi/zWOz2tiPZQeF0CxX/images/integrations/sanity/token-issued.png?fit=max\&auto=format\&n=zWOz2tiPZQeF0CxX\&q=85\&s=9327b523f36eb28743e392479c52095c)

> [!NOTE]
>
> * Sanity社の「[Roles and permissions（外部サイト）](https://www.sanity.io/docs/content-lake/roles-concepts)」のとおり、メンバーを削除できる既定のロールは**Administrator**のみです。**Developer**のロールは、メンバーの招待・取得・更新はできますが、削除はできません。Adminaからユーザーを削除するには、**Administrator**相当の権限が必要です。
> * トークンには、プロジェクトのメンバーを読み取る権限が必要です。
> * **Administrator**のロールは、Adminaから招待するときのロールに選べません。

## インテグレーションのセットアップ

1. インテグレーション画面にて**Sanity**を検索します。

2. **ワークスペースキー**にSanityのプロジェクトID（英数字）、**APIキー**に前の手順でコピーしたトークンを入力し、**連携する**をクリックします。

   ![Sanityの連携設定画面で、ワークスペースキー・APIキーの入力欄が表示されている状態](https://mintcdn.com/moneyforwardi/zWOz2tiPZQeF0CxX/images/integrations/sanity/integrate-workspace.png?fit=max\&auto=format\&n=zWOz2tiPZQeF0CxX\&q=85\&s=0151983d59724ff1477498738667420d)

3. Sanityとの連携が成功すると、アカウント一覧に登録済みのユーザー情報が表示されます。正常に完了しない場合は、まず [SaaS連携エラーの対処法](https://support.i.moneyforward.com/it-management/saas-management/93nahw45is-trouble.md) に記載のステップをお試しください。それでも解決しない場合は、[ご提供いただきたい情報](https://support.i.moneyforward.com/it-management/saas-management/93nahw45is-trouble.md#info-to-provide) をご確認のうえ、[サポート窓口](https://support.i.moneyforward.com/contact-support.md)までお問い合わせください。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.