Whatstask Logo
WHATSTASK
Overview

WhatsTask Direct
Notifications API

Send Telegram notifications from your app with a single API call. No authentication tokens. No webhooks to configure. Just POST and go.

One Endpoint

Single POST request

No Auth Needed

Just your Telegram ID

HTML Support

Rich text formatting

API Endpoint

POST https://pm.whatstask.com/api/notifications/send
Quick Start

Get started in 2 steps

Send your first notification in under a minute.

1

Get your Telegram ID

1Open Telegram
2Start a chat with @whatstask_bot
3Send /start
4Your Telegram ID will be shown (e.g., 7955910963)
2

Send a notification

Make a POST request with your Telegram ID and message.

curl -X POST "https://pm.whatstask.com/api/notifications/send" \
  -H "Content-Type: application/json" \
  -d '{
    "telegramId": "YOUR_TELEGRAM_ID",
    "message": "<b>Hello!</b>\n\nThis is my first notification.",
    "type": "general"
  }'

Done!

You'll receive the notification in Telegram instantly.

API Reference

Endpoint

POST/api/notifications/send

Base URL: https://pm.whatstask.com

Request body

FieldRequiredDescription
telegramIdYesYour Telegram ID (from @whatstask_bot)
messageYesNotification text (supports HTML)
typeNoNotification type (default: general)

Response

Success (200)

{
  "success": true
}

Error (400/500)

{
  "error": "telegramId and message required"
}
Code Examples

In your language

Copy-paste examples for popular languages.

curl -X POST "https://pm.whatstask.com/api/notifications/send" \
  -H "Content-Type: application/json" \
  -d '{
    "telegramId": "YOUR_TELEGRAM_ID",
    "message": "<b>Alert</b>\n\nSomething happened!",
    "type": "general"
  }'
HTML Formatting

Supported tags

Messages support Telegram HTML formatting for rich text.

TagResult
<b>text</b>bold
<i>text</i>italic
<code>text</code>monospace
<pre>text</pre>code block
<a href="url">text</a>link
\nnewline

Example with formatting:

{
  "telegramId": "7955910963",
  "message": "<b>🛒 New Order</b>\n\nOrder #12345\nCustomer: John Doe\nTotal: <b>$99.00</b>\n\n<a href=\"https://example.com\">View Order</a>",
  "type": "general"
}
Use Cases

Example templates

Ready-to-use message templates for common scenarios.

🛒

E-commerce Order

New order notifications

const message = `<b>🛒 New Order</b>

Order #${orderId}
Customer: ${customerName}
Total: <b>$${total}</b>

<a href="https://dashboard.example.com/orders/${orderId}">View Order</a>`
⚠️

Server Monitoring

System alerts

const message = `<b>⚠️ Server Alert</b>

Server: ${serverName}
Issue: ${alertType}
Time: ${timestamp}

CPU: ${cpuUsage}%
Memory: ${memUsage}%`
📬

Form Submission

Contact form alerts

const message = `<b>📬 New Contact</b>

From: ${name}
Email: ${email}

<i>"${messageText.slice(0, 200)}"</i>`
🚀

Deployment Status

CI/CD notifications

const message = `<b>🚀 Deployment ${status}</b>

Project: ${projectName}
Branch: ${branch}
Commit: <code>${commitHash.slice(0, 7)}</code>

${status === 'success' ? '✅ Live now' : '❌ Check logs'}`
Multiple Recipients

Notify your team

Store Telegram IDs and call the endpoint for each recipient.

Environment variable:

WHATSTASK_TELEGRAM_ID=7955910963

Notify multiple team members:

const TEAM_IDS = ['111111111', '222222222', '333333333']

async function notifyTeam(message) {
  await Promise.all(
    TEAM_IDS.map(id =>
      fetch('https://pm.whatstask.com/api/notifications/send', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({ telegramId: id, message, type: 'general' })
      })
    )
  )
}

// Usage
await notifyTeam('<b>Team Alert</b>\n\nNew deployment ready for review')
Error Handling

Response codes

StatusMeaning
200Notification sent successfully
400Missing required fields (telegramId or message)
500Bot not configured or Telegram API error
telegramId and message required

Fix: Ensure both fields are included in your request body.

Bot not configured

Fix: The notification service is not available. Contact support.

Telegram API error

Fix: Check that your Telegram ID is correct and you've started @whatstask_bot.

┌─────────────────────────────────────────────────────────────────────┐
WHATSTASK NOTIFICATIONS QUICK REFERENCE
├─────────────────────────────────────────────────────────────────────┤

ENDPOINT:

POST https://pm.whatstask.com/api/notifications/send

PAYLOAD:

{

"telegramId": "YOUR_ID", // Required

"message": "Your text", // Required (HTML supported)

"type": "general" // Optional

}

SETUP:

1. Message @whatstask_bot on Telegram

2. Send /start to get your Telegram ID

3. Use that ID in your API calls

HTML TAGS:

<b>bold</b> <i>italic</i> <code>mono</code>

<a href="url">link</a> \n for newlines

└─────────────────────────────────────────────────────────────────────┘

Ready to send notifications?

Get your Telegram ID and start sending notifications in under a minute.