Skip to main content

Discord API

Use this page for Discord-only public V2 endpoints.

Authentication

All Discord V2 public endpoints require:

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

Base path:

/v2

Rate limit:

  • 180 requests / 60 seconds

Discord Routes

MethodPathPurpose
POST/v2/discord/sendSend a message to the bound Discord channel
POST/v2/discord/replyReply to a previously sent Discord message
POST/v2/discord/start-threadStart a Discord thread from a bound channel
POST/v2/discord/send-thread-messageSend a message into an existing Discord thread

Send A Discord Message

POST /v2/discord/send

Required Fields

  • channelRef
  • message

Request Example

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

Latest Success Response

{
"statusCode": 200,
"message": "Message sent successfully",
"data": {
"messageId": "discord-message-1",
"threadId": "discord-message-1",
"channelId": "discord-channel-1",
"channelRef": "C_ALT_ABC123",
"balance": 90
}
}

Field meanings:

  • messageId: Discord message ID of the sent message
  • threadId: same as messageId, used as reply target
  • channelId: Discord channel ID where the message was posted
  • channelRef: internal Alerta Discord binding reference
  • balance: remaining wallet balance

Reply To A Discord Message

POST /v2/discord/reply

Required Fields

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

Success Response

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

Start A Discord Thread

POST /v2/discord/start-thread

Required Fields

  • channelRef
  • title
  • message
curl --request POST \
--url https://api.usealerta.com/v2/discord/start-thread \
--header "content-type: application/json" \
--header "x-api-key: YOUR_API_KEY" \
--header "x-api-secret: YOUR_API_SECRET" \
--data '{
"channelRef": "C_ALT_ABC123",
"title": "Incident #1192",
"message": "Starting investigation thread."
}'

Success Response

{
"statusCode": 200,
"message": "Thread started successfully",
"data": {
"rootChannelId": "1119355453625880591",
"baseMessageId": "1492962136463249598",
"threadChannelId": "1492963000000000000",
"threadName": "Incident #1192",
"balance": 80
}
}

Send A Message To A Discord Thread

POST /v2/discord/send-thread-message

Required Fields

  • channelRef
  • threadChannelId
  • message
curl --request POST \
--url https://api.usealerta.com/v2/discord/send-thread-message \
--header "content-type: application/json" \
--header "x-api-key: YOUR_API_KEY" \
--header "x-api-secret: YOUR_API_SECRET" \
--data '{
"channelRef": "C_ALT_ABC123",
"threadChannelId": "1492963000000000000",
"message": "Investigating replica lag now."
}'

Success Response

{
"statusCode": 200,
"message": "Message sent to thread",
"data": {
"threadChannelId": "1492963000000000000",
"balance": 70
}
}

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"
}
{
"statusCode": 400,
"message": "No Discord channel bound"
}

Discord Notes

  • channelRef is an internal Alerta reference such as C_ALT_..., not the raw Discord channel name.
  • channelId and threadId are returned directly by POST /v2/discord/send; you do not need a separate lookup before replying.
  • threadId is the same as the sent Discord messageId for reply targeting.
  • Discord thread APIs are separate from normal replies.