Message malformed: extra keys not allowed @ data['action'] error on Apple TV integration

I’m using the AppleTV integration, and copy/pasting the example to open a youtube video. The only line I change is the entity_id to match mine, but I can’t save the script.

# Open a specific YouTube video:
action: media_player.play_media
data:
  media_content_type: url
  media_content_id: youtube://www.youtube.com/watch?v=dQw4w9WgXcQ
target:
  entity_id: media_player.appletv

Are you on an old version of Home Assistant? It used to be domain/service but changed to action.

Nope 2025.3.2