Skip to main content
Every card is a JSON document that conforms to the CometChat Card Message Schema. Card Builder produces conforming JSON automatically, so you only need this page if you generate cards programmatically — for example, from a BYOA agent or a Custom API Tool. The schema is Draft-07.
Data placeholders ({{variable}}) must be resolved before the card is sent — the backend passes the JSON through as-is and does not substitute them.

Root structure

Push notifications are not part of the card. When a card is sent, the message’s data.text carries the push/preview text — set from the Notification tab in Card Builder, falling back to fallbackText. The card JSON itself has no notification field.

Colors

Color fields are objects with explicit light- and dark-mode values, so a card looks right in both themes. Each side is a 6-digit hex string or "transparent":
Use "transparent" to apply no color for one mode while setting the other, and omit the property entirely if you don’t need a color override (where allowed — note style.background is required).

Elements

Every element needs a unique id and a type. The type determines its other required fields. No element may include properties not defined for its type (additionalProperties: false). For a description of each element, see Elements & Actions.

Actions

Add an action to a button, iconButton, link, or chip. Every action needs a type plus its required fields.

Variables

Insert variables as {{name}} (for example {{user.name}}, {{order.id}}) into text and URL fields. They personalize a single card per recipient, but must be resolved before sending — when an agent sends a card, instruct it to fill them in first.

Full JSON Schema

This is the complete schema. Validate generated cards against it (any Draft-07 validator, e.g. Ajv) before sending.