Prompt
send event to external system webhook
Latest observation
Oct 14, 2026
OpenAI APIWeb search: off
Sure — sending an event to an external system via webhook usually means making an HTTP request from your app to a URL exposed by that system.
Here’s a basic example in JavaScript (Node.js):
const axios = require('axios');
async function sendWebhookEvent() {
try {
const payload = {
event: 'user.created',
data: {
id: '123',
email: 'user@example.com',
},
timestamp: new Date().toISOString(),
};
const response = await axios.post('https://external-system.com/webhook', payload, {
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_TOKEN', // if required
},
timeout: 5000,
});
console.log('Webhook sent:', response.status);
} catch (error) {
console.error('Failed to send webhook:', error.message);
}
}
sendWebhookEvent();
Common things to include
- Webhook URL: the destination endpoint
- Event type: e.g.
user.created,order.paid - Payload data: relevant event details
- Authentication: API key, bearer token, HMAC signature, etc.
- Retry logic: if the external service is temporarily unavailable
Example payload
{
"event": "order.paid",
"data": {
"orderId": "ORD-456",
"amount": 99.99,
"currency": "USD"
},
"timestamp": "2026-10-14T12:00:00Z"
}
If you want, I can also provide:
- a Python version,
- a webhook receiver example,
- or a secure signed webhook implementation.