> ## 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.

# Plain

> How to integrate Plain with Admina using an API key. Admina retrieves user names, email addresses, and roles and supports account deletion.

export const IntegrationCapabilities = ({lang = "ja", modes = "", plan = "", lifecycle = "", automation = "", fetch = "", capabilities = "", memo = ""}) => {
  const TEXT = ({
    ja: {
      rows: {
        mode: "連携モード",
        plan: "連携確認プラン",
        lifecycle: "アカウントライフサイクル",
        automation: "自動化",
        fetch: "取得データ",
        capabilities: "対応機能",
        memo: "備考"
      },
      empty: "-",
      more: "各項目の意味は[連携可能SaaS・機能対応一覧](/integrations/supported-saas)をご覧ください。",
      mode: {
        "API Key": "APIキー"
      },
      lifecycle: {
        provisioning: "アカウント作成",
        deactivate: "アカウント無効化",
        delete: "アカウント削除"
      },
      automation: {
        provisioning: "アカウント作成",
        deactivate: "アカウント無効化",
        delete: "アカウント削除"
      },
      fetch: {
        User: "ユーザー名",
        Mail: "メールアドレス",
        Role: "ロール",
        Status: "ステータス",
        "2FA": "二要素認証",
        LastActivity: "最終利用日",
        Licenses: "ライセンス"
      },
      capabilities: {
        "employee-master": "従業員マスター連携",
        "identity-provider": "IDプロバイダー連携",
        "cost-aggregation": "コスト管理",
        "file-aggregation": "ファイル管理",
        "file-permissions": "ファイル権限管理",
        "device-aggregation": "MDM連携"
      }
    },
    en: {
      rows: {
        mode: "Integration mode",
        plan: "Verified plan",
        lifecycle: "Account lifecycle",
        automation: "Automation",
        fetch: "Fetched data",
        capabilities: "Capabilities",
        memo: "Notes"
      },
      empty: "-",
      more: "See [Supported SaaS and Capabilities](/en/integrations/supported-saas) for what each item means.",
      mode: {},
      lifecycle: {
        provisioning: "Account creation",
        deactivate: "Account deactivation",
        delete: "Account deletion"
      },
      automation: {
        provisioning: "Account creation",
        deactivate: "Account deactivation",
        delete: "Account deletion"
      },
      fetch: {
        LastActivity: "Last Activity"
      },
      capabilities: {
        "employee-master": "HR master",
        "identity-provider": "Identity provider",
        "cost-aggregation": "Cost management",
        "file-aggregation": "File management",
        "file-permissions": "File permissions",
        "device-aggregation": "MDM integration"
      }
    }
  })[lang === "en" ? "en" : "ja"];
  const BADGE_COLORS = {
    "ID/Password": "yellow",
    "API Key": "cyan",
    OAuth: "red",
    App: "purple",
    User: "blue",
    Mail: "cyan",
    Role: "orange",
    Status: "teal",
    "2FA": "pink",
    LastActivity: "green",
    Licenses: "purple",
    provisioning: "green",
    delete: "red",
    deactivate: "yellow",
    "employee-master": "blue",
    "identity-provider": "teal",
    "cost-aggregation": "yellow",
    "file-aggregation": "cyan",
    "file-permissions": "orange",
    "device-aggregation": "purple"
  };
  const list = value => String(value || "").split(",").map(item => item.trim()).filter(Boolean);
  const badges = (source, labels) => {
    const values = list(source);
    if (values.length === 0) {
      return <span className="integration-capabilities-empty">{TEXT.empty}</span>;
    }
    return values.map(value => <span key={value} className={"integration-catalog-badge integration-catalog-badge--" + (BADGE_COLORS[value] || "gray")}>
        {labels?.[value] ?? value}
      </span>);
  };
  const text = value => value || <span className="integration-capabilities-empty">{TEXT.empty}</span>;
  const linkify = value => {
    if (!value) return null;
    const parts = [];
    let rest = String(value);
    let key = 0;
    for (; ; ) {
      const mid = rest.indexOf("](");
      if (mid < 0) break;
      const open = rest.lastIndexOf("[", mid);
      const close = rest.indexOf(")", mid);
      if (close < 0) break;
      if (open < 0) {
        parts.push(rest.slice(0, mid + 2));
        rest = rest.slice(mid + 2);
        continue;
      }
      if (open > 0) parts.push(rest.slice(0, open));
      parts.push(<a key={key++} href={rest.slice(mid + 2, close)} target="_blank" rel="noopener noreferrer">
          {rest.slice(open + 1, mid)}
        </a>);
      rest = rest.slice(close + 1);
    }
    if (rest) parts.push(rest);
    return parts;
  };
  const ROWS = [["mode", badges(modes, TEXT.mode)], ["plan", text(plan)], ["lifecycle", badges(lifecycle, TEXT.lifecycle)], ["automation", badges(automation, TEXT.automation)], ["fetch", badges(fetch, TEXT.fetch)], ["capabilities", badges(capabilities, TEXT.capabilities)], ["memo", text(linkify(memo))]];
  return <div className="integration-capabilities">
      <dl className="integration-capabilities-list">
        {ROWS.map(([key, value]) => <div className="integration-capabilities-row" key={key}>
            <dt>{TEXT.rows[key]}</dt>
            <dd>{value}</dd>
          </div>)}
      </dl>
    </div>;
};

## Integration Specifications

<IntegrationCapabilities lang="en" modes="API Key" lifecycle="delete" fetch="User, Mail, Role" />

## Prerequisites

### Getting your API key

1. After logging in to Plain, open the settings and select **Machine users & Agents** under **Developer**.

   <img src="https://mintcdn.com/moneyforwardi/qI8MezkUn0HcvCCi/images/integrations/plain/machine-users-menu.png?fit=max&auto=format&n=qI8MezkUn0HcvCCi&q=85&s=d0e6d8641bb8483c95d801d61ac53479" alt="Plain settings menu with Machine users & Agents under Developer highlighted" width="694" height="1534" data-path="images/integrations/plain/machine-users-menu.png" />

2. Click **Add machine user**.

3. Enter a **Name** and a **Public name**. Make sure **Type** is set to **API integration**, then click **Create machine user**.

   <img src="https://mintcdn.com/moneyforwardi/qI8MezkUn0HcvCCi/images/integrations/plain/create-machine-user.png?fit=max&auto=format&n=qI8MezkUn0HcvCCi&q=85&s=61d926fe17ae1586161743625e17ac9b" alt="Machine user creation screen with API integration selected and the Create machine user button highlighted" width="1726" height="1826" data-path="images/integrations/plain/create-machine-user.png" />

4. Open the machine user you created and click **Add API key**.

5. Make sure all of the following permissions are selected, then create the API key.

   * `permission:read`
   * `roles:assign`
   * `roles:read`
   * `user:edit`
   * `user:read`
   * `workspaceInvite:create`
   * `workspaceInvite:delete`
   * `workspaceInvite:edit`
   * `workspaceInvite:read`

6. Copy the API key you created and store it in a safe place.

<Info>
  To delete accounts from Admina, the API key also needs the `user:delete` permission in addition to the permissions above.
</Info>

## Setting up the integration

1. On the integration screen, search for **Plain**.

2. Enter the API key you obtained in the previous steps into **API key**, then click **Connect**.

   <img src="https://mintcdn.com/moneyforwardi/qI8MezkUn0HcvCCi/images/integrations/plain/integrate-workspace.png?fit=max&auto=format&n=qI8MezkUn0HcvCCi&q=85&s=0d1d7e4093671ae0b3fc8dcf478ee6cd" alt="Plain integration setup screen showing the API key field and the Connect button" width="664" height="622" data-path="images/integrations/plain/integrate-workspace.png" />

3. Once the integration with Plain succeeds, registered user information appears in the account list. If it doesn't complete successfully, first try the steps in [Troubleshoot SaaS integration errors](/en/it-management/saas-management/93nahw45is-trouble). If that doesn't resolve it, check [Information to provide](/en/it-management/saas-management/93nahw45is-trouble#info-to-provide) and contact [support](/en/contact-support).


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