Chat apps

Chat apps, or "apps" for short, are web applications or services that run in Google Chat.

Chat apps can receive synchronous events from the Chat API, like getting messaged by a user or added to a space, and then respond to the events in a variety of ways — they can:

  • Send a simple text message, or interactive card message to users in Google Chat.
  • Open a dialog to help users complete multi-step processes, like filling in form data.
  • Unfurl links by attaching cards with helpful information that let users take action directly from the conversation.

Chat apps can also work with Chat data asynchronously by accessing REST resources with Chat API. Common uses of Chat REST resources include the following tasks:

  • Create, delete, and update messages.
  • List people and Chat bots conversing in a space.
  • List all the spaces your Chat bot has been added to.

Many Chat apps connect with external web apps and services to integrate them with Google Chat.

App access to user data

In order to operate in a useful way, when an app is invoked, it needs to know who is invoking it, in what context, and how to address the invoker. To access data beyond this basic identity data, the app must be granted access through authentication.

  • By default, apps can only read the basic identity of users that invoke them or users being @mentioned in the same message that invokes the app. This information includes the user's display name, user ID, email address, and avatar image.
  • For apps with link preview functionality the app can read URLs added to the message that match the app's configured URL patterns.
  • If an app needs to access other data to provide enhanced functionality to users, set up authentication so it can access that data. If accessing user data, the app prompts the user to ask for access, and the user must grant it.

Independence from users

Apps aren't associated with any particular user: anyone in your domain can add an app to a space or remove it. Once the app is added to a space, anyone in your domain can @mention it. Apps aren't accessible by external users who aren't in your domain.

Some use cases for apps

Adding apps to a conversational platform like Google Chat lets people ask questions, issue commands, and so on without changing context. On its back end, an app can access other systems, acting as an intermediary to those systems.

This ability to provide access to a wide range of resources and tools, while maintaining a unified cognitive experience, can provide an excellent framework for many types of applications, including:

  • workflow management
  • setup and configuration
  • order generation
  • search
  • data collection

Specific examples

Some low-level examples of things you might ask an app to do from within the Chat space include:

  • Look up information — An app can retrieve information based on structured or free text queries entered by the user.
  • File tickets — An app can generate incident reports or other artifacts, using information provided by the user.
  • Coordinate efforts — An app can enhance the way that team members interact with each other, by providing "team memory", scheduling resources, and so on.

Integrating with Google Workspace

If you're considering building a Google Chat app that will integrate with Google Workspace, consider implementing the app in Apps Script. This provides your app with easy access to Google Workspace services and data such as Sheets, Slides, Docs, and Calendar.

Google Chat API

The Google Chat API provides a number of ways that you can integrate your apps into Chat spaces and DMs, but does not provide or dictate any particular way to implement the app logic. You can create a simple command-driven app or use any kind of language processing and AI services or modules that you like, and you can do this on a variety of platforms, including:

  • Apps Script
  • Google Cloud Platform
  • Cloud or an on-prem HTTP server

See App implementation architectures for more on this topic.

Standard features

When you configure an app in Google Chat, it must provide an identity; this consists of:

  • The app name
  • An avatar image for the app
  • Identity of the app developer

Apps should also provide a help command or the equivalent to help users get started using the app.

App communication with Google Chat

Apps can receive messages from, and send messages to, Google Chat. These messages use defined message formats, which may render as simple text messages or interactive cards in Google Chat.

Apps in direct messages (DM)

You can configure an app so that it responds to direct messages. This provides a one-to-one conversational interface that involves a single user.

Apps in Chat spaces

You can add an app to a Chat space, so that it can respond to specific content that appears in the space. For example, you can specify that any message that begins with "@foobot" is passed to some foobot app and the response appears in the chat space. The following sequence diagram summarizes the app behavior:

Sequence diagram of Chat app in Chat space

Google Chat communicates with your app via an endpoint, which may be one of the following types:

  • HTTP (web service) endpoints can accommodate various styles of interaction.
  • Cloud Pub/Sub endpoints let your app subscribe to a topic that relays messages from Google Chat, even if the implementation is behind a firewall.

See the Endpoint types section for more about the different ways you can connect Google Chat with your app.

Chatbots in Google Chat

Chatbots, or "bots" for short, are computer programs that interact with people in a way that mimics human interaction to some degree. The interaction can vary in complexity from simple keyword-driven queries to elaborate conversational systems using natural language processing and AI techniques. This conversational form of human-computer interaction can act as a framework for many types of useful applications.

Early chatbots included academic curiosities like Eliza (1964) and Julia (1994), but now bots are at work all over the internet in customer support, as virtual assistants like Google Assistant, and in many other roles.

A Chat app can be called a chatbot, and including "bot" in your app name is a fun way to represent your service. Because Chat apps are fully functional web applications and services, we encourage you to think of Chat apps as more than "just bots".