# Method: spaces.findDirectMessage

- [HTTP request](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/findDirectMessage#body.HTTP_TEMPLATE)
- [Query parameters](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/findDirectMessage#body.QUERY_PARAMETERS)
- [Request body](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/findDirectMessage#body.request_body)
- [Response body](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/findDirectMessage#body.response_body)
- [Authorization scopes](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/findDirectMessage#body.aspect)
- [Try it!](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/findDirectMessage#try-it)

Returns the existing direct message with the specified user. If no direct message space is found, returns a `404 NOT_FOUND` error. For an example, see [Find a direct message](https://developers.google.com/chat/api/guides/v1/spaces/find-direct-message).

With [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app), returns the direct message space between the specified user and the calling Chat app.

With [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), returns the direct message space between the specified user and the authenticated user.

Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):

- [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with the authorization scope:

  - `https://www.googleapis.com/auth/chat.bot`
- [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following authorization scopes:

  - `https://www.googleapis.com/auth/chat.spaces.readonly`
  - `https://www.googleapis.com/auth/chat.spaces`

### HTTP request

`GET https://chat.googleapis.com/v1/spaces:findDirectMessage`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Query parameters

| Parameters ||
|---|---|
| `name` | `string` Required. Resource name of the user to find direct message with. Format: `users/{user}`, where `{user}` is either the `id` for the [person](https://developers.google.com/people/api/rest/v1/people) from the People API, or the `id` for the [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Directory API. For example, if the People API profile ID is `123456789`, you can find a direct message with that person by using `users/123456789` as the `name`. When [authenticated as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), you can use the email as an alias for `{user}`. For example, `users/example@gmail.com` where `example@gmail.com` is the email of the Google Chat user. |

### Request body

The request body must be empty.

### Response body

If successful, the response body contains an instance of `https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#Space`.

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/chat.spaces`
- `https://www.googleapis.com/auth/chat.spaces.readonly`
- `https://www.googleapis.com/auth/chat.bot`

For more information, see the [Authorization guide](https://developers.google.com/workspace/chat/authenticate-authorize).