Trouble calling a web service

I have a keypad that I use to trigger various things, and now I want to assign a key to call a web service to close a door.

I’ve searched, and using rest_command seems to be the recommended approach, but it’s failing.

In configuration.yaml, I added:

rest_command:
    office_door_close:
        url: "http://192.168.0.226:8000/srvc?target=closed"
    office_door_open:
        url: "http://192.168.0.226:8000/srvc?target=open"

I created an automation, then edited automation.yaml:

- id: '1735321750276'
  alias: NewCloseDoor
  description: Close the door when keypad "+" is pressed
  trigger:
  - platform: event
    event_type: keyboard_remote_command_received
    id: '101'
    event_data:
      key_code: 78
      type: key_down
      device_descriptor: /dev/input/event0
  condition: []
  action:
  - service: rest_command.close_office_door
    data: {}
  mode: single

When I press the key, the automation is triggered, but it generates this error:

The automation “NewCloseDoor” (automation.newclosedoor_2) has an action that calls an unknown service: rest_command.close_office_door.

This error prevents the automation from running correctly. Maybe this service is no longer available, or perhaps a typo caused it.

To fix this error, edit the automation and remove the action that calls this service.

Click on SUBMIT below to confirm you have fixed this automation.

I have tried some changes, like adding an explicit method for the web service.

I’d appreciate help, including changing away from using rest_command if there’s a better way.