Got 5 minutes? Help us improve the Google Chat developer documentation by taking a quick survey.

Card header

The CardHeader widget represents the header of a card. Headers can include a title, subtitle, and avatar-style image.

You can include headers for card messages and dialogs.

The following is a card consisting of CardHeader, image, and subtitle components:

JSON representation and fields

JSON representation
{
  "title": string,
  "subtitle": string,
  "imageType": enum (ImageType),
  "imageUrl": string,
  "imageAltText": string
}
Fields
title

string

Required. The title of the card header. The header has a fixed height: if both a title and subtitle are specified, each takes up one line. If only the title is specified, it takes up both lines.

subtitle

string

The subtitle of the card header. If specified, appears on its own line below the title.

imageType

enum (ImageType)

The shape used to crop the image.

imageUrl

string

The HTTPS URL of the image in the card header.

imageAltText

string

The alternative text of this image that's used for accessibility.

ImageType

The shape used to crop the image.

Enums
SQUARE Default value. Applies a square mask to the image. For example, a 4x3 image becomes 3x3.
CIRCLE Applies a circular mask to the image. For example, a 4x3 image becomes a circle with a diameter of 3.

Troubleshoot

When a Google Chat app or card returns an error, the Chat interface surfaces a message saying "Something went wrong." or "Unable to process your request." Sometimes the Chat UI doesn't display any error message, but the Chat app or card produces an unexpected result; for example, a card message might not appear.

Although an error message might not display in the Chat UI, descriptive error messages and log data are available to help you fix errors when error logging for Chat apps is turned on. For help viewing, debugging, and fixing errors, see Troubleshoot and fix Google Chat errors.