{
  "canonicalName": "Home Graph Service",
  "ownerName": "Google",
  "auth": {
    "oauth2": {
      "scopes": {
        "https://www.googleapis.com/auth/homegraph": {
          "description": "Private Service: https://www.googleapis.com/auth/homegraph"
        }
      }
    }
  },
  "version": "v1",
  "documentationLink": "https://developers.home.google.com/cloud-to-cloud/get-started",
  "baseUrl": "https://homegraph.googleapis.com/",
  "resources": {
    "devices": {
      "methods": {
        "reportStateAndNotification": {
          "id": "homegraph.devices.reportStateAndNotification",
          "parameters": {},
          "parameterOrder": [],
          "request": {
            "$ref": "ReportStateAndNotificationRequest"
          },
          "response": {
            "$ref": "ReportStateAndNotificationResponse"
          },
          "httpMethod": "POST",
          "path": "v1/devices:reportStateAndNotification",
          "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.",
          "scopes": [
            "https://www.googleapis.com/auth/homegraph"
          ]
        },
        "sync": {
          "response": {
            "$ref": "SyncResponse"
          },
          "request": {
            "$ref": "SyncRequest"
          },
          "parameterOrder": [],
          "id": "homegraph.devices.sync",
          "parameters": {},
          "scopes": [
            "https://www.googleapis.com/auth/homegraph"
          ],
          "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.",
          "flatPath": "v1/devices:sync",
          "path": "v1/devices:sync",
          "httpMethod": "POST"
        },
        "requestSync": {
          "httpMethod": "POST",
          "flatPath": "v1/devices:requestSync",
          "path": "v1/devices:requestSync",
          "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"
          ],
          "id": "homegraph.devices.requestSync",
          "parameters": {},
          "parameterOrder": [],
          "request": {
            "$ref": "RequestSyncDevicesRequest"
          },
          "response": {
            "$ref": "RequestSyncDevicesResponse"
          }
        },
        "query": {
          "parameterOrder": [],
          "id": "homegraph.devices.query",
          "parameters": {},
          "response": {
            "$ref": "QueryResponse"
          },
          "request": {
            "$ref": "QueryRequest"
          },
          "path": "v1/devices:query",
          "flatPath": "v1/devices:query",
          "httpMethod": "POST",
          "scopes": [
            "https://www.googleapis.com/auth/homegraph"
          ],
          "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."
        }
      }
    },
    "agentUsers": {
      "methods": {
        "delete": {
          "path": "v1/{+agentUserId}",
          "flatPath": "v1/agentUsers/{agentUsersId}",
          "httpMethod": "DELETE",
          "scopes": [
            "https://www.googleapis.com/auth/homegraph"
          ],
          "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.",
          "parameterOrder": [
            "agentUserId"
          ],
          "id": "homegraph.agentUsers.delete",
          "parameters": {
            "requestId": {
              "location": "query",
              "type": "string",
              "description": "Request ID used for debugging."
            },
            "agentUserId": {
              "type": "string",
              "description": "Required. Third-party user ID.",
              "required": true,
              "location": "path",
              "pattern": "^agentUsers/.*$"
            }
          },
          "response": {
            "$ref": "Empty"
          }
        }
      }
    }
  },
  "icons": {
    "x16": "http://www.google.com/images/icons/product/search-16.gif",
    "x32": "http://www.google.com/images/icons/product/search-32.gif"
  },
  "discoveryVersion": "v1",
  "mtlsRootUrl": "https://homegraph.mtls.googleapis.com/",
  "servicePath": "",
  "version_module": true,
  "protocol": "rest",
  "title": "HomeGraph API",
  "ownerDomain": "google.com",
  "description": "",
  "rootUrl": "https://homegraph.googleapis.com/",
  "id": "homegraph:v1",
  "fullyEncodeReservedExpansion": true,
  "name": "homegraph",
  "basePath": "",
  "kind": "discovery#restDescription",
  "schemas": {
    "AgentDeviceId": {
      "type": "object",
      "properties": {
        "id": {
          "description": "Third-party device ID.",
          "type": "string"
        }
      },
      "id": "AgentDeviceId",
      "description": "Third-party device ID for one device."
    },
    "DeviceNames": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Primary name of the device, generally provided by the user. Names will be truncated if over the 60 Unicode code point (character) limit and no errors will be thrown. Developers are responsible for handling long names."
        },
        "nicknames": {
          "type": "array",
          "description": "Additional names provided by the user for the device.",
          "items": {
            "type": "string"
          }
        },
        "defaultNames": {
          "type": "array",
          "description": "List of names provided by the manufacturer rather than the user, such as serial numbers, SKUs, etc.",
          "items": {
            "type": "string"
          }
        }
      },
      "id": "DeviceNames",
      "description": "Identifiers used to describe the device."
    },
    "Empty": {
      "type": "object",
      "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); }"
    },
    "QueryResponse": {
      "id": "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": {
        "payload": {
          "$ref": "QueryResponsePayload",
          "description": "Device states for the devices given in the request."
        },
        "requestId": {
          "type": "string",
          "description": "Request ID used for debugging. Copied from the request."
        }
      }
    },
    "SyncRequest": {
      "type": "object",
      "properties": {
        "requestId": {
          "description": "Request ID used for debugging.",
          "type": "string"
        },
        "agentUserId": {
          "type": "string",
          "description": "Required. Third-party user ID."
        }
      },
      "id": "SyncRequest",
      "description": "Request type for the [`Sync`](#google.home.graph.v1.HomeGraphApiService.Sync) call."
    },
    "DeviceInfo": {
      "id": "DeviceInfo",
      "description": "Device information.",
      "type": "object",
      "properties": {
        "swVersion": {
          "type": "string",
          "description": "Device software version."
        },
        "manufacturer": {
          "type": "string",
          "description": "Device manufacturer."
        },
        "hwVersion": {
          "type": "string",
          "description": "Device hardware version."
        },
        "model": {
          "type": "string",
          "description": "Device model."
        }
      }
    },
    "AgentOtherDeviceId": {
      "id": "AgentOtherDeviceId",
      "description": "Alternate third-party device ID.",
      "type": "object",
      "properties": {
        "agentId": {
          "description": "Project ID for your smart home Action.",
          "type": "string"
        },
        "deviceId": {
          "type": "string",
          "description": "Unique third-party device ID."
        }
      }
    },
    "QueryRequest": {
      "id": "QueryRequest",
      "description": "Request type for the [`Query`](#google.home.graph.v1.HomeGraphApiService.Query) call.",
      "type": "object",
      "properties": {
        "inputs": {
          "type": "array",
          "description": "Required. Inputs containing third-party device IDs for which to get the device states.",
          "items": {
            "$ref": "QueryRequestInput"
          }
        },
        "requestId": {
          "type": "string",
          "description": "Request ID used for debugging."
        },
        "agentUserId": {
          "description": "Required. Third-party user ID.",
          "type": "string"
        }
      }
    },
    "SyncResponsePayload": {
      "id": "SyncResponsePayload",
      "description": "Payload containing device information.",
      "type": "object",
      "properties": {
        "agentUserId": {
          "description": "Third-party user ID",
          "type": "string"
        },
        "devices": {
          "description": "Devices associated with the third-party user.",
          "type": "array",
          "items": {
            "$ref": "Device"
          }
        }
      }
    },
    "SyncResponse": {
      "type": "object",
      "properties": {
        "requestId": {
          "description": "Request ID used for debugging. Copied from the request.",
          "type": "string"
        },
        "payload": {
          "$ref": "SyncResponsePayload",
          "description": "Devices associated with the third-party user."
        }
      },
      "id": "SyncResponse",
      "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\" } }] } } ```"
    },
    "Device": {
      "type": "object",
      "properties": {
        "name": {
          "description": "Names given to this device by your smart home Action.",
          "$ref": "DeviceNames"
        },
        "willReportState": {
          "type": "boolean",
          "description": "Indicates whether your smart home Action will report state of this device to Google via ReportStateAndNotification."
        },
        "roomHint": {
          "type": "string",
          "description": "Suggested name for the room where this device is installed. Google attempts to use this value during user setup."
        },
        "attributes": {
          "type": "object",
          "additionalProperties": {
            "type": "any",
            "description": "Properties of the object."
          },
          "description": "Attributes for the traits supported by the device."
        },
        "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"
        },
        "id": {
          "type": "string",
          "description": "Third-party device ID."
        },
        "traits": {
          "type": "array",
          "description": "Traits supported by the device. See [device traits](https://developers.home.google.com/cloud-to-cloud/traits).",
          "items": {
            "type": "string"
          }
        },
        "type": {
          "description": "Hardware type of the device. See [device types](https://developers.home.google.com/cloud-to-cloud/guides).",
          "type": "string"
        },
        "deviceInfo": {
          "$ref": "DeviceInfo",
          "description": "Device manufacturer, model, hardware version, and software version."
        },
        "structureHint": {
          "type": "string",
          "description": "Suggested name for the structure where this device is installed. Google attempts to use this value during user setup."
        },
        "customData": {
          "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.",
          "type": "object",
          "additionalProperties": {
            "description": "Properties of the object.",
            "type": "any"
          }
        },
        "otherDeviceIds": {
          "items": {
            "$ref": "AgentOtherDeviceId"
          },
          "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).",
          "type": "array"
        }
      },
      "id": "Device",
      "description": "Third-party device definition."
    },
    "ReportStateAndNotificationDevice": {
      "type": "object",
      "properties": {
        "states": {
          "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",
          "additionalProperties": {
            "type": "any",
            "description": "Properties of the object."
          }
        },
        "notifications": {
          "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).",
          "type": "object",
          "additionalProperties": {
            "type": "any",
            "description": "Properties of the object."
          }
        }
      },
      "id": "ReportStateAndNotificationDevice",
      "description": "The states and notifications specific to a device."
    },
    "QueryRequestInput": {
      "id": "QueryRequestInput",
      "description": "Device ID inputs to QueryRequest.",
      "type": "object",
      "properties": {
        "payload": {
          "description": "Payload containing third-party device IDs.",
          "$ref": "QueryRequestPayload"
        }
      }
    },
    "QueryRequestPayload": {
      "id": "QueryRequestPayload",
      "description": "Payload containing device IDs.",
      "type": "object",
      "properties": {
        "devices": {
          "description": "Third-party device IDs for which to get the device states.",
          "type": "array",
          "items": {
            "$ref": "AgentDeviceId"
          }
        }
      }
    },
    "ReportStateAndNotificationRequest": {
      "id": "ReportStateAndNotificationRequest",
      "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 }, }, } } } ```",
      "type": "object",
      "properties": {
        "requestId": {
          "description": "Request ID used for debugging.",
          "type": "string"
        },
        "followUpToken": {
          "type": "string",
          "description": "Deprecated.",
          "deprecated": true
        },
        "payload": {
          "$ref": "StateAndNotificationPayload",
          "description": "Required. State of devices to update and notification metadata for devices."
        },
        "eventId": {
          "description": "Unique identifier per event (for example, a doorbell press).",
          "type": "string"
        },
        "agentUserId": {
          "description": "Required. Third-party user ID.",
          "type": "string"
        }
      }
    },
    "StateAndNotificationPayload": {
      "id": "StateAndNotificationPayload",
      "description": "Payload containing the state and notification information for devices.",
      "type": "object",
      "properties": {
        "devices": {
          "$ref": "ReportStateAndNotificationDevice",
          "description": "The devices for updating state and sending notifications."
        }
      }
    },
    "RequestSyncDevicesRequest": {
      "type": "object",
      "properties": {
        "agentUserId": {
          "description": "Required. Third-party user ID.",
          "type": "string"
        },
        "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"
        }
      },
      "id": "RequestSyncDevicesRequest",
      "description": "Request type for the [`RequestSyncDevices`](#google.home.graph.v1.HomeGraphApiService.RequestSyncDevices) call."
    },
    "RequestSyncDevicesResponse": {
      "id": "RequestSyncDevicesResponse",
      "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.",
      "type": "object",
      "properties": {}
    },
    "ReportStateAndNotificationResponse": {
      "type": "object",
      "properties": {
        "requestId": {
          "description": "Request ID copied from ReportStateAndNotificationRequest.",
          "type": "string"
        }
      },
      "id": "ReportStateAndNotificationResponse",
      "description": "Response type for the [`ReportStateAndNotification`](#google.home.graph.v1.HomeGraphApiService.ReportStateAndNotification) call."
    },
    "QueryResponsePayload": {
      "id": "QueryResponsePayload",
      "description": "Payload containing device states information.",
      "type": "object",
      "properties": {
        "devices": {
          "type": "object",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": {
              "description": "Properties of the object.",
              "type": "any"
            }
          },
          "description": "States of the devices. Map of third-party device ID to struct of device states."
        }
      }
    }
  },
  "parameters": {
    "prettyPrint": {
      "default": "true",
      "location": "query",
      "description": "Returns response with indentations and line breaks.",
      "type": "boolean"
    },
    "oauth_token": {
      "description": "OAuth 2.0 token for the current user.",
      "type": "string",
      "location": "query"
    },
    "key": {
      "type": "string",
      "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.",
      "location": "query"
    },
    "uploadType": {
      "location": "query",
      "type": "string",
      "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\")."
    },
    "access_token": {
      "location": "query",
      "type": "string",
      "description": "OAuth access token."
    },
    "upload_protocol": {
      "type": "string",
      "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").",
      "location": "query"
    },
    "$.xgafv": {
      "type": "string",
      "description": "V1 error format.",
      "enumDescriptions": [
        "v1 error format",
        "v2 error format"
      ],
      "location": "query",
      "enum": [
        "1",
        "2"
      ]
    },
    "alt": {
      "location": "query",
      "default": "json",
      "enum": [
        "json",
        "media",
        "proto"
      ],
      "type": "string",
      "description": "Data format for response.",
      "enumDescriptions": [
        "Responses with Content-Type of application/json",
        "Media download with context-dependent Content-Type",
        "Responses with Content-Type of application/x-protobuf"
      ]
    },
    "callback": {
      "type": "string",
      "description": "JSONP",
      "location": "query"
    },
    "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"
    },
    "fields": {
      "location": "query",
      "type": "string",
      "description": "Selector specifying which fields to include in a partial response."
    }
  },
  "revision": "20260407",
  "batchPath": "batch"
}
