> 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/error_reports.md).

# Error Reports

#### An ErrorReport object looks like: <a href="#errorreport" id="errorreport"></a>

```js
// A collection of information around a specific notification of a problem
{
  // The users problem summary, like an email subject line
  "subject": "File upload breaking",
  // long form documentation of what was witnessed
  "comments": "When I went to upload a .mov file to my files page, I got an error.  Retrying didn't help, other file types seem ok",
  // categorization of how bad the user thinks the problem is.  Should be one of
  // [just_a_comment, not_urgent, workaround_possible, blocks_what_i_need_to_do,
  // extreme_critical_emergency].
  "user_perceived_severity": "just_a_comment",
  // the email address of the reporting user
  "email": "name@example.com",
  // URL of the page on which the error was reported
  "url": "https://canvas.instructure.com/courses/1",
  // string describing the asset being interacted with at the time of error. 
  // Formatted '[type]_[id]'
  "context_asset_string": "user_1",
  // comma seperated list of roles the reporting user holds.  Can be one
  // [student], or many [teacher,admin]
  "user_roles": "user,teacher,admin"
}
```

## [Create Error Report](#method.errors.create) <a href="#method.errors.create" id="method.errors.create"></a>

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

#### `POST /api/v1/error_reports`

**Scope:** `url:POST|/api/v1/error_reports`

Create a new error report documenting an experienced problem

Performs the same action as when a user uses the "help -> report a problem" dialog.

#### Request Parameters:

| Parameter         | Type              | Description                                                                                                                                                                                                                                                                                                             |
| ----------------- | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `error[subject]`  | Required `string` | The summary of the problem                                                                                                                                                                                                                                                                                              |
| `error[url]`      | `string`          | URL from which the report was issued                                                                                                                                                                                                                                                                                    |
| `error[email]`    | `string`          | Email address for the reporting user                                                                                                                                                                                                                                                                                    |
| `error[comments]` | `string`          | The long version of the story from the user one what they experienced                                                                                                                                                                                                                                                   |
| `error[http_env]` | `SerializedHash`  | <p>A collection of metadata about the users' environment. If not provided,<br>canvas will collect it based on information found in the request.<br>(Doesn't have to be HTTPENV info, could be anything JSON object that can be<br>serialized as a hash, a mobile app might include relevant metadata for<br>itself)</p> |

#### Example Request:

```bash
# Create error report
curl 'https://<canvas>/api/v1/error_reports' \
      -X POST \
      -F 'error[subject]="things are broken"' \
      -F 'error[url]=http://<canvas>/courses/1' \
      -F 'error[description]="All my thoughts on what I saw"' \
      -H 'Authorization: Bearer <token>'
```

***

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


---

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