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

# Create a played event

> Create an event for when a user begins playing a piece of media.

> **Supported products**

> **Required Scopes**


## OpenAPI

````yaml specs/legacy/v1/cms-media-bridge-v1.json POST /media-bridge/v1/events/media-played
openapi: 3.0.1
info:
  title: CMS Media Bridge
  description: Basepom for all HubSpot Projects
  version: v1
  x-hubspot-product-tier-requirements:
    marketing: FREE
    sales: FREE
    service: FREE
    cms: FREE
    commerce: FREE
    crmHub: FREE
    dataHub: FREE
  x-hubspot-related-documentation:
    - name: Media Bridge Guide
      url: https://developers.hubspot.com/docs/guides/api/cms/media-bridge
servers:
  - url: https://api.hubapi.com
security: []
tags:
  - name: Advanced
  - name: Basic
  - name: Batch
paths:
  /media-bridge/v1/events/media-played:
    post:
      tags:
        - Advanced
      summary: Create a played event
      description: Create an event for when a user begins playing a piece of media.
      operationId: post-/media-bridge/v1/events/media-played
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MediaPlayedEventRequest'
        required: true
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MediaPlayedEvent'
        default:
          $ref: '#/components/responses/Error'
          description: ''
      security:
        - oauth2:
            - media_bridge.write
components:
  schemas:
    MediaPlayedEventRequest:
      required:
        - mediaType
        - occurredTimestamp
        - sessionId
        - state
      type: object
      properties:
        _hsenc:
          type: string
        contactId:
          type: integer
          format: int64
        contactUtk:
          type: string
        externalId:
          type: string
        externalPlayContext:
          type: string
          enum:
            - EMAIL
            - EXTERNAL_PAGE
        iframeUrl:
          type: string
        mediaBridgeId:
          type: integer
          format: int64
        mediaName:
          type: string
        mediaType:
          type: string
          enum:
            - AUDIO
            - DOCUMENT
            - IMAGE
            - OTHER
            - VIDEO
        mediaUrl:
          type: string
        occurredTimestamp:
          type: integer
          format: int64
        pageId:
          type: integer
          format: int64
        pageName:
          type: string
        pageUrl:
          type: string
        sessionId:
          type: string
        state:
          type: string
          enum:
            - STARTED
            - VIEWED
    MediaPlayedEvent:
      required:
        - contactId
        - mediaBridgeId
        - mediaBridgeObjectCoordinates
        - mediaBridgeObjectTypeId
        - mediaName
        - mediaType
        - occurredTimestamp
        - portalId
        - providerId
        - sessionId
        - state
      type: object
      properties:
        contactId:
          type: integer
          format: int64
        externalPlayContext:
          type: string
          enum:
            - EMAIL
            - EXTERNAL_PAGE
        iframeUrl:
          type: string
        mediaBridgeId:
          type: integer
          format: int64
        mediaBridgeObjectCoordinates:
          type: string
        mediaBridgeObjectTypeId:
          type: string
        mediaName:
          type: string
        mediaType:
          type: string
          enum:
            - AUDIO
            - DOCUMENT
            - IMAGE
            - OTHER
            - VIDEO
        mediaUrl:
          type: string
        occurredTimestamp:
          type: integer
          format: int64
        pageId:
          type: integer
          format: int64
        pageName:
          type: string
        pageObjectCoordinates:
          type: string
        pageUrl:
          type: string
        portalId:
          type: integer
          format: int32
        providerId:
          type: integer
          format: int32
        sessionId:
          type: string
        state:
          type: string
          enum:
            - STARTED
            - VIEWED
    Error:
      required:
        - category
        - correlationId
        - message
      type: object
      properties:
        category:
          type: string
          description: The error category
        context:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: Context about the error condition
          example: >-
            {invalidPropertyName=[propertyValue], missingScopes=[scope1,
            scope2]}
        correlationId:
          type: string
          description: >-
            A unique identifier for the request. Include this value with any
            error reports or support tickets
          format: uuid
          example: aeb5f871-7f07-4993-9211-075dc63e7cbf
        errors:
          type: array
          description: further information about the error
          items:
            $ref: '#/components/schemas/ErrorDetail'
        links:
          type: object
          additionalProperties:
            type: string
          description: >-
            A map of link names to associated URIs containing documentation
            about the error or recommended remediation steps
        message:
          type: string
          description: >-
            A human readable message describing the error along with remediation
            steps where appropriate
          example: An error occurred
        subCategory:
          type: string
          description: >-
            A specific category that contains more specific detail about the
            error
      description: >-
        Represents an error response returned by the API when an operation
        fails. This component is used in various endpoints to provide detailed
        information about the error encountered.
      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: The status code associated with the error detail
        context:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: Context about the error condition
          example: '{missingScopes=[scope1, scope2]}'
        in:
          type: string
          description: The name of the field or parameter in which the error was found.
        message:
          type: string
          description: >-
            A human readable message describing the error along with remediation
            steps where appropriate
        subCategory:
          type: string
          description: >-
            A specific category that contains more specific detail about the
            error
      description: >-
        Represents detailed information about an error that occurred in the API.
        This component is used to provide additional context and specifics about
        errors, typically as part of an error response.
  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: ''

````