Zum Hauptinhalt springen
POST
/
events
/
v3
/
event-definitions
カスタムイベント定義を作成
curl --request POST \
  --url https://api.hubapi.com/events/v3/event-definitions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "description": "<string>",
  "label": "<string>",
  "name": "<string>",
  "primaryObject": "<string>",
  "propertyDefinitions": [
    {
      "description": "<string>",
      "label": "<string>",
      "name": "<string>",
      "options": [
        {
          "description": "<string>",
          "displayOrder": 123,
          "hidden": true,
          "label": "<string>",
          "value": "<string>"
        }
      ],
      "type": "<string>"
    }
  ]
}'
{
  "archived": true,
  "associations": [
    {
      "allowsCustomLabels": true,
      "cardinality": "ONE_TO_MANY",
      "category": "HUBSPOT_DEFINED",
      "fromObjectType": "ABANDONED_CART",
      "fromObjectTypeId": "<string>",
      "hasAllAssociatedObjects": true,
      "hasCascadingDeletes": true,
      "hasUserEnforcedMaxFromObjectIds": true,
      "hasUserEnforcedMaxToObjectIds": true,
      "hidden": true,
      "id": 123,
      "inverseAllowsCustomLabels": true,
      "inverseCardinality": "ONE_TO_MANY",
      "inverseHasAllAssociatedObjects": true,
      "inverseId": 123,
      "inverseLabel": "<string>",
      "inverseName": "<string>",
      "isInversePrimary": true,
      "isPrimary": true,
      "label": "<string>",
      "maxFromObjectIds": 123,
      "maxToObjectIds": 123,
      "name": "<string>",
      "portalUniqueIdentifier": "<string>",
      "toObjectType": "ABANDONED_CART",
      "toObjectTypeId": "<string>"
    }
  ],
  "comboEventRules": {
    "composingRules": [
      {
        "count": 123,
        "eventTypeId": "<string>",
        "lookbackWindowDays": 123,
        "propertyFilters": [
          {
            "filterType": "PROPERTY",
            "frameworkFilterId": 123,
            "operation": {
              "defaultValue": "<string>",
              "includeObjectsWithNoValueSet": true,
              "operationType": "<string>",
              "operator": "HAS_EVER_BEEN_EQUAL_TO",
              "operatorName": "<string>",
              "propertyType": "bool",
              "value": true
            },
            "property": "<string>"
          }
        ]
      }
    ],
    "operationType": "AND",
    "ruleBranches": [
      {}
    ]
  },
  "createdAt": "2023-11-07T05:31:56Z",
  "createdUserId": 123,
  "description": "<string>",
  "fullyQualifiedName": "<string>",
  "id": "<string>",
  "labels": {
    "plural": "<string>",
    "singular": "<string>"
  },
  "name": "<string>",
  "objectTypeId": "<string>",
  "primaryObject": "<string>",
  "primaryObjectId": "<string>",
  "properties": [
    {
      "archived": true,
      "archivedAt": "2023-11-07T05:31:56Z",
      "calculated": true,
      "calculationFormula": "<string>",
      "createdAt": "2023-11-07T05:31:56Z",
      "createdUserId": "<string>",
      "dataSensitivity": "highly_sensitive",
      "description": "<string>",
      "displayOrder": 123,
      "externalOptions": true,
      "fieldType": "<string>",
      "formField": true,
      "groupName": "<string>",
      "hasUniqueValue": true,
      "hidden": true,
      "hubspotDefined": true,
      "label": "<string>",
      "modificationMetadata": {
        "archivable": true,
        "readOnlyDefinition": true,
        "readOnlyOptions": true,
        "readOnlyValue": true
      },
      "name": "<string>",
      "options": [
        {
          "description": "<string>",
          "displayOrder": 123,
          "hidden": true,
          "label": "<string>",
          "value": "<string>"
        }
      ],
      "referencedObjectType": "<string>",
      "sensitiveDataCategories": [
        "<string>"
      ],
      "showCurrencySymbol": true,
      "type": "<string>",
      "updatedAt": "2023-11-07T05:31:56Z",
      "updatedUserId": "<string>"
    }
  ],
  "trackingType": "CLICKED_ELEMENT"
}
次のいずれかの製品またはそれ以上が必要です。
Marketing HubMarketing Hub -Enterprise
Sales HubSales Hub -Enterprise
Service HubService Hub -Enterprise
Content HubContent Hub -Enterprise
この API には、次のいずれかのスコープが必要です。
behavioral_events.event_definitions.read_write

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Body

application/json
label
string
required

人間が読めるイベントのラベル。HubSpot UIで使用されます

propertyDefinitions
object[]
required

イベントのカスタムプロパティーのリスト

description
string

HubSpotにヘルプテキストとして表示されるイベントの説明。

name
string

このイベント定義APIからイベントを参照するときに使用する必要がある内部イベント名。名前が指定されていない場合、ラベルに基づいて生成されます。「name」値は、イベント完了をこのイベントに送信する際に使用することになるイベント定義の「fullyQualifiedName」を自動的に生成するためにも使用されます。

primaryObject
string

このイベントを関連付けるオブジェクトタイプ。CONTACT、COMPANY、DEAL、TICKETのいずれかになります。primaryObjectが指定されていない場合、デフォルトではCONTACTオブジェクトにイベントが関連付けられます。

Response

successful operation

archived
boolean
required
associations
object[]
required
fullyQualifiedName
string
required
id
string
required
labels
object
required
name
string
required
objectTypeId
string
required
properties
object[]
required
comboEventRules
object
createdAt
string<date-time>
createdUserId
integer
description
string
primaryObject
string
primaryObjectId
string
trackingType
enum<string>
Verfügbare Optionen:
CLICKED_ELEMENT,
COMBO_EVENT,
CUSTOM_SCRIPT,
IMPORT,
MANUAL,
PROPERTY_CHANGE,
VISITED_URL,
WEBHOOK