{ "discoveryVersion": "v1", "auth": { "oauth2": { "scopes": { "https://www.googleapis.com/auth/homegraph": { "description": "Private Service: https://www.googleapis.com/auth/homegraph" } } } }, "version_module": true, "parameters": { "quotaUser": { "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", "type": "string", "location": "query" }, "alt": { "default": "json", "description": "Data format for response.", "location": "query", "enumDescriptions": [ "Responses with Content-Type of application/json", "Media download with context-dependent Content-Type", "Responses with Content-Type of application/x-protobuf" ], "enum": [ "json", "media", "proto" ], "type": "string" }, "uploadType": { "type": "string", "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", "location": "query" }, "access_token": { "description": "OAuth access token.", "location": "query", "type": "string" }, "prettyPrint": { "type": "boolean", "location": "query", "description": "Returns response with indentations and line breaks.", "default": "true" }, "callback": { "description": "JSONP", "location": "query", "type": "string" }, "fields": { "location": "query", "type": "string", "description": "Selector specifying which fields to include in a partial response." }, "upload_protocol": { "type": "string", "location": "query", "description": "Upload protocol for media (e.g. \"raw\", \"multipart\")." }, "$.xgafv": { "location": "query", "type": "string", "description": "V1 error format.", "enum": [ "1", "2" ], "enumDescriptions": [ "v1 error format", "v2 error format" ] }, "oauth_token": { "location": "query", "type": "string", "description": "OAuth 2.0 token for the current user." }, "key": { "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", "type": "string", "location": "query" } }, "servicePath": "", "ownerDomain": "google.com", "icons": { "x16": "http://www.google.com/images/icons/product/search-16.gif", "x32": "http://www.google.com/images/icons/product/search-32.gif" }, "id": "homegraph:v1", "mtlsRootUrl": "https://homegraph.mtls.googleapis.com/", "documentationLink": "https://developers.home.google.com/cloud-to-cloud/get-started", "canonicalName": "Home Graph Service", "revision": "20230707", "fullyEncodeReservedExpansion": true, "name": "homegraph", "ownerName": "Google", "baseUrl": "https://homegraph.googleapis.com/", "protocol": "rest", "title": "HomeGraph API", "schemas": { "QueryResponse": { "description": "Response type for the [`Query`](#google.home.graph.v1.HomeGraphApiService.Query) call. This should follow the same format as the Google smart home `action.devices.QUERY` [response](https://developers.home.google.com/cloud-to-cloud/intents/query). Example: ```json { \"requestId\": \"ff36a3cc-ec34-11e6-b1a0-64510650abcf\", \"payload\": { \"devices\": { \"123\": { \"on\": true, \"online\": true }, \"456\": { \"on\": true, \"online\": true, \"brightness\": 80, \"color\": { \"name\": \"cerulean\", \"spectrumRGB\": 31655 } } } } } ```", "type": "object", "properties": { "requestId": { "type": "string", "description": "Request ID used for debugging. Copied from the request." }, "payload": { "$ref": "QueryResponsePayload", "description": "Device states for the devices given in the request." } }, "id": "QueryResponse" }, "StateAndNotificationPayload": { "properties": { "devices": { "$ref": "ReportStateAndNotificationDevice", "description": "The devices for updating state and sending notifications." } }, "description": "Payload containing the state and notification information for devices.", "id": "StateAndNotificationPayload", "type": "object" }, "ReportStateAndNotificationDevice": { "properties": { "notifications": { "type": "object", "description": "Notifications metadata for devices. See the **Device NOTIFICATIONS** section of the individual trait [reference guides](https://developers.home.google.com/cloud-to-cloud/traits).", "additionalProperties": { "type": "any", "description": "Properties of the object." } }, "states": { "additionalProperties": { "type": "any", "description": "Properties of the object." }, "description": "States of devices to update. See the **Device STATES** section of the individual trait [reference guides](https://developers.home.google.com/cloud-to-cloud/traits).", "type": "object" } }, "type": "object", "id": "ReportStateAndNotificationDevice", "description": "The states and notifications specific to a device." }, "AgentDeviceId": { "type": "object", "description": "Third-party device ID for one device.", "id": "AgentDeviceId", "properties": { "id": { "type": "string", "description": "Third-party device ID." } } }, "ReportStateAndNotificationRequest": { "properties": { "requestId": { "description": "Request ID used for debugging.", "type": "string" }, "followUpToken": { "description": "Deprecated.", "deprecated": true, "type": "string" }, "payload": { "description": "Required. State of devices to update and notification metadata for devices.", "$ref": "StateAndNotificationPayload" }, "agentUserId": { "type": "string", "description": "Required. Third-party user ID." }, "eventId": { "type": "string", "description": "Unique identifier per event (for example, a doorbell press)." } }, "type": "object", "description": "Request type for the [`ReportStateAndNotification`](#google.home.graph.v1.HomeGraphApiService.ReportStateAndNotification) call. It may include states, notifications, or both. States and notifications are defined per `device_id` (for example, \"123\" and \"456\" in the following example). Example: ```json { \"requestId\": \"ff36a3cc-ec34-11e6-b1a0-64510650abcf\", \"agentUserId\": \"1234\", \"payload\": { \"devices\": { \"states\": { \"123\": { \"on\": true }, \"456\": { \"on\": true, \"brightness\": 10 } }, } } } ```", "id": "ReportStateAndNotificationRequest" }, "DeviceInfo": { "type": "object", "description": "Device information.", "id": "DeviceInfo", "properties": { "swVersion": { "description": "Device software version.", "type": "string" }, "manufacturer": { "type": "string", "description": "Device manufacturer." }, "hwVersion": { "type": "string", "description": "Device hardware version." }, "model": { "description": "Device model.", "type": "string" } } }, "SyncRequest": { "id": "SyncRequest", "description": "Request type for the [`Sync`](#google.home.graph.v1.HomeGraphApiService.Sync) call.", "properties": { "requestId": { "description": "Request ID used for debugging.", "type": "string" }, "agentUserId": { "type": "string", "description": "Required. Third-party user ID." } }, "type": "object" }, "QueryRequestPayload": { "id": "QueryRequestPayload", "type": "object", "description": "Payload containing device IDs.", "properties": { "devices": { "items": { "$ref": "AgentDeviceId" }, "type": "array", "description": "Third-party device IDs for which to get the device states." } } }, "QueryRequestInput": { "type": "object", "id": "QueryRequestInput", "properties": { "payload": { "description": "Payload containing third-party device IDs.", "$ref": "QueryRequestPayload" } }, "description": "Device ID inputs to QueryRequest." }, "QueryRequest": { "description": "Request type for the [`Query`](#google.home.graph.v1.HomeGraphApiService.Query) call.", "id": "QueryRequest", "type": "object", "properties": { "requestId": { "description": "Request ID used for debugging.", "type": "string" }, "inputs": { "description": "Required. Inputs containing third-party device IDs for which to get the device states.", "type": "array", "items": { "$ref": "QueryRequestInput" } }, "agentUserId": { "description": "Required. Third-party user ID.", "type": "string" } } }, "RequestSyncDevicesResponse": { "type": "object", "description": "Response type for the [`RequestSyncDevices`](#google.home.graph.v1.HomeGraphApiService.RequestSyncDevices) call. Intentionally empty upon success. An HTTP response code is returned with more details upon failure.", "id": "RequestSyncDevicesResponse", "properties": {} }, "SyncResponse": { "id": "SyncResponse", "properties": { "requestId": { "description": "Request ID used for debugging. Copied from the request.", "type": "string" }, "payload": { "description": "Devices associated with the third-party user.", "$ref": "SyncResponsePayload" } }, "description": "Response type for the [`Sync`](#google.home.graph.v1.HomeGraphApiService.Sync) call. This should follow the same format as the Google smart home `action.devices.SYNC` [response](https://developers.home.google.com/cloud-to-cloud/intents/sync). Example: ```json { \"requestId\": \"ff36a3cc-ec34-11e6-b1a0-64510650abcf\", \"payload\": { \"agentUserId\": \"1836.15267389\", \"devices\": [{ \"id\": \"123\", \"type\": \"action.devices.types.OUTLET\", \"traits\": [ \"action.devices.traits.OnOff\" ], \"name\": { \"defaultNames\": [\"My Outlet 1234\"], \"name\": \"Night light\", \"nicknames\": [\"wall plug\"] }, \"willReportState\": false, \"deviceInfo\": { \"manufacturer\": \"lights-out-inc\", \"model\": \"hs1234\", \"hwVersion\": \"3.2\", \"swVersion\": \"11.4\" }, \"customData\": { \"fooValue\": 74, \"barValue\": true, \"bazValue\": \"foo\" } }] } } ```", "type": "object" }, "ReportStateAndNotificationResponse": { "id": "ReportStateAndNotificationResponse", "type": "object", "description": "Response type for the [`ReportStateAndNotification`](#google.home.graph.v1.HomeGraphApiService.ReportStateAndNotification) call.", "properties": { "requestId": { "type": "string", "description": "Request ID copied from ReportStateAndNotificationRequest." } } }, "Empty": { "properties": {}, "id": "Empty", "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }", "type": "object" }, "AgentOtherDeviceId": { "type": "object", "properties": { "deviceId": { "type": "string", "description": "Unique third-party device ID." }, "agentId": { "type": "string", "description": "Project ID for your smart home Action." } }, "description": "Alternate third-party device ID.", "id": "AgentOtherDeviceId" }, "QueryResponsePayload": { "id": "QueryResponsePayload", "properties": { "devices": { "description": "States of the devices. Map of third-party device ID to struct of device states.", "additionalProperties": { "type": "object", "additionalProperties": { "description": "Properties of the object.", "type": "any" } }, "type": "object" } }, "description": "Payload containing device states information.", "type": "object" }, "Device": { "id": "Device", "properties": { "willReportState": { "description": "Indicates whether your smart home Action will report state of this device to Google via ReportStateAndNotification.", "type": "boolean" }, "deviceInfo": { "description": "Device manufacturer, model, hardware version, and software version.", "$ref": "DeviceInfo" }, "attributes": { "type": "object", "description": "Attributes for the traits supported by the device.", "additionalProperties": { "type": "any", "description": "Properties of the object." } }, "traits": { "description": "Traits supported by the device. See [device traits](https://developers.home.google.com/cloud-to-cloud/traits).", "items": { "type": "string" }, "type": "array" }, "notificationSupportedByAgent": { "description": "Indicates whether your smart home Action will report notifications to Google for this device via ReportStateAndNotification. If your smart home Action enables users to control device notifications, you should update this field and call RequestSyncDevices.", "type": "boolean" }, "structureHint": { "description": "Suggested name for the structure where this device is installed. Google attempts to use this value during user setup.", "type": "string" }, "roomHint": { "type": "string", "description": "Suggested name for the room where this device is installed. Google attempts to use this value during user setup." }, "customData": { "type": "object", "description": "Custom device attributes stored in Home Graph and provided to your smart home Action in each [QUERY](https://developers.home.google.com/cloud-to-cloud/intents/query) and [EXECUTE](https://developers.home.google.com/cloud-to-cloud/intents/execute) intent. Data in this object has a few constraints: No sensitive information, including but not limited to Personally Identifiable Information.", "additionalProperties": { "type": "any", "description": "Properties of the object." } }, "id": { "type": "string", "description": "Third-party device ID." }, "type": { "description": "Hardware type of the device. See [device types](https://developers.home.google.com/cloud-to-cloud/guides).", "type": "string" }, "name": { "description": "Names given to this device by your smart home Action.", "$ref": "DeviceNames" }, "otherDeviceIds": { "type": "array", "description": "Alternate IDs associated with this device. This is used to identify cloud synced devices enabled for [local fulfillment](https://developers.home.google.com/local-home/overview).", "items": { "$ref": "AgentOtherDeviceId" } } }, "description": "Third-party device definition.", "type": "object" }, "DeviceNames": { "type": "object", "id": "DeviceNames", "properties": { "nicknames": { "type": "array", "description": "Additional names provided by the user for the device.", "items": { "type": "string" } }, "defaultNames": { "description": "List of names provided by the manufacturer rather than the user, such as serial numbers, SKUs, etc.", "type": "array", "items": { "type": "string" } }, "name": { "description": "Primary name of the device, generally provided by the user.", "type": "string" } }, "description": "Identifiers used to describe the device." }, "RequestSyncDevicesRequest": { "id": "RequestSyncDevicesRequest", "description": "Request type for the [`RequestSyncDevices`](#google.home.graph.v1.HomeGraphApiService.RequestSyncDevices) call.", "properties": { "agentUserId": { "type": "string", "description": "Required. Third-party user ID." }, "async": { "description": "Optional. If set, the request will be added to a queue and a response will be returned immediately. This enables concurrent requests for the given `agent_user_id`, but the caller will not receive any error responses.", "type": "boolean" } }, "type": "object" }, "SyncResponsePayload": { "type": "object", "description": "Payload containing device information.", "id": "SyncResponsePayload", "properties": { "devices": { "items": { "$ref": "Device" }, "description": "Devices associated with the third-party user.", "type": "array" }, "agentUserId": { "description": "Third-party user ID", "type": "string" } } } }, "resources": { "agentUsers": { "methods": { "delete": { "httpMethod": "DELETE", "response": { "$ref": "Empty" }, "path": "v1/{+agentUserId}", "id": "homegraph.agentUsers.delete", "scopes": [ "https://www.googleapis.com/auth/homegraph" ], "flatPath": "v1/agentUsers/{agentUsersId}", "parameterOrder": [ "agentUserId" ], "description": "Unlinks the given third-party user from your smart home Action. All data related to this user will be deleted. For more details on how users link their accounts, see [fulfillment and authentication](https://developers.home.google.com/cloud-to-cloud/primer/fulfillment). The third-party user's identity is passed in via the `agent_user_id` (see DeleteAgentUserRequest). This request must be authorized using service account credentials from your Actions console project.", "parameters": { "requestId": { "type": "string", "description": "Request ID used for debugging.", "location": "query" }, "agentUserId": { "description": "Required. Third-party user ID.", "required": true, "location": "path", "type": "string", "pattern": "^agentUsers/.*$" } } } } }, "devices": { "methods": { "sync": { "request": { "$ref": "SyncRequest" }, "flatPath": "v1/devices:sync", "id": "homegraph.devices.sync", "scopes": [ "https://www.googleapis.com/auth/homegraph" ], "parameters": {}, "path": "v1/devices:sync", "parameterOrder": [], "description": "Gets all the devices associated with the given third-party user. The third-party user's identity is passed in via the `agent_user_id` (see SyncRequest). This request must be authorized using service account credentials from your Actions console project.", "response": { "$ref": "SyncResponse" }, "httpMethod": "POST" }, "reportStateAndNotification": { "path": "v1/devices:reportStateAndNotification", "scopes": [ "https://www.googleapis.com/auth/homegraph" ], "httpMethod": "POST", "parameterOrder": [], "request": { "$ref": "ReportStateAndNotificationRequest" }, "parameters": {}, "flatPath": "v1/devices:reportStateAndNotification", "description": "Reports device state and optionally sends device notifications. Called by your smart home Action when the state of a third-party device changes or you need to send a notification about the device. See [Implement Report State](https://developers.home.google.com/cloud-to-cloud/integration/report-state) for more information. This method updates the device state according to its declared [traits](https://developers.home.google.com/cloud-to-cloud/primer/device-types-and-traits). Publishing a new state value outside of these traits will result in an `INVALID_ARGUMENT` error response. The third-party user's identity is passed in via the `agent_user_id` (see ReportStateAndNotificationRequest). This request must be authorized using service account credentials from your Actions console project.", "id": "homegraph.devices.reportStateAndNotification", "response": { "$ref": "ReportStateAndNotificationResponse" } }, "query": { "description": "Gets the current states in Home Graph for the given set of the third-party user's devices. The third-party user's identity is passed in via the `agent_user_id` (see QueryRequest). This request must be authorized using service account credentials from your Actions console project.", "path": "v1/devices:query", "id": "homegraph.devices.query", "scopes": [ "https://www.googleapis.com/auth/homegraph" ], "parameterOrder": [], "flatPath": "v1/devices:query", "httpMethod": "POST", "request": { "$ref": "QueryRequest" }, "parameters": {}, "response": { "$ref": "QueryResponse" } }, "requestSync": { "id": "homegraph.devices.requestSync", "request": { "$ref": "RequestSyncDevicesRequest" }, "httpMethod": "POST", "flatPath": "v1/devices:requestSync", "path": "v1/devices:requestSync", "response": { "$ref": "RequestSyncDevicesResponse" }, "description": "Requests Google to send an `action.devices.SYNC` [intent](https://developers.home.google.com/cloud-to-cloud/intents/sync) to your smart home Action to update device metadata for the given user. The third-party user's identity is passed via the `agent_user_id` (see RequestSyncDevicesRequest). This request must be authorized using service account credentials from your Actions console project.", "scopes": [ "https://www.googleapis.com/auth/homegraph" ], "parameters": {}, "parameterOrder": [] } } } }, "batchPath": "batch", "basePath": "", "kind": "discovery#restDescription", "description": "", "version": "v1", "rootUrl": "https://homegraph.googleapis.com/" }