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

# 認証

> Legitmark 統合のための API キーの使用、レート制限、セキュリティベストプラクティス。

## API キー認証

Legitmark は API キー認証を使用します。API キーはプラットフォームを識別し、Legitmark サービスへのアクセスを認可します。

<Note>
  API キーが必要ですか？[はじめに](/ja/partner/getting-started)を参照して組織をセットアップし、[開発者設定](https://app.legitmark.com/settings/developer)でキーを作成してください。
</Note>

すべてのリクエストの `Authorization` ヘッダーに API キーを含めてください：

```javascript theme={null}
const headers = {
  'Authorization': 'Bearer leo_xxxxxxxxx',
  'Content-Type': 'application/json'
};
```

[TypeScript SDK](https://github.com/legitmark-eng/legitmark-typescript) を使用する場合、認証は自動的に処理されます：

```typescript theme={null}
import { Legitmark } from 'legitmark';

const legitmark = new Legitmark('leo_your_api_key');
```

### セキュリティモデル

すべての API 通信は API キーを使用して認証されます。個人情報はヘッダー、URL、クエリパラメータで送信されることはなく、厳格なデータ保護基準を満たしています。

## レート制限

プラットフォームの安定性を確保するために、レート制限が適用される場合があります。`429` レスポンスを受け取った場合は、待ってから再試行してください。詳細は[レート制限](/api-reference/rate-limits)をご覧ください。

## セキュリティベストプラクティス

### API キーセキュリティ

* 認可されたシステムのみに API キーアクセスを制限
* API キーの保存に環境変数を使用
* キーローテーション手順を実装
* API キー使用の異常を監視

### リクエストセキュリティ

* API 通信には常に HTTPS を使用
* リクエストタイムアウトと再試行ロジックを実装
* すべての認証リクエストにセキュアヘッダーを使用

## 認証のテスト

### API キーの検証

シンプルなリクエストで API キーをテスト：

```bash theme={null}
curl -X GET "https://api.legitmark.com/api/v2/categories?active_only=true" \
  -H "Authorization: Bearer leo_your_api_key"
```

### SDK でテスト

```typescript theme={null}
import { Legitmark } from 'legitmark';

const legitmark = new Legitmark('leo_your_api_key', { debug: true });
const { data: categories } = await legitmark.taxonomy.getCategories();
console.log(`接続成功！ ${categories.length} カテゴリを検出`);
```

## 次のステップ

1. **確認** [タクソノミー](/ja/partner/taxonomy) でアイテム分類を理解
2. **実装** [ワークフロー](/ja/partner/workflow) でサービスリクエスト
3. **設定** [Webhook](/ja/webhook-reference/introduction) でリアルタイム通知
