Novu Agents Reply Types
Choose and send the right reply types from your agent handlers.
The public reply API is ctx.reply(content, options?). The content argument must be either a plain text string, markdown value or a ChatElement card. File attachments are passed in the optional second argument.
Plain text
The most basic reply is a plain text string.
Markdown
Markdown is supported for rich text replies. Use markdown to format your replies with headings, lists, links, and other rich text elements.
Sending attachments
You can include files in your markdown or plain text replies. The files are displayed as inline attachments in the reply.
Attachment files are limited to 25 MB per file. Files are only supported with string/markdown replies, not card replies. Provide each file with exactly one of url or data properties.
File reference type:
Use url for files larger than a few megabytes. Novu fetches public HTTP(S) URLs server-side, and uploads the resulting file to the provider. Use data for small generated files that your agent already has in memory.
Inline data can also be a base64 string, but passing binary values such as Uint8Array, ArrayBuffer, Blob, or a Node Buffer is usually easier when working with AI SDKs, PDF generators, screenshots, audio, or other generated files.
Interactive cards
Cards are rich, structured messages with buttons, dropdowns, links, and more. They can be built using function calls or JSX.
Function call API
Use this API when building card structures as function calls.
JSX API
Use this API when you prefer JSX syntax. Configure tsconfig.json with "jsxImportSource": "@novu/framework".
When a user clicks a button or selects a dropdown value, your onAction handler fires with the actionId and value.
Available card components
The following components are available for building interactive cards:
| Component | Description |
|---|---|
Card | Container with an optional title |
CardText | Text block inside a card |
Button | Interactive button - id maps to ctx.action.actionId |
Actions | Required wrapper around Button elements |
Select / SelectOption | Dropdown - triggers onAction with selected value |
Divider | Visual separator |
CardLink | Clickable link |
TextInput | Text input field |
Editing sent messages
ctx.reply() returns a ReplyHandle that lets you edit the message in place:
You can also attach files when editing plain text or markdown content:
Edits update the existing platform message rather than posting a new one.