> For the complete documentation index, see [llms.txt](https://developerdocs.instructure.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developerdocs.instructure.com/services/canvas/resources/history.md).

# History

#### A HistoryEntry object looks like: <a href="#historyentry" id="historyentry"></a>

```js
// Information about a recently visited item or page in Canvas
{
  // The asset string for the item viewed
  "asset_code": "assignment_123",
  // The name of the item
  "asset_name": "Test Assignment",
  // The icon type shown for the item. One of 'icon-announcement',
  // 'icon-assignment', 'icon-calendar-month', 'icon-discussion', 'icon-document',
  // 'icon-download', 'icon-gradebook', 'icon-home', 'icon-message',
  // 'icon-module', 'icon-outcomes', 'icon-quiz', 'icon-user', 'icon-syllabus'
  "asset_icon": "icon-assignment",
  // The associated category describing the asset_icon
  "asset_readable_category": "Assignment",
  // The type of context of the item visited. One of 'Course', 'Group', 'User', or
  // 'Account'
  "context_type": "Course",
  // The id of the context, if applicable
  "context_id": 123,
  // The name of the context
  "context_name": "Something 101",
  // The URL of the item
  "visited_url": "https://canvas.example.com/courses/123/assignments/456",
  // When the page was visited
  "visited_at": "2019-08-01T19:49:47Z",
  // The estimated time spent on the page in seconds
  "interaction_seconds": 400
}
```

## [List recent history for a user](#method.history.index) <a href="#method.history.index" id="method.history.index"></a>

[HistoryController#index](https://github.com/instructure/canvas-lms/blob/master/app/controllers/history_controller.rb)

#### `GET /api/v1/users/:user_id/history`

**Scope:** `url:GET|/api/v1/users/:user_id/history`

Return a paginated list of the user's recent history. History entries are returned in descending order, newest to oldest. You may list history entries for yourself (use +self+ as the user\_id), for a student you observe, or for a user you manage as an administrator. Note that the +per\_page+ pagination argument is not supported and the number of history entries returned per page will vary.

Returns a list of [HistoryEntry](#historyentry) objects.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developerdocs.instructure.com/services/canvas/resources/history.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
