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

# BlockEditorTemplate

Block Editor Templates are pre-build templates that can be used to create pages. The BlockEditorTemplate API allows you to create, retrieve, update, and delete templates.

#### A BlockEditorTemplate object looks like: <a href="#blockeditortemplate" id="blockeditortemplate"></a>

```js
{
  // the ID of the page
  "id": 1,
  // name of the template
  "name": "Navigation Bar",
  // description of the template
  "description": "A bar of links to other content",
  // the creation date for the template
  "created_at": "2012-08-06T16:46:33-06:00",
  // the date the template was last updated
  "updated_at": "2012-08-08T14:25:20-06:00",
  // The JSON data that is the template
  "node_tree": null,
  // The version of the editor that created the template
  "editor_version": "1.0",
  // The type of template. One of 'block', 'section', or 'page'
  "template_type": "page",
  // String indicating what state this assignment is in.
  "workflow_state": "unpublished"
}
```

## [List block templates](#method.block_editor_templates_api.index) <a href="#method.block_editor_templates_api.index" id="method.block_editor_templates_api.index"></a>

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

#### `GET /api/v1/courses/:course_id/block_editor_templates`

**Scope:** `url:GET|/api/v1/courses/:course_id/block_editor_templates`

A list of the block templates available to the current user.

#### Request Parameters:

| Parameter   | Type      | Description                                                                                                |
| ----------- | --------- | ---------------------------------------------------------------------------------------------------------- |
| `sort`      | `string`  | Sort results by this field. Allowed values: `name`, `created_at`, `updated_at`                             |
| `order`     | `string`  | The sorting order. Defaults to 'asc'. Allowed values: `asc`, `desc`                                        |
| `drafts`    | `boolean` | <p>If true, include draft templates. If false or omitted<br>only published templates will be returned.</p> |
| `type[]`    | `string`  | What type of templates should be returned. Allowed values: `page`, `section`, `block`                      |
| `include[]` | `string`  | no description Allowed values: `node_tree`, `thumbnail`                                                    |

#### Example Request:

```bash
curl -H 'Authorization: Bearer <token>' \
     https://<canvas>/api/v1/courses/123/block_editor_templates?sort=name&order=asc&drafts=true
```

Returns a list of [BlockEditorTemplate](#blockeditortemplate) 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/block_editor_template.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.
