Atonom
DocumentationAPI Reference
Integrations

Custom External Chat

Connect your own messaging channel, such as SMS or email, to a Cloud Employee. You send each incoming message to Atonom and deliver the reply yourself.

Custom External Chat is for when you already send and receive messages (SMS, email, or your own chat) and you want a Cloud Employee to write the replies. You pass each incoming message to Atonom. Atonom returns the reply. You send that reply to the person.

Slack, Google Chat, and Microsoft Teams each have their own guide. Use this page when the messages live in a system you run.

Set up the channel

  1. In the Atonom app, open the Cloud Employee you want to use. The address in your browser ends with that Cloud Employee's id. It looks like AUIAE-DUXA. You will paste that id into the API call below.
  2. Open the Channels tab, then External Chat.
  3. If you see Enable the External Chat Channel, click it.
  4. On the Platform Settings card, click Edit. Set Platform to Custom.
  5. Set Identifier type:
    • Phone — each API call sends the person's phone number.
    • Email — each API call sends the person's email address.
  6. Webhook URL is where Atonom sends messages that start on its side, such as a Job Flow or an inactivity message. Have Atonom call your server explains how that works.
  7. Save, then turn Active on.

What to put in identifier

  • Phone: include the country code, for example +14155550001. Atonom accepts common phone formats and stores the number in that form.
  • Email: [email protected] and [email protected] are the same address. Atonom stores it in lowercase.
  • Atonom keeps one conversation for each phone number or email address on this Cloud Employee. To start a fresh conversation for the same person, set start_new_conversation to true on that request.

Send a message

When someone messages you, send what they wrote to Atonom. Replace AUIAE-DUXA with the id from the Cloud Employee address, and YOUR_API_KEY with your API key. Creating a key is covered on Generate a custom external chat message.

POST https://api.atonom.ai/beta/cloud-employees/AUIAE-DUXA/channels/external-chat:generate-response
X-Api-Key: YOUR_API_KEY
Content-Type: application/json
{
  "identifier": "+14155550001",
  "message": "What are your hours?",
  "external_message_id": "sms-inbound-9f3c2a"
}
  • identifier is the person's phone number or email address. It has to match the Identifier type you saved.
  • message is what they wrote. It can be up to 1000 characters.
  • external_message_id is an id you choose for this message, such as the id from your SMS provider. If the request fails and you send it again, use the same id. Atonom returns the reply it already wrote, so the person does not get two messages.

Atonom responds with the reply:

{
  "message_id": "AMIAG-DUXA",
  "conversation_id": "AMIAE-FWJA",
  "reply": {
    "text": "We're open Monday through Friday, 9am to 5pm Pacific."
  }
}

Send reply.text to the person on your channel. If reply is null, the Cloud Employee had nothing to say, so do not send them a message.

To have the Cloud Employee write first, send prompt instead of message. Send one of those fields, not both. The reply still comes back in reply.text.

{
  "identifier": "+14155550001",
  "prompt": "Let them know their appointment is tomorrow at 9am.",
  "external_message_id": "reminder-42"
}

Atonom keeps the conversation in the app, including any tools the Cloud Employee used. You only need reply.text to send.

Have Atonom call your server

Save a Webhook URL so Atonom has a place to send messages that start on its side. A Job Flow sends messages here. So do inactivity messages: a warning, then a closing message, when a conversation goes quiet. You take text from that request and send it to the person. Without this URL, those messages are not delivered.

You can also use this URL for a reply from Send a message. Set deliver_via to webhook on that call, and Atonom posts the reply here instead of returning it in the response.

On the Platform Settings card, click Edit and paste your URL into Webhook URL. The URL has to be public https:// that Atonom can reach on the internet. Leave any username and password out of it. https://user:pass@host/... is rejected. Addresses on your computer or a private network are rejected, including 10.x, 127.0.0.1, and 169.254.169.254.

Atonom sends a POST to that URL with Content-Type: application/json. Send the text field to the phone number or email in recipient.value.

{
  "event": "message.outbound",
  "message_id": "AMIAG-DUXA",
  "conversation_id": "AMIAE-FWJA",
  "cloud_employee_id": "AUIAE-DUXA",
  "recipient": {
    "type": "phone",
    "value": "+14155550001"
  },
  "text": "Your appointment is tomorrow at 9am.",
  "reason": "proactive",
  "in_reply_to": "reminder-42",
  "created_at": "2026-03-26T18:04:05Z"
}
FieldDescription
eventmessage.outbound
message_idMessage id, the same form returned by the generate API
conversation_idConversation id, the same form returned by the generate API
cloud_employee_idCloud Employee id, the same form used in API URLs
textThe reply to send to the person
reasonproactive when Atonom starts the message, such as a Job Flow. timeout for an inactivity warning or closing message. reply when this is the answer to a generate call that set deliver_via to webhook
recipient.typephone or email, from Identifier type
recipient.valuePhone number or email address to deliver to
in_reply_toThe external_message_id from your call, when you sent one
created_atWhen Atonom created the message

Every delivery includes a signed JWT in the X-Atonom-Signature header. Verify it with your webhook public key before you trust the JSON. The JWT's aud claim is the Webhook URL you saved on the channel. The sig claim signs the raw body. Full steps and code samples are in Webhook Authorization.

Answer Atonom like this:

  • Return a success status (200 through 299) after you have accepted the body. You can send the message to the person after you respond.
  • Return 401 when signature verification fails.
  • 408, 429, and 500 through 599 are retried.
  • Any other 400 through 499 is final. Atonom saves the failure on the conversation.

Atonom waits 30 seconds for your response. If you redirect, the final URL must still be public https://.

For a generate call delivered this way, set deliver_via to webhook. Atonom answers with HTTP 202. That means the message was accepted. The reply text is not in that response. reply is null, and the text arrives on the webhook above.

{
  "identifier": "+14155550001",
  "message": "What are your hours?",
  "external_message_id": "sms-inbound-9f3c2a",
  "deliver_via": "webhook"
}
{
  "message_id": "AMIAG-DUXA",
  "conversation_id": "AMIAE-FWJA",
  "reply": null
}

If you are sending SMS

Skip this section if you are not sending text messages.

Message guidelines limit what the Cloud Employee is allowed to say. They do not take the place of the person's permission, or of your registration with the phone carrier.

  1. Open Message Guidelines.
  2. Create a guideline:
    • Instructions — tone, required disclosures, and topics to avoid
    • Content description — what the Cloud Employee may help with
    • Sample message 1 and Sample message 2 — examples of approved texts, including how often you text, "message and data rates may apply", and STOP/HELP language
    • Content checks — Maximum length (characters), Plain text only (no markdown), Links are not allowed, Phone numbers are not allowed
    • Check the draft after generation — Atonom checks the reply and can rewrite it once. If it still breaks the guideline, Atonom returns a short fallback or the error reply violates message guidelines.
  3. Go back to the Cloud Employee's External Chat channel. In the Message Guidelines card, select the guideline. A guideline on the Cloud Employee profile applies on every channel. A guideline on External Chat applies only to this channel.

Type in the rules your compliance team already uses. Atonom does not copy them from your SMS provider's 10DLC campaign form.

When you send the reply as a text through your own provider:

  • The person needs to have agreed to receive these texts before the first one. Keep a record of that agreement.
  • Honor STOP, HELP, and any other keywords your program uses.
  • Stay inside the use case and content of your registered A2P / 10DLC campaign.
  • You confirm that agreement yourself. A phone number saved on an Atonom contact is not that record.
  • The guideline checks the wording. It is not the agreement.

If a request fails

  • Active is off. Turn Active on for External Chat.
  • The identifier does not match Identifier type. A phone channel needs a phone number, such as +14155550001. An email channel needs an email address.
  • Webhook URL is empty. Job Flow messages and inactivity messages are not delivered. A generate call with deliver_via set to webhook fails too.

Other ways to reach people

PathUse when
Custom External Chat (this page)You run SMS, email, or your own chat, and you need the Cloud Employee's reply text
Built-in SMS channelAtonom should write the message and send the SMS. Consent checks apply on that channel
Slack, Microsoft Teams, or Google ChatYou want that product's connection

For questions, contact [email protected].

On this page