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