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

# Create a property for an event definition

> 既存のイベント定義の新しいプロパティーを作成します。

export const ScopesList = ({scopes = [], description = "この API には、次のいずれかのスコープが必要です。"}) => {
  if (!scopes || scopes.length === 0) {
    return null;
  }
  const sortedScopes = scopes.sort((a, b) => a.localeCompare(b));
  return <div>
      <div className="text-sm mb-2">{description}</div>
      <div>
        {sortedScopes.map((scope, index) => <div key={index}>
            <code>
              <span className="text-xs">{scope}</span>
            </code>
          </div>)}
      </div>
    </div>;
};

export const SupportedProducts = ({marketing, sales, service, cms, marketingLevel, salesLevel, serviceLevel, cmsLevel}) => {
  const translations = {
    header: "サポートされる製品",
    description: "次のいずれかの製品またはそれ以上が必要です。",
    productNames: {
      marketing: "Marketing Hub",
      sales: "Sales Hub",
      service: "Service Hub",
      cms: "Content Hub"
    },
    tiers: {
      free: "無料ツール",
      starter: "Starter",
      professional: "Professional",
      enterprise: "Enterprise"
    }
  };
  const translateTier = tier => {
    if (!tier) return '';
    const lowerTier = tier.toLowerCase();
    return translations.tiers[lowerTier] || tier;
  };
  const products = [{
    name: marketing ? translations.productNames.marketing : '',
    level: translateTier(marketingLevel),
    icon: "https://mintlify-assets.b-cdn.net/Icons/marketing-bolt.svg",
    alt: "Marketing Hub"
  }, {
    name: sales ? translations.productNames.sales : '',
    level: translateTier(salesLevel),
    icon: "https://mintlify-assets.b-cdn.net/Icons/sales-star.svg",
    alt: "Sales Hub"
  }, {
    name: service ? translations.productNames.service : '',
    level: translateTier(serviceLevel),
    icon: "https://mintlify-assets.b-cdn.net/Icons/service-heart.svg",
    alt: "Service Hub"
  }, {
    name: cms ? translations.productNames.cms : '',
    level: translateTier(cmsLevel),
    icon: "https://mintlify-assets.b-cdn.net/Icons/content-play.svg",
    alt: "Content Hub"
  }].filter(product => product.name && product.level);
  if (products.length === 0) return null;
  return <div>
      <div className="text-sm mb-2">{translations.description}</div>
      <div className={`grid ${products.length === 1 ? 'grid-cols-1' : 'grid-cols-2'} gap-1.5`}>
        {products.map((product, index) => <div key={index} style={{
    display: 'flex',
    alignItems: 'center'
  }}>
            <img src={product.icon} alt={product.alt} className="w-3.5 h-3.5 mr-1.5 mt-2.5 mb-2.5 flex-shrink-0 align-middle" />
            <span className="font-medium mr-1 text-sm">{product.name} -</span>
            <span className="text-sm">{product.level}</span>
          </div>)}
      </div>
    </div>;
};

<AccordionGroup>
  <Accordion title="Supported products" defaultOpen="true" icon="cubes">
    <SupportedProducts marketing={true} sales={true} service={true} cms={true} marketingLevel="ENTERPRISE" salesLevel="ENTERPRISE" serviceLevel="ENTERPRISE" cmsLevel="ENTERPRISE" />
  </Accordion>

  <Accordion title="Required Scopes" icon="key">
    <ScopesList
      scopes={[
  'behavioral_events.event_definitions.read_write'
]}
    />
  </Accordion>
</AccordionGroup>


## OpenAPI

````yaml specs/legacy/v3/events-manage-event-definitions-v3.json POST /events/v3/event-definitions/{eventName}/property
openapi: 3.0.1
info:
  title: Events Manage Event Definitions
  description: Endpoint to create, delete and get behavioral event definitions
  version: v3
  x-hubspot-product-tier-requirements:
    marketing: ENTERPRISE
    sales: ENTERPRISE
    service: ENTERPRISE
    cms: ENTERPRISE
    commerce: ENTERPRISE
    crmHub: ENTERPRISE
    dataHub: ENTERPRISE
  x-hubspot-related-documentation:
    - name: Custom Events Definitions Guide
      url: >-
        https://developers.hubspot.com/docs/guides/api/analytics-and-events/custom-events/custom-event-definitions
servers:
  - url: https://api.hubapi.com
security: []
tags:
  - name: Advanced
  - name: Basic
  - name: Batch
paths:
  /events/v3/event-definitions/{eventName}/property:
    post:
      tags:
        - Advanced
      summary: イベント定義のプロパティーを作成
      description: 既存のイベント定義の新しいプロパティーを作成します。
      operationId: post-/events/v3/event-definitions/{eventName}/property
      parameters:
        - name: eventName
          in: path
          description: ''
          required: true
          style: simple
          explode: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExternalBehavioralEventPropertyCreate'
        required: true
      responses:
        '201':
          description: successful operation
          headers:
            Location:
              description: URL of the newly created resource
              style: simple
              explode: false
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Property'
        default:
          $ref: '#/components/responses/Error'
          description: ''
      security:
        - oauth2:
            - behavioral_events.event_definitions.read_write
components:
  schemas:
    ExternalBehavioralEventPropertyCreate:
      required:
        - label
        - type
      type: object
      properties:
        description:
          type: string
          description: HubSpotにヘルプテキストとして表示されるプロパティーの説明。
        label:
          type: string
          description: 人間が読めるプロパティーのラベル。HubSpot UIで使用されます
        name:
          type: string
          description: このAPIからプロパティーを参照する際に使用する必要がある内部プロパティー名
        options:
          type: array
          description: 列挙プロパティーに使用可能なオプションのリスト。メモ：このフィールドは列挙型のプロパティーにのみ適用されます。
          items:
            $ref: '#/components/schemas/OptionInput'
        type:
          type: string
          description: プロパティーのデータ型。[string、number、enumeration、datetime]のいずれかになります
    Property:
      required:
        - description
        - fieldType
        - groupName
        - label
        - name
        - options
        - type
      type: object
      properties:
        archived:
          type: boolean
          description: プロパティーがアーカイブされているかどうか。
        archivedAt:
          type: string
          description: プロパティーがアーカイブされた時刻のタイムスタンプ（ISO 8601形式）。
          format: date-time
        calculated:
          type: boolean
          description: プロパティーが計算フィールドかどうか。
        calculationFormula:
          type: string
          description: 計算プロパティーに使用される式。
        createdAt:
          type: string
          description: プロパティーが作成された時刻のタイムスタンプ（ISO 8601形式）。
          format: date-time
        createdUserId:
          type: string
          description: プロパティーを作成したユーザーのID。
        currencyPropertyName:
          type: string
          description: 関連する通貨プロパティーの名前。
        dataSensitivity:
          type: string
          description: >-
            「non_sensitive」、「sensitive」、「highly_sensitive」など、プロパティーのセンシティブ（慎重に扱うべき）レベルを示します。
          enum:
            - highly_sensitive
            - non_sensitive
            - sensitive
        dateDisplayHint:
          type: string
          enum:
            - absolute
            - absolute_with_relative
            - time_since
            - time_until
        description:
          type: string
          description: プロパティーの目的の要約。
        displayOrder:
          type: integer
          description: リスト内項目の他の項目との相対位置。
          format: int32
        externalOptions:
          type: boolean
          description: >-
            列挙型のプロパティーにのみ適用されます。trueに設定し、「referencedObjectType」を「OWNER」に設定します。それ以外の場合はfalse。
        fieldType:
          type: string
          description: HubSpotのUIまたはフォーム上でプロパティーがどう表示されるかを指定します。詳細はプロパティーAPIガイドをご確認ください。
        formField:
          type: boolean
          description: プロパティーをフォームで表示できるかどうか。
        groupName:
          type: string
          description: プロパティーが割り当てられているグループの名前。
        hasUniqueValue:
          type: boolean
          description: プロパティーが固有IDプロパティーかどうか。
        hidden:
          type: boolean
          description: プロパティーをHubSpot UIから非表示にするかどうか。カスタムプロパティーの場合は、これをfalseに設定することが推奨されます。
          example: false
        hubspotDefined:
          type: boolean
          description: HubSpotデフォルトプロパティーについてtrueに設定されるブール値。
        label:
          type: string
          description: プロパティーの表示ラベル。
        modificationMetadata:
          $ref: '#/components/schemas/PropertyModificationMetadata'
        name:
          type: string
          description: プロパティーの内部名。
        numberDisplayHint:
          type: string
          description: >-
            HubSpotのUIでの数値プロパティーの表示方法と検証方法に関するヒント。「unformatted」、「formatted」、「currency」、「percentage」、「duration」、「probability」のいずれかにできます。
          enum:
            - currency
            - duration
            - formatted
            - percentage
            - probability
            - unformatted
        options:
          type: array
          description: プロパティーの有効なオプションのリスト。このフィールドは列挙型のプロパティーに必要です。
          items:
            $ref: '#/components/schemas/Option_1'
        referencedObjectType:
          type: string
          description: 非推奨。代わりにexternalOptionsReferenceTypeを使用してください。
        sensitiveDataCategories:
          type: array
          description: sensitiveDataがtrueの場合、プロパティーに含まれるセンシティブデータのタイプを示します（例：「HIPAA」）。
          items:
            type: string
        showCurrencySymbol:
          type: boolean
          description: HubSpotのUIに通貨記号を表示するかどうか。
        textDisplayHint:
          type: string
          description: >-
            HubSpotのUIでのテキストの表示方法と検証方法に関するヒント。「unformatted_single_line」、「multi_line」、「email」、「phone_number」、「domain_name」、「ip_address」、「physical_address」、「postal_code」のいずれかにできます。
          enum:
            - domain_name
            - email
            - ip_address
            - multi_line
            - phone_number
            - physical_address
            - postal_code
            - unformatted_single_line
        type:
          type: string
          description: 文字列や数値など、プロパティーのデータ型。
        updatedAt:
          type: string
          description: プロパティーが最後に更新されたタイムスタンプ（ISO 8601形式）。
          format: date-time
        updatedUserId:
          type: string
      description: HubSpotプロパティー
    OptionInput:
      required:
        - displayOrder
        - hidden
        - label
        - value
      type: object
      properties:
        description:
          type: string
          description: 'null'
        displayOrder:
          type: integer
          format: int32
        hidden:
          type: boolean
        label:
          type: string
          description: 'null'
        value:
          type: string
          description: 'null'
    PropertyModificationMetadata:
      required:
        - archivable
        - readOnlyDefinition
        - readOnlyValue
      type: object
      properties:
        archivable:
          type: boolean
        readOnlyDefinition:
          type: boolean
        readOnlyOptions:
          type: boolean
        readOnlyValue:
          type: boolean
    Option_1:
      required:
        - hidden
        - label
        - value
      type: object
      properties:
        description:
          type: string
        displayOrder:
          type: integer
          format: int32
        hidden:
          type: boolean
        label:
          type: string
        value:
          type: string
    Error:
      required:
        - category
        - correlationId
        - message
      type: object
      properties:
        category:
          type: string
          description: エラーカテゴリー
        context:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: エラー条件に関する背景状況
          example: >-
            {invalidPropertyName=[propertyValue], missingScopes=[scope1,
            scope2]}
        correlationId:
          type: string
          description: リクエストの固有ID。エラー報告またはサポートチケットには必ずこの値を含めてください
          format: uuid
          example: aeb5f871-7f07-4993-9211-075dc63e7cbf
        errors:
          type: array
          description: エラーに関する詳細情報
          items:
            $ref: '#/components/schemas/ErrorDetail'
        links:
          type: object
          additionalProperties:
            type: string
          description: エラーまたは推奨の修正手順に関するドキュメントが含まれる関連付けられたURIへのリンク名の対応付け
        message:
          type: string
          description: エラーと修正手順（該当する場合）を記した、人が理解できるメッセージ
          example: An error occurred
        subCategory:
          type: string
          description: エラーに関する具体的な詳細が含まれる特定のカテゴリー
      example:
        message: Invalid input (details will vary based on the error)
        correlationId: aeb5f871-7f07-4993-9211-075dc63e7cbf
        category: VALIDATION_ERROR
        links:
          knowledge-base: https://www.hubspot.com/products/service/knowledge-base
    ErrorDetail:
      required:
        - message
      type: object
      properties:
        code:
          type: string
          description: エラーの詳細に関連付けられているステータスコード
        context:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: エラー条件に関する背景状況
          example: '{missingScopes=[scope1, scope2]}'
        in:
          type: string
          description: エラーが見つかったフィールドまたはパラメーターの名前。
        message:
          type: string
          description: エラーと修正手順（該当する場合）を記した、人が理解できるメッセージ
        subCategory:
          type: string
          description: エラーに関する具体的な詳細が含まれる特定のカテゴリー
  responses:
    Error:
      description: An error occurred.
      content:
        '*/*':
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://app.hubspot.com/oauth/authorize
          tokenUrl: https://api.hubapi.com/oauth/v1/token
          scopes:
            analytics.behavioral_events.send: ''
            behavioral_events.event_definitions.read_write: ''

````