REST Resource: spaces

Resource: Space

A space in Google Chat. Spaces are conversations between two or more users or 1:1 messages between a user and a Chat app.

JSON representation
{
  "name": string,
  "type": enum (Type),
  "spaceType": enum (SpaceType),
  "singleUserBotDm": boolean,
  "threaded": boolean,
  "displayName": string,
  "spaceThreadingState": enum (SpaceThreadingState),
  "spaceDetails": {
    object (SpaceDetails)
  },
  "spaceHistoryState": enum (HistoryState),
  "adminInstalled": boolean
}
Fields
name

string

Resource name of the space.

Format: spaces/{space}

type
(deprecated)

enum (Type)

Output only. Deprecated: Use spaceType instead. The type of a space.

spaceType

enum (SpaceType)

The type of space. Required when creating a space or updating the space type of a space. Output only for other usage.

singleUserBotDm

boolean

Optional. Whether the space is a DM between a Chat app and a single human.

threaded
(deprecated)

boolean

Output only. Deprecated: Use spaceThreadingState instead. Whether messages are threaded in this space.

displayName

string

The space's display name. Required when creating a space.

For direct messages, this field might be empty.

Supports up to 128 characters.

spaceThreadingState

enum (SpaceThreadingState)

Output only. The threading state in the Chat space.

spaceDetails

object (SpaceDetails)

Details about the space including description and rules.

spaceHistoryState

enum (HistoryState)

The message history state for messages and threads in this space.

adminInstalled

boolean

Output only. Whether the Chat app was installed by a Google Workspace administrator. Administrators can install a Chat app for their domain, organizational unit, or a group of users.

Administrators can only install Chat apps for direct messaging between users and the app. To support admin install, your app must feature direct messaging.

Type

Deprecated: Use SpaceType instead.

Enums
TYPE_UNSPECIFIED
ROOM Conversations between two or more humans.
DM 1:1 Direct Message between a human and a Chat app, where all messages are flat. Note that this doesn't include direct messages between two humans.

SpaceType

The type of space. Required when creating or updating a space. Output only for other usage.

Enums
SPACE_TYPE_UNSPECIFIED Reserved.
SPACE A place where people send messages, share files, and collaborate. A SPACE can include Chat apps.
GROUP_CHAT Group conversations between 3 or more people. A GROUP_CHAT can include Chat apps.
DIRECT_MESSAGE 1:1 messages between two humans or a human and a Chat app.

SpaceThreadingState

Specifies the type of threading state in the Chat space.

Enums
SPACE_THREADING_STATE_UNSPECIFIED Reserved.
THREADED_MESSAGES Named spaces that support message threads. When users respond to a message, they can reply in-thread, which keeps their response in the context of the original message.
GROUPED_MESSAGES Named spaces where the conversation is organized by topic. Topics and their replies are grouped together.
UNTHREADED_MESSAGES Direct messages (DMs) between two people and group conversations between 3 or more people.

SpaceDetails

Details about the space including description and rules.

JSON representation
{
  "description": string,
  "guidelines": string
}
Fields
description

string

Optional. A description of the space. For example, describe the space's discussion topic, functional purpose, or participants.

Supports up to 150 characters.

guidelines

string

Optional. The space's rules, expectations, and etiquette.

Supports up to 5,000 characters.

HistoryState

The history state for messages and spaces. Specifies how long messages and conversation threads are kept after creation.

Enums
HISTORY_STATE_UNSPECIFIED Default value. Do not use.
HISTORY_OFF History off. Messages and threads are kept for 24 hours.
HISTORY_ON History on. The organization's Vault retention rules specify for how long messages and threads are kept.

Methods

create

Creates a named space.

delete

Deletes a named space.

findDirectMessage

Returns the existing direct message with the specified user.

get

Returns details about a space.

list

Lists spaces the caller is a member of.

patch

Updates a space.

setup

Creates a space and adds specified users to it.