> For the complete documentation index, see [llms.txt](https://lety.gitbook.io/lety-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lety.gitbook.io/lety-docs/chatbot-api/chatbot-api-send-receive-messages.md).

# Chatbot API - Send/Receive Messages

Using API to Send & Receive Messages w/ AI Chatbot

What is an API?

The API is a way for you to send and receive data from your AI chatbot. When we use the API we are essentially copying and pasting different values from one place to another. The most important thing is making sure you are pasting everything in the right place.

This is the specific URL that is used to send and receive data from your AI chatbot. In order to properly send and receive messages with the AI chatbot via the API you need to have the following fields setup.

URL: <https://YOUT\\_AGENCY\\_DOMAIN/en/chatbot/api/v1/message/>

HEADERS: Authorization | Token ba534d4274523452345da0e99345a67000

BODY (KEY AND VALUE):

\- chatbot\_uuid | this is the value copy/pasted from the chatbot’s dashboard

\- query | this is the message from the user that you want to send to the AI chatbot

\- user\_key | this is the unique contact ID to identify each person’s conversation

After the connection to the chatbot has been made you will be able to send it questions and receive a generated response.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://lety.gitbook.io/lety-docs/chatbot-api/chatbot-api-send-receive-messages.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
