Search documentation

Search for docs or ask AI

Action Types Reference

Actions represent things users can do in your application. Each action has a type that determines how it behaves.

Action Types

TypeDescriptionUse Case
navigateNavigate to a page in your appSettings, dashboard, detail pages
trigger_actionRun custom logicOpen modals, start wizards, toggle features
inline_uiShow interactive UI in chatForms, confirmations, previews
external_linkOpen URL in new tabDocumentation, external resources
copy_textCopy text to clipboardAPI keys, code snippets

Navigate to a page in your application.

examples/reference/action-types/navigate.tsx
{
open_settings: {
description: 'Navigate to the settings page',
type: 'navigate',
path: '/settings',
autoRun: true, // Navigate without clicking
autoComplete: true, // Mark done immediately
},
}
PropertyTypeDescription
pathstringThe path to navigate to
autoRunbooleanExecute immediately when suggested
autoCompletebooleanMark step as complete immediately

Default handler: window.location.href = path


trigger_action

Run custom logic in your application.

examples/reference/action-types/trigger-action.tsx
{
invite_member: {
description: 'Open the invite team member modal',
type: 'trigger_action',
examples: ['invite someone', 'add a user'],
dataSchema: {
type: 'object',
properties: {
email: { type: 'string', description: 'Email to invite' },
role: { type: 'string', enum: ['admin', 'member'] },
},
},
handler: (data) => openInviteModal(data),
},
}
PropertyTypeDescription
dataSchemaJSONSchemaSchema for data extraction from user message
handler(data) => TaskResultFunction to execute

inline_ui

Show interactive UI directly in the chat.

examples/reference/action-types/inline-ui.tsx
{
invite_members: {
description: 'Invite team members with confirmation',
type: 'inline_ui',
card_type: 'invite_members', // Maps to registered card component
dataSchema: {
type: 'object',
properties: {
emails: { type: 'array', items: { type: 'string' } },
role: { type: 'string' },
},
},
},
}
PropertyTypeDescription
card_typestringThe registered card component to render
dataSchemaJSONSchemaSchema for data extraction

Requires a registered card component. See Custom Cards.


Open a URL in a new browser tab.

examples/reference/action-types/external-link.tsx
{
view_docs: {
description: 'Open the API documentation',
type: 'external_link',
externalUrl: 'https://docs.example.com/api',
autoRun: true,
},
}
PropertyTypeDescription
externalUrlstringThe URL to open

Default handler: window.open(url, '_blank')


copy_text

Copy text to the user's clipboard.

examples/reference/action-types/copy-text.tsx
{
copy_api_key: {
description: 'Copy the API key to clipboard',
type: 'copy_text',
dataSchema: {
type: 'object',
properties: {
text: { type: 'string', description: 'Text to copy' },
},
},
},
}

Default handler: navigator.clipboard.writeText(text)


Common Properties

These properties are available on all action types:

PropertyTypeDefaultDescription
descriptionstringRequiredAI uses this to match user intent
typeActionTypeRequiredOne of the types above
examplesstring[][]Example phrases that trigger this action
autoRunbooleanfalseExecute without user clicking
autoCompletebooleanfalseMark done immediately
requiredContextobjectundefinedContext required for action to be available
defaultDataobjectundefinedDefault values passed to handler

Data Schema

Use JSON Schema to define what data the AI should extract from user messages:

examples/reference/action-types/data-schema.tsx
dataSchema: {
type: 'object',
properties: {
url: {
type: 'string',
description: 'URL of the source to add',
},
name: {
type: 'string',
description: 'Display name for the source',
},
},
required: ['url'],
}

When a user says "Add my docs site at docs.example.com", the AI extracts:

examples/reference/action-types/data-extraction.json
{ "url": "docs.example.com" }

Required Context

Filter actions based on user attributes:

examples/reference/action-types/required-context.tsx
{
delete_user: {
description: 'Delete a user from the organization',
type: 'trigger_action',
requiredContext: {
userRole: 'admin',
},
handler: ({ userId }) => deleteUser(userId),
},
}

This action only appears when pillar.setContext({ userRole: 'admin' }) is set.