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

# Assignment Extensions

API for setting extensions on student assignment submissions. These cannot be set for discussion assignments or quizzes. For quizzes, use [Quiz Extensions](/services/canvas/resources/quiz_extensions.md) instead.

#### An AssignmentExtension object looks like: <a href="#assignmentextension" id="assignmentextension"></a>

```js
{
  // The ID of the Assignment the extension belongs to.
  "assignment_id": 2,
  // The ID of the Student that needs the assignment extension.
  "user_id": 3,
  // Number of times the student is allowed to re-submit the assignment
  "extra_attempts": 2
}
```

## [Set extensions for student assignment submissions](#method.assignment_extensions.create) <a href="#method.assignment_extensions.create" id="method.assignment_extensions.create"></a>

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

#### `POST /api/v1/courses/:course_id/assignments/:assignment_id/extensions`

**Scope:** `url:POST|/api/v1/courses/:course_id/assignments/:assignment_id/extensions`

\<b>Responses\</b>

* \<b>200 OK\</b> if the request was successful
* \<b>403 Forbidden\</b> if you are not allowed to extend assignments for this course
* \<b>400 Bad Request\</b> if any of the extensions are invalid

#### Request Parameters:

| Parameter                                 | Type               | Description                                                                                |
| ----------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------ |
| `assignment_extensions[][user_id]`        | Required `integer` | The ID of the user we want to add assignment extensions for.                               |
| `assignment_extensions[][extra_attempts]` | Required `integer` | <p>Number of times the student is allowed to re-take the assignment over the<br>limit.</p> |

#### Example Request:

```bash
{
  "assignment_extensions": [{
    "user_id": 3,
    "extra_attempts": 2
  },{
    "user_id": 2,
    "extra_attempts": 2
  }]
}
```

#### Example Response:

```js
{
  "assignment_extensions": [AssignmentExtension]
}
```

***

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:

```
GET https://developerdocs.instructure.com/services/canvas/resources/assignment_extensions.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.
