• EN
  • Send your first message

    Create a bot token and send a message to a Pulse channel from your terminal.

    1. Create a bot token

    With permission to manage workspace integrations, open Workspace settings → Integrations → Bots. Create Deploy Bot, enable chat:write, and choose an expiry. Store the xoxb- token when it appears.

    Open an unencrypted channel that allows posting. Choose Add people and bots and add the bot account. In the example, use the channel name without #.

    2. Send a message

    Load your bot token into PULSE_BOT_TOKEN from your secret store. Replace general with your channel. Set PULSE_ORIGIN to the public application origin of a self-hosted server.

    Send a message
    curl --fail-with-body -i "${PULSE_ORIGIN:-https://app.pulsechat.ru}/api/v1/bots/messages" \
      -H "Authorization: Bearer $PULSE_BOT_TOKEN" \
      -H 'Content-Type: application/json' \
      -H 'Idempotency-Key: quickstart-message-001' \
      --data '{"channel":"general","text":"Hello from Deploy Bot"}'

    3. Check the response

    A successful request returns 201 Created and a message object. Its id is the message UUID and content contains the text. Open the channel to see the message under your bot's name. Keep the same idempotency key and payload when retrying this send. Use a new key for each new message.

    To discover channel names with channels:read, use list channels.

    Send from JavaScript

    This example runs on a server with fetch available. Store the token in the server environment.

    const origin = process.env.PULSE_ORIGIN ?? 'https://app.pulsechat.ru'
    const response = await fetch(`${origin}/api/v1/bots/messages`, {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.PULSE_BOT_TOKEN}`,
        'Content-Type': 'application/json',
        'Idempotency-Key': 'deploy-build-1042',
      },
      body: JSON.stringify({ channel: 'general', text: 'Build 1042 deployed' }),
    })
    const result = await response.json()
    if (!response.ok) throw new Error(`${response.status} ${result.error}`)
    console.log(result.id)

    If the request fails

    StatusCheck
    401The token is correct, active, and unexpired
    403Required scopes, bot membership, a writable channel, and its encryption mode
    404The channel name exists in the token's workspace
    409The channel name is unique and the idempotency key matches the original payload
    429Wait for the number of seconds in Retry-After

    Continue with bot credentials and scopes, message endpoints, and safe retries. For a single-channel notification URL, see incoming webhooks.