Ping

curl Integration

The simplest way to send notifications from any system with curl installed.


Basic Notification

Terminal
curl -X POST 'YOUR_WEBHOOK_URL' \
  -H 'Content-Type: application/json' \
  -d '{"title": "Task Complete"}'

Preview

Task Complete

just now

With Body

Terminal
curl -X POST 'YOUR_WEBHOOK_URL' \
  -H 'Content-Type: application/json' \
  -d '{"title": "Deploy Complete", "body": "v2.1.0 deployed to production"}'

Preview

Deploy Complete

just now
v2.1.0 deployed to production

High Priority Alert

Terminal
curl -X POST 'YOUR_WEBHOOK_URL' \
  -H 'Content-Type: application/json' \
  -d '{"title": "Server Alert", "body": "CPU usage above 90%", "priority": "high"}'

Preview

Server Alert

just now
CPU usage above 90%

With URL Action

Terminal
curl -X POST 'YOUR_WEBHOOK_URL' \
  -H 'Content-Type: application/json' \
  -d '{
    "title": "Build Complete",
    "body": "All tests passed",
    "actions": [
      {"type": "url", "label": "View Build", "value": "https://github.com/org/repo/actions/runs/123"}
    ]
  }'

Preview

Build Complete

just now
All tests passed

Handling Special Characters

If your message contains special characters, use printf:

Terminal
printf '{"title":"Alert","body":"Something happened: check logs"}' | \
  curl -s -X POST 'YOUR_WEBHOOK_URL' \
  -H 'Content-Type: application/json' -d @-

Using Environment Variables

For security, never hardcode your webhook URL:

Terminal
# Set in your environment
export PING_URL="https://ping-api-production.up.railway.app/v1/send/YOUR_TOKEN"

# Use in scripts
curl -X POST "$PING_URL" \
  -H 'Content-Type: application/json' \
  -d '{"title": "Alert"}'

Preview

Alert

just now

Checking the Response

Always verify the response in scripts:

Terminal
RESPONSE=$(curl -s -X POST "$PING_URL" \
  -H 'Content-Type: application/json' \
  -d '{"title": "Alert"}')

if echo "$RESPONSE" | jq -e '.ok' > /dev/null 2>&1; then
  echo "Notification sent successfully"
else
  echo "Failed to send notification: $RESPONSE"
fi

Preview

Alert

just now