Automations
This guide covers building automated messaging flows with the API. This is separate from the EZ Texting Workflows product, which provides a visual builder for automations without code.
With the API, you combine building blocks: inbound messages (any text someone sends to your number), keywords (specific words that trigger opt-ins or actions), webhooks (event listeners), contacts and groups (audience management), and messages with sendAt (scheduled delivery). Inbound messages are the most common trigger — a customer texts you, your webhook fires, and your app responds. Keywords are a specific case of that where a particular word drives the logic.
| Building block | What it does | Key endpoints |
|---|---|---|
| Inbound Messages | Any text a contact sends to your number — the most common workflow trigger | Received via webhooks (inbound_text.received) |
| Keywords | Specific words that trigger opt-ins or actions when texted to your number | /v1/keywords/{keyword}/* |
| Webhooks | Push real-time event notifications to your server | /v1/webhooks/subscriptions |
| Contacts & Groups | Store contact data, organize audiences | /v1/contacts, /v1/contact-groups |
| Scheduled Messages | Send messages at a future time | POST /v1/messages with sendAt |
Keywords
Keywords are words that contacts text to your number to trigger an action — typically opting into a contact group. They're the entry point for most automation flows. Keywords use the keyword string in the path (not an ID).
# Check if a keyword is available
curl --request GET \
--url "https://a.eztexting.com/v1/keywords/JOIN/check" \
--header "Authorization: Basic $(echo -n 'your_username:your_password' | base64)"
# Acquire the keyword (requires credit card on file)
curl --request POST \
--url https://a.eztexting.com/v1/keywords/JOIN/acquire \
--header "Authorization: Basic $(echo -n 'your_username:your_password' | base64)" \
--header "Content-Type: application/json" \
--data '{"creditCardLastFour": "4242"}'
# Configure the keyword — set auto-reply and group assignment
curl --request PUT \
--url https://a.eztexting.com/v1/keywords/JOIN \
--header "Authorization: Basic $(echo -n 'your_username:your_password' | base64)" \
--header "Content-Type: application/json" \
--data '{
"autoReply": "Welcome! You are now subscribed to Acme Co updates. Reply STOP to unsubscribe.",
"contactGroupId": "987654"
}'Keyword lifecycle
- Check availability —
GET /v1/keywords/{keyword}/check - Acquire —
POST /v1/keywords/{keyword}/acquire(requirescreditCardLastFour) - Configure —
PUT /v1/keywords/{keyword}to set auto-reply and group assignment - Monitor —
GET /v1/keywordsto list,GET /v1/keywords/{keyword}for details - Release —
DELETE /v1/keywords/{keyword}/releasewhen no longer needed
Webhooks
Webhooks push real-time notifications to your server when events occur. Instead of polling the API, your server receives an HTTP POST request the moment something happens. Create subscriptions with callbackUrl (required), type (required), and optionally a secret for signature verification.
# Create a webhook subscription for inbound messages
curl --request POST \
--url https://a.eztexting.com/v1/webhooks/subscriptions \
--header "Authorization: Basic $(echo -n 'your_username:your_password' | base64)" \
--header "Content-Type: application/json" \
--data '{
"callbackUrl": "https://your-server.com/webhooks/eztexting",
"type": "inbound_text.received",
"secret": "your_webhook_secret"
}'
# Create a webhook for keyword opt-ins
curl --request POST \
--url https://a.eztexting.com/v1/webhooks/subscriptions \
--header "Authorization: Basic $(echo -n 'your_username:your_password' | base64)" \
--header "Content-Type: application/json" \
--data '{
"callbackUrl": "https://your-server.com/webhooks/opt-in",
"type": "keyword.opt_in",
"secret": "your_webhook_secret"
}'
# List your active webhook subscriptions
curl --request GET \
--url https://a.eztexting.com/v1/webhooks/subscriptions \
--header "Authorization: Basic $(echo -n 'your_username:your_password' | base64)"Webhook event types
| Event | Trigger | Use for |
|---|---|---|
inbound_text.received | A contact sends a message | Auto-responders, support routing, CRM updates |
keyword.opt_in | A contact texts one of your keywords | Welcome sequences, group assignment, RSVP confirmation |
contact.created | A new contact is created | CRM sync, welcome messages, audience tracking |
Workflow patterns
Pattern 1: Keyword opt-in flow
Contact texts a keyword, gets added to a group, and receives a welcome message.
- Acquire and configure a keyword (one-time setup)
- Create a contact group for subscribers
- Subscribe to the
keyword.opt_inwebhook event - When the webhook fires, your app creates/updates the contact, adds them to the group, and sends a welcome message
- Schedule follow-up messages using
sendAt
Pattern 2: Welcome drip sequence
After opt-in, send a series of messages over time. Your app calculates the sendAt timestamps and creates each scheduled message.
# Immediate welcome message
curl --request POST \
--url https://a.eztexting.com/v1/messages \
--header "Authorization: Basic $(echo -n 'your_username:your_password' | base64)" \
--header "Content-Type: application/json" \
--data '{
"toNumbers": ["15551234567"],
"message": "Welcome to Acme Co! Thanks for subscribing. Here is what to expect: weekly tips and exclusive offers.",
"messageType": "SMS",
"companyName": "Acme Co"
}'
# Day 1: Tips message (scheduled)
curl --request POST \
--url https://a.eztexting.com/v1/messages \
--header "Authorization: Basic $(echo -n 'your_username:your_password' | base64)" \
--header "Content-Type: application/json" \
--data '{
"toNumbers": ["15551234567"],
"message": "Tip #1: Did you know you can customize your notification preferences? Visit https://example.com/prefs",
"messageType": "SMS",
"companyName": "Acme Co",
"sendAt": "2026-04-16T12:00:00Z"
}'
# Day 3: Offer message (scheduled)
curl --request POST \
--url https://a.eztexting.com/v1/messages \
--header "Authorization: Basic $(echo -n 'your_username:your_password' | base64)" \
--header "Content-Type: application/json" \
--data '{
"toNumbers": ["15551234567"],
"message": "As a new subscriber, enjoy 15% off your first order with code WELCOME15. Shop now: https://example.com/shop",
"messageType": "SMS",
"companyName": "Acme Co",
"sendAt": "2026-04-18T12:00:00Z"
}'Pattern 3: Inbound message auto-responder
- Subscribe to
inbound_text.receivedwebhook - Your server receives the message content and sender phone number
- Apply your business logic (check message content, look up contact, consult rules)
- Send a reply via
POST /v1/messages— automatically threaded into the conversation - Update the contact's custom fields or group membership based on the interaction
Pattern 4: Appointment reminders
- Appointment booked in your system (not an EZ Texting event)
- Create or update the contact via
POST /v1/contacts - Schedule reminders: 24 hours before, 1 hour before
- Store message IDs so you can cancel with
DELETE /v1/messagesif the appointment changes
Blocking numbers
Use POST /v1/blocks to prevent outbound messages to specific phone numbers. Pass a phoneNumbers array. This is for manual exclusions beyond standard STOP opt-out handling (which EZ Texting processes automatically).
Endpoints reference
| Endpoint | Method | Description |
|---|---|---|
/v1/keywords | GET | List your keywords |
/v1/keywords/{keyword} | GET | Get keyword details |
/v1/keywords/{keyword}/check | GET | Check availability |
/v1/keywords/{keyword}/acquire | POST | Acquire a keyword |
/v1/keywords/{keyword} | PUT | Update keyword settings |
/v1/keywords/{keyword}/release | DELETE | Release a keyword |
/v1/webhooks/subscriptions | GET / POST | List or create webhook subscriptions |
/v1/webhooks/subscriptions/{id} | GET / DELETE | Get or delete a subscription |
/v1/blocks | POST | Block outbound texts to numbers |
Best practices
- Use webhooks, not polling. Webhooks deliver events in real time with zero wasted requests.
- Make webhook handlers idempotent. Your handler may receive the same event twice due to retries. Check before creating duplicates.
- Respond to webhooks quickly. Return
200immediately and process work asynchronously in a background queue. - Verify webhook signatures. Use the
secretyou set when creating the subscription to verify incoming requests are genuine. - Store message IDs for scheduled sends. You'll need them to cancel remaining messages if a contact opts out.
- Respect quiet hours. Don't schedule messages before 8 AM or after 9 PM in the recipient's time zone.
Next steps
- Transactional Messaging — The message sending endpoints used in automation flows
- Conversational Messaging — Manage two-way threads triggered by inbound messages
- Marketing Campaigns — Send campaigns to the groups your automations build
- Contact Management — Create and organize contacts in your workflows
- Webhooks — Full webhook setup and event documentation
- API Reference — Full interactive endpoint documentation