# Chatling

> Manage Chatling chatbots, contacts, conversations and knowledge sources, and chat with your knowledge base.

App · 25 actions. Web page: https://docs.lodol.com/docs/integrations/chatling

## Actions

### Add FAQ

Add FAQ.

**Inputs**

- Chatbot (`chatbot_id`, text, required): The chatbot ID.
- Faqs (`faqs`, list, required): Array of FAQs to add to the knowledge base.

**Outputs**

- `response` (object): Response.

**Example output**

```json
{
  "response": {
    "data": {
      "faqs_added": 1
    },
    "status": "example"
  }
}
```

### Add text

Add text.

**Inputs**

- Chatbot (`chatbot_id`, text, required): The chatbot ID.
- Texts (`texts`, list, required): Array of texts to add to the knowledge base.

**Outputs**

- `response` (object): Response.

**Example output**

```json
{
  "response": {
    "data": {
      "texts_added": 1
    },
    "status": "example"
  }
}
```

### AI Credits

AI Credits.

**Inputs**: None.

**Outputs**

- `response` (object): Response.

**Example output**

```json
{
  "response": {
    "data": {
      "max": 1,
      "used": 1
    },
    "status": "example"
  }
}
```

### Chat with Knowledge Base AI

Chat with Knowledge Base AI.

**Inputs**

- Chatbot (`chatbot_id`, text, required): The chatbot ID.
- Message (`message`, text, required): The message to send to the AI.
- AI model (`ai_model_id`, number, required): The ID of the AI model to use for the response. To get a list of available AI models, use the [List AI models](https://docs.chatling.ai/api-reference/v2/ai-kb/list-ai-models.md) endpoint.
- Conversation ID (`conversation_id`, text): The ID of the conversation. This allows the AI to remember the context of the conversation.
- Contact ID (`contact_id`, text): The ID of the contact to associate with the conversation.
- Language (`language_id`, number): The ID of the language to use for the AI response. To get a list of available languages, use the [List languages](https://docs.chatling.ai/api-reference/v2/ai-kb/list-ai-languages.md) endpoint.
- Temperature (`temperature`, number): The temperature to be used by the AI. The temperature controls the randomness of the response. A lower temperature value, such as 0, will make the outputs more focused and deterministic, whereas a higher temperature, such as 1, will make the responses more diverse and unpredictable.
- Instructions (`instructions`, list): List of [instructions](https://docs.chatling.ai/chatbot/ai/instructions.md) to tailor the AI's response. It can be used to provide additional context to the AI, such as the desired tone or style of the response.

**Outputs**

- `response` (object): Response.

**Example output**

```json
{
  "response": {
    "data": {
      "conversation_id": "example",
      "response": "example",
      "sources": []
    },
    "status": "example"
  }
}
```

### Create chatbot

Create chatbot.

**Inputs**

- Name (`name`, text, required): The chatbot name.
- Template (`template_id`, number): The ID of the chatbot template to use. You can get the list of available templates using the [List chatbot templates](https://docs.chatling.ai/api-reference/v2/chatbots/list-chatbot-templates.md) endpoint.

**Outputs**

- `response` (object): Response.

**Example output**

```json
{
  "response": {
    "data": {
      "created_at": "example",
      "id": "example",
      "name": "example",
      "version": "example",
      "visibility": "example"
    },
    "status": "example"
  }
}
```

### Create contact

Create contact.

**Inputs**

- Chatbot (`chatbot_id`, text, required): The chatbot ID.
- Properties (`properties`, object, required): At least one of the following properties is required.

**Outputs**

- `response` (object): Response.

**Example output**

```json
{
  "response": {
    "data": {
      "id": "example"
    },
    "status": "example"
  }
}
```

### Delete contact

Delete contact.

**Inputs**

- Chatbot (`chatbot_id`, text, required): The chatbot ID.
- Contact ID (`contact_id`, text, required): The contact ID.

**Outputs**

- `response` (object): Response.

**Example output**

```json
{
  "response": {
    "status": "example"
  }
}
```

### Delete conversation

Delete conversation.

**Inputs**

- Chatbot (`chatbot_id`, text, required): The chatbot ID.
- Conversation ID (`conversation_id`, text, required): The conversation ID.

**Outputs**

- `response` (object): Response.

**Example output**

```json
{
  "response": {
    "status": "example"
  }
}
```

### Delete data source

Delete data source.

**Inputs**

- Chatbot (`chatbot_id`, text, required): The chatbot ID.
- Data source ID (`data_source_id`, text, required): The data source ID.

**Outputs**

- `response` (object): Response.

**Example output**

```json
{
  "response": {
    "status": "example"
  }
}
```

### Get chatbot

Retrieve chatbot.

**Inputs**

- Chatbot (`chatbot_id`, text, required): The chatbot ID.

**Outputs**

- `response` (object): Response.

**Example output**

```json
{
  "response": {
    "data": {
      "created_at": "example",
      "id": "example",
      "name": "example",
      "version": "example",
      "visibility": "example"
    },
    "status": "example"
  }
}
```

### Get contact

Retrieve contact.

**Inputs**

- Contact ID (`contact_id`, text, required): The contact ID.
- Chatbot (`chatbot_id`, text, required): The chatbot ID.

**Outputs**

- `response` (object): Response.

**Example output**

```json
{
  "response": {
    "data": {
      "company": "example",
      "created_at": "example",
      "email": "example",
      "id": "example",
      "job_title": "example",
      "name": "example",
      "phone": "example",
      "website": "example"
    },
    "status": "example"
  }
}
```

### Get conversation

Retrieve conversation.

**Inputs**

- Chatbot (`chatbot_id`, text, required): The chatbot ID.
- Conversation ID (`conversation_id`, text, required): The conversation ID.

**Outputs**

- `response` (object): Response.

**Example output**

```json
{
  "response": {
    "data": {
      "archived": 1,
      "contact_id": "example",
      "created_at": "example",
      "id": "example",
      "important": 1,
      "messages": []
    },
    "status": "example"
  }
}
```

### List AI languages

List AI languages. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Chatbot (`chatbot_id`, text, required): The chatbot ID.
- Page (`page`, number): The page number for pagination.

**Outputs**

- `response` (object): Response.

**Example output**

```json
{
  "response": {
    "data": {
      "languages": [],
      "pages": {
        "current_page": 1,
        "last_page": 1,
        "per_page": 1
      }
    },
    "status": "example"
  }
}
```

### List AI models

List AI models. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Chatbot (`chatbot_id`, text, required): The chatbot ID.
- Page (`page`, number): The page number for pagination.

**Outputs**

- `response` (object): Response.

**Example output**

```json
{
  "response": {
    "data": {
      "models": [],
      "pages": {
        "current_page": 1,
        "last_page": 1,
        "per_page": 1
      }
    },
    "status": "example"
  }
}
```

### List chatbot templates

List chatbot templates. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Page (`page`, number): The page number for pagination.

**Outputs**

- `response` (object): Response.

**Example output**

```json
{
  "response": {
    "data": {
      "pages": {
        "current_page": 1,
        "last_page": 1,
        "per_page": 1
      },
      "templates": []
    },
    "status": "example"
  }
}
```

### List chatbots

List chatbots. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Page (`page`, number): The page number for pagination.

**Outputs**

- `response` (object): Response.

**Example output**

```json
{
  "response": {
    "data": {
      "chatbots": [],
      "pages": {
        "current_page": 1,
        "last_page": 1,
        "per_page": 1
      }
    },
    "status": "example"
  }
}
```

### List contacts

List contacts. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Chatbot (`chatbot_id`, text, required): The chatbot ID.
- Page (`page`, number): The page number for pagination.
- Sort (`sort`, text): The sort order. Possible values: One of: `date_desc` (date desc), `date_asc` (date asc).

**Outputs**

- `response` (object): Response.

**Example output**

```json
{
  "response": {
    "data": {
      "contacts": [],
      "pages": {
        "current_page": 1,
        "last_page": 1,
        "per_page": 1
      }
    },
    "status": "example"
  }
}
```

### List conversation messages

List conversation messages. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Chatbot (`chatbot_id`, text, required): The chatbot ID.
- Conversation ID (`conversation_id`, text, required): The conversation ID.
- Page (`page`, number): The page number for pagination.
- Sort (`sort`, text): The sort order. Possible values: One of: `date_desc` (date desc), `date_asc` (date asc).

**Outputs**

- `response` (object): Response.

**Example output**

```json
{
  "response": {
    "data": {
      "messages": [],
      "pages": {
        "current_page": 1,
        "last_page": 1,
        "per_page": 1
      }
    },
    "status": "example"
  }
}
```

### List conversations

List conversations. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Chatbot (`chatbot_id`, text, required): The chatbot ID.
- Cursor (`cursor`, text): The pagination cursor returned in pages.next_cursor from the previous response. Omit this parameter to retrieve the first page. Keep the same sort value when requesting subsequent pages.
- Sort (`sort`, text): The sort order. Possible values: One of: `date_desc` (date desc), `date_asc` (date asc).

**Outputs**

- `response` (object): Response.

**Example output**

```json
{
  "response": {
    "data": {
      "conversations": [],
      "pages": {
        "has_more_pages": false,
        "next_cursor": "example",
        "per_page": 1
      }
    },
    "status": "example"
  }
}
```

### List data sources

List data sources. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Chatbot (`chatbot_id`, text, required): The chatbot ID.
- Page (`page`, number): The page number for pagination.
- Sort (`sort`, text): The sort order. Possible values: One of: `date_desc` (date desc), `date_asc` (date asc).
- Type (`type`, text): Filter by the type of the data source. Possible values are link, text, faq, document, and zoho. One of: `link`, `text`, `faq`, `document`, `zoho`.

**Outputs**

- `response` (object): Response.

**Example output**

```json
{
  "response": {
    "data": {
      "pages": {
        "current_page": 1,
        "last_page": 1
      },
      "sources": []
    },
    "status": "example"
  }
}
```

### List members

List members. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Page (`page`, number): The page number for pagination.

**Outputs**

- `response` (object): Response.

**Example output**

```json
{
  "response": {
    "data": {
      "members": [],
      "pages": {
        "current_page": 1,
        "last_page": 1,
        "per_page": 1
      }
    },
    "status": "example"
  }
}
```

### List settings

List settings. Gets one page; to see more, run it again with the next page it gives.

**Inputs**: None.

**Outputs**

- `response` (object): Response.

**Example output**

```json
{
  "response": {
    "data": {
      "name": "example",
      "project_id": "example"
    },
    "status": "example"
  }
}
```

### Resync data source

Resync data source.

**Inputs**

- Chatbot (`chatbot_id`, text, required): The chatbot ID.
- Data source ID (`data_source_id`, text, required): The data source ID.

**Outputs**

- `response` (object): Response.

**Example output**

```json
{
  "response": {
    "status": "example"
  }
}
```

### Update chatbot settings

Update chatbot settings.

**Inputs**

- Chatbot (`chatbot_id`, text, required): The chatbot ID.
- Name (`name`, text): The chatbot name.
- Visibility (`visibility`, text): The visibility of the chatbot. Possible values are public and private.

**Outputs**

- `response` (object): Response.

**Example output**

```json
{
  "response": {
    "data": {
      "created_at": "example",
      "id": "example",
      "name": "example",
      "version": "example",
      "visibility": "example"
    },
    "status": "example"
  }
}
```

### Update conversation

Update conversation.

**Inputs**

- Chatbot (`chatbot_id`, text, required): The chatbot ID.
- Conversation ID (`conversation_id`, text, required): The conversation ID.
- Archive (`archive`, true/false): Whether to archive the conversation.
- Important (`important`, true/false): Whether to mark the conversation as important.
- Contact ID (`contact_id`, text): The ID of the contact to associate with the conversation.

**Outputs**

- `response` (object): Response.

**Example output**

```json
{
  "response": {
    "data": {
      "archived": 1,
      "contact_id": "example",
      "created_at": "example",
      "id": "example",
      "important": 1,
      "messages": []
    },
    "status": "example"
  }
}
```
