Webhooks

Webhooks allow your application to receive real-time notifications when events occur in your EZ Texting account. Instead of polling the API for updates, you register a URL that receives HTTP POST requests when events happen.

How Webhooks Work

  1. Register a webhook URL via the API or your EZ Texting dashboard
  2. When an event occurs (e.g., message delivered, reply received), EZ Texting sends an HTTP POST to your URL
  3. Your server processes the payload and responds with a 200 OK

Managing Webhooks via the API

Use the Webhooks endpoints to create, list, and delete webhooks programmatically.

Webhook Event Types

TypeDescription
inbound_text.receivedFired when an incoming SMS/MMS is received from a contact
keyword.opt_inFired when a contact opts in via a keyword
contact.createdFired when a new contact is created in your account

Payload Examples

When an event fires, EZ Texting POSTs a JSON body to your callback URL. Payload shape varies by event type — your handler can route on the type field.

inbound_text.received

A contact replied to one of your numbers or sent an incoming message.

{
  "type": "inbound_text.received",
  "eventId": "evt_8f2b1c4a",
  "receivedAt": "2026-04-16T14:32:11Z",
  "fromNumber": "15551234567",
  "toNumber": "15559876543",
  "message": "Yes, please confirm my appointment",
  "messageType": "SMS",
  "contact": {
    "phoneNumber": "15551234567",
    "firstName": "Jane",
    "lastName": "Doe"
  }
}

keyword.opt_in

A contact texted one of your registered keywords to opt in.

{
  "type": "keyword.opt_in",
  "eventId": "evt_4d9a2e71",
  "occurredAt": "2026-04-16T14:35:02Z",
  "keyword": "JOIN",
  "phoneNumber": "15551234567",
  "groupIds": ["987654"],
  "contact": {
    "phoneNumber": "15551234567",
    "optOut": false
  }
}

contact.created

A new contact was created — via API, upload, web widget, or keyword opt-in.

{
  "type": "contact.created",
  "eventId": "evt_b71e30f5",
  "createdAt": "2026-04-16T14:38:45Z",
  "source": "API",
  "contact": {
    "phoneNumber": "15551234567",
    "firstName": "Jane",
    "lastName": "Doe",
    "email": "jane@example.com",
    "optOut": false
  }
}

Create a Webhook

POST https://a.eztexting.com/v1/webhooks/subscriptions
Content-Type: application/json

{
  "type": "inbound_text.received",
  "callbackUrl": "https://your-app.com/webhooks/eztexting"
}

List Webhooks

GET https://a.eztexting.com/v1/webhooks/subscriptions

Delete a Webhook

DELETE https://a.eztexting.com/v1/webhooks/subscriptions/{id}

Best Practices

  • Respond quickly — Return a 200 response as fast as possible. Process webhook data asynchronously if needed.
  • Verify payloads— Validate that incoming requests are actually from EZ Texting before processing them.
  • Handle duplicates— Webhooks may be sent more than once. Use idempotent processing to handle duplicate deliveries gracefully.
  • Use HTTPS— Always use an HTTPS URL for your webhook endpoint to ensure data is encrypted in transit.
Tip: For testing webhooks locally during development, you can use tools like ngrok to expose your local server to the internet.