@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Google Home
@base http://example.com/setup
@version 2.0
@auth ApiKey cast-local-authorization-token in header
@endpoints 30
@hint download_for_search
@toc supported_timezones(1), get_app_device_id(1), supported_locales(1), assistant(7), offer(1), eureka_info(1), test_internet_download_speed(1), reboot(1), set_eureka_info(1), user_eq(1), bluetooth(7), connect_wifi(1), scan_wifi(1), configured_networks(1), forget_wifi(1), scan_results(1), NOTICE.html.gz(1), icon.png(1)

@group supported_timezones
@endpoint GET /supported_timezones
@desc Timezones
@returns(200)

@endgroup

@group get_app_device_id
@endpoint POST /get_app_device_id
@desc App Device ID
@required {app_id: str}
@returns(200) {app_device_id: str, certificate: str, signed_data: str}
@errors {404: Not Found}
@example_request {"app_id":"E8C28D3C"}

@endgroup

@group supported_locales
@endpoint GET /supported_locales
@desc Locales
@returns(200)

@endgroup

@group assistant
@endpoint POST /assistant/check_ready_status
@desc Check Ready Status
@required {play_ready_message: bool, user_id: str}
@returns(200) {can_enroll: bool, enrollment_state: int(int32), error_code: int(int32), ready: bool, retryable: bool}
@example_request {"play_ready_message":true,"user_id":"xxxxx"}

@endgroup

@group offer
@endpoint GET /offer
@desc Offer
@returns(200) {token: str}

@endgroup

@group eureka_info
@endpoint GET /eureka_info
@desc Eureka Info
@required {params: str, options: str, nonce: int(int32)}
@returns(200) {aogh: map{aogh_api_version: str}, audio: map{digital: bool}, build_info: map{build_type: int(int32), cast_build_revision: str, cast_control_version: int(int32), preview_channel_state: int(int32), release_track: str, system_build_number: str}, detail: map{icon_list: [map], locale: map{display_string: str}, timezone: map{display_string: str, offset: int(int32)}}, device_info: map{4k_blocked: int(int32), capabilities: map{aogh_supported: bool, assistant_supported: bool, audio_hdr_supported: bool, audio_surround_mode_supported: bool, ble_supported: bool, bluetooth_audio_sink_supported: bool, bluetooth_audio_source_supported: bool, bluetooth_supported: bool, cloudcast_supported: bool, content_filters_supported: bool, display_supported: bool, fdr_supported: bool, hdmi_prefer_50hz_supported: bool, hdmi_prefer_high_fps_supported: bool, hotspot_supported: bool, https_setup_supported: bool, input_management_supported: bool, keep_hotspot_until_connected_supported: bool, multi_user_supported: bool, multichannel_group_supported: bool, multizone_supported: bool, night_mode_supported: bool, night_mode_supported_v2: bool, opencast_supported: bool, preview_channel_supported: bool, reboot_supported: bool, remote_ducking_supported: bool, separate_tts_volume_supported: bool, setup_supported: bool, sleep_mode_supported: bool, stats_supported: bool, system_sound_effects_supported: bool, user_eq_supported: bool, wifi_auto_save_supported: bool, wifi_regulatory_domain_locked: bool, wifi_supported: bool}, cloud_device_id: str, factory_country_code: str, hotspot_bssid: str, local_authorization_token_hash: str, mac_address: str, manufacturer: str, model_name: str, product_name: str, public_key: str, ssdp_udn: str, uma_client_id: str, uptime: num, weave_device_id: str}, multizone: map{audio_output_delay: int(int32), audio_output_delay_hdmi: int(int32), audio_output_delay_oem: int(int32), aux_in_group: str, dynamic_groups: [str], groups: [str], multichannel_status: int(int32)}, name: str, net: map{ethernet_connected: bool, ip_address: str, online: bool}, night_mode_params: map{device_override_do_not_disturb: int(int32), do_not_disturb: bool, enabled: bool, led_brightness: num, volume: num, windows: [map]}, opencast: map{pin_code: str}, opt_in: map{audio_hdr: bool, audio_surround_mode: int(int32), autoplay_on_signal: bool, cloud_ipc: bool, hdmi_prefer_50hz: bool, hdmi_prefer_high_fps: bool, managed_mode: bool, opencast: bool, preview_channel: bool, remote_ducking: bool, stats: bool, ui_flipped: bool, wpa3_support_enabled: bool}, proxy: map{mode: str}, settings: map{closed_caption: map, control_notifications: int(int32), country_code: str, locale: str, network_standby: int(int32), system_sound_effects: bool, time_format: int(int32), timezone: str, wake_on_cast: int(int32)}, setup: map{qr_ssid_suffix: str, setup_state: int(int32), ssid_suffix: str, stats: map{num_check_connectivity: int(int32), num_connect_wifi: int(int32), num_connected_wifi_not_saved: int(int32), num_initial_eureka_info: int(int32), num_obtain_ip: int(int32)}, tos_accepted: bool}, sign: map{certificate: str, intermediate_certs: [str], nonce: str, signed_data: str}, user_eq: map{high_shelf: map{frequency: int(int32), gain_db: int(int32), quality: num}, low_shelf: map{frequency: int(int32), gain_db: int(int32), quality: num}, max_peaking_eqs: int(int32), peaking_eqs: [str]}, version: int(int32), wifi: map{bssid: str, has_changes: bool, noise_level: int(int32), signal_level: int(int32), ssid: str, wpa_configured: bool, wpa_id: int(int32), wpa_state: int(int32)}}

@endgroup

@group test_internet_download_speed
@endpoint POST /test_internet_download_speed
@desc Test Internet Download Speed
@required {url: str}
@returns(200) {bytes_received: int(int32), response_code: int(int32), time_for_data_fetch: int(int32), time_for_http_response: int(int32)}
@example_request {"url":"https://storage.googleapis.com/reliability-speedtest/random.txt"}

@endgroup

@group reboot
@endpoint POST /reboot
@desc Reboot and Factory Reset
@required {params: str}
@returns(200)
@example_request {"params":"now"}

@endgroup

@group assistant
@endpoint POST /assistant/set_night_mode_params
@desc Night Mode settings
@required {enabled: bool, do_not_disturb: bool, led_brightness: num, volume: num, demo_to_user: bool, windows: [map{days!: [int(int32)], length_hours!: int(int32), start_hour!: int(int32)}]}
@returns(200) {do_not_disturb: bool, enabled: bool, led_brightness: num, volume: num, windows: [map]}
@example_request {"enabled":false,"do_not_disturb":true,"led_brightness":0.44999998807907104,"volume":0.46000000834465027,"demo_to_user":true,"windows":[{"length_hours":8,"days":[0,1,2,3,4,5,6],"start_hour":22}]}

@endgroup

@group set_eureka_info
@endpoint POST /set_eureka_info
@desc Set Eureka Info
@required {name: str, settings: map{control_notifications!: int(int32)}, opt_in: map{opencast!: bool, preview_channel!: bool, remote_ducking!: bool, stats!: bool}}
@returns(200)
@example_request {"name":"Living Room","settings":{"control_notifications":2},"opt_in":{"opencast":true,"preview_channel":true,"remote_ducking":true,"stats":true}}

@endgroup

@group assistant
@endpoint GET /assistant/alarms
@desc Get Alarms and Timers
@returns(200) {alarm: [map], timer: [map]}

@endpoint POST /assistant/alarms/delete
@desc Delete Alarms and Timers
@required {ids: [str]}
@returns(200) {success: bool}
@example_request {"ids":["timer/xxx","alarm/xxx"]}

@endpoint POST /assistant/notifications
@desc Do Not Disturb
@required {Content-Type: str}
@returns(200) {notifications_enabled: bool}

@endpoint POST /assistant/alarms/volume
@desc Alarm Volume
@required {volume: int(int32)}
@returns(200) {volume: num}
@example_request {"volume":1}

@endgroup

@group user_eq
@endpoint POST /user_eq/set_equalizer
@desc Set Equalizer Values
@required {low_shelf: map{gain_db!: int(int32)}, high_shelf: map{gain_db!: int(int32)}}
@returns(200)
@example_request {"low_shelf":{"gain_db":0},"high_shelf":{"gain_db":0}}

@endgroup

@group assistant
@endpoint POST /assistant/a11y_mode
@desc Accessibility
@required {hotword_enabled: bool, endpoint_enabled: bool}
@returns(200) {endpoint_enabled: bool, hotword_enabled: bool}
@example_request {"hotword_enabled":false,"endpoint_enabled":false}

@endgroup

@group bluetooth
@endpoint GET /bluetooth/scan_results
@desc Get Scan Results
@returns(200)

@endpoint POST /bluetooth/bond
@desc Forget paired device
@required {mac_address: str, bond: bool}
@returns(200)
@example_request {"mac_address":"xx:xx:xx:xx:xx:xx","bond":false}

@endpoint POST /bluetooth/discovery
@desc Change Discoverability
@required {enable_discovery: bool}
@returns(200)
@example_request {"enable_discovery":true}

@endpoint POST /bluetooth/connect
@desc Pair with Speaker
@required {mac_address: str, connect: bool, profile: int(int32)}
@returns(200)
@example_request {"mac_address":"54:13:79:49:19:22","connect":true,"profile":2}

@endpoint GET /bluetooth/status
@desc Status
@returns(200) {audio_mode: int(int32), connecting_devices: [str], connected_devices: [map], remote_sink: map{bond_date: num, device_class: int(int32), device_type: int(int32), last_connect_date: int(int32), mac_address: str, name: str, rssi: int(int32), service_uuids: [str]}, discovery_enabled: bool, scanning_enabled: bool}

@endpoint POST /bluetooth/scan
@desc Scan for devices
@required {enable: bool, clear_results: bool, timeout: int(int32)}
@returns(200)
@example_request {"enable":true,"clear_results":true,"timeout":60}

@endpoint GET /bluetooth/get_bonded
@desc Get Paired Devices
@returns(200)

@endgroup

@group connect_wifi
@endpoint POST /connect_wifi
@desc Connect to Wi-Fi Network
@required {bssid: str, signal_level: int(int32), ssid: str, wpa_auth: int(int32), wpa_cipher: int(int32), enc_passwd: str}
@returns(200)
@example_request {"bssid":"5c:0a:xx:xx:xx:xx","signal_level":-42,"ssid":"myotherssid","wpa_auth":7,"wpa_cipher":4,"enc_passwd":"xxxxxfPY="}

@endgroup

@group scan_wifi
@endpoint POST /scan_wifi
@desc Scan for Networks
@returns(200)

@endgroup

@group configured_networks
@endpoint GET /configured_networks
@desc Get Saved Networks
@returns(200)

@endgroup

@group forget_wifi
@endpoint POST /forget_wifi
@desc Forget Wi-Fi Network
@required {wpa_id: int(int32)}
@returns(200)
@example_request {"wpa_id":0}

@endgroup

@group scan_results
@endpoint GET /scan_results
@desc Get Wi-Fi Scan Results
@returns(200)

@endgroup

@group NOTICE.html.gz
@endpoint GET /NOTICE.html.gz
@desc Legal Notice
@returns(200)

@endgroup

@group icon.png
@endpoint GET /icon.png
@desc Chromecast Icon
@returns(200)

@endgroup

@end
