.do
Integration

webhooks

Webhook management for receiving and sending HTTP callbacks

webhooks

Create, manage, and process webhooks for integrating with external services and notifying partners of events.

Overview

The webhooks primitive enables you to send HTTP callbacks to external services when events occur, and receive webhooks from third-party platforms with automatic verification and retry logic.

SDK Object Mapping

This primitive maps to the on and send SDK objects - two of the 8 core platform objects:

import { on, send, webhooks } from 'sdk.do'

// Send webhook via send
await send('webhook.deliver', {
  url: 'https://partner.com/webhooks',
  event: 'order.created',
  data: { order: { id: '123', total: 99.99 } },
})

// Listen for webhook events via on
on('webhook.received', async ({ source, event, data }) => {
  console.log(`Received ${event} from ${source}`)
  await processWebhook(data)
})

// Register webhook endpoint
await webhooks.register({
  url: 'https://partner.com/webhooks',
  events: ['order.created', 'order.updated'],
  secret: generateSecret(),
})

Subdomain Architecture

The webhooks primitive uses infinite free subdomains for webhook sources and types:

webhooks.do                        # Root - Webhook management
├── stripe.webhooks.do             # Stripe webhooks
├── github.webhooks.do             # GitHub webhooks
├── shopify.webhooks.do            # Shopify webhooks
└── {customer}.webhooks.do         # Customer webhook endpoints

Child Primitives

  • events - Internal event system with on and send
  • triggers - Event-based workflow triggers
  • actions - Action execution from events

Quick Example

import { webhooks } from 'sdk.do'

// Register webhook endpoint
await webhooks.register({
  url: 'https://partner.com/webhooks',
  events: ['order.created', 'order.updated'],
  secret: generateSecret(),
})

// Send webhook
await webhooks.send({
  url: 'https://partner.com/webhooks',
  event: 'order.created',
  data: { order: { id: '123', total: 99.99 } },
})

Core Capabilities

  • Outgoing Webhooks - Send HTTP callbacks to external services
  • Incoming Webhooks - Receive and verify webhooks from partners
  • Automatic Retries - Exponential backoff for failed deliveries
  • Signature Verification - HMAC-SHA256 security for webhook authenticity
  • Event Filtering - Subscribe to specific event patterns

Access Methods

SDK

TypeScript/JavaScript library for webhook management

await webhooks.send({ url: 'https://partner.com/webhooks', event: 'order.created', data: { order } })

SDK Documentation

CLI

Command-line tool for webhook operations

do webhook send https://partner.com/webhooks --event order.created --data '{"order":{"id":"123"}}'

CLI Documentation

API

REST/RPC endpoints for webhook management

curl -X POST https://api.do/v1/webhooks/send -d '{"url":"https://partner.com/webhooks","event":"order.created"}'

API Documentation

MCP

Model Context Protocol for AI-driven webhook operations

Send a webhook to https://partner.com/webhooks for order.created event with order ID 123

MCP Documentation

Child Primitives

  • events - Internal event system with on and send
  • triggers - Event-based workflow triggers
  • actions - Action execution from events
  • on - Event handlers (SDK object mapping)
  • send - Event emission (SDK object mapping)
  • oauth - Webhook authentication
  • rpc - Service-to-service communication