Skip to content

HubSpot: Create — media Bridge media Played

HubSpot mediaBridge.mediaPlayed: arguments, response, policy and SDK examples.

← Media bridge operations · Get started

Operation hubspot.media_bridge_media_played

Provider route: POST /media-bridge/2026-09/events/media-played. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/hubspot with npm, or alter-sdk-hubspot with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { HubSpotIntegration } from "@alter-ai/hubspot";
async function execute(input: Parameters<HubSpotIntegration["mediaBridge"]["mediaPlayed"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new HubSpotIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.mediaBridge.mediaPlayed(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_hubspot import HubSpotIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = HubSpotIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.media_bridge.media_played(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
bodyModelRequired within parentExpand Create — media Bridge media Played — request body — body

Referenced models: Create — media Bridge media Played — request body — body

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Create — media Bridge media Played — response body

Referenced models: Create — media Bridge media Played — response body

Create — media Bridge media Played — request body — body
FieldTypePresenceDescription and constraints
$objectRoot
_hsencstringOptionalAn encoding parameter used internally by HubSpot.
contactIdintegerOptionalThe unique identifier for the contact associated with the media play event.
Format: int64
contactUtkstringOptionalThe unique tracking key for the contact, used for tracking purposes.
externalIdstringOptionalAn external identifier for the media, used to correlate with external systems.
externalPlayContextstringOptionalAdditional context about the media play event, provided by external systems.
One of: EMAIL, EXTERNAL_PAGE
iframeUrlstringOptionalThe URL of the iframe containing the media, if applicable.
mediaBridgeIdintegerOptionalA unique identifier for the media bridge instance.
Format: int64
mediaNamestringOptionalThe name of the media that was played.
mediaTypestringRequired within parentThe type of media that was played, such as 'VIDEO', 'AUDIO', 'DOCUMENT', 'OTHER', or 'IMAGE'.
One of: AUDIO, DOCUMENT, IMAGE, OTHER, VIDEO
mediaUrlstringOptionalThe URL of the media that was played.
occurredTimestampintegerRequired within parentThe timestamp when the media play event occurred, in Unix time format.
Format: int64
pageIdintegerOptionalA unique identifier for the page where the media was played.
Format: int64
pageNamestringOptionalThe name of the page where the media was played.
pageUrlstringOptionalThe URL of the page where the media was played.
sessionIdstringRequired within parentA unique identifier for the session during which the media was played.
statestringRequired within parentThe state of the media play event, indicating the current status.
One of: STARTED, VIEWED
Create — media Bridge media Played — response body
FieldTypePresenceDescription and constraints
$objectRoot
contactIdJSONRequired within parent
contactId (anyOf 1)integerAlternativeThe unique identifier for the contact associated with this media event.
Format: int64
contactId (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
externalPlayContextstringOptionalAdditional context provided by external systems about the play event.
Known values: EMAIL, EXTERNAL_PAGE
iframeUrlstringOptionalThe URL of the iframe where the media was embedded and played.
mediaBridgeIdJSONRequired within parent
mediaBridgeId (anyOf 1)integerAlternativeThe unique identifier for the media bridge instance associated with this event.
Format: int64
mediaBridgeId (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
mediaBridgeObjectCoordinatesstringRequired within parentCoordinates that specify the location or context of the media bridge object.
mediaBridgeObjectTypeIdstringRequired within parentThe type identifier of the media bridge object involved in the event.
mediaNamestringRequired within parentThe name of the media content that was played.
mediaTypestringRequired within parentThe type of media that was played, such as video or audio.
Known values: AUDIO, DOCUMENT, IMAGE, OTHER, VIDEO
mediaUrlstringOptionalThe URL where the media content is hosted.
occurredTimestampJSONRequired within parent
occurredTimestamp (anyOf 1)integerAlternativeA Unix timestamp in milliseconds indicating when the media play event occurred.
Format: int64
occurredTimestamp (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
pageIdJSONOptional
pageId (anyOf 1)integerAlternativeThe unique identifier for the page where the media was played.
Format: int64
pageId (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
pageNamestringOptionalThe name of the page where the media was played.
pageObjectCoordinatesstringOptionalCoordinates that specify the location or context of the page object.
pageUrlstringOptionalThe URL of the page where the media was played.
portalIdJSONRequired within parent
portalId (anyOf 1)integerAlternativeThe unique identifier of the HubSpot portal where the event occurred.
Format: int32
portalId (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
providerIdJSONRequired within parent
providerId (anyOf 1)integerAlternativeThe unique identifier for the media provider.
Format: int32
providerId (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
sessionIdstringRequired within parentThe unique identifier for the session during which the media was played.
statestringRequired within parentThe state of the media play event, such as 'started' or 'completed'.
Known values: STARTED, VIEWED

SDK function policy ID: hubspot.media_bridge_media_played. Catalog operation: media_bridge_media_played. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Required provider scopes: ["media_bridge.write"]

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.