Skip to content
Latchkey

GitHub Actions slackapi/slack-github-action Fails to Post

slackapi/slack-github-action could not deliver the message. The webhook URL or bot token is missing, the payload does not match the chosen posting technique, or Slack returned a transient error.

What this error means

The Slack step fails with an invalid_payload, no_text, or auth error, or a transient HTTP failure. The notification never reaches the channel.

Actions log
Error: An API error occurred: invalid_payload
# or
Error: Need to provide at least one botToken or webhook to use this action

Common causes

Missing or wrong credential

The action needs either an incoming-webhook URL or a bot token. A missing secret, or supplying the wrong one for the technique you configured, fails authentication.

Payload does not match the technique

The webhook and bot-token techniques expect different payload shapes. A payload built for one rejected by the other yields invalid_payload or no_text.

How to fix it

Supply the credential and a matching payload

.github/workflows/notify.yml
- uses: slackapi/slack-github-action@v2
  with:
    webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
    webhook-type: incoming-webhook
    payload: |
      text: "Build ${{ job.status }} for ${{ github.ref_name }}"

Match payload to technique; retry blips

  1. Use webhook + webhook-type for incoming webhooks, or a bot token for chat.postMessage.
  2. Build the payload in the shape the chosen technique expects.
  3. Re-run when the failure is a transient Slack HTTP error rather than an auth/payload error.

How to prevent it

  • Store the webhook URL or bot token as a secret and reference it consistently.
  • Match the payload shape to the posting technique.
  • Retry transient Slack API errors.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →