The guides in this section explain how a Google Chat app can call the Chat API, which lets Chat apps do things such as create a space, add people to it, and post a message without being prompted by a Chat app interaction event.
Calling the Chat API asynchronously requires authentication. Each Chat API method requires either user authentication (to perform actions or access data on behalf of a user) or app authentication (to perform actions or access data as a Chat app). Some methods support both user authentication and app authentication.
To learn more about authentication in Chat, see Authentication overview.
API resources and methods
REST resources and methods grant asynchronous access to Chat spaces, space members, messages, message reactions, and message attachments.
Spaces are places where people and apps can converse and share files. There are several types of spaces. Direct messages (DMs) are 1:1 conversations between two users or a user and a Chat app. Group chats are conversations between three or more users and Chat apps. Named spaces are persistent places where people send messages, share files, and collaborate.
spacesresource represents a space.
Spaces support the following methods:
- Create a space, a place where people and apps can converse and share files.
- Set up a space to create the space, and add people and Chat apps to that space.
- Get a space to see details about a space.
- List spaces to see a paginated, filterable list of spaces.
- Update a space to change attributes about a space, like its user-visible display name, description, and guidelines.
- Delete a space when it's no longer needed.
- Find a direct message (DM) to return a DM between two users, or a DM between a user and the calling Chat apps.
Members are users and Chat apps that have joined or are invited to a space.
spaces.membersresource represents a member.
Members support the following methods:
spaces.messagesresource represents a message.
Messages support the following methods:
- Create a message to post a text or card message. You can also start or reply to a message thread.
- Get a message to get details about a message, like when it was sent or what it says.
- List messages to see a paginated, filterable list of messages in a space.
- Update a message to change message attributes, such as what it says. You can also append text to a card message, or a card to a text message.
- Delete a message when it's no longer needed.
Reactions represent the emoji people use to react to a message, such as 👍, 🚲, and 🌞.
spaces.messages.reactionsresource represents a reaction.
Reactions support the following methods:
- Media and attachments
Media represents a file uploaded to Google Chat, like images, videos, and documents.
mediaresource represents media attached to messages.
Attachments are instances of media (files) attached to messages.
spaces.messages.attachmentsresource represents an attachment. An attachment includes the media and associated metadata attached to a message.
Media and attachments support the following methods:
- User read states (Developer Preview)
User read states are singleton resources that represent details about a specified user's last read message in a Google Chat space or a message thread.
users.spacesresource represents a user's read state in a space.
users.spaces.threadsresource represents a user's read state in a message thread.
User read states support the following methods:
Locate the discovery document
The discovery document for this API is located at the following URL: