---
updatedAt: 2026-04-27T13:21:23.000Z
agentTools:
  projectIndex: https://developers.karte.io/llms.txt
---

# Send event to KARTE

イベントを API 経由で KARTE に送信し、ユーザーの解析に利用できます。 API 経由のイベントは、ポップアップやメール、アプリプッシュ通知などの全てのアクションの配信トリガーとして利用できません。イベントの書き込みは非同期で実行されます。

イベント送信の際の制限は以下のページを参照してください。

[KARTEの様々な上限 / 制限について | スタートガイド / KARTE基礎知識・仕様 / KARTE動作環境 | KARTEサポートサイト](https://support.karte.io/post/7leyGX8ReFdgukJBUtCWJP#1-0)

[イベントで使用できないイベント名、フィールド名、フィールド値 | スタートガイド / タグ設置・イベント計測 / 概要 | KARTEサポートサイト](https://support.karte.io/post/44VkfBjO7JdRnDv9YOfbFB)

#### Required Scope
APIの実行に必要なScopeです。
```
track.event.write
```

#### Required Role
管理画面でScopeを追加する際に必要な権限です。
```
基本機能 > 基本機能作成・編集
```


# OpenAPI definition

````json
{
  "openapi": "3.0.0",
  "servers": [
    {
      "url": "https://api.karte.io",
      "description": "Production server"
    },
    {
      "url": "https://api-jp.karte.io",
      "description": "Production JP server. リージョン固定オプションのプロジェクトはこちらのエンドポイントを利用してください."
    }
  ],
  "info": {
    "version": "2.0.0",
    "title": "Insight"
  },
  "paths": {
    "/v2/track/event/write": {
      "post": {
        "tags": [
          "Event"
        ],
        "summary": "Send event to KARTE",
        "description": "イベントを API 経由で KARTE に送信し、ユーザーの解析に利用できます。 API 経由のイベントは、ポップアップやメール、アプリプッシュ通知などの全てのアクションの配信トリガーとして利用できません。イベントの書き込みは非同期で実行されます。\n\nイベント送信の際の制限は以下のページを参照してください。\n\n[KARTEの様々な上限 / 制限について | スタートガイド / KARTE基礎知識・仕様 / KARTE動作環境 | KARTEサポートサイト](https://support.karte.io/post/7leyGX8ReFdgukJBUtCWJP#1-0)\n\n[イベントで使用できないイベント名、フィールド名、フィールド値 | スタートガイド / タグ設置・イベント計測 / 概要 | KARTEサポートサイト](https://support.karte.io/post/44VkfBjO7JdRnDv9YOfbFB)\n\n#### Required Scope\nAPIの実行に必要なScopeです。\n```\ntrack.event.write\n```\n\n#### Required Role\n管理画面でScopeを追加する際に必要な権限です。\n```\n基本機能 > 基本機能作成・編集\n```\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "keys",
                  "event"
                ],
                "properties": {
                  "keys": {
                    "$ref": "#/components/schemas/Keys"
                  },
                  "event": {
                    "$ref": "#/components/schemas/Event"
                  }
                },
                "additionalProperties": false
              },
              "example": {
                "keys": {
                  "user_id": "test01"
                },
                "event": {
                  "event_name": "buy",
                  "values": {
                    "item_id": 12345,
                    "item_name": "jacket",
                    "price": 10000,
                    "quantity": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "$ref": "#/components/schemas/TrackId"
                    }
                  },
                  "required": [
                    "id"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "id": "1"
                }
              }
            }
          },
          "422": {
            "description": "APIのイベント送信数の上限に達した場合",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LimitExceededError"
                },
                "example": {
                  "error": "Limit Exceeded"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-karte-api",
            "schema": {
              "type": "string"
            },
            "description": "今後利用する可能性のある予約語です。現在は設定不要です。"
          },
          {
            "in": "header",
            "name": "authorization",
            "schema": {
              "type": "string"
            },
            "description": "認証情報を含むトークンです。\"Authorization\" ヘッダーに `Bearer <token>` の形式で設定してください。"
          },
          {
            "in": "header",
            "name": "content-type",
            "schema": {
              "type": "string"
            },
            "description": "リクエストのコンテンツタイプを指定します。通常は `application/json` を使用してください。"
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "Event": {
        "description": "送信するイベントの情報",
        "type": "object",
        "required": [
          "event_name"
        ],
        "properties": {
          "event_name": {
            "type": "string",
            "description": "KARTE でイベントとして識別される文字列\n** 利用いただけない event_name **\n- page\n- req\n- enter_group\n- leave_group\n- view\n- group\n- message_send\n- date\n- message_open\n- message_click\n- message_clicked\n- message_close\n"
          },
          "values": {
            "type": "object",
            "description": "任意のKey-Value型の値\n* identify イベントを送信する場合、ユーザーデータ管理機能をご利用いただくために values 内に user_id を含めていただく必要があります。詳細については、[こちら](https://support.karte.io/post/5WaAqgOMKu7ghwI9ChBVw3#2-2)をご参照ください。\n* Key-ValueのValueには任意の型（string, bool, number, object, array）が指定できます。APIリファレンス上でフィールドを追加すると自動的にstring型になってしまうため、string以外の型を指定する場合はお手元の環境でご確認ください。\n",
            "additionalProperties": true
          }
        },
        "additionalProperties": false
      },
      "Keys": {
        "description": "送信データのキーとなるデータ。keys には user_id か visitor_id のどちらかが必須となります。両方指定することはできません。",
        "type": "object",
        "properties": {
          "user_id": {
            "description": "KARTE で解析されたユーザーのキー (identify イベントで送信される user_id フィールドの値)。 なお、合致する user_id を持つユーザーが存在しない場合、新しくユーザーが作成されます。",
            "type": "string"
          },
          "visitor_id": {
            "type": "string",
            "description": "ユーザーを識別する任意のキー"
          }
        },
        "additionalProperties": false
      },
      "TrackId": {
        "description": "requestを一意に識別するID",
        "type": "string"
      },
      "LimitExceededError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "x-explorer-enabled": false
}
````