> ## 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 Event

> MediaBridgeServiceで新しいアテンション スパン イベントを作成してください。このエンドポイントは、メディアコンテンツに対するユーザーエンゲージメントの追跡に役立つアテンション スパン イベントを記録するために使用されます。リクエストには、AttentionSpanEventRequestスキーマに準拠した有効なJSONボディを含める必要があります。

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="FREE" salesLevel="FREE" serviceLevel="FREE" cmsLevel="FREE" />
  </Accordion>

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


## OpenAPI

````yaml specs/2026-09/cms-media-bridge-v2026-09.json POST /media-bridge/2026-09/events/attention-span
openapi: 3.0.1
info:
  title: CMS Media Bridge
  description: Basepom for all HubSpot Projects
  version: 2026-09
  x-hubspot-product-tier-requirements:
    marketing: FREE
    sales: FREE
    service: FREE
    cms: FREE
    commerce: FREE
    crmHub: FREE
    dataHub: FREE
servers:
  - url: https://api.hubapi.com
security: []
tags:
  - name: Advanced
  - name: Basic
  - name: Batch
paths:
  /media-bridge/2026-09/events/attention-span:
    post:
      tags:
        - Advanced
      summary: イベントを作成
      description: >-
        MediaBridgeServiceで新しいアテンション スパン
        イベントを作成してください。このエンドポイントは、メディアコンテンツに対するユーザーエンゲージメントの追跡に役立つアテンション スパン
        イベントを記録するために使用されます。リクエストには、AttentionSpanEventRequestスキーマに準拠した有効なJSONボディを含める必要があります。
      operationId: post-/media-bridge/2026-09/events/attention-span
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AttentionSpanEventRequest'
        required: true
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttentionSpanEvent'
        default:
          $ref: '#/components/responses/Error'
          description: ''
      security:
        - oauth2:
            - media_bridge.write
components:
  schemas:
    AttentionSpanEventRequest:
      required:
        - mediaType
        - occurredTimestamp
        - rawDataMap
        - sessionId
      type: object
      properties:
        _hsenc:
          type: string
          description: HubSpot固有のエンコード目的で使用されるエンコード済み文字列。
        contactId:
          type: integer
          description: イベントに関連付けられているコンタクトの固有ID。
          format: int64
        contactUtk:
          type: string
          description: コンタクトの追跡に使用される、一意の追跡キー。
        derivedValues:
          $ref: '#/components/schemas/AttentionSpanCalculatedValues'
        externalId:
          type: string
          description: イベントの外部ID。通常、外部システムとの関連付けに使用されます。
        externalPlayContext:
          type: string
          description: 再生イベントに関する追加のコンテキスト。通常、外部連携に使用されます。
          enum:
            - EMAIL
            - EXTERNAL_PAGE
        mediaBridgeId:
          type: integer
          description: メディア ブリッジ インスタンスの一意の識別子。
          format: int64
        mediaName:
          type: string
          description: イベントに関連するメディアの名前。
        mediaType:
          type: string
          description: >-
            イベントに関連するメディアの種類です。有効な値は「VIDEO」、「AUDIO」、「DOCUMENT」、「OTHER」、「IMAGE」です。
          enum:
            - AUDIO
            - DOCUMENT
            - IMAGE
            - OTHER
            - VIDEO
        mediaUrl:
          type: string
          description: イベントに関連するメディアのURL。
        occurredTimestamp:
          type: integer
          description: イベント発生時のタイムスタンプ。ミリ秒単位のUnixタイムスタンプで表します。
          format: int64
        pageId:
          type: integer
          description: イベントが発生したページの固有ID。
          format: int64
        pageName:
          type: string
          description: イベントが発生したページの名前。
        pageUrl:
          type: string
          description: イベントが発生したページのURL。
        rawDataMap:
          type: object
          additionalProperties:
            type: integer
            format: int32
          description: イベントに関する追加のコンテキストを提供する、生データのキーと値のペアのマップ。
        rawDataString:
          type: string
          description: イベントに関する追加情報が含まれた生データの文字列。
        sessionId:
          type: string
          description: イベントが発生したセッションの固有ID。
    AttentionSpanEvent:
      required:
        - contactId
        - mediaBridgeId
        - mediaBridgeObjectCoordinates
        - mediaBridgeObjectTypeId
        - mediaName
        - mediaType
        - occurredTimestamp
        - percentRange
        - portalId
        - providerId
        - sessionId
        - totalPercentPlayed
      type: object
      properties:
        contactId:
          type: integer
          description: イベントに関連付けられているコンタクトの固有IDを表す文字列。
          format: int64
        externalPlayContext:
          type: string
          description: 再生イベントに関する外部ソースからの追加のコンテキストを提供する文字列。
          enum:
            - EMAIL
            - EXTERNAL_PAGE
        mediaBridgeId:
          type: integer
          description: メディアブリッジインスタンスの一意の識別子を表す文字列。
          format: int64
        mediaBridgeObjectCoordinates:
          type: string
          description: メディアブリッジオブジェクトの座標の詳細を示す文字列。
        mediaBridgeObjectTypeId:
          type: string
          description: メディアブリッジオブジェクトのタイプIDを表す文字列。
        mediaName:
          type: string
          description: メディアコンテンツの名前を表す文字列
        mediaType:
          type: string
          description: イベントで使用されるメディアの種類を示す文字列（「VIDEO」、「AUDIO」など）。
          enum:
            - AUDIO
            - DOCUMENT
            - IMAGE
            - OTHER
            - VIDEO
        mediaUrl:
          type: string
          description: メディアコンテンツのURLが含まれた文字列。
        occurredTimestamp:
          type: integer
          description: イベント発生時のタイムスタンプを表すISO 8601形式の文字列。
          format: int64
        pageId:
          type: integer
          description: ページの固有IDを表す文字列。
          format: int64
        pageName:
          type: string
          description: メディアがアクセスされたページの名前を表す文字列。
        pageObjectCoordinates:
          type: string
          description: ページオブジェクトの座標の詳細を示す文字列。
        pageUrl:
          type: string
          description: メディアがアクセスされたページのURLが含まれた文字列。
        percentRange:
          type: string
          description: セッション中に再生されたパーセンテージの範囲を示す文字列。
        portalId:
          type: integer
          description: HubSpotポータルの固有IDを表す整数。
          format: int32
        providerId:
          type: integer
          description: メディアプロバイダーの固有IDを表す文字列。
          format: int32
        rawData:
          type: string
          description: イベントに関連付けられた生データを含む文字列。
        sessionId:
          type: string
          description: メディアが再生されたセッションの一意の識別子を表す文字列。
        totalPercentPlayed:
          type: number
          description: メディアが再生された割合の合計を示す数値。
        totalSecondsPlayed:
          type: integer
          description: メディアの再生の合計秒数を表す数値。
          format: int32
    AttentionSpanCalculatedValues:
      required:
        - totalPercentPlayed
        - totalSecondsPlayed
      type: object
      properties:
        totalPercentPlayed:
          type: number
          description: 再生されたメディアコンテンツの割合。これは、コンテンツ全体のどれだけが視聴されたかを示す数値で、パーセンテージで表されます。
        totalSecondsPlayed:
          type: integer
          description: メディアコンテンツが再生された合計時間（秒）。これは累積再生時間を表す数値です。
          format: int32
    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: エラーに関する具体的な詳細が含まれる特定のカテゴリー
      description: >-
        操作が失敗した際にAPIから返されるエラーレスポンスを表します。このコンポーネントは、発生したエラーに関する詳細情報を提供するために、さまざまなエンドポイントで使用されます。
      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: エラーに関する具体的な詳細が含まれる特定のカテゴリー
      description: >-
        APIで発生したエラーに関する詳細情報を表します。このコンポーネントは、通常、エラーレスポンスの一部として、エラーに関する追加の背景情報と詳細を提供するために使用されます。
  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:
            media_bridge.write: ''

````