canonical: https://jentic.com/apis/googleapis.com/chat

# Google Chat API

The Google Chat API lets applications and bots create and manage spaces, post and update messages, react to user actions, and integrate Chat into automation workflows alongside the rest of Google Workspace. It supports both bot accounts (Chat apps) and user-impersonating OAuth flows, exposing membership management, attachments, message threading, and rich card-based messages. Common uses include incident response bots, deploy notifications, on-call paging, and AI assistants embedded in team conversations.

## For AI agents

Create Google Chat spaces, post and update messages with rich cards, manage memberships, and operate Chat bots and apps inside Google Workspace.

## Scope

Does not handle email, video meetings, or SMS - use for Google Chat space, message, and membership operations only.

## Capabilities

- Create direct messages and named spaces between users and Chat apps
- Post text and card-formatted messages to a space, optionally inside a thread
- Update or delete messages previously posted by the calling Chat app
- Manage memberships by adding, removing, and listing space members
- Upload and download attachments tied to a Chat message
- Search for spaces and find the direct-message space between two users

## Use cases

### Incident Response Notifications

DevOps teams wire monitoring tools into a Google Chat app that creates an incident space, posts a structured card with severity and runbook links, and adds the on-call responders as members. The same app can post status updates to the original thread as the incident progresses. Card messages render the same on web and mobile.

Example prompt: Create a space named "INC-1234 - payments-api 5xx spike", add on-call@example.com as a member, and post a card message with severity SEV2 and a runbook link.

### Deploy and CI Notifications

Engineering teams post deploy and CI status messages to a #releases space from their pipeline. The Chat app uses a single POST /v1/spaces/{space}/messages call per event and threads follow-up messages under the original deploy message. This replaces email blasts with a single readable timeline per release.

Example prompt: Post a threaded message under deploy parent thread with text "deploy to prod completed: build #482" via /v1/spaces/{space}/messages with messageReplyOption=REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD.

### AI Assistant Embedded in a Team Space

An AI assistant joins a project space as a Chat app, listens for slash commands or @mentions, and responds with summaries, action items, or links to ticket creation. The assistant uses spaces.messages to reply and spaces.members to enumerate participants for context. Workspace admin approval is required for the Chat app to publish to other domains.

Example prompt: When a slash command /summarise is received, post a reply in the same thread with a summary of the last 50 messages in the space.

### AI Agent Workspace Operator via Jentic

An AI agent through Jentic acts as a project assistant - creating a Chat space for a new initiative, inviting the right teammates by email, posting an onboarding card, and uploading the kickoff doc as an attachment. Jentic isolates the Workspace OAuth credentials and exposes the Chat operations as named tools.

Example prompt: Through Jentic, search chat_create_message, load schema, and execute it for space spaces/AAAA with text "Kickoff at 10am - agenda attached".

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /v1/spaces | Create a Chat space |
| GET | /v1/spaces | List spaces a Chat app is a member of |
| GET | /v1/spaces:findDirectMessage | Find the direct message space between two users |
| POST | /v1/spaces:setup | Create a space and add members in a single call |
| PUT | /v1/{+name} | Update a previously posted message |
| POST | /v1/{+parent}/attachments:upload | Upload an attachment for a Chat message |

## Key resources

- **Spaces** — Create, list, search, and manage Chat spaces and direct messages
- **Messages** — Post, update, and delete text and card messages, including threaded replies
- **Members** — Add, remove, and list members of a space
- **Attachments and Media** — Upload and download files attached to messages
- **Notification Settings** — Read and update per-user space notification preferences

## Why Jentic

- **Setup:** Wiring the Google Chat API by hand means standing up Workspace OAuth or a Chat app service account, refreshing scoped access tokens, and assembling space, message, and membership calls with cardsV2 layouts yourself. Through Jentic you install once, import the Google Chat API from the API Directory, store the credential once, and your agent calls it.
- **Permission scoping:** Chat puts the space and resource in the URL path for name-based operations (/v1/{+name}, /v1/{+parent}/attachments:upload), so a rule can pin your agent to the spaces it works in and limit it to the operations it needs, such as creating a space or posting a message. You choose those operations, so ones like deleting a space are not included unless you add them.
- **Credential handling:** Your Workspace OAuth credentials or Chat app service account are stored once, encrypted, by your own Jentic One instance and injected at execution time. The agent receives only short-lived access tokens and the refresh token and service account JSON never enter its prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'post a Google Chat message' or 'set up a new space', and Jentic returns the matching spaces operation with its parameter schema, including cardsV2 layout support, so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Gmail API** — Send and read email instead of posting to a real-time chat space.
- **Google Drive API** — Store and share files that can be linked or attached in Chat messages.
- **Google Calendar API** — Schedule meetings to follow up on a Chat conversation.

## FAQ

### What authentication does the Google Chat API use?

It supports two flows: a Chat app service account using OAuth 2.0 with the chat.bot scope, and user-impersonation OAuth with scopes such as chat.spaces and chat.messages. Through Jentic, the chosen credential is stored encrypted in your Jentic One instance and the agent receives only short-lived access tokens.

### Can I post a message to a Google Chat space via the API?

Yes. POST to /v1/{parent}/messages where parent is the space resource name (spaces/AAAA). The body can include text, cardsV2 for rich card layouts, and threadKey or thread.name to post inside an existing thread.

### What are the rate limits for the Google Chat API?

Google Workspace applies per-app per-user write quotas, typically around 60 messages per minute per space for a single Chat app, with higher project-level quotas. Bursts above the per-space rate return 429 and require backoff.

### How do I create a Chat space through Jentic?

Use the Jentic search query "create a Google Chat space" to discover the spaces.create operation, load its schema, and execute it with displayName and spaceType (SPACE or DIRECT_MESSAGE). Run pip install jentic to get started.

### Can a Chat app update or delete messages?

A Chat app can update and delete only the messages it posted itself. Use PUT /v1/{+name} with an updateMask covering the fields to change, and DELETE /v1/{+name} to remove a message.

### Is the Google Chat API free?

The API itself has no per-call charge. It is available to Google Workspace customers; some features (such as enterprise external Chat apps) require specific Workspace editions.

### Can I limit what my agent is allowed to do with the Google Chat API?

Yes. Because Jentic One is self-hosted, your own rules decide which Google Chat operations and credentials the agent may use. Google Chat carries the space and resource in the URL path for name-based operations like /v1/{+name} and /v1/{+parent}/attachments:upload, so you can pin the agent to the specific spaces it works in and grant only the operations it needs, such as creating a space or posting a message. Higher-impact calls like deleting a space are excluded unless you explicitly add them.
