# AI Conversations

{% hint style="warning" %}
**Welcome to Our New API Docs!** This is the new home for all things API (previously at [Canvas LMS REST API Documentation](https://api.instructure.com)).
{% endhint %}

## AI Conversations API

API for managing conversations with AI Experiences.

### [Show conversation](#method.ai_conversations.show) <a href="#method.ai_conversations.show" id="method.ai_conversations.show"></a>

[AiConversationsController#show](https://github.com/instructure/canvas-lms/blob/master/app/controllers/ai_conversations_controller.rb)

**`GET /api/v1/courses/:course_id/ai_experiences/:ai_experience_id/conversations/:id`**

**Scope:** `url:GET|/api/v1/courses/:course_id/ai_experiences/:ai_experience_id/conversations/:id`

Get a specific conversation by ID (for teachers viewing student conversations)

### [Get active conversation](#method.ai_conversations.active_conversation) <a href="#method.ai_conversations.active_conversation" id="method.ai_conversations.active_conversation"></a>

[AiConversationsController#active\_conversation](https://github.com/instructure/canvas-lms/blob/master/app/controllers/ai_conversations_controller.rb)

**`GET /api/v1/courses/:course_id/ai_experiences/:ai_experience_id/conversations`**

**Scope:** `url:GET|/api/v1/courses/:course_id/ai_experiences/:ai_experience_id/conversations`

Get the active conversation for the current user and AI experience

### [Create AI conversation](#method.ai_conversations.create) <a href="#method.ai_conversations.create" id="method.ai_conversations.create"></a>

[AiConversationsController#create](https://github.com/instructure/canvas-lms/blob/master/app/controllers/ai_conversations_controller.rb)

**`POST /api/v1/courses/:course_id/ai_experiences/:ai_experience_id/conversations`**

**Scope:** `url:POST|/api/v1/courses/:course_id/ai_experiences/:ai_experience_id/conversations`

Initialize a new conversation with the AI experience

### [Post message to conversation](#method.ai_conversations.post_message) <a href="#method.ai_conversations.post_message" id="method.ai_conversations.post_message"></a>

[AiConversationsController#post\_message](https://github.com/instructure/canvas-lms/blob/master/app/controllers/ai_conversations_controller.rb)

**`POST /api/v1/courses/:course_id/ai_experiences/:ai_experience_id/conversations/:id/messages`**

**Scope:** `url:POST|/api/v1/courses/:course_id/ai_experiences/:ai_experience_id/conversations/:id/messages`

Send a message to an existing conversation and get the AI response

**Request Parameters:**

| Parameter | Type              | Description                          |
| --------- | ----------------- | ------------------------------------ |
| `message` | Required `string` | The user’s message to send to the AI |

### [Delete AI conversation](#method.ai_conversations.destroy) <a href="#method.ai_conversations.destroy" id="method.ai_conversations.destroy"></a>

[AiConversationsController#destroy](https://github.com/instructure/canvas-lms/blob/master/app/controllers/ai_conversations_controller.rb)

**`DELETE /api/v1/courses/:course_id/ai_experiences/:ai_experience_id/conversations/:id`**

**Scope:** `url:DELETE|/api/v1/courses/:course_id/ai_experiences/:ai_experience_id/conversations/:id`

Mark a conversation as completed/deleted

### [Get conversation evaluation](#method.ai_conversations.evaluation) <a href="#method.ai_conversations.evaluation" id="method.ai_conversations.evaluation"></a>

[AiConversationsController#evaluation](https://github.com/instructure/canvas-lms/blob/master/app/controllers/ai_conversations_controller.rb)

**`GET /api/v1/courses/:course_id/ai_experiences/:ai_experience_id/conversations/:id/evaluation`**

**Scope:** `url:GET|/api/v1/courses/:course_id/ai_experiences/:ai_experience_id/conversations/:id/evaluation`

Fetch evaluation data for a conversation from the llm-conversation service

### [Create feedback on a conversation message](#method.ai_conversations.create_feedback) <a href="#method.ai_conversations.create_feedback" id="method.ai_conversations.create_feedback"></a>

[AiConversationsController#create\_feedback](https://github.com/instructure/canvas-lms/blob/master/app/controllers/ai_conversations_controller.rb)

**`POST /api/v1/courses/:course_id/ai_experiences/:ai_experience_id/conversations/:id/messages/:message_id/feedback`**

**Scope:** `url:POST|/api/v1/courses/:course_id/ai_experiences/:ai_experience_id/conversations/:id/messages/:message_id/feedback`

Submit a like or dislike vote on an AI-generated message.

**Request Parameters:**

| Parameter          | Type              | Description                   |
| ------------------ | ----------------- | ----------------------------- |
| `vote`             | Required `string` | “liked” or “disliked”         |
| `message_id`       | Required `string` | llm-conversation message UUID |
| `feedback_message` | `string`          | optional text for dislike     |

### [Delete feedback on a conversation message](#method.ai_conversations.delete_feedback) <a href="#method.ai_conversations.delete_feedback" id="method.ai_conversations.delete_feedback"></a>

[AiConversationsController#delete\_feedback](https://github.com/instructure/canvas-lms/blob/master/app/controllers/ai_conversations_controller.rb)

**`DELETE /api/v1/courses/:course_id/ai_experiences/:ai_experience_id/conversations/:id/messages/:message_id/feedback/:feedback_id`**

**Scope:** `url:DELETE|/api/v1/courses/:course_id/ai_experiences/:ai_experience_id/conversations/:id/messages/:message_id/feedback/:feedback_id`

Remove a previously submitted vote (toggling off like/dislike).

***

This documentation is generated directly from the Canvas LMS source code, available [on Github](https://github.com/instructure/canvas-lms).


---

# Agent Instructions: 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://developerdocs.instructure.com/services/canvas/resources/ai_conversations.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.
