Composition Objects
This page documents the public C# API for composition objects, generated from the XML documentation of the compiled library. Values are immutable, constructors take named arguments and validate them, and read-only properties return what was passed.
AreaChart
An area chart for a data visualization block.
- Required:
series,axisConfig. - Every series needs exactly one data point for each axis category.
See the Slack reference.
Implements IChart.
AreaChart
Creates and validates a AreaChart.
public AreaChart(IEnumerable<DataSeries> series, AxisConfig axisConfig, IReadOnlyDictionary<string, object?>? additionalFields = null)
| Parameter | Description |
|---|---|
series | Data series in display order. Series names must be unique. Required. Must contain between 1 and 12 items. |
axisConfig | The axis categories and labels. Every series needs exactly one point per category. Required. |
additionalFields | Slack fields that have no named parameter yet, such as a field Slack introduced after this release. Values must be strings, numbers, booleans, lists, dictionaries, JSON nodes, or slackblocks values, and are validated with the rest of the object. Typed properties do not reflect them, and a field cannot be set both here and through its named parameter. |
| Throws | When |
|---|---|
ValidationException | The value breaks a Block Kit rule, such as a missing required field or an exceeded length limit. |
ArgumentException | A collection contains null, or an additional field cannot be written as JSON or repeats a named parameter. |
Related types: AreaChart, AxisConfig, DataSeries
Series
Gets data series in display order. Series names must be unique.
The values in order, or an empty list when none were set.
public IReadOnlyList<DataSeries> Series { get; }
Related types: DataSeries
AxisConfig
Gets the axis categories and labels. Every series needs exactly one point per category.
public AxisConfig AxisConfig { get; }
Related types: AxisConfig
AxisConfig
The categories and labels shared by bar, area, and line chart axes.
- Required:
categories.
See the Slack reference.
AxisConfig
Creates and validates a AxisConfig.
public AxisConfig(IEnumerable<string> categories, string? xLabel = null, string? yLabel = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
| Parameter | Description |
|---|---|
categories | Axis categories in display order. Labels must be unique. Required. Must contain between 1 and 20 items. |
xLabel | The horizontal axis label. Slack allows at most 50 characters. |
yLabel | The vertical axis label. Slack allows at most 50 characters. |
additionalFields | Slack fields that have no named parameter yet, such as a field Slack introduced after this release. Values must be strings, numbers, booleans, lists, dictionaries, JSON nodes, or slackblocks values, and are validated with the rest of the object. Typed properties do not reflect them, and a field cannot be set both here and through its named parameter. |
| Throws | When |
|---|---|
ValidationException | The value breaks a Block Kit rule, such as a missing required field or an exceeded length limit. |
ArgumentException | A collection contains null, or an additional field cannot be written as JSON or repeats a named parameter. |
Related types: AxisConfig
Categories
Gets axis categories in display order. Labels must be unique.
The values in order, or an empty list when none were set.
public IReadOnlyList<string> Categories { get; }
XLabel
Gets the horizontal axis label.
The value, or null when it was not set.
public string? XLabel { get; }
YLabel
Gets the vertical axis label.
The value, or null when it was not set.
public string? YLabel { get; }
BarChart
A bar chart for a data visualization block.
- Required:
series,axisConfig. - Every series needs exactly one data point for each axis category.
See the Slack reference.
Implements IChart.
BarChart
Creates and validates a BarChart.
public BarChart(IEnumerable<DataSeries> series, AxisConfig axisConfig, IReadOnlyDictionary<string, object?>? additionalFields = null)
| Parameter | Description |
|---|---|
series | Data series in display order. Series names must be unique. Required. Must contain between 1 and 12 items. |
axisConfig | The axis categories and labels. Every series needs exactly one point per category. Required. |
additionalFields | Slack fields that have no named parameter yet, such as a field Slack introduced after this release. Values must be strings, numbers, booleans, lists, dictionaries, JSON nodes, or slackblocks values, and are validated with the rest of the object. Typed properties do not reflect them, and a field cannot be set both here and through its named parameter. |
| Throws | When |
|---|---|
ValidationException | The value breaks a Block Kit rule, such as a missing required field or an exceeded length limit. |
ArgumentException | A collection contains null, or an additional field cannot be written as JSON or repeats a named parameter. |
Related types: AxisConfig, BarChart, DataSeries
Series
Gets data series in display order. Series names must be unique.
The values in order, or an empty list when none were set.
public IReadOnlyList<DataSeries> Series { get; }
Related types: DataSeries
AxisConfig
Gets the axis categories and labels. Every series needs exactly one point per category.
public AxisConfig AxisConfig { get; }
Related types: AxisConfig
ChartSegment
One labelled segment of a pie chart.
- Required:
label,value.
See the Slack reference.
ChartSegment
Creates and validates a ChartSegment.
public ChartSegment(string label, double value, IReadOnlyDictionary<string, object?>? additionalFields = null)
| Parameter | Description |
|---|---|
label | The segment label. Required. Slack allows at most 20 characters. |
value | The segment's size. Must be greater than zero. Required. Whole numbers are sent without a decimal point. |
additionalFields | Slack fields that have no named parameter yet, such as a field Slack introduced after this release. Values must be strings, numbers, booleans, lists, dictionaries, JSON nodes, or slackblocks values, and are validated with the rest of the object. Typed properties do not reflect them, and a field cannot be set both here and through its named parameter. |
| Throws | When |
|---|---|
ValidationException | The value breaks a Block Kit rule, such as a missing required field or an exceeded length limit. |
ArgumentException | A collection contains null, or an additional field cannot be written as JSON or repeats a named parameter. |
Related types: ChartSegment
Label
Gets the segment label.
public string Label { get; }
Value
Gets the segment's size. Must be greater than zero.
public double Value { get; }
ColumnAlign
Horizontal alignment for table columns.
ToWireValue() returns the value Slack expects in JSON.
| Constant | Slack value | Meaning |
|---|---|---|
Left | left | Align cell content to the left. |
Center | center | Center cell content. |
Right | right | Align cell content to the right. |
ColumnSettings
Alignment and wrapping settings for one table column.
See the Slack reference.
ColumnSettings
Creates and validates a ColumnSettings.
public ColumnSettings(ColumnAlign? align = null, bool? isWrapped = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
| Parameter | Description |
|---|---|
align | How cell content in the column is aligned. |
isWrapped | Whether long cell content wraps instead of being truncated. |
additionalFields | Slack fields that have no named parameter yet, such as a field Slack introduced after this release. Values must be strings, numbers, booleans, lists, dictionaries, JSON nodes, or slackblocks values, and are validated with the rest of the object. Typed properties do not reflect them, and a field cannot be set both here and through its named parameter. |
| Throws | When |
|---|---|
ValidationException | The value breaks a Block Kit rule, such as a missing required field or an exceeded length limit. |
ArgumentException | A collection contains null, or an additional field cannot be written as JSON or repeats a named parameter. |
Related types: ColumnAlign, ColumnSettings
Align
Gets how cell content in the column is aligned.
The value, or null when it was not set.
public ColumnAlign? Align { get; }
Related types: ColumnAlign
IsWrapped
Gets whether long cell content wraps instead of being truncated.
The value, or null when it was not set.
public bool? IsWrapped { get; }
Confirmation
A dialog that asks users to confirm an action before it is sent.
- Required:
title,text,confirm,deny.
See the Slack reference.
Confirmation
Creates and validates a Confirmation.
public Confirmation(PlainText title, Text text, PlainText confirm, PlainText deny, ButtonStyle? style = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
| Parameter | Description |
|---|---|
title | The dialog title. Required. Slack allows at most 100 characters. A string is sent as a plain_text text object. |
text | The explanatory text in the dialog body. Required. Slack allows at most 300 characters. A string is sent as a mrkdwn text object. |
confirm | The label of the button that confirms the action. Required. Slack allows at most 30 characters. A string is sent as a plain_text text object. |
deny | The label of the button that cancels the action. Required. Slack allows at most 30 characters. A string is sent as a plain_text text object. |
style | The emphasis of the confirm button. |
additionalFields | Slack fields that have no named parameter yet, such as a field Slack introduced after this release. Values must be strings, numbers, booleans, lists, dictionaries, JSON nodes, or slackblocks values, and are validated with the rest of the object. Typed properties do not reflect them, and a field cannot be set both here and through its named parameter. |
| Throws | When |
|---|---|
ValidationException | The value breaks a Block Kit rule, such as a missing required field or an exceeded length limit. |
ArgumentException | A collection contains null, or an additional field cannot be written as JSON or repeats a named parameter. |
Related types: ButtonStyle, Confirmation, PlainText, Text
Title
Gets the dialog title.
public PlainText Title { get; }
Related types: PlainText
Text
Gets the explanatory text in the dialog body.
public Text Text { get; }
Related types: Text
Confirm
Gets the label of the button that confirms the action.
public PlainText Confirm { get; }
Related types: PlainText
Deny
Gets the label of the button that cancels the action.
public PlainText Deny { get; }
Related types: PlainText
Style
Gets the emphasis of the confirm button.
The value, or null when it was not set.
public ButtonStyle? Style { get; }
Related types: ButtonStyle
ConversationFilter
Limits which conversations a conversation menu offers.
- Set at least one filter.
See the Slack reference.
ConversationFilter
Creates and validates a ConversationFilter.
public ConversationFilter(IEnumerable<string>? include = null, bool? excludeExternalSharedChannels = null, bool? excludeBotUsers = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
| Parameter | Description |
|---|---|
include | Conversation types to offer: im, mpim, private, or public. |
excludeExternalSharedChannels | Whether externally shared channels are excluded. |
excludeBotUsers | Whether bot users are excluded. |
additionalFields | Slack fields that have no named parameter yet, such as a field Slack introduced after this release. Values must be strings, numbers, booleans, lists, dictionaries, JSON nodes, or slackblocks values, and are validated with the rest of the object. Typed properties do not reflect them, and a field cannot be set both here and through its named parameter. |
| Throws | When |
|---|---|
ValidationException | The value breaks a Block Kit rule, such as a missing required field or an exceeded length limit. |
ArgumentException | A collection contains null, or an additional field cannot be written as JSON or repeats a named parameter. |
Related types: ConversationFilter
Include
Gets conversation types to offer: im, mpim, private, or public.
The values in order, or an empty list when none were set.
public IReadOnlyList<string> Include { get; }
ExcludeExternalSharedChannels
Gets whether externally shared channels are excluded.
The value, or null when it was not set.
public bool? ExcludeExternalSharedChannels { get; }
ExcludeBotUsers
Gets whether bot users are excluded.
The value, or null when it was not set.
public bool? ExcludeBotUsers { get; }
DataPoint
One value of a chart series, keyed by axis category.
- Required:
label,value.
See the Slack reference.
DataPoint
Creates and validates a DataPoint.
public DataPoint(string label, double value, IReadOnlyDictionary<string, object?>? additionalFields = null)
| Parameter | Description |
|---|---|
label | The axis category this point belongs to. Required. Slack allows at most 20 characters. |
value | The point's value. Required. Whole numbers are sent without a decimal point. |
additionalFields | Slack fields that have no named parameter yet, such as a field Slack introduced after this release. Values must be strings, numbers, booleans, lists, dictionaries, JSON nodes, or slackblocks values, and are validated with the rest of the object. Typed properties do not reflect them, and a field cannot be set both here and through its named parameter. |
| Throws | When |
|---|---|
ValidationException | The value breaks a Block Kit rule, such as a missing required field or an exceeded length limit. |
ArgumentException | A collection contains null, or an additional field cannot be written as JSON or repeats a named parameter. |
Related types: DataPoint
Label
Gets the axis category this point belongs to.
public string Label { get; }
Value
Gets the point's value.
public double Value { get; }
DataSeries
A named series of chart data points.
- Required:
name,data.
See the Slack reference.
DataSeries
Creates and validates a DataSeries.
public DataSeries(string name, IEnumerable<DataPoint> data, IReadOnlyDictionary<string, object?>? additionalFields = null)
| Parameter | Description |
|---|---|
name | The series name shown in the legend. Required. Slack allows at most 20 characters. |
data | Data points in axis-category order. Required. Must contain between 1 and 20 items. |
additionalFields | Slack fields that have no named parameter yet, such as a field Slack introduced after this release. Values must be strings, numbers, booleans, lists, dictionaries, JSON nodes, or slackblocks values, and are validated with the rest of the object. Typed properties do not reflect them, and a field cannot be set both here and through its named parameter. |
| Throws | When |
|---|---|
ValidationException | The value breaks a Block Kit rule, such as a missing required field or an exceeded length limit. |
ArgumentException | A collection contains null, or an additional field cannot be written as JSON or repeats a named parameter. |
Related types: DataPoint, DataSeries
Name
Gets the series name shown in the legend.
public string Name { get; }
Data
Gets data points in axis-category order.
The values in order, or an empty list when none were set.
public IReadOnlyList<DataPoint> Data { get; }
Related types: DataPoint
DispatchActionConfiguration
Chooses which interactions with an input send a block_actions payload.
See the Slack reference.
DispatchActionConfiguration
Creates and validates a DispatchActionConfiguration.
public DispatchActionConfiguration(IEnumerable<string>? triggerActionsOn = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
| Parameter | Description |
|---|---|
triggerActionsOn | The interactions that send a payload: on_enter_pressed or on_character_entered. |
additionalFields | Slack fields that have no named parameter yet, such as a field Slack introduced after this release. Values must be strings, numbers, booleans, lists, dictionaries, JSON nodes, or slackblocks values, and are validated with the rest of the object. Typed properties do not reflect them, and a field cannot be set both here and through its named parameter. |
| Throws | When |
|---|---|
ValidationException | The value breaks a Block Kit rule, such as a missing required field or an exceeded length limit. |
ArgumentException | A collection contains null, or an additional field cannot be written as JSON or repeats a named parameter. |
Related types: DispatchActionConfiguration
TriggerActionsOn
Gets the interactions that send a payload: on_enter_pressed or on_character_entered.
The values in order, or an empty list when none were set.
public IReadOnlyList<string> TriggerActionsOn { get; }
FeedbackButton
One button of a feedback buttons element.
- Required:
text,value.
See the Slack reference.
FeedbackButton
Creates and validates a FeedbackButton.
public FeedbackButton(PlainText text, string value, string? accessibilityLabel = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
| Parameter | Description |
|---|---|
text | The button label. Required. Slack allows at most 75 characters. A string is sent as a plain_text text object. |
value | The application-defined value sent in interaction payloads. Required. Slack allows at most 2000 characters. |
accessibilityLabel | The label read by screen readers in place of the visible text. Slack allows at most 75 characters. |
additionalFields | Slack fields that have no named parameter yet, such as a field Slack introduced after this release. Values must be strings, numbers, booleans, lists, dictionaries, JSON nodes, or slackblocks values, and are validated with the rest of the object. Typed properties do not reflect them, and a field cannot be set both here and through its named parameter. |
| Throws | When |
|---|---|
ValidationException | The value breaks a Block Kit rule, such as a missing required field or an exceeded length limit. |
ArgumentException | A collection contains null, or an additional field cannot be written as JSON or repeats a named parameter. |
Related types: FeedbackButton, PlainText
Text
Gets the button label.
public PlainText Text { get; }
Related types: PlainText, Text
Value
Gets the application-defined value sent in interaction payloads.
public string Value { get; }
AccessibilityLabel
Gets the label read by screen readers in place of the visible text.
The value, or null when it was not set.
public string? AccessibilityLabel { get; }
IChart
A chart that can be displayed by a data visualization block.
Implemented by AreaChart, BarChart, LineChart, PieChart.
InputParameter
A named value passed to a workflow trigger.
- Required:
name,value.
See the Slack reference.
InputParameter
Creates and validates a InputParameter.
public InputParameter(string name, string value, IReadOnlyDictionary<string, object?>? additionalFields = null)
| Parameter | Description |
|---|---|
name | The workflow input parameter name. Required. |
value | The value passed to the workflow input. Required. |
additionalFields | Slack fields that have no named parameter yet, such as a field Slack introduced after this release. Values must be strings, numbers, booleans, lists, dictionaries, JSON nodes, or slackblocks values, and are validated with the rest of the object. Typed properties do not reflect them, and a field cannot be set both here and through its named parameter. |
| Throws | When |
|---|---|
ValidationException | The value breaks a Block Kit rule, such as a missing required field or an exceeded length limit. |
ArgumentException | A collection contains null, or an additional field cannot be written as JSON or repeats a named parameter. |
Related types: InputParameter
Name
Gets the workflow input parameter name.
public string Name { get; }
Value
Gets the value passed to the workflow input.
public string Value { get; }
IRichTextBlockElement
A top-level element of a rich text block: a section, list, preformatted block, or quote.
Implemented by RichTextCodeBlock, RichTextList, RichTextQuote, RichTextSection.
IRichTextSectionElement
An inline rich text element: text, a link, an emoji, or a channel, user, or user group mention.
Implemented by RichTextChannel, RichTextEmoji, RichTextLink, RichTextText, RichTextUser, RichTextUserGroup.
LineChart
A line chart for a data visualization block.
- Required:
series,axisConfig. - Every series needs exactly one data point for each axis category.
See the Slack reference.
Implements IChart.
LineChart
Creates and validates a LineChart.
public LineChart(IEnumerable<DataSeries> series, AxisConfig axisConfig, IReadOnlyDictionary<string, object?>? additionalFields = null)
| Parameter | Description |
|---|---|
series | Data series in display order. Series names must be unique. Required. Must contain between 1 and 12 items. |
axisConfig | The axis categories and labels. Every series needs exactly one point per category. Required. |
additionalFields | Slack fields that have no named parameter yet, such as a field Slack introduced after this release. Values must be strings, numbers, booleans, lists, dictionaries, JSON nodes, or slackblocks values, and are validated with the rest of the object. Typed properties do not reflect them, and a field cannot be set both here and through its named parameter. |
| Throws | When |
|---|---|
ValidationException | The value breaks a Block Kit rule, such as a missing required field or an exceeded length limit. |
ArgumentException | A collection contains null, or an additional field cannot be written as JSON or repeats a named parameter. |
Related types: AxisConfig, DataSeries, LineChart
Series
Gets data series in display order. Series names must be unique.
The values in order, or an empty list when none were set.
public IReadOnlyList<DataSeries> Series { get; }
Related types: DataSeries
AxisConfig
Gets the axis categories and labels. Every series needs exactly one point per category.
public AxisConfig AxisConfig { get; }
Related types: AxisConfig
MarkdownText
A mrkdwn text composition object.
- Required:
text.
See the Slack reference.
Derives from Text. Implements IContextElement.
MarkdownText
Creates and validates a MarkdownText.
public MarkdownText(string text, bool? verbatim = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
| Parameter | Description |
|---|---|
text | The mrkdwn-formatted text content. Required. |
verbatim | Whether Slack leaves URLs, mentions, and channel names unlinked. |
additionalFields | Slack fields that have no named parameter yet, such as a field Slack introduced after this release. Values must be strings, numbers, booleans, lists, dictionaries, JSON nodes, or slackblocks values, and are validated with the rest of the object. Typed properties do not reflect them, and a field cannot be set both here and through its named parameter. |
| Throws | When |
|---|---|
ValidationException | The value breaks a Block Kit rule, such as a missing required field or an exceeded length limit. |
ArgumentException | A collection contains null, or an additional field cannot be written as JSON or repeats a named parameter. |
Related types: MarkdownText
Text
Gets the mrkdwn-formatted text content.
public string Text { get; }
Related types: Text
Verbatim
Gets whether Slack leaves URLs, mentions, and channel names unlinked.
The value, or null when it was not set.
public bool? Verbatim { get; }
Implicit conversion
Converts a string to a mrkdwn object.
public static implicit operator MarkdownText?(string? text)
| Parameter | Description |
|---|---|
text | The text content. |
Returns: Markdown text, or null when text is null.
| Throws | When |
|---|---|
ValidationException | The text breaks a Slack limit. |
Related types: MarkdownText
Option
A selectable option for menus, checkboxes, radio buttons, and overflow menus.
- Required:
text,value.
See the Slack reference.
Option
Creates and validates a Option.
public Option(Text text, string value, Text? description = null, string? url = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
| Parameter | Description |
|---|---|
text | The option label shown to users. Required. Slack allows at most 75 characters. A string is sent as a plain_text text object. |
value | The value sent in interaction payloads when this option is chosen. Required. Slack allows at most 150 characters. |
description | Supporting text shown below the label. Only rendered by checkboxes and radio buttons. Slack allows at most 75 characters. A string is sent as a plain_text text object. |
url | A URL loaded in the user's browser when an overflow menu option is chosen. Slack allows at most 3000 characters. |
additionalFields | Slack fields that have no named parameter yet, such as a field Slack introduced after this release. Values must be strings, numbers, booleans, lists, dictionaries, JSON nodes, or slackblocks values, and are validated with the rest of the object. Typed properties do not reflect them, and a field cannot be set both here and through its named parameter. |
| Throws | When |
|---|---|
ValidationException | The value breaks a Block Kit rule, such as a missing required field or an exceeded length limit. |
ArgumentException | A collection contains null, or an additional field cannot be written as JSON or repeats a named parameter. |
Text
Gets the option label shown to users.
public Text Text { get; }
Related types: Text
Value
Gets the value sent in interaction payloads when this option is chosen.
public string Value { get; }
Description
Gets supporting text shown below the label. Only rendered by checkboxes and radio buttons.
The value, or null when it was not set.
public Text? Description { get; }
Related types: Text
Url
Gets a URL loaded in the user's browser when an overflow menu option is chosen.
The value, or null when it was not set.
public string? Url { get; }
OptionGroup
A labelled group of options in a static select menu.
- Required:
label,options.
See the Slack reference.
OptionGroup
Creates and validates a OptionGroup.
public OptionGroup(PlainText label, IEnumerable<Option> options, IReadOnlyDictionary<string, object?>? additionalFields = null)
| Parameter | Description |
|---|---|
label | The group heading. Required. Slack allows at most 75 characters. A string is sent as a plain_text text object. |
options | Selectable options in display order. Required. Must contain between 1 and 100 items. |
additionalFields | Slack fields that have no named parameter yet, such as a field Slack introduced after this release. Values must be strings, numbers, booleans, lists, dictionaries, JSON nodes, or slackblocks values, and are validated with the rest of the object. Typed properties do not reflect them, and a field cannot be set both here and through its named parameter. |
| Throws | When |
|---|---|
ValidationException | The value breaks a Block Kit rule, such as a missing required field or an exceeded length limit. |
ArgumentException | A collection contains null, or an additional field cannot be written as JSON or repeats a named parameter. |
Related types: Option, OptionGroup, PlainText
Label
Gets the group heading.
public PlainText Label { get; }
Related types: PlainText
Options
Gets selectable options in display order.
The values in order, or an empty list when none were set.
public IReadOnlyList<Option> Options { get; }
Related types: Option
PieChart
A pie chart for a data visualization block.
- Required:
segments.
See the Slack reference.
Implements IChart.
PieChart
Creates and validates a PieChart.
public PieChart(IEnumerable<ChartSegment> segments, IReadOnlyDictionary<string, object?>? additionalFields = null)
| Parameter | Description |
|---|---|
segments | Pie segments in display order. Required. Must contain between 1 and 12 items. |
additionalFields | Slack fields that have no named parameter yet, such as a field Slack introduced after this release. Values must be strings, numbers, booleans, lists, dictionaries, JSON nodes, or slackblocks values, and are validated with the rest of the object. Typed properties do not reflect them, and a field cannot be set both here and through its named parameter. |
| Throws | When |
|---|---|
ValidationException | The value breaks a Block Kit rule, such as a missing required field or an exceeded length limit. |
ArgumentException | A collection contains null, or an additional field cannot be written as JSON or repeats a named parameter. |
Related types: ChartSegment, PieChart
Segments
Gets pie segments in display order.
The values in order, or an empty list when none were set.
public IReadOnlyList<ChartSegment> Segments { get; }
Related types: ChartSegment
PlainText
A plain-text composition object.
- Required:
text.
See the Slack reference.
Derives from Text. Implements IContextElement.
PlainText
Creates and validates a PlainText.
public PlainText(string text, bool? emoji = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
| Parameter | Description |
|---|---|
text | The text content. Required. |
emoji | Whether emoji shortcodes such as 🎉 are rendered as emoji. |
additionalFields | Slack fields that have no named parameter yet, such as a field Slack introduced after this release. Values must be strings, numbers, booleans, lists, dictionaries, JSON nodes, or slackblocks values, and are validated with the rest of the object. Typed properties do not reflect them, and a field cannot be set both here and through its named parameter. |
| Throws | When |
|---|---|
ValidationException | The value breaks a Block Kit rule, such as a missing required field or an exceeded length limit. |
ArgumentException | A collection contains null, or an additional field cannot be written as JSON or repeats a named parameter. |
Related types: PlainText
Text
Gets the text content.
public string Text { get; }
Related types: Text
Emoji
Gets whether emoji shortcodes such as 🎉 are rendered as emoji.
The value, or null when it was not set.
public bool? Emoji { get; }
Implicit conversion
Converts a string to a plain_text object.
public static implicit operator PlainText?(string? text)
| Parameter | Description |
|---|---|
text | The text content. |
Returns: Plain text, or null when text is null.
| Throws | When |
|---|---|
ValidationException | The text breaks a Slack limit. |
Related types: PlainText
RawNumber
A numeric data table cell with display text.
- Required:
value,text.
See the Slack reference.
Implements IDataTableCell.
RawNumber
Creates and validates a RawNumber.
public RawNumber(double value, string text, IReadOnlyDictionary<string, object?>? additionalFields = null)
| Parameter | Description |
|---|---|
value | The numeric value used for sorting. Required. Whole numbers are sent without a decimal point. |
text | The formatted text displayed for the number, such as 1,234.5. Required. |
additionalFields | Slack fields that have no named parameter yet, such as a field Slack introduced after this release. Values must be strings, numbers, booleans, lists, dictionaries, JSON nodes, or slackblocks values, and are validated with the rest of the object. Typed properties do not reflect them, and a field cannot be set both here and through its named parameter. |
| Throws | When |
|---|---|
ValidationException | The value breaks a Block Kit rule, such as a missing required field or an exceeded length limit. |
ArgumentException | A collection contains null, or an additional field cannot be written as JSON or repeats a named parameter. |
Related types: RawNumber
Value
Gets the numeric value used for sorting.
public double Value { get; }
Text
Gets the formatted text displayed for the number, such as 1,234.5.
public string Text { get; }
Related types: Text
RawText
An unformatted table cell.
- Required:
text.
See the Slack reference.
Implements IDataTableCell, ITableCell.
RawText
Creates and validates a RawText.
public RawText(string text, IReadOnlyDictionary<string, object?>? additionalFields = null)
| Parameter | Description |
|---|---|
text | The cell text. Required. |
additionalFields | Slack fields that have no named parameter yet, such as a field Slack introduced after this release. Values must be strings, numbers, booleans, lists, dictionaries, JSON nodes, or slackblocks values, and are validated with the rest of the object. Typed properties do not reflect them, and a field cannot be set both here and through its named parameter. |
| Throws | When |
|---|---|
ValidationException | The value breaks a Block Kit rule, such as a missing required field or an exceeded length limit. |
ArgumentException | A collection contains null, or an additional field cannot be written as JSON or repeats a named parameter. |
Related types: RawText
Text
Gets the cell text.
public string Text { get; }
Related types: Text
RichTextChannel
A channel mention inside rich text.
- Required:
channelId.
See the Slack reference.
Implements IRichTextSectionElement.
RichTextChannel
Creates and validates a RichTextChannel.
public RichTextChannel(string channelId, RichTextStyle? style = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
| Parameter | Description |
|---|---|
channelId | The ID of the mentioned channel. Required. |
style | The mention style. Supported flags: bold, italic, strike, highlight, client_highlight, unlink. |
additionalFields | Slack fields that have no named parameter yet, such as a field Slack introduced after this release. Values must be strings, numbers, booleans, lists, dictionaries, JSON nodes, or slackblocks values, and are validated with the rest of the object. Typed properties do not reflect them, and a field cannot be set both here and through its named parameter. |
| Throws | When |
|---|---|
ValidationException | The value breaks a Block Kit rule, such as a missing required field or an exceeded length limit. |
ArgumentException | A collection contains null, or an additional field cannot be written as JSON or repeats a named parameter. |
Related types: RichTextChannel, RichTextStyle
ChannelId
Gets the ID of the mentioned channel.
public string ChannelId { get; }
Style
Gets the mention style.
The value, or null when it was not set.
public RichTextStyle? Style { get; }
Related types: RichTextStyle
RichTextCodeBlock
A preformatted code block inside rich text.
- Required:
elements.
See the Slack reference.
Implements IRichTextBlockElement.
RichTextCodeBlock
Creates and validates a RichTextCodeBlock.
public RichTextCodeBlock(IEnumerable<IRichTextSectionElement> elements, int? border = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
| Parameter | Description |
|---|---|
elements | Inline rich text elements in display order. Required. |
border | The width of the left border, in pixels. |
additionalFields | Slack fields that have no named parameter yet, such as a field Slack introduced after this release. Values must be strings, numbers, booleans, lists, dictionaries, JSON nodes, or slackblocks values, and are validated with the rest of the object. Typed properties do not reflect them, and a field cannot be set both here and through its named parameter. |
| Throws | When |
|---|---|
ValidationException | The value breaks a Block Kit rule, such as a missing required field or an exceeded length limit. |
ArgumentException | A collection contains null, or an additional field cannot be written as JSON or repeats a named parameter. |
Related types: IRichTextSectionElement, RichTextCodeBlock
Elements
Gets inline rich text elements in display order.
The values in order, or an empty list when none were set.
public IReadOnlyList<IRichTextSectionElement> Elements { get; }
Related types: IRichTextSectionElement
Border
Gets the width of the left border, in pixels.
The value, or null when it was not set.
public int? Border { get; }
RichTextEmoji
An emoji inside rich text.
- Required:
name.
See the Slack reference.
Implements IRichTextSectionElement.
RichTextEmoji
Creates and validates a RichTextEmoji.
public RichTextEmoji(string name, int? skinTone = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
| Parameter | Description |
|---|---|
name | The emoji shortcode name, without colons. Required. |
skinTone | The emoji skin tone, from 1 to 6. |
additionalFields | Slack fields that have no named parameter yet, such as a field Slack introduced after this release. Values must be strings, numbers, booleans, lists, dictionaries, JSON nodes, or slackblocks values, and are validated with the rest of the object. Typed properties do not reflect them, and a field cannot be set both here and through its named parameter. |
| Throws | When |
|---|---|
ValidationException | The value breaks a Block Kit rule, such as a missing required field or an exceeded length limit. |
ArgumentException | A collection contains null, or an additional field cannot be written as JSON or repeats a named parameter. |
Related types: RichTextEmoji
Name
Gets the emoji shortcode name, without colons.
public string Name { get; }
SkinTone
Gets the emoji skin tone, from 1 to 6.
The value, or null when it was not set.
public int? SkinTone { get; }
RichTextLink
A hyperlink inside rich text.
- Required:
url.
See the Slack reference.
Implements IRichTextSectionElement.
RichTextLink
Creates and validates a RichTextLink.
public RichTextLink(string url, string? text = null, RichTextStyle? style = null, bool? unsafe = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
| Parameter | Description |
|---|---|
url | The link target. Required. |
text | The visible link text. Slack shows the URL when omitted. |
style | The visual style. Supported flags: bold, italic, strike, code. |
unsafe | Whether Slack treats the link as unsafe. |
additionalFields | Slack fields that have no named parameter yet, such as a field Slack introduced after this release. Values must be strings, numbers, booleans, lists, dictionaries, JSON nodes, or slackblocks values, and are validated with the rest of the object. Typed properties do not reflect them, and a field cannot be set both here and through its named parameter. |
| Throws | When |
|---|---|
ValidationException | The value breaks a Block Kit rule, such as a missing required field or an exceeded length limit. |
ArgumentException | A collection contains null, or an additional field cannot be written as JSON or repeats a named parameter. |
Related types: RichTextLink, RichTextStyle
Url
Gets the link target.
public string Url { get; }
Text
Gets the visible link text. Slack shows the URL when omitted.
The value, or null when it was not set.
public string? Text { get; }
Related types: Text
Style
Gets the visual style.
The value, or null when it was not set.
public RichTextStyle? Style { get; }
Related types: RichTextStyle
Unsafe
Gets whether Slack treats the link as unsafe.
The value, or null when it was not set.
public bool? Unsafe { get; }
RichTextList
A bulleted or numbered list inside rich text.
- Required:
style,elements.
See the Slack reference.
Implements IRichTextBlockElement.
RichTextList
Creates and validates a RichTextList.
public RichTextList(RichTextListStyle style, IEnumerable<RichTextSection> elements, int? indent = null, int? offset = null, int? border = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
| Parameter | Description |
|---|---|
style | Whether the list is bulleted or numbered. Required. |
elements | List items, one rich text section per item. Required. |
indent | The list's indentation level. |
offset | The number of items to skip when numbering an ordered list. |
border | The width of the left border, in pixels. |
additionalFields | Slack fields that have no named parameter yet, such as a field Slack introduced after this release. Values must be strings, numbers, booleans, lists, dictionaries, JSON nodes, or slackblocks values, and are validated with the rest of the object. Typed properties do not reflect them, and a field cannot be set both here and through its named parameter. |
| Throws | When |
|---|---|
ValidationException | The value breaks a Block Kit rule, such as a missing required field or an exceeded length limit. |
ArgumentException | A collection contains null, or an additional field cannot be written as JSON or repeats a named parameter. |
Related types: RichTextList, RichTextListStyle, RichTextSection
Style
Gets whether the list is bulleted or numbered.
public RichTextListStyle Style { get; }
Related types: RichTextListStyle
Elements
Gets list items, one rich text section per item.
The values in order, or an empty list when none were set.
public IReadOnlyList<RichTextSection> Elements { get; }
Related types: RichTextSection
Indent
Gets the list's indentation level.
The value, or null when it was not set.
public int? Indent { get; }
Offset
Gets the number of items to skip when numbering an ordered list.
The value, or null when it was not set.
public int? Offset { get; }
Border
Gets the width of the left border, in pixels.
The value, or null when it was not set.
public int? Border { get; }
RichTextListStyle
Marker styles for rich text lists.
ToWireValue() returns the value Slack expects in JSON.
| Constant | Slack value | Meaning |
|---|---|---|
Bullet | bullet | An unordered, bulleted list. |
Ordered | ordered | A numbered list. |
RichTextQuote
A quotation inside rich text.
- Required:
elements.
See the Slack reference.
Implements IRichTextBlockElement.
RichTextQuote
Creates and validates a RichTextQuote.
public RichTextQuote(IEnumerable<IRichTextSectionElement> elements, int? border = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
| Parameter | Description |
|---|---|
elements | Inline rich text elements in display order. Required. |
border | The width of the left border, in pixels. |
additionalFields | Slack fields that have no named parameter yet, such as a field Slack introduced after this release. Values must be strings, numbers, booleans, lists, dictionaries, JSON nodes, or slackblocks values, and are validated with the rest of the object. Typed properties do not reflect them, and a field cannot be set both here and through its named parameter. |
| Throws | When |
|---|---|
ValidationException | The value breaks a Block Kit rule, such as a missing required field or an exceeded length limit. |
ArgumentException | A collection contains null, or an additional field cannot be written as JSON or repeats a named parameter. |
Related types: IRichTextSectionElement, RichTextQuote
Elements
Gets inline rich text elements in display order.
The values in order, or an empty list when none were set.
public IReadOnlyList<IRichTextSectionElement> Elements { get; }
Related types: IRichTextSectionElement
Border
Gets the width of the left border, in pixels.
The value, or null when it was not set.
public int? Border { get; }
RichTextSection
A paragraph of inline rich text elements.
- Required:
elements.
See the Slack reference.
Implements IRichTextBlockElement.
RichTextSection
Creates and validates a RichTextSection.
public RichTextSection(IEnumerable<IRichTextSectionElement> elements, IReadOnlyDictionary<string, object?>? additionalFields = null)
| Parameter | Description |
|---|---|
elements | Inline rich text elements in display order. Required. |
additionalFields | Slack fields that have no named parameter yet, such as a field Slack introduced after this release. Values must be strings, numbers, booleans, lists, dictionaries, JSON nodes, or slackblocks values, and are validated with the rest of the object. Typed properties do not reflect them, and a field cannot be set both here and through its named parameter. |
| Throws | When |
|---|---|
ValidationException | The value breaks a Block Kit rule, such as a missing required field or an exceeded length limit. |
ArgumentException | A collection contains null, or an additional field cannot be written as JSON or repeats a named parameter. |
Related types: IRichTextSectionElement, RichTextSection
Elements
Gets inline rich text elements in display order.
The values in order, or an empty list when none were set.
public IReadOnlyList<IRichTextSectionElement> Elements { get; }
Related types: IRichTextSectionElement
RichTextStyle
Formatting flags for inline rich text such as text, links, and mentions.
Only the flags you set are sent. Text and links support bold, italic, strike, and code; channel, user, and user group mentions support bold, italic, strike, highlight, client_highlight, and unlink.
RichTextStyle
Creates a style with the given flags.
public RichTextStyle(bool? bold = null, bool? italic = null, bool? strike = null, bool? code = null, bool? highlight = null, bool? clientHighlight = null, bool? unlink = null)
| Parameter | Description |
|---|---|
bold | Whether the text is bold. |
italic | Whether the text is italic. |
strike | Whether the text is struck through. |
code | Whether the text is shown as inline code. |
highlight | Whether a mention is highlighted. |
clientHighlight | Whether a mention is highlighted for the viewing user. |
unlink | Whether a mention is shown without a link. |
Related types: RichTextStyle
Bold
Gets whether the text is bold, or null when not set.
public bool? Bold { get; }
Italic
Gets whether the text is italic, or null when not set.
public bool? Italic { get; }
Strike
Gets whether the text is struck through, or null when not set.
public bool? Strike { get; }
Code
Gets whether the text is inline code, or null when not set.
public bool? Code { get; }
Highlight
Gets whether a mention is highlighted, or null when not set.
public bool? Highlight { get; }
ClientHighlight
Gets whether a mention is highlighted for the viewer, or null when not set.
public bool? ClientHighlight { get; }
Unlink
Gets whether a mention is shown without a link, or null when not set.
public bool? Unlink { get; }
RichTextText
A run of optionally styled text inside rich text.
- Required:
text.
See the Slack reference.
Implements IRichTextSectionElement.
RichTextText
Creates and validates a RichTextText.
public RichTextText(string text, RichTextStyle? style = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
| Parameter | Description |
|---|---|
text | The text content. Required. |
style | The visual style. Supported flags: bold, italic, strike, code. |
additionalFields | Slack fields that have no named parameter yet, such as a field Slack introduced after this release. Values must be strings, numbers, booleans, lists, dictionaries, JSON nodes, or slackblocks values, and are validated with the rest of the object. Typed properties do not reflect them, and a field cannot be set both here and through its named parameter. |
| Throws | When |
|---|---|
ValidationException | The value breaks a Block Kit rule, such as a missing required field or an exceeded length limit. |
ArgumentException | A collection contains null, or an additional field cannot be written as JSON or repeats a named parameter. |
Related types: RichTextStyle, RichTextText
Text
Gets the text content.
public string Text { get; }
Related types: Text
Style
Gets the visual style.
The value, or null when it was not set.
public RichTextStyle? Style { get; }
Related types: RichTextStyle
RichTextUser
A user mention inside rich text.
- Required:
userId.
See the Slack reference.
Implements IRichTextSectionElement.
RichTextUser
Creates and validates a RichTextUser.
public RichTextUser(string userId, RichTextStyle? style = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
| Parameter | Description |
|---|---|
userId | The ID of the mentioned user. Required. |
style | The visual style. Supported flags: bold, italic, strike, highlight, client_highlight, unlink. |
additionalFields | Slack fields that have no named parameter yet, such as a field Slack introduced after this release. Values must be strings, numbers, booleans, lists, dictionaries, JSON nodes, or slackblocks values, and are validated with the rest of the object. Typed properties do not reflect them, and a field cannot be set both here and through its named parameter. |
| Throws | When |
|---|---|
ValidationException | The value breaks a Block Kit rule, such as a missing required field or an exceeded length limit. |
ArgumentException | A collection contains null, or an additional field cannot be written as JSON or repeats a named parameter. |
Related types: RichTextStyle, RichTextUser
UserId
Gets the ID of the mentioned user.
public string UserId { get; }
Style
Gets the visual style.
The value, or null when it was not set.
public RichTextStyle? Style { get; }
Related types: RichTextStyle
RichTextUserGroup
A user group mention inside rich text.
- Required:
userGroupId.
See the Slack reference.
Implements IRichTextSectionElement.
RichTextUserGroup
Creates and validates a RichTextUserGroup.
public RichTextUserGroup(string userGroupId, RichTextStyle? style = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
| Parameter | Description |
|---|---|
userGroupId | The ID of the mentioned user group. Required. |
style | The visual style. Supported flags: bold, italic, strike, highlight, client_highlight, unlink. |
additionalFields | Slack fields that have no named parameter yet, such as a field Slack introduced after this release. Values must be strings, numbers, booleans, lists, dictionaries, JSON nodes, or slackblocks values, and are validated with the rest of the object. Typed properties do not reflect them, and a field cannot be set both here and through its named parameter. |
| Throws | When |
|---|---|
ValidationException | The value breaks a Block Kit rule, such as a missing required field or an exceeded length limit. |
ArgumentException | A collection contains null, or an additional field cannot be written as JSON or repeats a named parameter. |
Related types: RichTextStyle, RichTextUserGroup
UserGroupId
Gets the ID of the mentioned user group.
public string UserGroupId { get; }
Style
Gets the visual style.
The value, or null when it was not set.
public RichTextStyle? Style { get; }
Related types: RichTextStyle
SlackFile
A reference to an image file hosted in Slack.
- Provide exactly one of an ID or a URL.
See the Slack reference.
SlackFile
Creates and validates a SlackFile.
public SlackFile(string? id = null, string? url = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
| Parameter | Description |
|---|---|
id | The ID of a file previously uploaded to Slack. Cannot be combined with a URL. |
url | The URL of a file hosted in Slack. Cannot be combined with an ID. |
additionalFields | Slack fields that have no named parameter yet, such as a field Slack introduced after this release. Values must be strings, numbers, booleans, lists, dictionaries, JSON nodes, or slackblocks values, and are validated with the rest of the object. Typed properties do not reflect them, and a field cannot be set both here and through its named parameter. |
| Throws | When |
|---|---|
ValidationException | The value breaks a Block Kit rule, such as a missing required field or an exceeded length limit. |
ArgumentException | A collection contains null, or an additional field cannot be written as JSON or repeats a named parameter. |
Related types: SlackFile
Id
Gets the ID of a file previously uploaded to Slack. Cannot be combined with a URL.
The value, or null when it was not set.
public string? Id { get; }
Url
Gets the URL of a file hosted in Slack. Cannot be combined with an ID.
The value, or null when it was not set.
public string? Url { get; }
SlackIcon
A Slack-provided icon, referenced by name.
See the Slack reference.
SlackIcon
Creates and validates a SlackIcon.
public SlackIcon(string? name = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
| Parameter | Description |
|---|---|
name | The name of the Slack-provided icon, such as rocket. |
additionalFields | Slack fields that have no named parameter yet, such as a field Slack introduced after this release. Values must be strings, numbers, booleans, lists, dictionaries, JSON nodes, or slackblocks values, and are validated with the rest of the object. Typed properties do not reflect them, and a field cannot be set both here and through its named parameter. |
| Throws | When |
|---|---|
ValidationException | The value breaks a Block Kit rule, such as a missing required field or an exceeded length limit. |
ArgumentException | A collection contains null, or an additional field cannot be written as JSON or repeats a named parameter. |
Related types: SlackIcon
Name
Gets the name of the Slack-provided icon, such as rocket.
The value, or null when it was not set.
public string? Name { get; }
Text
A Slack text composition object: either PlainText or MarkdownText.
A string converts to Text implicitly, so a field typed Text accepts "Hello" directly. The field decides the representation: most such fields send mrkdwn, and the few that Slack requires as plain text, such as an option's label, send plain_text. On its own, a converted string is MarkdownText.
Implicit conversion
Converts a string to text whose representation the receiving field decides.
public static implicit operator Text?(string? text)
| Parameter | Description |
|---|---|
text | The text content. |
Returns: A text object, or null when text is null.
Related types: Text
Trigger
A link trigger that starts a workflow.
- Required:
url.
See the Slack reference.
Trigger
Creates and validates a Trigger.
public Trigger(string url, IEnumerable<InputParameter>? customizableInputParameters = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
| Parameter | Description |
|---|---|
url | The link trigger URL. Required. |
customizableInputParameters | The input values passed to the workflow's trigger. |
additionalFields | Slack fields that have no named parameter yet, such as a field Slack introduced after this release. Values must be strings, numbers, booleans, lists, dictionaries, JSON nodes, or slackblocks values, and are validated with the rest of the object. Typed properties do not reflect them, and a field cannot be set both here and through its named parameter. |
| Throws | When |
|---|---|
ValidationException | The value breaks a Block Kit rule, such as a missing required field or an exceeded length limit. |
ArgumentException | A collection contains null, or an additional field cannot be written as JSON or repeats a named parameter. |
Related types: InputParameter, Trigger
Url
Gets the link trigger URL.
public string Url { get; }
CustomizableInputParameters
Gets the input values passed to the workflow's trigger.
The values in order, or an empty list when none were set.
public IReadOnlyList<InputParameter> CustomizableInputParameters { get; }
Related types: InputParameter
UrlSource
A linked source cited by a task card.
- Required:
url,text.
See the Slack reference.
UrlSource
Creates and validates a UrlSource.
public UrlSource(string url, string text, IReadOnlyDictionary<string, object?>? additionalFields = null)
| Parameter | Description |
|---|---|
url | The source URL. Required. Must be between 1 and 3000 characters. |
text | The source link text. Required. |
additionalFields | Slack fields that have no named parameter yet, such as a field Slack introduced after this release. Values must be strings, numbers, booleans, lists, dictionaries, JSON nodes, or slackblocks values, and are validated with the rest of the object. Typed properties do not reflect them, and a field cannot be set both here and through its named parameter. |
| Throws | When |
|---|---|
ValidationException | The value breaks a Block Kit rule, such as a missing required field or an exceeded length limit. |
ArgumentException | A collection contains null, or an additional field cannot be written as JSON or repeats a named parameter. |
Related types: UrlSource
Url
Gets the source URL.
public string Url { get; }
Text
Gets the source link text.
public string Text { get; }
Related types: Text
Workflow
The workflow started by a workflow button.
- Required:
trigger.
See the Slack reference.
Workflow
Creates and validates a Workflow.
public Workflow(Trigger trigger, IReadOnlyDictionary<string, object?>? additionalFields = null)
| Parameter | Description |
|---|---|
trigger | The link trigger that starts the workflow. Required. |
additionalFields | Slack fields that have no named parameter yet, such as a field Slack introduced after this release. Values must be strings, numbers, booleans, lists, dictionaries, JSON nodes, or slackblocks values, and are validated with the rest of the object. Typed properties do not reflect them, and a field cannot be set both here and through its named parameter. |
| Throws | When |
|---|---|
ValidationException | The value breaks a Block Kit rule, such as a missing required field or an exceeded length limit. |
ArgumentException | A collection contains null, or an additional field cannot be written as JSON or repeats a named parameter. |
Related types: Trigger, Workflow
Trigger
Gets the link trigger that starts the workflow.
public Trigger Trigger { get; }
Related types: Trigger