# ConvertKitに購読者を追加する

> Formspree Docs · CLIの使用方法 · 2023年7月14日

**タグを適用** アクションは、ConvertKitに購読者を追加し、1つ以上のタグを適用します。このアクションは内部的に [**tag a subscriber**](https://developers.convertkit.com/#tag-a-subscriber) APIエンドポイントを呼び出します。呼び出しが失敗した場合は、自動的に再試行します。

`formspree.json` ファイルに **タグを適用** アクションを追加することは、FormspreeダッシュボードでConvertKitプラグインを追加するのと同じ効果があります。

## Formspree.jsonの設定

| キー | 型 | 説明 |
| --- | --- | --- |
| `app` |  String |  `convertkit` でなければなりません  |
| `type` |  String |  `applyTags` でなければなりません |
| `tags` |  Array |  購読者に適用するタグのリスト（必須） |
| `apiKey` |  String |  ConvertKit APIキー（[こちら](https://app.convertkit.com/account/edit) で確認可能。$ 環境変数参照である必要があります。必須） |

**例**

```javascript
{
  "forms": {
    "contact": {
      "name": "Contact Form",
      "actions": [
        {
          "app": "convertkit",
          "type": "applyTags",
          "tags": ["Newsletter"],
          "apiKey": "$CONVERTKIT_API_KEY"
        }
      ]
    }
  }
}
```

## バリデーションルール

**タグを適用** アクションは、以下のバリデーションルールを暗黙的に追加します：

| フィールド | バリデーションルール |
| --- | --- |
| `email` | 必須 |
| `email` | 型は `email` |
