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

# Upsert contact data

問い合わせデータを作成・更新します。
既に同一IDの問い合わせデータが存在する場合は、既存のデータを上書きします。
visitorId・userIdはオプショナルのフィールドですが、どちらも未指定の場合、問い合わせデータとWeb行動の紐付けができず、分析ができません。
そのため、どちらかはなるべく指定してください。
また、個人情報が入りうるフィールド(text, additionalNote)が存在する場合、visitorId・userIdのいずれも未指定だとAPIリクエストを受け付けません。(個人情報保護の観点で、ユーザーを指定した問い合わせデータの消去を後からできるようにするためです)

#### Required Scope
APIの実行に必要なScopeです。
```
beta.rightsupport.contactData.upsert
```

#### Required Role
管理画面でScopeを追加する際に必要な権限です。
```
RightSupport > RightSupportの編集
```


# 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": "RightSupport"
  },
  "paths": {
    "/v2beta/rightsupport/contactData/upsert": {
      "post": {
        "tags": [
          "ContactData"
        ],
        "summary": "Upsert contact data",
        "description": "問い合わせデータを作成・更新します。\n既に同一IDの問い合わせデータが存在する場合は、既存のデータを上書きします。\nvisitorId・userIdはオプショナルのフィールドですが、どちらも未指定の場合、問い合わせデータとWeb行動の紐付けができず、分析ができません。\nそのため、どちらかはなるべく指定してください。\nまた、個人情報が入りうるフィールド(text, additionalNote)が存在する場合、visitorId・userIdのいずれも未指定だとAPIリクエストを受け付けません。(個人情報保護の観点で、ユーザーを指定した問い合わせデータの消去を後からできるようにするためです)\n\n#### Required Scope\nAPIの実行に必要なScopeです。\n```\nbeta.rightsupport.contactData.upsert\n```\n\n#### Required Role\n管理画面でScopeを追加する際に必要な権限です。\n```\nRightSupport > RightSupportの編集\n```\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "問い合わせデータのID。(お客様のシステム側で採番されたもの)"
                  },
                  "contactedAt": {
                    "type": "string",
                    "description": "問い合わせ発生時刻。ISO8601フォーマットで指定してください。例1(UTCでの指定): 2022-09-29T05:39:56Z / 例2(JSTでの指定): 2022-09-29T05:39:56+09:00"
                  },
                  "channel": {
                    "type": "string",
                    "enum": [
                      "call",
                      "chat",
                      "form",
                      "other"
                    ],
                    "description": "問い合わせチャネル。call, chat, form, otherのいずれかを指定してください。"
                  },
                  "contactPointId": {
                    "type": "string",
                    "description": "問い合わせ窓口のID。(お客様のシステム側で採番されたもの)"
                  },
                  "userId": {
                    "type": "string",
                    "description": "ユーザーID。(KARTEのidentifyイベントで飛ばしているユーザーIDと同一のものが送信できる場合に指定してください)"
                  },
                  "visitorId": {
                    "type": "string",
                    "description": "KARTEのビジターID。なお、先頭にvis-はつけないでください。"
                  },
                  "reasonId": {
                    "type": "string",
                    "description": "問い合わせのカテゴリを表すID。(お客様のシステム側で採番されたもの)"
                  },
                  "urlToContactDetail": {
                    "type": "string",
                    "description": "お客様の問い合わせ管理システム(CRMなど)で、問い合わせの詳細が閲覧できるページのURL。"
                  },
                  "text": {
                    "type": "string",
                    "description": "問い合わせ内容本文。"
                  },
                  "additionalNote": {
                    "type": "string",
                    "description": "問い合わせに関する追加メモ。"
                  }
                },
                "required": [
                  "id",
                  "contactedAt",
                  "channel",
                  "contactPointId"
                ],
                "example": {
                  "id": "c-id",
                  "contactedAt": "2022-09-29T05:39:56Z",
                  "channel": "call",
                  "contactPointId": "cp-id",
                  "userId": "u-id",
                  "visitorId": "AaBbCcD1",
                  "reasonId": "r-id",
                  "urlToContactDetail": "https://example.com/c-id",
                  "text": "問い合わせ内容本文です。",
                  "additionalNote": "追加メモの文章です。"
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          }
        },
        "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": {
      "SuccessResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          }
        },
        "example": {
          "success": true
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "x-explorer-enabled": false
}
````