Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Slack

Schemesslack://
Cargo featureservice-slack
Servicehttps://slack.com/
Body formatsmarkdown, text (first is the default)
Attachmentsyes
Title length250 characters
Body length35,000 characters
Body linesunlimited
Request throttle1200 ms between requests
Vendor URLs acceptedyes

URL formats

{schema}://{token_a}/{token_b}/{token_c}
{schema}://{botname}@{token_a}/{token_b}/{token_c}
{schema}://{token_a}/{token_b}/{token_c}/{targets}
{schema}://{botname}@{token_a}/{token_b}/{token_c}/{targets}
{schema}://{access_token}/
{schema}://{access_token}/{targets}

{schema} is one of slack://.

URL tokens

TokenMeaningTypeRequiredDefaultNotes
{access_token}OAuth Access Tokenstringyessecret; must match ^(?:xoxe\.)?xox[abp]-[A-Z0-9-]+$
{botname}Bot Namestringno
{target_channels}Target Channelstringnoprefix #
{target_email}Target Emailemailno
{target_encoded_id}Target Encoded IDstringnoprefix +
{target_user}Target Userstringnoprefix @
{targets}Targetslistnoany of target_channels, target_email, target_encoded_id, target_user; separated by /
{token_a}Token Astringyessecret; must match ^[A-Z0-9]+$
{token_b}Token Bstringyessecret; must match ^[A-Z0-9]+$
{token_c}Token Cstringyessecret; must match ^[A-Za-z0-9]+$
{workflow_path}Workflow Pathstringnosecret

Query parameters

ParameterMeaningTypeDefaultNotes
blocksUse Blocksboolno
footerInclude Footerboolyes
imageInclude Imageboolyes
modeMessage Modechoiceone of hook, gov-hook, bot, workflow, trigger
templateTemplate Pathstringsecret
timestampInclude Timestampboolyes
toTargetslistsets {targets}
tokenOAuth Access Tokenstringsets {access_token}, {token_a}, {token_b}, {token_c}

Prefixed parameters:

  • :name=value: Template Tokens

The common URL parameters (format, overflow, verify, redirect, cto, rto, retry, wait, store, tag, tz, user, password, port, optional, emojis) apply as well.

Examples

Accepted URLs (tokens are fake):

slack://xoxb-1234-1234-abc124
slack://xoxb-1234-1234-abc124/#a/#b
slack://xoxb-1234-1234-abc124/#nuxref
slack://T1JJ3T3L2/A1BRTD4JD/TIiajkdnlazkcOXrIdevi7FQ/
slack://username@T1JJ3T3L2/A1BRTD4JD/TIiajkdnlazkcOXrIdevi7FQ
slack://T1JJ3T3L2/A1BRTD4JD/TIiajkdnlazkcOXrIdevi7FQ/+id/@id/plain
slack://T1JJ3T3L2/A1BRTD4JD/TIiajkdnlazkcOXrIdevi7FQ/#hmm/#-invalid-
https://hooks.slack.com/workflows/T1JJ3T3L2/Ft07XXXX/XXXXXXXX/YYYYYYYY

Rejected URLs:

slack://
slack://:@/
slack://T1JJ3T3L2
slack://T1JJ3T3L2/A1BRTD4JD/

Send one from the command line:

mercurio -t 'Backup' -b 'Finished in 42s' 'slack://xoxb-1234-1234-abc124'

Notes

Slack (slack://): messages through incoming webhooks (hook, gov-hook), bot tokens (bot, with e-mail lookups and the external file-upload flow) and workflow webhooks (workflow, trigger).

E-mail lookups are cached for the lifetime of the parsed URL. On ?retry=, channels that accepted the message are skipped and their remembered channel ids still receive the attachments that have not been delivered yet.

Differences with Apprise