Help with home assistant api call

I think it’s supposed to be this:

Configuration.yaml

rest_command:
  set_climate_state_idle:
    method: POST
    url: 'https://xxxxxx.duckdns.org:8123/api/states/climate.panasonic_aircon'
    password: 'xxxxxx'
    content_type: application/json
    payload: '{
    "state": "idle",
    "attributes": {
        "fan_mode": "auto",
        "operation_mode": "idle"
        }
    }'

Automation.yaml

- alias: set climate state to idle when aircon turns off
  trigger:
    - platform: state
      entity_id: binary_sensor.door_window_sensor_158d0001f38b1f
      from: 'on'
      to: 'off'
  condition:
    - condition: template
      value_template: "{{ not is_state('climate.panasonic_aircon', 'idle') }}"     
  action:
    - service: rest_command.set_climate_state_idle

but i get an error in configuration.yaml and I’m not sure what the issue is.