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

# Send a Slack

> Send a one-way Slack message to a channel or user, or set a `waitTime` to listen for a reply and capture it in the response.

**Prerequisites:** You must either [join the Poku Slack workspace](https://pokulabs.slack.com/join/shared_invite/zt-334pmqhy9-oZN8cMAXLFUdmDCgNZX9rA) or add the Poku bot to your own Slack workspace before using this endpoint.



## OpenAPI

````yaml POST /messages/slack
openapi: 3.1.0
info:
  title: Poku API
  version: 1.0.0
  description: OpenAPI document for the authenticated Poku API routes.
servers:
  - url: https://api.pokulabs.com
security:
  - bearerAuth: []
tags:
  - name: calls
  - name: messages
  - name: forms
  - name: interactions
  - name: numbers
  - name: webhooks
paths:
  /messages/slack:
    post:
      tags:
        - messages
      summary: Send a Slack message
      description: >-
        Send a one-way Slack message to a channel or user, or set a `waitTime`
        to listen for a reply and capture it in the response.


        **Prerequisites:** You must either [join the Poku Slack
        workspace](https://pokulabs.slack.com/join/shared_invite/zt-334pmqhy9-oZN8cMAXLFUdmDCgNZX9rA)
        or add the Poku bot to your own Slack workspace before using this
        endpoint.
      operationId: sendSlackMessage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SlackMessage'
      responses:
        '200':
          description: Message sent successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SmsMessageResponse'
              examples:
                noWaitTime:
                  summary: No waitTime set
                  value:
                    interactionId: 092f9eb4-3694-4718-9084-5c786afa87ec
                replyReceived:
                  summary: Reply received within waitTime
                  value:
                    response: 'Human response: Hello there!'
                noReply:
                  summary: No reply received
                  value:
                    response: Human did not respond, please continue where you left off.
components:
  schemas:
    SlackMessage:
      type: object
      required:
        - message
        - to
      properties:
        message:
          type: string
          description: The content of the Slack message.
        to:
          type: string
          description: >-
            The Slack user, member, or channel ID to send the message to.


            - **User/Member ID:** Open the Slack user's profile, click the
            three-dot menu (⋮), and select "Copy Member ID."

            - **Channel ID:** Right-click the channel, select "View channel
            details," and copy the channel ID at the bottom of the page.
        from:
          type: string
          description: >-
            If left blank, the message is sent from the Poku Slack workspace —
            you must [join it
            first](https://pokulabs.slack.com/join/shared_invite/zt-334pmqhy9-oZN8cMAXLFUdmDCgNZX9rA).


            Your Slack workspace ID. When provided, Pokubot sends the message
            from within your own workspace. [How to find your workspace
            ID](https://slack.com/help/articles/221769328-Locate-your-Slack-URL-or-ID#find-your-workspace-or-org-id)
        waitTime:
          type: number
          minimum: 1
          maximum: 600
          description: >-
            When undefined or not supplied, no reply is captured.


            When supplied, this is the number of seconds the API request is held
            open waiting for a reply. The recipient MUST reply directly to the
            Slack thread and the reply will be captured in the HTTP response.
          example: 60
        followUpTime:
          type: number
          minimum: 1
          maximum: 60000
          description: >-
            Duration in seconds to keep listening for a reply after the
            `waitTime` window closes.


            When a reply arrives within this window, Poku sends it to any
            webhooks you've configured.
          example: 6000
      additionalProperties: false
    SmsMessageResponse:
      type: object
      properties:
        interactionId:
          type: string
          description: >-
            Returned when no waitTime is set. Unique identifier for this
            interaction.
        response:
          type: string
          description: >-
            Returned when waitTime is set. Contains the recipient reply, or a
            timeout message if no reply was received.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Authentication header containing your Poku API key. Find it in the [Poku
        dashboard](https://dashboard.pokulabs.com/). The format is "Bearer
        YOUR_API_KEY"

````