> ## Documentation Index
> Fetch the complete documentation index at: https://www.composer.id/llms.txt
> Use this file to discover all available pages before exploring further.

# Slack

> Developer notes for the Slack upstream connector: Block Kit, chat.postMessage and chat.update, bot scopes, interactivity and transport.

These are developer notes for the Slack upstream connector: how Triage's diagnostic runs as a Slack app, rendered with Block Kit over the Web API. The page documents the platform surface the Intake Gateway's Slack renderer builds on. The gateway itself is described in [Upstream connectors](/connectors/overview).

<Info>
  The Slack connector is on the roadmap. The Slack renderer ships in the reference implementation; the hosted transport is planned. Method and scope names on this page are taken from Slack's official Web API OpenAPI specification, listed under Developer references.
</Info>

## Platform at a glance

<AccordionGroup>
  <Accordion title="App and install" icon="package">
    A Slack app (definable through an app manifest) with a bot user and granular bot scopes, installed to a workspace through OAuth 2.0. Base URL `https://slack.com/api`.
  </Accordion>

  <Accordion title="Scopes" icon="key-round">
    `chat:write` to post and update messages, `im:write` or `conversations:write` to open a DM, and `users:read` to resolve the acting user.
  </Accordion>

  <Accordion title="Post a question" icon="send">
    `chat.postMessage` ("Sends a message to a channel") with a Block Kit `blocks` payload.
  </Accordion>

  <Accordion title="Lock in place" icon="lock">
    `chat.update` ("Updates a message") replaces the question message with a locked version whose interactive elements are gone, mirroring the Teams card update.
  </Accordion>

  <Accordion title="Question rendering" icon="layers">
    Block Kit `section`, `context` and `actions` blocks. `button` elements carry the answer values; text is `plain_text` or `mrkdwn`.
  </Accordion>

  <Accordion title="Interactivity" icon="circle-dot">
    Button clicks deliver a `block_actions` interaction payload identified by `block_id` and `action_id`. The app acknowledges within 3 seconds and may reply through the `response_url`.
  </Accordion>

  <Accordion title="Transport" icon="radio">
    The app receives interactions and events over the Events API (a request URL) or Socket Mode (a WebSocket). The gateway is transport-agnostic.
  </Accordion>

  <Accordion title="Identity" icon="users">
    The acting user is resolved from `user.id` on the interaction payload, enriched through `users.info` where needed.
  </Accordion>
</AccordionGroup>

## How the diagnostic runs in Slack

| Step | What happens on the platform                                                                                                                                              |
| ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 1    | The requester opens the Triage app's DM, or invokes it. Slack delivers events and interactions to the gateway over the Events API or Socket Mode.                         |
| 2    | The gateway resolves the requester's identity from the payload (`user.id`).                                                                                               |
| 3    | The gateway posts the first question with `chat.postMessage`: a Block Kit message with `button` options.                                                                  |
| 4    | On a click, Slack sends a `block_actions` payload. The gateway acknowledges within 3 seconds, calls `chat.update` to lock the message, then posts the next question.      |
| 5    | On the final answer the gateway calls the Triage decision core. The Intent Record is minted and the completion message (channel, confidence, `intent://` chip) is posted. |
| 6    | When composerID publishes downstream, `chat.update` adds a button linking to the created record.                                                                          |

## Developer references

Slack's official developer documentation. Method and scope names on this page are taken from the vendor-published Web API OpenAPI spec (`slackapi/slack-api-specs`).

| Reference              | Vendor documentation                                                                  |
| ---------------------- | ------------------------------------------------------------------------------------- |
| Slack API home         | [api.slack.com](https://api.slack.com/)                                               |
| chat.postMessage       | [api.slack.com: chat.postMessage](https://api.slack.com/methods/chat.postMessage)     |
| chat.update            | [api.slack.com: chat.update](https://api.slack.com/methods/chat.update)               |
| Block Kit              | [api.slack.com: Block Kit](https://api.slack.com/block-kit)                           |
| Handling interactivity | [api.slack.com: Handling interactivity](https://api.slack.com/interactivity/handling) |
| Events API             | [api.slack.com: Events API](https://api.slack.com/apis/events-api)                    |
| Socket Mode            | [api.slack.com: Socket Mode](https://api.slack.com/apis/socket-mode)                  |
| OAuth scopes           | [api.slack.com: Scopes](https://api.slack.com/scopes)                                 |
| Web API OpenAPI spec   | [github.com: slackapi/slack-api-specs](https://github.com/slackapi/slack-api-specs)   |

<Note>
  The Slack renderer and its contract tests live in `upstream/slack_blocks.py`: the same gateway core as Teams, a different renderer. [Upstream connectors](/connectors/overview) explains how to run the reference implementation.
</Note>

## Next steps

<Columns cols={2}>
  <Card title="Upstream connectors" icon="messages-square" href="/connectors/overview">
    The Intake Gateway, the card lifecycle and the hand-off to composerID.
  </Card>

  <Card title="Coverage and status" icon="table" href="/destinations/index">
    Every surface and destination with its registry status.
  </Card>
</Columns>
