Type Reference
Complete TypeScript type definitions for all API objects.
Card Types
Block (Union Type)
type Block =
| TextBlock
| BadgeBlock
| KeyValueBlock
| ImageBlock
| ButtonBlock
| DividerBlock
| InputBlock
| SelectBlock
| MultiselectBlock
| ToggleBlock
TextBlock
type TextBlock = {
id?: string
type: 'text'
content: string
size?: 'sm' | 'md' | 'lg' | 'xl'
bold?: boolean
}
BadgeBlock
type BadgeBlock = {
id?: string
type: 'badge'
label: string
variant: 'default' | 'success' | 'warning' | 'error' | 'pending'
}
KeyValueBlock
type KeyValueBlock = {
id?: string
type: 'kv'
rows: Array<{ key: string; value: string }>
}
ImageBlock
type ImageBlock = {
id?: string
type: 'image'
url: string
alt?: string
}
ButtonBlock
type ButtonBlock = {
id?: string
type: 'button'
buttons: Array<{
id: string
label: string
style?: 'primary' | 'secondary' | 'danger'
disabled?: boolean
}>
}
DividerBlock
type DividerBlock = {
id?: string
type: 'divider'
}
InputBlock
type InputBlock = {
id?: string
type: 'input'
label?: string
placeholder?: string
input_type?: 'text' | 'number' | 'email' | 'url'
default_value?: string
disabled?: boolean
required?: boolean
}
SelectBlock
type SelectBlock = {
id?: string
type: 'select'
label?: string
options: Array<{ value: string; label: string }>
selected_value?: string
placeholder?: string
disabled?: boolean
}
MultiselectBlock
type MultiselectBlock = {
id?: string
type: 'multiselect'
label?: string
options: Array<{ value: string; label: string }>
selected_values?: string[]
max_selections?: number
disabled?: boolean
}
ToggleBlock
type ToggleBlock = {
id?: string
type: 'toggle'
label: string
enabled: boolean
disabled?: boolean
description?: string
}
Entity Types
Workspace
type Workspace = {
id: string
name: string
slug: string
icon: string
user_id: string | null
visibility: 'private' | 'protected' | 'public'
layout: 'list' | 'sidebar' | 'tabs' | 'grid'
show_search: boolean
custom_slug: string | null
created_at: string
}
Channel
type Channel = {
id: string
name: string
description: string | null
mode: 'view' | 'interactive'
icon: string
webhook_url: string | null
workspace_id: string | null
visibility: 'private' | 'protected' | 'public'
created_at: string
updated_at?: string
}
Card
type Card = {
id: string
channel_id: string
blocks: Block[]
status: 'default' | 'success' | 'warning' | 'error' | 'pending'
created_at: string
updated_at?: string
}
ChannelAction
type ChannelAction = {
id: string
channel_id: string
label: string
style: 'primary' | 'secondary' | 'danger'
position: number
}
ChannelAttribute
type ChannelAttribute = {
id: string
channel_id: string
key: string
value: string
created_at: string
updated_at: string
}
Interaction
type Interaction = {
id: string
channel_id: string
card_id: string | null
action_id: string | null
type: 'button_click' | 'reply' | 'header_action' | 'input_change'
payload: Record<string, unknown> | null
created_at: string
}
WebhookLog
type WebhookLog = {
id: string
channel_id: string
interaction_id: string
status: 'success' | 'failed'
response_code: number | null
attempts: number
created_at: string
}
Enum Reference
BlockStatus / BadgeVariant
type BlockStatus = 'default' | 'success' | 'warning' | 'error' | 'pending'
type BadgeVariant = 'default' | 'success' | 'warning' | 'error' | 'pending'
ButtonStyle
type ButtonStyle = 'primary' | 'secondary' | 'danger'
WorkspaceLayout
type WorkspaceLayout = 'list' | 'sidebar' | 'tabs' | 'grid'
Visibility
type Visibility = 'private' | 'protected' | 'public'
InputType
type InputType = 'text' | 'number' | 'email' | 'url'
InteractionType
type InteractionType = 'button_click' | 'reply' | 'header_action' | 'input_change'