Messaging

AI auto-reply automations

Automatically reply to every inbound WhatsApp DM on a number with your AI agent. The automation owns the inbound → agent → send graph; the messages API delivers the reply with the same service-window, opt-out, and billing rules as any other send.

1. Create an AI agent

POST/v1/ai-agents

Create the agent persona the automation will invoke, and keep its id. Agent creation is API/SDK-only today — the dashboard does not yet have an AI agent creation screen.

curl https://api.tyxter.com/v1/ai-agents \
  -H "authorization: Bearer $TYXTER_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "name": "support_bot",
    "system_prompt": "You are a friendly support agent. Answer briefly."
  }'

2. Create, version, and publish the automation

POST/v1/automations
POST/v1/automations/{'{automation_id}'}/versions
POST/v1/automations/{'{automation_id}'}/publish

Create the automation, add a version whose graph is the canonical inbound → ai_agent.invokemessage.send shape, then publish that version. Bind the inbound_message trigger to the WhatsApp number that should auto-reply via its phone_number_id. Published versions are immutable; a run always points at the exact version it executes.

3. The contact messages the number

When a contact sends an inbound WhatsApp text, Tyxter receives it, honors the contact's opt-out state, and creates a single automation run. Runs are deduplicated per inbound message, so provider retries never produce a double reply.

4. The agent replies automatically

The run invokes your AI agent with the contact's message and sends the agent's reply back through the messages API. If the agent yields no usable reply, the builder-configured fallback message is sent instead.

One auto-reply per number

At most one enabled inbound_message automation may be bound to a given phone_number_id per environment. Publishing or enabling a second inbound automation for the same number is rejected with 409 automation_inbound_number_conflict.

Only WhatsApp text inbound triggers an auto-reply in this release. Instagram and non-text inbound are not yet supported.