Skip to main content

Slack API

Use this page for Slack-only public V2 endpoints.

Authentication

All Slack V2 public endpoints require:

  • x-api-key
  • x-api-secret
  • Content-Type: application/json

Base path:

/v2

Rate limit:

  • 180 requests / 60 seconds

Slack Routes

MethodPathPurpose
POST/v2/slack/sendSend a new Slack message
POST/v2/slack/replyReply to an existing Slack message

Send A Slack Message

POST /v2/slack/send

Required Fields

  • channel
  • message

Optional Fields

  • replyTo
curl --request POST \
--url https://api.usealerta.com/v2/slack/send \
--header "content-type: application/json" \
--header "x-api-key: YOUR_API_KEY" \
--header "x-api-secret: YOUR_API_SECRET" \
--data '{
"channel": "alerts",
"message": "Database replication lag exceeded threshold.",
"replyTo": false
}'

Sample Response

{
"statusCode": 200,
"message": "Message sent successfully",
"data": {
"replyData": ""
}
}

If replyTo: true, the response may include:

{
"statusCode": 200,
"message": "Message sent successfully",
"data": {
"replyData": {
"channelId": "C123",
"threadId": "1712345678.123456",
"channelRef": "CHANREF-11"
}
}
}

Reply To A Slack Message

POST /v2/slack/reply

Required Fields

  • channelRef
  • channelId
  • threadId
  • message
curl --request POST \
--url https://api.usealerta.com/v2/slack/reply \
--header "content-type: application/json" \
--header "x-api-key: YOUR_API_KEY" \
--header "x-api-secret: YOUR_API_SECRET" \
--data '{
"channelRef": "CHANREF-11",
"channelId": "C123",
"threadId": "1712345678.123456",
"message": "Acknowledged, investigating now."
}'

Sample Response

{
"statusCode": 200,
"message": "Reply sent successfully",
"data": {
"balance": 90
}
}

Common Errors

{
"statusCode": 403,
"message": "Missing API key"
}
{
"statusCode": 403,
"message": "Missing API secret"
}
{
"statusCode": 403,
"message": "Invalid API key"
}
{
"statusCode": 403,
"message": "Invalid API secret"
}
{
"statusCode": 403,
"message": "Organization is inactive"
}
{
"statusCode": 400,
"message": "Invalid Channel reference"
}

Slack Notes

  • Slack send uses the configured Slack channel name.
  • Slack reply uses channelRef, channelId, and threadId.
  • channelRef is an internal Alerta reference, not the Slack channel name or ID.