Skip to main content

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)
ParameterDescription
seriesData series in display order. Series names must be unique. Required. Must contain between 1 and 12 items.
axisConfigThe axis categories and labels. Every series needs exactly one point per category. Required.
additionalFieldsSlack 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.
ThrowsWhen
ValidationExceptionThe value breaks a Block Kit rule, such as a missing required field or an exceeded length limit.
ArgumentExceptionA 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)
ParameterDescription
categoriesAxis categories in display order. Labels must be unique. Required. Must contain between 1 and 20 items.
xLabelThe horizontal axis label. Slack allows at most 50 characters.
yLabelThe vertical axis label. Slack allows at most 50 characters.
additionalFieldsSlack 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.
ThrowsWhen
ValidationExceptionThe value breaks a Block Kit rule, such as a missing required field or an exceeded length limit.
ArgumentExceptionA 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)
ParameterDescription
seriesData series in display order. Series names must be unique. Required. Must contain between 1 and 12 items.
axisConfigThe axis categories and labels. Every series needs exactly one point per category. Required.
additionalFieldsSlack 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.
ThrowsWhen
ValidationExceptionThe value breaks a Block Kit rule, such as a missing required field or an exceeded length limit.
ArgumentExceptionA 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)
ParameterDescription
labelThe segment label. Required. Slack allows at most 20 characters.
valueThe segment's size. Must be greater than zero. Required. Whole numbers are sent without a decimal point.
additionalFieldsSlack 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.
ThrowsWhen
ValidationExceptionThe value breaks a Block Kit rule, such as a missing required field or an exceeded length limit.
ArgumentExceptionA 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.

ConstantSlack valueMeaning
LeftleftAlign cell content to the left.
CentercenterCenter cell content.
RightrightAlign 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)
ParameterDescription
alignHow cell content in the column is aligned.
isWrappedWhether long cell content wraps instead of being truncated.
additionalFieldsSlack 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.
ThrowsWhen
ValidationExceptionThe value breaks a Block Kit rule, such as a missing required field or an exceeded length limit.
ArgumentExceptionA 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)
ParameterDescription
titleThe dialog title. Required. Slack allows at most 100 characters. A string is sent as a plain_text text object.
textThe explanatory text in the dialog body. Required. Slack allows at most 300 characters. A string is sent as a mrkdwn text object.
confirmThe 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.
denyThe 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.
styleThe emphasis of the confirm button.
additionalFieldsSlack 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.
ThrowsWhen
ValidationExceptionThe value breaks a Block Kit rule, such as a missing required field or an exceeded length limit.
ArgumentExceptionA 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)
ParameterDescription
includeConversation types to offer: im, mpim, private, or public.
excludeExternalSharedChannelsWhether externally shared channels are excluded.
excludeBotUsersWhether bot users are excluded.
additionalFieldsSlack 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.
ThrowsWhen
ValidationExceptionThe value breaks a Block Kit rule, such as a missing required field or an exceeded length limit.
ArgumentExceptionA 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)
ParameterDescription
labelThe axis category this point belongs to. Required. Slack allows at most 20 characters.
valueThe point's value. Required. Whole numbers are sent without a decimal point.
additionalFieldsSlack 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.
ThrowsWhen
ValidationExceptionThe value breaks a Block Kit rule, such as a missing required field or an exceeded length limit.
ArgumentExceptionA 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)
ParameterDescription
nameThe series name shown in the legend. Required. Slack allows at most 20 characters.
dataData points in axis-category order. Required. Must contain between 1 and 20 items.
additionalFieldsSlack 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.
ThrowsWhen
ValidationExceptionThe value breaks a Block Kit rule, such as a missing required field or an exceeded length limit.
ArgumentExceptionA 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)
ParameterDescription
triggerActionsOnThe interactions that send a payload: on_enter_pressed or on_character_entered.
additionalFieldsSlack 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.
ThrowsWhen
ValidationExceptionThe value breaks a Block Kit rule, such as a missing required field or an exceeded length limit.
ArgumentExceptionA 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)
ParameterDescription
textThe button label. Required. Slack allows at most 75 characters. A string is sent as a plain_text text object.
valueThe application-defined value sent in interaction payloads. Required. Slack allows at most 2000 characters.
accessibilityLabelThe label read by screen readers in place of the visible text. Slack allows at most 75 characters.
additionalFieldsSlack 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.
ThrowsWhen
ValidationExceptionThe value breaks a Block Kit rule, such as a missing required field or an exceeded length limit.
ArgumentExceptionA 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)
ParameterDescription
nameThe workflow input parameter name. Required.
valueThe value passed to the workflow input. Required.
additionalFieldsSlack 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.
ThrowsWhen
ValidationExceptionThe value breaks a Block Kit rule, such as a missing required field or an exceeded length limit.
ArgumentExceptionA 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)
ParameterDescription
seriesData series in display order. Series names must be unique. Required. Must contain between 1 and 12 items.
axisConfigThe axis categories and labels. Every series needs exactly one point per category. Required.
additionalFieldsSlack 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.
ThrowsWhen
ValidationExceptionThe value breaks a Block Kit rule, such as a missing required field or an exceeded length limit.
ArgumentExceptionA 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)
ParameterDescription
textThe mrkdwn-formatted text content. Required.
verbatimWhether Slack leaves URLs, mentions, and channel names unlinked.
additionalFieldsSlack 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.
ThrowsWhen
ValidationExceptionThe value breaks a Block Kit rule, such as a missing required field or an exceeded length limit.
ArgumentExceptionA 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)
ParameterDescription
textThe text content.

Returns: Markdown text, or null when text is null.

ThrowsWhen
ValidationExceptionThe 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)
ParameterDescription
textThe option label shown to users. Required. Slack allows at most 75 characters. A string is sent as a plain_text text object.
valueThe value sent in interaction payloads when this option is chosen. Required. Slack allows at most 150 characters.
descriptionSupporting 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.
urlA URL loaded in the user's browser when an overflow menu option is chosen. Slack allows at most 3000 characters.
additionalFieldsSlack 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.
ThrowsWhen
ValidationExceptionThe value breaks a Block Kit rule, such as a missing required field or an exceeded length limit.
ArgumentExceptionA collection contains null, or an additional field cannot be written as JSON or repeats a named parameter.

Related types: Option, Text

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)
ParameterDescription
labelThe group heading. Required. Slack allows at most 75 characters. A string is sent as a plain_text text object.
optionsSelectable options in display order. Required. Must contain between 1 and 100 items.
additionalFieldsSlack 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.
ThrowsWhen
ValidationExceptionThe value breaks a Block Kit rule, such as a missing required field or an exceeded length limit.
ArgumentExceptionA 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)
ParameterDescription
segmentsPie segments in display order. Required. Must contain between 1 and 12 items.
additionalFieldsSlack 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.
ThrowsWhen
ValidationExceptionThe value breaks a Block Kit rule, such as a missing required field or an exceeded length limit.
ArgumentExceptionA 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)
ParameterDescription
textThe text content. Required.
emojiWhether emoji shortcodes such as 🎉 are rendered as emoji.
additionalFieldsSlack 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.
ThrowsWhen
ValidationExceptionThe value breaks a Block Kit rule, such as a missing required field or an exceeded length limit.
ArgumentExceptionA 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)
ParameterDescription
textThe text content.

Returns: Plain text, or null when text is null.

ThrowsWhen
ValidationExceptionThe 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)
ParameterDescription
valueThe numeric value used for sorting. Required. Whole numbers are sent without a decimal point.
textThe formatted text displayed for the number, such as 1,234.5. Required.
additionalFieldsSlack 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.
ThrowsWhen
ValidationExceptionThe value breaks a Block Kit rule, such as a missing required field or an exceeded length limit.
ArgumentExceptionA 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)
ParameterDescription
textThe cell text. Required.
additionalFieldsSlack 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.
ThrowsWhen
ValidationExceptionThe value breaks a Block Kit rule, such as a missing required field or an exceeded length limit.
ArgumentExceptionA 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)
ParameterDescription
channelIdThe ID of the mentioned channel. Required.
styleThe mention style. Supported flags: bold, italic, strike, highlight, client_highlight, unlink.
additionalFieldsSlack 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.
ThrowsWhen
ValidationExceptionThe value breaks a Block Kit rule, such as a missing required field or an exceeded length limit.
ArgumentExceptionA 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)
ParameterDescription
elementsInline rich text elements in display order. Required.
borderThe width of the left border, in pixels.
additionalFieldsSlack 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.
ThrowsWhen
ValidationExceptionThe value breaks a Block Kit rule, such as a missing required field or an exceeded length limit.
ArgumentExceptionA 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)
ParameterDescription
nameThe emoji shortcode name, without colons. Required.
skinToneThe emoji skin tone, from 1 to 6.
additionalFieldsSlack 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.
ThrowsWhen
ValidationExceptionThe value breaks a Block Kit rule, such as a missing required field or an exceeded length limit.
ArgumentExceptionA 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; }

A hyperlink inside rich text.

  • Required: url.

See the Slack reference.

Implements IRichTextSectionElement.

Creates and validates a RichTextLink.

public RichTextLink(string url, string? text = null, RichTextStyle? style = null, bool? unsafe = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
ParameterDescription
urlThe link target. Required.
textThe visible link text. Slack shows the URL when omitted.
styleThe visual style. Supported flags: bold, italic, strike, code.
unsafeWhether Slack treats the link as unsafe.
additionalFieldsSlack 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.
ThrowsWhen
ValidationExceptionThe value breaks a Block Kit rule, such as a missing required field or an exceeded length limit.
ArgumentExceptionA 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)
ParameterDescription
styleWhether the list is bulleted or numbered. Required.
elementsList items, one rich text section per item. Required.
indentThe list's indentation level.
offsetThe number of items to skip when numbering an ordered list.
borderThe width of the left border, in pixels.
additionalFieldsSlack 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.
ThrowsWhen
ValidationExceptionThe value breaks a Block Kit rule, such as a missing required field or an exceeded length limit.
ArgumentExceptionA 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.

ConstantSlack valueMeaning
BulletbulletAn unordered, bulleted list.
OrderedorderedA 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)
ParameterDescription
elementsInline rich text elements in display order. Required.
borderThe width of the left border, in pixels.
additionalFieldsSlack 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.
ThrowsWhen
ValidationExceptionThe value breaks a Block Kit rule, such as a missing required field or an exceeded length limit.
ArgumentExceptionA 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)
ParameterDescription
elementsInline rich text elements in display order. Required.
additionalFieldsSlack 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.
ThrowsWhen
ValidationExceptionThe value breaks a Block Kit rule, such as a missing required field or an exceeded length limit.
ArgumentExceptionA 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)
ParameterDescription
boldWhether the text is bold.
italicWhether the text is italic.
strikeWhether the text is struck through.
codeWhether the text is shown as inline code.
highlightWhether a mention is highlighted.
clientHighlightWhether a mention is highlighted for the viewing user.
unlinkWhether 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; }

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)
ParameterDescription
textThe text content. Required.
styleThe visual style. Supported flags: bold, italic, strike, code.
additionalFieldsSlack 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.
ThrowsWhen
ValidationExceptionThe value breaks a Block Kit rule, such as a missing required field or an exceeded length limit.
ArgumentExceptionA 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)
ParameterDescription
userIdThe ID of the mentioned user. Required.
styleThe visual style. Supported flags: bold, italic, strike, highlight, client_highlight, unlink.
additionalFieldsSlack 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.
ThrowsWhen
ValidationExceptionThe value breaks a Block Kit rule, such as a missing required field or an exceeded length limit.
ArgumentExceptionA 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)
ParameterDescription
userGroupIdThe ID of the mentioned user group. Required.
styleThe visual style. Supported flags: bold, italic, strike, highlight, client_highlight, unlink.
additionalFieldsSlack 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.
ThrowsWhen
ValidationExceptionThe value breaks a Block Kit rule, such as a missing required field or an exceeded length limit.
ArgumentExceptionA 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)
ParameterDescription
idThe ID of a file previously uploaded to Slack. Cannot be combined with a URL.
urlThe URL of a file hosted in Slack. Cannot be combined with an ID.
additionalFieldsSlack 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.
ThrowsWhen
ValidationExceptionThe value breaks a Block Kit rule, such as a missing required field or an exceeded length limit.
ArgumentExceptionA 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)
ParameterDescription
nameThe name of the Slack-provided icon, such as rocket.
additionalFieldsSlack 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.
ThrowsWhen
ValidationExceptionThe value breaks a Block Kit rule, such as a missing required field or an exceeded length limit.
ArgumentExceptionA 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)
ParameterDescription
textThe 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)
ParameterDescription
urlThe link trigger URL. Required.
customizableInputParametersThe input values passed to the workflow's trigger.
additionalFieldsSlack 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.
ThrowsWhen
ValidationExceptionThe value breaks a Block Kit rule, such as a missing required field or an exceeded length limit.
ArgumentExceptionA 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)
ParameterDescription
urlThe source URL. Required. Must be between 1 and 3000 characters.
textThe source link text. Required.
additionalFieldsSlack 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.
ThrowsWhen
ValidationExceptionThe value breaks a Block Kit rule, such as a missing required field or an exceeded length limit.
ArgumentExceptionA 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)
ParameterDescription
triggerThe link trigger that starts the workflow. Required.
additionalFieldsSlack 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.
ThrowsWhen
ValidationExceptionThe value breaks a Block Kit rule, such as a missing required field or an exceeded length limit.
ArgumentExceptionA 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