Skip to main content

AI Assistants & Chatbots

AI Assistants & Chatbots: Build Intelligent Conversations with Messaging APIs

LoopMessage allows you to connect AI assistants and chatbots to popular messaging platforms, including iMessage, SMS/RCS, and WhatsApp.

Instead of requiring customers to install another app, visit a website, or use a dedicated chatbot interface, you can let them communicate with your AI assistant directly through their preferred messaging application.

Whether you’re building an AI-powered customer support agent, a sales assistant, a booking chatbot, or a custom conversational AI product, LoopMessage provides the messaging infrastructure you need to exchange messages with users through a single API.

You control the AI model, business logic, conversation context, and integrations. LoopMessage handles messaging between your application and your customers.

Additionally, with features such as Data Retention and S3 Bucket Storage, you can control how long LoopMessage retains message and request history and where incoming attachments are stored.

1. How does it work?

LoopMessage provides a two-way messaging API that allows your AI assistant to receive messages, process them, and send responses.

You don’t need to build a messaging client or manage separate integrations for every supported messaging channel.

A typical conversation works as follows:

  1. Customer sends a message. A user contacts your business through iMessage, SMS/RCS, or WhatsApp.
  2. LoopMessage receives the message. Our system delivers an inbound webhook to your backend containing the message content and relevant metadata.
  3. Your AI assistant processes the message. Your backend forwards the necessary information to your AI model, agent framework, or automation workflow.
  4. Your AI generates a response. The assistant can use conversation context, your knowledge base, and connected business systems to determine the appropriate reply.
  5. Your backend sends the response. Your application makes a request to the LoopMessage Sending Messages API.
  6. The customer receives the reply. LoopMessage delivers the message through the appropriate messaging channel.

The conversation can continue as long as the customer and your assistant keep exchanging messages.

Example conversation

Customer: “Hi! Do you offer international shipping?”

AI Assistant: “Hey! Yes, we ship to several countries. Which country are you ordering from?”

Customer: “Canada. How long does delivery take?”

AI Assistant: “Standard delivery to Canada usually takes 5–8 business days. Would you like me to check the available shipping options for a specific product?”

Your AI assistant can retrieve this information from your database, product catalog, knowledge base, or other services connected to your backend.

LoopMessage acts as the communication layer. The intelligence, conversation logic, and external integrations remain under your control.

2. Integrate your AI assistant through the LoopMessage API

You can connect LoopMessage to virtually any AI system that supports API-based integrations.

This includes custom AI applications, language models, agent frameworks, and workflow automation platforms.

Receive messages through webhooks

LoopMessage sends inbound messages to your backend using webhooks.

When a customer sends a message, your server receives a message_inbound event that can include:

  • Customer contact information.
  • Message text.
  • Message ID.
  • Messaging channel.
  • Attachment URLs, when applicable.
  • Other available metadata.

Your application can use these fields to identify the customer, retrieve relevant conversation context, and forward the message to your AI assistant.

Learn more in the Webhooks/Callbacks API documentation.

Send AI-generated responses through the API

Once your AI assistant generates a response, your backend can send it through the LoopMessage API.

For example:

POST https://a.loopmessage.com/api/v1/message/send/

The request includes the recipient and the response text, along with optional parameters such as the sender, messaging channel, and attachments.

You can also track message delivery using webhooks or the message status API.

Learn more in the Sending Messages API documentation.

Maintain your own conversation context

For multi-turn conversations, your application can maintain conversation context in its own database or AI memory system.

This allows your assistant to remember relevant information from earlier messages, such as:

  • Customer preferences.
  • Previous questions.
  • Order or account details.
  • Unresolved support requests.
  • Current conversation goals.

You decide what information is necessary, how it is processed, and how long it should remain available to your AI assistant.

You can also choose whether to use your own AI infrastructure or a third-party AI provider.

LoopMessage can support many types of conversational AI applications.

AI Customer Support

Provide automated answers to frequently asked questions, troubleshoot common issues, and help customers find relevant information.

Your assistant can use your documentation, Helpdesk articles, or internal knowledge base to answer questions.

For example:

Customer: “How can I change my subscription?”

AI Assistant: “I can help with that! Are you looking to upgrade, downgrade, or cancel your current plan?”

For more complex requests, your backend can escalate the conversation to a human support representative.

AI Sales Assistants

Help potential customers find products or services, answer questions, and guide them through the purchasing process.

Your assistant can retrieve information from a product catalog, CRM, or other backend systems.

For example:

Customer: “I’m looking for a laptop for video editing.”

AI Assistant: “Happy to help! Do you have a preferred budget or screen size?”

The assistant can continue asking relevant questions and provide personalized recommendations.

AI Appointment and Booking Assistants

Allow customers to schedule, reschedule, or inquire about appointments directly from their messaging application.

Your AI assistant can connect to your calendar or booking platform through your own backend.

For example:

Customer: “Can I book an appointment for Friday afternoon?”

AI Assistant: “Let me check availability. I have openings at 2 PM and 4 PM. Which works better for you?”

Your backend can verify availability and confirm the appointment through the appropriate booking integration.

AI Knowledge Base Assistants

Build assistants that answer questions using your own documentation, company policies, product guides, or other information sources.

You can integrate your AI system with a retrieval-augmented generation (RAG) architecture to provide answers based on your organization’s knowledge.

AI Agents with Business Integrations

Your AI assistant can go beyond answering questions.

Depending on the tools and permissions you configure, it can also interact with business systems to:

  • Check order statuses.
  • Retrieve customer account information.
  • Create support tickets.
  • Update CRM records.
  • Look up product availability.
  • Schedule appointments.
  • Trigger approved business workflows.

All business actions are handled through your own AI application and connected systems, while LoopMessage provides the messaging interface.

4. Build more natural conversations with messaging features

Unlike traditional text-only chatbots, your AI assistant can use additional features supported by LoopMessage and the destination messaging channel.

Attachments and multimedia

Customers can share supported attachments, such as images, documents, and other media.

For example, a customer might send a photo of a damaged product and ask for assistance.

Your backend can retrieve the attachment and, if your AI model supports image understanding, analyze it to provide a relevant response.

Your assistant can also send supported attachments, such as product images or instructional documents, through the Sending Messages API.

Voice messages

Your chatbot can receive supported audio messages.

When speech transcription is available, inbound webhook data may include transcribed text that your AI assistant can process.

You can also integrate audio processing into your own AI infrastructure.

Reactions and message interactions

LoopMessage supports features such as message reactions and reply-to references, depending on the messaging channel.

You can use these capabilities to build more natural interactions or help your backend understand which message a user is responding to.

Typing indicators

For supported active conversations, LoopMessage provides an API to display typing indicators.

This can improve the user experience while your AI assistant generates a response.

Keep in mind that availability and behavior depend on the messaging channel and applicable platform limitations.

Learn more in the Sending Messages API documentation.

5. Control data retention for your AI assistant

When building an AI assistant, controlling how conversation data is stored can be especially important.

Depending on your application, messages may contain customer information, support requests, business details, or other sensitive data.

LoopMessage provides a built-in Data Retention feature that allows each organization to configure how long request history is stored in the LoopMessage database.

You can define separate retention periods for:

  • Message history: Previously received and sent messages.
  • Webhooks history: Records of webhook events.
  • API requests history: Historical API request records.

The minimum retention period is 1 day.

For example, you might configure:

Data categoryRetention period
Message history7 days
Webhooks history3 days
API requests history3 days

These are example settings only. You should choose retention periods based on your application’s operational and compliance requirements.

Once the configured retention period expires, the applicable historical records are automatically deleted from LoopMessage’s database.

Why is this useful for AI applications?

If your AI assistant already stores the necessary conversation context in your own infrastructure, you may not need LoopMessage to retain the same message history for an extended period.

Reducing unnecessary historical storage can help support your organization’s privacy and data-handling policies.

LoopMessage stores request history primarily to support debugging, customer access, and troubleshooting.

This history is not made available to the LoopMessage technical team by default. Access to customer message history is provided when the customer requests technical assistance and the relevant data is needed to investigate an issue.

How to configure Data Retention

  1. Open the LoopMessage Dashboard.
  2. Select your organization.
  3. Navigate to Preferences → Data retention.
  4. Click Edit and enable Custom data retention.
  5. Set the required retention periods and save your changes.

Important: We recommend choosing reasonable retention periods. Very short periods can make debugging difficult and affect features that rely on previous message IDs, such as reactions, reply-to threads, and group conversations.

Data Retention controls records stored by LoopMessage. It does not automatically delete conversation history stored in your AI application, model provider, or other third-party systems.

Learn more in our Data Retention documentation.

6. Store attachments in your own S3 Bucket

LoopMessage also supports integration with your own S3-compatible storage.

This is especially useful when building AI assistants that process files, images, documents, or other attachments from customers.

By default, LoopMessage temporarily retains inbound attachments for approximately one hour.

With the S3 Bucket integration, you can configure LoopMessage to automatically upload inbound attachments into storage that you manage.

Supported providers include:

  • Amazon S3.
  • DigitalOcean Spaces.
  • Cloudflare R2.
  • Other S3-compatible storage services.

How does it work?

When a customer sends a message containing an attachment:

  1. LoopMessage receives the incoming attachment.
  2. Our system downloads the file from its original message URL.
  3. The file is uploaded to your configured S3-compatible bucket.
  4. LoopMessage updates the message’s attachment URL to reference the file in your storage.
  5. Your AI backend can retrieve the attachment using the resulting URL and process it as needed.

Why use your own storage?

Choose where files are stored

Select your preferred storage provider, bucket, and region based on your infrastructure and data-location requirements.

Control how long files are retained

Configure storage lifecycle and deletion rules directly with your storage provider.

For example, you can automatically remove attachments after 7 days, 30 days, or another period appropriate for your application.

Manage access permissions

Keep your bucket private and control which systems or users can access stored files.

LoopMessage supports temporary presigned URLs for accessing private attachments.

Integrate with your AI infrastructure

Your AI application can retrieve files from your bucket and process them using your preferred models, document-processing pipelines, or other services.

How to connect your S3 Bucket

  1. Open the LoopMessage Dashboard and select your organization.
  2. Navigate to Integrations → AWS S3 Storage.
  3. Click Connect.
  4. Enter your bucket name, endpoint, region, and access credentials.
  5. Configure your preferred URL access settings.
  6. Save the integration.

For sensitive attachments, we recommend using private buckets and appropriately restricted credentials.

Important: The S3 integration covers inbound attachments. Your backend remains responsible for providing accessible file URLs when sending outbound attachments.

Deleting a message from LoopMessage’s history does not automatically remove its attachment from your S3 bucket. Configure lifecycle or deletion rules with your storage provider.

Learn more in our S3 Bucket documentation.

7. Combine Data Retention and S3 Storage for greater control

One of the key advantages of building an AI assistant with LoopMessage is the ability to separate messaging infrastructure from your own AI processing and data storage.

You can design your architecture so that:

  • LoopMessage handles inbound and outbound messaging while retaining request history only for the configured period.
  • Your own S3 Bucket stores inbound attachments according to your storage policies.
  • Your AI backend processes messages and maintains the conversation context it needs.
  • Your AI provider or self-hosted model generates responses based on the information your application supplies.

For example, your organization might retain debugging history in LoopMessage for 3 days, store incoming attachments in your private S3 bucket for 14 days, and keep selected customer conversation context in your own database according to your internal policies.

This architecture provides flexibility to minimize unnecessary data retention and decide where your application stores and processes information.

Important privacy considerations

Data Retention and S3 Bucket Storage apply to different categories of data and do not provide universal deletion or storage control.

If you use a third-party AI provider, review its data handling, processing, and retention policies separately.

Likewise, telecom carriers, destination messaging services, and recipient devices may process or retain information independently of LoopMessage.

For regulated or sensitive use cases, make sure the entire architecture—including your AI provider, messaging channels, storage, and business integrations—meets the requirements applicable to your organization.

Keep your AI logic in your backend. Use LoopMessage as the messaging layer while maintaining control over prompts, models, tools, and conversation state.

Process inbound webhooks asynchronously. Acknowledge webhook requests promptly and handle AI processing in your own application queue or worker. This avoids webhook timeouts and unnecessary retries.

Handle duplicate events. Use webhook identifiers to prevent repeated processing when a webhook delivery is retried.

Monitor message statuses. A successful API request means the sending request was accepted, not necessarily that the message reached its recipient. Use delivery and failure events to track the outcome.

Respect messaging limits. Replies to recent inbound messages can be sent without additional interval delays, while proactive outbound messages may be subject to sending restrictions.

Provide human assistance when necessary. Allow your application to route complex, sensitive, or unresolved conversations to a human representative. You can also explore Embed Inbox as a messaging interface for your team.

Protect customer data. Restrict access to conversation history, attachments, API credentials, and AI integrations according to your security requirements.

Make users aware of AI involvement. Clearly identify automated assistance when appropriate, and provide a straightforward way to reach a human.

9. Getting started

You can start building your AI assistant with LoopMessage in a few steps:

  1. Create your LoopMessage organization and configure a sender.
  2. Obtain your API credentials.
  3. Configure a webhook endpoint for inbound messages.
  4. Connect your webhook processing to your AI backend or automation workflow.
  5. Use the Sending Messages API to return generated responses.
  6. Configure Data Retention based on your application requirements.
  7. Connect an S3-compatible bucket if your assistant needs to store incoming attachments.
  8. Test multi-turn conversations, attachments, error handling, and delivery statuses before enabling production traffic.

With LoopMessage, you can bring your AI assistant directly into the messaging apps your customers already use—while keeping control over your AI implementation, conversation context, retention settings, and attachment storage.