---
title: "Create Event"
method: POST
path: "/media-bridge/2026-09/events/attention-span"
tags: ["Advanced"]
---

# Create Event

`POST /media-bridge/2026-09/events/attention-span`

## Request

- Base URL: `https://api.hubapi.com`
- URL: `https://api.hubapi.com/media-bridge/2026-09/events/attention-span`
- Auth: OAuth 2
  - Authorization code: `https://app.hubspot.com/oauth/authorize`
  - Token URL: `https://api.hubapi.com/oauth/v1/token` scopes: `media_bridge.write`

Create a new attention span event in the MediaBridgeService. This endpoint is used to record attention span events, which can be useful for tracking user engagement with media content. The request must include a valid JSON body conforming to the AttentionSpanEventRequest schema.

## Request body

- AttentionSpanEventRequest
  - `_hsenc` string: An encoded string used for HubSpot-specific encoding purposes.
  - `contactId` integer: The unique identifier for the contact associated with the event.
  - `contactUtk` string: The unique tracking key for the contact, used for tracking purposes.
  - `derivedValues` AttentionSpanCalculatedValues
    - `totalPercentPlayed` number, required: The percentage of the media content that was played. This is a numerical value indicating how much of the total content was viewed, expressed as a percentage.
    - `totalSecondsPlayed` integer, required: The total duration in seconds that the media content was played. This is a numerical value representing the cumulative playtime.
  - `externalId` string: An external identifier for the event, typically used to correlate with external systems.
  - `externalPlayContext` 'EMAIL' | 'EXTERNAL_PAGE': Additional context about the play event, typically used for external integrations.
  - `mediaBridgeId` integer: The unique identifier for the media bridge instance.
  - `mediaName` string: The name of the media involved in the event.
  - `mediaType` 'AUDIO' | 'DOCUMENT' | 'IMAGE' | 'OTHER' | 'VIDEO', required: The type of media involved in the event. Valid values include 'VIDEO', 'AUDIO', 'DOCUMENT', 'OTHER', and 'IMAGE'.
  - `mediaUrl` string: The URL of the media involved in the event.
  - `occurredTimestamp` integer, required: The timestamp when the event occurred, represented as a Unix timestamp in milliseconds.
  - `pageId` integer: The unique identifier for the page where the event occurred.
  - `pageName` string: The name of the page where the event occurred.
  - `pageUrl` string: The URL of the page where the event occurred.
  - `rawDataMap` object, required: A map of raw data key-value pairs providing additional context about the event.
  - `rawDataString` string: A raw data string containing additional information about the event.
  - `sessionId` string, required: The unique identifier for the session during which the event occurred.

## Response `200`

successful operation

- AttentionSpanEvent
  - `contactId` integer, required: A string representing the unique identifier for the contact associated with the event.
  - `externalPlayContext` 'EMAIL' | 'EXTERNAL_PAGE': A string providing additional context about the play event from an external source.
  - `mediaBridgeId` integer, required: A string representing the unique identifier for the media bridge instance.
  - `mediaBridgeObjectCoordinates` string, required: A string detailing the coordinates of the media bridge object.
  - `mediaBridgeObjectTypeId` string, required: A string representing the type identifier for the media bridge object.
  - `mediaName` string, required: A string representing the name of the media content.
  - `mediaType` 'AUDIO' | 'DOCUMENT' | 'IMAGE' | 'OTHER' | 'VIDEO', required: A string indicating the type of media involved in the event, such as 'VIDEO', 'AUDIO', etc.
  - `mediaUrl` string: A string containing the URL of the media content.
  - `occurredTimestamp` integer, required: A string representing the timestamp of when the event occurred, in ISO 8601 format.
  - `pageId` integer: A string representing the unique identifier for the page.
  - `pageName` string: A string representing the name of the page where the media was accessed.
  - `pageObjectCoordinates` string: A string detailing the coordinates of the page object.
  - `pageUrl` string: A string containing the URL of the page where the media was accessed.
  - `percentRange` string, required: A string indicating the range of percentages that were played during the session.
  - `portalId` integer, required: An integer representing the unique identifier for the HubSpot portal.
  - `providerId` integer, required: A string representing the unique identifier for the media provider.
  - `rawData` string: A string containing raw data associated with the event.
  - `sessionId` string, required: A string representing the unique identifier for the session during which the media was played.
  - `totalPercentPlayed` number, required: A number indicating the total percentage of the media that was played.
  - `totalSecondsPlayed` integer: A number representing the total seconds of media that were played.

## Other responses

- `default`: An error occurred.

---

[API](https://skmtc.dev/hubspot/apis/cms-media-bridge.md) - [All operations](https://skmtc.dev/hubspot/apis/cms-media-bridge/llms.txt) - [OpenAPI document](https://skmtc.dev/hubspot/apis/cms-media-bridge/revisions/8f11766b98c4?raw)
