Advanced

Create Event

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.

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

Request body

_hsencstring

An encoded string used for HubSpot-specific encoding purposes.

contactIdinteger

The unique identifier for the contact associated with the event.

contactUtkstring

The unique tracking key for the contact, used for tracking purposes.

externalIdstring

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.

mediaBridgeIdinteger

The unique identifier for the media bridge instance.

mediaNamestring

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'.

mediaUrlstring

The URL of the media involved in the event.

occurredTimestampinteger required

The timestamp when the event occurred, represented as a Unix timestamp in milliseconds.

pageIdinteger

The unique identifier for the page where the event occurred.

pageNamestring

The name of the page where the event occurred.

pageUrlstring

The URL of the page where the event occurred.

rawDataMapobject required

A map of raw data key-value pairs providing additional context about the event.

rawDataStringstring

A raw data string containing additional information about the event.

sessionIdstring required

The unique identifier for the session during which the event occurred.

Response

successful operation

contactIdinteger 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.

mediaBridgeIdinteger required

A string representing the unique identifier for the media bridge instance.

mediaBridgeObjectCoordinatesstring required

A string detailing the coordinates of the media bridge object.

mediaBridgeObjectTypeIdstring required

A string representing the type identifier for the media bridge object.

mediaNamestring 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.

mediaUrlstring

A string containing the URL of the media content.

occurredTimestampinteger required

A string representing the timestamp of when the event occurred, in ISO 8601 format.

pageIdinteger

A string representing the unique identifier for the page.

pageNamestring

A string representing the name of the page where the media was accessed.

pageObjectCoordinatesstring

A string detailing the coordinates of the page object.

pageUrlstring

A string containing the URL of the page where the media was accessed.

percentRangestring required

A string indicating the range of percentages that were played during the session.

portalIdinteger required

An integer representing the unique identifier for the HubSpot portal.

providerIdinteger required

A string representing the unique identifier for the media provider.

rawDatastring

A string containing raw data associated with the event.

sessionIdstring required

A string representing the unique identifier for the session during which the media was played.

totalPercentPlayednumber required

A number indicating the total percentage of the media that was played.

totalSecondsPlayedinteger

A number representing the total seconds of media that were played.

Changes

No operation changes recorded.