---
title: "POST /v1/devices:query"
method: POST
path: "/v1/devices:query"
tags: ["devices"]
---

# POST /v1/devices:query

`POST /v1/devices:query`

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.

## Request body

- QueryRequest — Request type for the [`Query`](#google.home.graph.v1.HomeGraphApiService.Query) call.
  - `requestId` string — Request ID used for debugging.
  - `inputs` QueryRequestInput[] — Required. Inputs containing third-party device IDs for which to get the device states.
    - `payload` QueryRequestPayload — Payload containing device IDs.
      - `devices` AgentDeviceId[] — Third-party device IDs for which to get the device states.
        - `id` string — Third-party device ID.
  - `includeDeviceMetadata` boolean — Optional. If true, the response will include device metadata in the device_metadata field.
  - `agentUserId` string — Required. Third-party user ID.
  - `deviceView` 'DEVICE_VIEW_UNSPECIFIED' | 'SMART_HOME_TRAIT_ONLY' | 'HOME_TRAIT_ONLY' | 'HOME_TRAIT_AND_SMART_HOME_TRAIT' — Optional. Specifies the type of device data to be returned in the response. This allows callers to request traditional Smart Home traits, Unified Device Data Model (UDDM) traits, or both. If unspecified, defaults to SMART_HOME_TRAIT_ONLY.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/homegraph.md) · [All operations](https://skmtc.net/google/apis/homegraph/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/homegraph/versions/28c601cbc091/schema)
