Back to Skills

google-chat-api

verified

Build Google Chat bots and webhooks with Cards v2, interactive forms, and Cloudflare Workers. Covers Spaces/Members/Reactions APIs, bearer token verification, and dialog patterns. Use when: creating Chat bots, workflow automation, interactive forms. Troubleshoot: bearer token 401, rate limit 429, card schema validation, webhook failures.

View on GitHub

Marketplace

claude-skills

jezweb/claude-skills

Plugin

frontend

Repository

jezweb/claude-skills
211stars

skills/google-chat-api/SKILL.md

Last Verified

January 21, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/jezweb/claude-skills/blob/main/skills/google-chat-api/SKILL.md -a claude-code --skill google-chat-api

Installation paths:

Claude
.claude/skills/google-chat-api/
Powered by add-skill CLI

Instructions

# Google Chat API

**Status**: Production Ready
**Last Updated**: 2026-01-09 (Added: Spaces API, Members API, Reactions API, Rate Limits)
**Dependencies**: Cloudflare Workers (recommended), Web Crypto API for token verification
**Latest Versions**: Google Chat API v1 (stable), Cards v2 (Cards v1 deprecated), wrangler@4.54.0

---

## Quick Start (5 Minutes)

### 1. Create Webhook (Simplest Approach)

```bash
# No code needed - just configure in Google Chat
# 1. Go to Google Cloud Console
# 2. Create new project or select existing
# 3. Enable Google Chat API
# 4. Configure Chat app with webhook URL
```

**Webhook URL**: `https://your-worker.workers.dev/webhook`

**Why this matters:**
- Simplest way to send messages to Chat
- No authentication required for incoming webhooks
- Perfect for notifications from external systems
- Limited to sending messages (no interactive responses)

### 2. Create Interactive Bot (Cloudflare Worker)

```typescript
export default {
  async fetch(request: Request, env: Env): Promise<Response> {
    const event = await request.json()

    // Respond with a card
    return Response.json({
      text: "Hello from bot!",
      cardsV2: [{
        cardId: "unique-card-1",
        card: {
          header: { title: "Welcome" },
          sections: [{
            widgets: [{
              textParagraph: { text: "Click the button below" }
            }, {
              buttonList: {
                buttons: [{
                  text: "Click me",
                  onClick: {
                    action: {
                      function: "handleClick",
                      parameters: [{ key: "data", value: "test" }]
                    }
                  }
                }]
              }
            }]
          }]
        }
      }]
    })
  }
}
```

**CRITICAL:**
- **Must respond within timeout** (typically 30 seconds)
- **Always return valid JSON** with `cardsV2` array
- **Card schema must be exact** - one wrong field breaks the whole card

##

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
22586 chars