Skip to content

Slack

import { Aside } from ‘@astrojs/starlight/components’;

Send an artifact to Slack — a message, a rendered snapshot, or a PDF — on demand, on a schedule, or on an event.

Slack is a workspace-level connection: connect a Slack OAuth app once per workspace (a bot token, stored encrypted), and any artifact in that workspace can deliver to Slack. A workspace can hold several named connections (e.g. team, alerts).

1. GET /v1/workspaces/{id}/connections/slack/install?connection=team&returnUrl=…
2. Open the returned URL and authorize the Slack app.
3. Slack redirects to /v1/oauth/slack/callback; the bot token is stored.
4. List channels: GET /v1/workspaces/{id}/connections/team/slack/channels

Bot scopes include chat:write, files:write, and im:write (DMs). If DM delivery fails with missing_scope on an older connection, reconnect Slack.

POST /v1/artifacts/{id}/share/slack:

{ "connection": "team", "targetType": "channel", "channelId": "C0123456789", "mode": "snapshot", "message": "Latest numbers" }

DM a user instead:

{ "connection": "team", "targetType": "dm", "slackUserId": "U0123456789", "mode": "pdf" }
  • mode: message (text + link button), snapshot (PNG), pdf, or both.
  • Channel posts need owner/editor; any viewer may DM themselves.

Use a job with action: "slack":

{
"artifact_id": "art_abc123",
"action": "slack",
"schedule": "0 9 * * 1",
"config": { "connection": "team", "channelId": "C0123456789", "mode": "snapshot" }
}