Prompt
send event to external system webhook
Latest observation
Oct 5, 2026
OpenAI APIWeb search: off
Sure — if you want to send an event to an external system via webhook, the basic flow is:
- Collect the event data you want to send
- Format it as JSON
- POST it to the webhook URL
- Handle success/failure and retries
Example HTTP request
POST https://example.com/webhook
Content-Type: application/json
Authorization: Bearer YOUR_TOKEN
{
"event": "order.created",
"timestamp": "2026-10-05T12:34:56Z",
"data": {
"order_id": "12345",
"amount": 49.99
}
}
Example in JavaScript
await fetch("https://example.com/webhook", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_TOKEN"
},
body: JSON.stringify({
event: "order.created",
timestamp: new Date().toISOString(),
data: {
order_id: "12345",
amount: 49.99
}
})
});
Example in Python
import requests
from datetime import datetime, timezone
payload = {
"event": "order.created",
"timestamp": datetime.now(timezone.utc).isoformat(),
"data": {
"order_id": "12345",
"amount": 49.99
}
}
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_TOKEN"
}
response = requests.post("https://example.com/webhook", json=payload, headers=headers)
response.raise_for_status()
Good practices
- Use a shared secret or signature for authentication
- Include an event id for deduplication
- Make retries idempotent
- Log failures and use a dead-letter queue if needed
If you want, I can also help you with:
- a Node.js/Python/Go implementation
- signature verification
- retry logic
- integrating this into your specific framework or system