> For the complete documentation index, see [llms.txt](https://docs.lingoblocks.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lingoblocks.com/docs/api/endpoints.md).

# Endpoints

Always remember to handle and display any error messages to users gracefully, and use the `accessToken` for authenticating subsequent requests to the Chatbot API after the initial authentication.

The **base url** is `https://api.lingoblocks.com`.

### **Authenticate Chatbot User**

Authenticate and obtain an access token to communicate with the chatbot.

* **Endpoint**: `/v1/chatbot/:id/authenticate`
* **Method**: POST
* **Request Body**:
  * `accessToken`: The existing access token for the session (optional).
* **Params**:
  * `id`: Your chatbot's unique ID.
* **Response**:
  * `accessToken`: The generated or verified access token for the session.
  * Note: If an existing `accessToken` is not provided or is invalid, a new `accessToken` will be generated.

### **Send a Message to Chatbot**

Send a message to the chatbot and receive its response.

* **Endpoint**: `/v1/chatbot/:id/message`
* **Method**: POST
* **Headers**:
  * `Content-Type`: application/json
* **Params**:
  * `id`: Your chatbot's unique ID.
* **Request Body**:
  * `text`: The message you want to send to the chatbot.
  * `accessToken`: The access token obtained after authentication.
* **Response**:
  * `response`: The chatbot's reply.
  * `metadata`: Additional data about the chatbot's response.

### **Get Chatbot Widget Settings**

Retrieve the settings for displaying the chatbot widget.

* **Endpoint**: `/v1/chatbot/widget/:id/settings`
* **Method**: GET
* **Headers**:
  * `Content-Type`: application/json
* **Params**:
  * `id`: Your chatbot's unique ID.
* **Query Parameters**:
  * `accessToken`: The access token obtained after authentication.
* **Response**:
  * `settings`: Object containing settings like `name` and `profilePhoto` for the chatbot widget.


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.lingoblocks.com/docs/api/endpoints.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
