Skip to main content

Blocks

This page documents the public C# API for blocks, 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.

Every block implements IBlock, so blocks of any kind share one collection type, and values serialize as Slack JSON with ToJson() or System.Text.Json.

ActionsBlock​

A block that holds interactive elements such as buttons and menus.

  • Required: elements.

See the Slack reference.

Implements IBlock.

ActionsBlock​

Creates and validates a ActionsBlock.

public ActionsBlock(IEnumerable<IElement> elements, string? blockId = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
ParameterDescription
elementsInteractive elements in display order. Required. Slack allows at most 25 items.
blockIdA unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Slack allows at most 255 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: ActionsBlock, IElement

Elements​

Gets interactive elements in display order.

The values in order, or an empty list when none were set.

public IReadOnlyList<IElement> Elements { get; }

Related types: IElement

BlockId​

Gets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

The value, or null when it was not set.

public string? BlockId { get; }

AlertBlock​

A severity-labelled alert, available in modals.

  • Required: text.

See the Slack reference.

Implements IBlock.

AlertBlock​

Creates and validates a AlertBlock.

public AlertBlock(Text text, AlertLevel? level = null, string? blockId = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
ParameterDescription
textThe alert message. Required. Slack allows at most 200 characters. A string is sent as a mrkdwn text object.
levelThe alert severity, which controls its color and icon.
blockIdA unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Slack allows at most 255 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: AlertBlock, AlertLevel, Text

Text​

Gets the alert message.

public Text Text { get; }

Related types: Text

Level​

Gets the alert severity, which controls its color and icon.

The value, or null when it was not set.

public AlertLevel? Level { get; }

Related types: AlertLevel

BlockId​

Gets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

The value, or null when it was not set.

public string? BlockId { get; }

AlertLevel​

Severity levels supported by alert blocks.

ToWireValue() returns the value Slack expects in JSON.

ConstantSlack valueMeaning
DefaultdefaultNeutral styling.
InfoinfoInformational styling.
WarningwarningWarning styling.
ErrorerrorError styling.
SuccesssuccessSuccess styling.

CardBlock​

A compact card with an image, text, and up to three buttons.

  • Provide at least one of a hero image, title, actions, or body.
  • An image icon and a Slack icon cannot be combined.

See the Slack reference.

Implements IBlock.

CardBlock​

Creates and validates a CardBlock.

public CardBlock(ImageElement? heroImage = null, ImageElement? icon = null, Text? title = null, Text? subtitle = null, Text? body = null, IEnumerable<ButtonElement>? actions = null, SlackIcon? slackIcon = null, Text? subtext = null, string? blockId = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
ParameterDescription
heroImageThe image displayed prominently at the top of the card.
iconThe image displayed beside the title.
titleThe card title. Slack allows at most 150 characters. A string is sent as a mrkdwn text object.
subtitleThe supporting text shown below the title. Slack allows at most 150 characters. A string is sent as a mrkdwn text object.
bodyThe main body text of the card. Slack allows at most 200 characters. A string is sent as a mrkdwn text object.
actionsButtons displayed at the bottom of the card, in display order. Slack allows at most 3 items.
slackIconA Slack-provided icon displayed beside the title. Cannot be combined with an image icon.
subtextThe small print shown at the bottom of the card. Slack allows at most 200 characters. A string is sent as a mrkdwn text object.
blockIdA unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Slack allows at most 255 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: ButtonElement, CardBlock, ImageElement, SlackIcon, Text

HeroImage​

Gets the image displayed prominently at the top of the card.

The value, or null when it was not set.

public ImageElement? HeroImage { get; }

Related types: ImageElement

Icon​

Gets the image displayed beside the title.

The value, or null when it was not set.

public ImageElement? Icon { get; }

Related types: ImageElement

Title​

Gets the card title.

The value, or null when it was not set.

public Text? Title { get; }

Related types: Text

Subtitle​

Gets the supporting text shown below the title.

The value, or null when it was not set.

public Text? Subtitle { get; }

Related types: Text

Body​

Gets the main body text of the card.

The value, or null when it was not set.

public Text? Body { get; }

Related types: Text

Actions​

Gets buttons displayed at the bottom of the card, in display order.

The values in order, or an empty list when none were set.

public IReadOnlyList<ButtonElement> Actions { get; }

Related types: ButtonElement

SlackIcon​

Gets a Slack-provided icon displayed beside the title. Cannot be combined with an image icon.

The value, or null when it was not set.

public SlackIcon? SlackIcon { get; }

Related types: SlackIcon

Subtext​

Gets the small print shown at the bottom of the card.

The value, or null when it was not set.

public Text? Subtext { get; }

Related types: Text

BlockId​

Gets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

The value, or null when it was not set.

public string? BlockId { get; }

CarouselBlock​

A horizontally scrolling set of cards, available in messages and App Home.

  • Required: elements.

See the Slack reference.

Implements IBlock.

CarouselBlock​

Creates and validates a CarouselBlock.

public CarouselBlock(IEnumerable<CardBlock> elements, string? blockId = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
ParameterDescription
elementsThe cards in display order. Required. Must contain between 1 and 10 items.
blockIdA unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Slack allows at most 255 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: CardBlock, CarouselBlock

Elements​

Gets the cards in display order.

The values in order, or an empty list when none were set.

public IReadOnlyList<CardBlock> Elements { get; }

Related types: CardBlock

BlockId​

Gets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

The value, or null when it was not set.

public string? BlockId { get; }

ContainerBlock​

A titled group of blocks that can optionally collapse.

  • Required: childBlocks.
  • Provide a title or a rich text title.

See the Slack reference.

Implements IBlock.

ContainerBlock​

Creates and validates a ContainerBlock.

public ContainerBlock(IEnumerable<IBlock> childBlocks, PlainText? title = null, RichTextBlock? richTextTitle = null, Text? subtitle = null, ContainerWidth? width = null, ImageElement? icon = null, bool? isCollapsible = null, bool? defaultCollapsed = null, bool? hasHeaderDivider = null, string? blockId = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
ParameterDescription
childBlocksThe blocks grouped inside the container, in display order. Required. Must contain between 1 and 10 items.
titleThe container title. Provide either a title or a rich text title. Slack allows at most 150 characters. A string is sent as a plain_text text object.
richTextTitleA rich text block used as the title in place of a plain-text title.
subtitleThe supporting text shown below the title. Slack allows at most 150 characters. A string is sent as a mrkdwn text object.
widthThe horizontal width of the container.
iconThe image displayed beside the title.
isCollapsibleWhether users can collapse and expand the container.
defaultCollapsedWhether a collapsible container starts collapsed. Requires the container to be collapsible.
hasHeaderDividerWhether Slack draws a divider below the container header. Only valid for non-collapsible containers.
blockIdA unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Slack allows at most 255 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: ContainerBlock, ContainerWidth, IBlock, ImageElement, PlainText, RichTextBlock, Text

ChildBlocks​

Gets the blocks grouped inside the container, in display order.

The values in order, or an empty list when none were set.

public IReadOnlyList<IBlock> ChildBlocks { get; }

Related types: IBlock

Title​

Gets the container title. Provide either a title or a rich text title.

The value, or null when it was not set.

public PlainText? Title { get; }

Related types: PlainText

RichTextTitle​

Gets a rich text block used as the title in place of a plain-text title.

The value, or null when it was not set.

public RichTextBlock? RichTextTitle { get; }

Related types: RichTextBlock

Subtitle​

Gets the supporting text shown below the title.

The value, or null when it was not set.

public Text? Subtitle { get; }

Related types: Text

Width​

Gets the horizontal width of the container.

The value, or null when it was not set.

public ContainerWidth? Width { get; }

Related types: ContainerWidth

Icon​

Gets the image displayed beside the title.

The value, or null when it was not set.

public ImageElement? Icon { get; }

Related types: ImageElement

IsCollapsible​

Gets whether users can collapse and expand the container.

The value, or null when it was not set.

public bool? IsCollapsible { get; }

DefaultCollapsed​

Gets whether a collapsible container starts collapsed. Requires the container to be collapsible.

The value, or null when it was not set.

public bool? DefaultCollapsed { get; }

HasHeaderDivider​

Gets whether Slack draws a divider below the container header. Only valid for non-collapsible containers.

The value, or null when it was not set.

public bool? HasHeaderDivider { get; }

BlockId​

Gets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

The value, or null when it was not set.

public string? BlockId { get; }

ContainerWidth​

Widths supported by Slack container blocks.

ToWireValue() returns the value Slack expects in JSON.

ConstantSlack valueMeaning
NarrownarrowA compact container.
StandardstandardSlack's standard container width.
WidewideA wide container.
FullfullThe full available width.

ContextActionsBlock​

A row of feedback or icon buttons, usually shown below AI-generated content.

  • Required: elements.

See the Slack reference.

Implements IBlock.

ContextActionsBlock​

Creates and validates a ContextActionsBlock.

public ContextActionsBlock(IEnumerable<IContextActionsElement> elements, string? blockId = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
ParameterDescription
elementsFeedback buttons or icon buttons in display order. Required. Slack allows at most 5 items.
blockIdA unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Slack allows at most 255 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: ContextActionsBlock, IContextActionsElement

Elements​

Gets feedback buttons or icon buttons in display order.

The values in order, or an empty list when none were set.

public IReadOnlyList<IContextActionsElement> Elements { get; }

Related types: IContextActionsElement

BlockId​

Gets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

The value, or null when it was not set.

public string? BlockId { get; }

ContextBlock​

A block of small, secondary images and text.

  • Required: elements.

See the Slack reference.

Implements IBlock.

ContextBlock​

Creates and validates a ContextBlock.

public ContextBlock(IEnumerable<IContextElement> elements, string? blockId = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
ParameterDescription
elementsImages and text in display order. Required. Slack allows at most 10 items.
blockIdA unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Slack allows at most 255 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: ContextBlock, IContextElement

Elements​

Gets images and text in display order.

The values in order, or an empty list when none were set.

public IReadOnlyList<IContextElement> Elements { get; }

Related types: IContextElement

BlockId​

Gets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

The value, or null when it was not set.

public string? BlockId { get; }

DataTableBlock​

A sortable, paginated table of raw text, numbers, and rich text.

  • Required: rows, caption.
  • The first row is the header row and cannot contain rich text.
  • Every row must have the same number of cells, and all cell text together is limited to 20,000 characters.

See the Slack reference.

Implements IBlock.

DataTableBlock​

Creates and validates a DataTableBlock.

public DataTableBlock(IEnumerable<IEnumerable<IDataTableCell>> rows, string caption, int? pageSize = null, int? rowHeaderColumnIndex = null, string? blockId = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
ParameterDescription
rowsComplete table rows in display order. Every row must have the same number of cells. Required. Must contain between 2 and 201 items.
captionThe caption that describes the table's contents. Required.
pageSizeHow many rows Slack shows per page. Must be between 1 and 100.
rowHeaderColumnIndexThe zero-based index of the column whose cells act as row headers. Must be at least 0.
blockIdA unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Slack allows at most 255 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: DataTableBlock, IDataTableCell

Rows​

Gets complete table rows in display order. Every row must have the same number of cells.

The values in order, or an empty list when none were set.

public IReadOnlyList<IReadOnlyList<IDataTableCell>> Rows { get; }

Related types: IDataTableCell

Caption​

Gets the caption that describes the table's contents.

public string Caption { get; }

PageSize​

Gets how many rows Slack shows per page.

public int? PageSize { get; }

RowHeaderColumnIndex​

Gets the zero-based index of the column whose cells act as row headers.

public int? RowHeaderColumnIndex { get; }

BlockId​

Gets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

The value, or null when it was not set.

public string? BlockId { get; }

DataVisualizationBlock​

A titled pie, bar, area, or line chart.

  • Required: title, chart.

See the Slack reference.

Implements IBlock.

DataVisualizationBlock​

Creates and validates a DataVisualizationBlock.

public DataVisualizationBlock(string title, IChart chart, string? blockId = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
ParameterDescription
titleThe chart title. Required. Slack allows at most 50 characters.
chartThe chart to display. Required.
blockIdA unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Slack allows at most 255 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: DataVisualizationBlock, IChart

Title​

Gets the chart title.

public string Title { get; }

Chart​

Gets the chart to display.

public IChart Chart { get; }

Related types: IChart

BlockId​

Gets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

The value, or null when it was not set.

public string? BlockId { get; }

DividerBlock​

A horizontal rule that separates blocks.

See the Slack reference.

Implements IBlock.

DividerBlock​

Creates and validates a DividerBlock.

public DividerBlock(string? blockId = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
ParameterDescription
blockIdA unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Slack allows at most 255 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: DividerBlock

BlockId​

Gets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

The value, or null when it was not set.

public string? BlockId { get; }

FileBlock​

A remote file previously added with the files.remote API.

  • Required: externalId, source.

See the Slack reference.

Implements IBlock.

FileBlock​

Creates and validates a FileBlock.

public FileBlock(string externalId, string? source = null, string? blockId = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
ParameterDescription
externalIdThe external identifier of a remote file previously added with the files.remote API. Required.
sourceThe file source. Slack currently supports only remote files. Required.
blockIdA unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Slack allows at most 255 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: FileBlock

ExternalId​

Gets the external identifier of a remote file previously added with the files.remote API.

public string ExternalId { get; }

Source​

Gets the file source. Slack currently supports only remote files.

public string? Source { get; }

BlockId​

Gets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

The value, or null when it was not set.

public string? BlockId { get; }

HeaderBlock​

Large, bold plain text that introduces a group of blocks.

  • Required: text.

See the Slack reference.

Implements IBlock.

HeaderBlock​

Creates and validates a HeaderBlock.

public HeaderBlock(PlainText text, string? blockId = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
ParameterDescription
textThe header text, shown in a larger bold font. Required. Slack allows at most 150 characters. A string is sent as a plain_text text object.
blockIdA unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Slack allows at most 255 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: HeaderBlock, PlainText

Text​

Gets the header text, shown in a larger bold font.

public PlainText Text { get; }

Related types: PlainText, Text

BlockId​

Gets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

The value, or null when it was not set.

public string? BlockId { get; }

IBlock​

A validated Slack layout block accepted directly by Slack's official Java SDK.

Implemented by ActionsBlock, AlertBlock, CardBlock, CarouselBlock, ContainerBlock, ContextActionsBlock, ContextBlock, DataTableBlock, DataVisualizationBlock, DividerBlock, FileBlock, HeaderBlock, ImageBlock, InputBlock, MarkdownBlock, PlanBlock, RichTextBlock, SectionBlock, TableBlock, TaskCardBlock, VideoBlock.

IContextActionsElement​

A value that can appear in a context actions block: feedback buttons or an icon button.

Implemented by FeedbackButtonsElement, IconButtonElement.

IContextElement​

A value that can appear in a context block: an image element or a text object.

Implemented by ImageElement, MarkdownText, PlainText.

IDataTableCell​

A value that can appear as a data table cell: raw text, a raw number, or a rich text block.

Implemented by RawNumber, RawText, RichTextBlock.

ImageBlock​

A standalone image with alternative text and an optional title.

  • Required: altText.
  • Provide exactly one of an image URL or a Slack file.

See the Slack reference.

Implements IBlock.

ImageBlock​

Creates and validates a ImageBlock.

public ImageBlock(string? imageUrl, string altText, PlainText? title = null, string? blockId = null, SlackFile? slackFile = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
ParameterDescription
imageUrlThe publicly accessible URL of the image. Cannot be combined with a Slack file. Slack allows at most 3000 characters.
altTextA plain-text summary of the image or video for assistive technology. Required. Slack allows at most 2000 characters.
titleThe title shown above the image. Slack allows at most 2000 characters. A string is sent as a plain_text text object.
blockIdA unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Slack allows at most 255 characters.
slackFileA file hosted in Slack as the image source. Cannot be combined with an image URL.
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: ImageBlock, PlainText, SlackFile

ImageUrl​

Gets the publicly accessible URL of the image. Cannot be combined with a Slack file.

The value, or null when it was not set.

public string? ImageUrl { get; }

SlackFile​

Gets a file hosted in Slack as the image source. Cannot be combined with an image URL.

The value, or null when it was not set.

public SlackFile? SlackFile { get; }

Related types: SlackFile

AltText​

Gets a plain-text summary of the image or video for assistive technology.

public string AltText { get; }

Title​

Gets the title shown above the image.

The value, or null when it was not set.

public PlainText? Title { get; }

Related types: PlainText

BlockId​

Gets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

The value, or null when it was not set.

public string? BlockId { get; }

InputBlock​

A labelled input that collects a value in a modal, App Home, or message.

  • Required: label, element.

See the Slack reference.

Implements IBlock.

InputBlock​

Creates and validates a InputBlock.

public InputBlock(PlainText label, IInputElement element, bool? dispatchAction = null, string? blockId = null, PlainText? hint = null, bool? optional = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
ParameterDescription
labelThe label shown above the input. Required. Slack allows at most 2000 characters. A string is sent as a plain_text text object.
elementThe input element that collects the user's value. Required.
dispatchActionWhether changing the element sends a block_actions payload immediately.
blockIdA unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Slack allows at most 255 characters.
hintHelper text shown below the input. Slack allows at most 2000 characters. A string is sent as a plain_text text object.
optionalWhether the modal can be submitted when this input is empty.
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: IInputElement, InputBlock, PlainText

Label​

Gets the label shown above the input.

public PlainText Label { get; }

Related types: PlainText

Element​

Gets the input element that collects the user's value.

public IInputElement Element { get; }

Related types: IInputElement

DispatchAction​

Gets whether changing the element sends a block_actions payload immediately.

The value, or null when it was not set.

public bool? DispatchAction { get; }

BlockId​

Gets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

The value, or null when it was not set.

public string? BlockId { get; }

Hint​

Gets helper text shown below the input.

The value, or null when it was not set.

public PlainText? Hint { get; }

Related types: PlainText

Optional​

Gets whether the modal can be submitted when this input is empty.

The value, or null when it was not set.

public bool? Optional { get; }

ITableCell​

A value that can appear as a table block cell: raw text or a rich text block.

Implemented by RawText, RichTextBlock.

MarkdownBlock​

Standard markdown rendered by Slack, intended for AI-generated content.

  • Required: text.

See the Slack reference.

Implements IBlock.

MarkdownBlock​

Creates and validates a MarkdownBlock.

public MarkdownBlock(string text, string? blockId = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
ParameterDescription
textStandard markdown content, which Slack renders directly. Required. Slack allows at most 12000 characters.
blockIdA unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Slack allows at most 255 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: MarkdownBlock

Text​

Gets standard markdown content, which Slack renders directly.

public string Text { get; }

Related types: Text

BlockId​

Gets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

The value, or null when it was not set.

public string? BlockId { get; }

PlanBlock​

A titled sequence of task cards.

  • Required: title, tasks.
  • Task IDs must be unique within a plan.

See the Slack reference.

Implements IBlock.

PlanBlock​

Creates and validates a PlanBlock.

public PlanBlock(string title, IEnumerable<TaskCardBlock>? tasks = null, string? blockId = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
ParameterDescription
titleThe plan title. Required.
tasksTask cards in display order. Required. Slack allows at most 50 items.
blockIdA unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Slack allows at most 255 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: PlanBlock, TaskCardBlock

Title​

Gets the plan title.

public string Title { get; }

Tasks​

Gets task cards in display order.

The values in order, or an empty list when none were set.

public IReadOnlyList<TaskCardBlock> Tasks { get; }

Related types: TaskCardBlock

BlockId​

Gets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

The value, or null when it was not set.

public string? BlockId { get; }

RichTextBlock​

Formatted text built from sections, lists, preformatted blocks, and quotes.

  • Required: elements.

See the Slack reference.

Implements IBlock, IDataTableCell, ITableCell.

RichTextBlock​

Creates and validates a RichTextBlock.

public RichTextBlock(IEnumerable<IRichTextBlockElement> elements, string? blockId = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
ParameterDescription
elementsSections, lists, preformatted blocks, and quotes in display order. Required.
blockIdA unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Slack allows at most 255 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: IRichTextBlockElement, RichTextBlock

Elements​

Gets sections, lists, preformatted blocks, and quotes in display order.

The values in order, or an empty list when none were set.

public IReadOnlyList<IRichTextBlockElement> Elements { get; }

Related types: IRichTextBlockElement

BlockId​

Gets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

The value, or null when it was not set.

public string? BlockId { get; }

SectionBlock​

Text, a grid of fields, or both, with an optional accessory element.

  • Provide text, fields, or both.

See the Slack reference.

Implements IBlock.

SectionBlock​

Creates and validates a SectionBlock.

public SectionBlock(Text? text = null, IEnumerable<Text>? fields = null, IElement? accessory = null, string? blockId = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
ParameterDescription
textThe main text of the section. Slack allows at most 3000 characters. A string is sent as a mrkdwn text object.
fieldsSection fields, shown in a two-column grid, in display order. Slack allows at most 10 items, each at most 2000 characters. Strings are sent as mrkdwn text objects.
accessoryThe element displayed beside the section text.
blockIdA unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Slack allows at most 255 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: IElement, SectionBlock, Text

Text​

Gets the main text of the section.

The value, or null when it was not set.

public Text? Text { get; }

Related types: Text

Fields​

Gets section fields, shown in a two-column grid, in display order.

The values in order, or an empty list when none were set.

public IReadOnlyList<Text> Fields { get; }

Related types: Text

Accessory​

Gets the element displayed beside the section text.

The value, or null when it was not set.

public IElement? Accessory { get; }

Related types: IElement

BlockId​

Gets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

The value, or null when it was not set.

public string? BlockId { get; }

TableBlock​

A simple table of raw text and rich text cells.

  • Required: rows.

See the Slack reference.

Implements IBlock.

TableBlock​

Creates and validates a TableBlock.

public TableBlock(IEnumerable<IEnumerable<ITableCell>> rows, IEnumerable<ColumnSettings>? columnSettings = null, string? blockId = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
ParameterDescription
rowsComplete table rows in display order. Required. Slack allows at most 100 items.
columnSettingsPer-column settings in column order. Provide one entry for every column. Slack allows at most 20 items.
blockIdA unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Slack allows at most 255 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: ColumnSettings, ITableCell, TableBlock

Rows​

Gets complete table rows in display order.

The values in order, or an empty list when none were set.

public IReadOnlyList<IReadOnlyList<ITableCell>> Rows { get; }

Related types: ITableCell

ColumnSettings​

Gets per-column settings in column order. Provide one entry for every column.

The values in order, or an empty list when none were set.

public IReadOnlyList<ColumnSettings> ColumnSettings { get; }

Related types: ColumnSettings

BlockId​

Gets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

The value, or null when it was not set.

public string? BlockId { get; }

TaskCardBlock​

One task with its status, details, output, and sources.

  • Required: taskId, title, status.
  • A standalone task card's status cannot be pending; pending is only valid for plan tasks.

See the Slack reference.

Implements IBlock.

TaskCardBlock​

Creates and validates a TaskCardBlock.

public TaskCardBlock(string taskId, string title, RichTextBlock? details = null, RichTextBlock? output = null, IEnumerable<UrlSource>? sources = null, TaskCardStatus? status = null, string? blockId = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
ParameterDescription
taskIdThe identifier of the task. Required.
titleThe task title. Required.
detailsA rich text description of the task.
outputRich text describing the task's output.
sourcesLinks to the sources the task used, in display order.
statusThe task's current state. Required.
blockIdA unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Slack allows at most 255 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: RichTextBlock, TaskCardBlock, TaskCardStatus, UrlSource

TaskId​

Gets the identifier of the task.

public string TaskId { get; }

Title​

Gets the task title.

public string Title { get; }

Details​

Gets a rich text description of the task.

The value, or null when it was not set.

public RichTextBlock? Details { get; }

Related types: RichTextBlock

Output​

Gets rich text describing the task's output.

The value, or null when it was not set.

public RichTextBlock? Output { get; }

Related types: RichTextBlock

Sources​

Gets links to the sources the task used, in display order.

The values in order, or an empty list when none were set.

public IReadOnlyList<UrlSource> Sources { get; }

Related types: UrlSource

Status​

Gets the task's current state.

The value, or null when it was not set.

public TaskCardStatus? Status { get; }

Related types: TaskCardStatus

BlockId​

Gets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

The value, or null when it was not set.

public string? BlockId { get; }

TaskCardStatus​

States supported by task card blocks.

ToWireValue() returns the value Slack expects in JSON.

ConstantSlack valueMeaning
PendingpendingThe task has not started.
InProgressin_progressThe task is running.
CompletecompleteThe task finished successfully.
ErrorerrorThe task failed.

VideoBlock​

An embedded video player.

  • Required: altText, thumbnailUrl, title, videoUrl.

See the Slack reference.

Implements IBlock.

VideoBlock​

Creates and validates a VideoBlock.

public VideoBlock(string altText, string thumbnailUrl, PlainText title, string videoUrl, string? blockId = null, string? authorName = null, PlainText? description = null, string? providerIconUrl = null, string? providerName = null, string? titleUrl = null, IReadOnlyDictionary<string, object?>? additionalFields = null)
ParameterDescription
altTextA plain-text summary of the image or video for assistive technology. Required. Slack allows at most 2000 characters.
thumbnailUrlThe URL of the image shown before the video plays. Required. Slack allows at most 3000 characters.
titleThe video title. Required. Slack allows at most 200 characters. A string is sent as a plain_text text object.
videoUrlThe embeddable URL of the video. The domain must be listed in the app's unfurl domains. Required. Slack allows at most 3000 characters.
blockIdA unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Slack allows at most 255 characters.
authorNameThe name of the video's author. Slack allows at most 50 characters.
descriptionThe video description. Slack allows at most 200 characters. A string is sent as a plain_text text object.
providerIconUrlThe URL of the video provider's icon. Slack allows at most 2000 characters.
providerNameThe name of the video provider, such as YouTube. Slack allows at most 50 characters.
titleUrlThe HTTPS URL opened when the title is clicked. Slack allows at most 2000 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: PlainText, VideoBlock

AltText​

Gets a plain-text summary of the image or video for assistive technology.

public string AltText { get; }

ThumbnailUrl​

Gets the URL of the image shown before the video plays.

public string ThumbnailUrl { get; }

Title​

Gets the video title.

public PlainText Title { get; }

Related types: PlainText

VideoUrl​

Gets the embeddable URL of the video. The domain must be listed in the app's unfurl domains.

public string VideoUrl { get; }

BlockId​

Gets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

The value, or null when it was not set.

public string? BlockId { get; }

AuthorName​

Gets the name of the video's author.

The value, or null when it was not set.

public string? AuthorName { get; }

Description​

Gets the video description.

The value, or null when it was not set.

public PlainText? Description { get; }

Related types: PlainText

ProviderIconUrl​

Gets the URL of the video provider's icon.

The value, or null when it was not set.

public string? ProviderIconUrl { get; }

ProviderName​

Gets the name of the video provider, such as YouTube.

The value, or null when it was not set.

public string? ProviderName { get; }

TitleUrl​

Gets the HTTPS URL opened when the title is clicked.

The value, or null when it was not set.

public string? TitleUrl { get; }