# Webhooks Subscriptions for Plagiarism Platform

{% 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 %}

## Webhooks Subscriptions for Plagiarism Platform API

**LTI API for Webhook Subscriptions (Must use** [**JWT access tokens**](/services/canvas/external-tools/plagiarism-detection-platform/file.jwt_access_tokens.md) **with this API).**

This is intended for use with Canvas' [Plagiarism Detection Platform](/services/canvas/external-tools/plagiarism-detection-platform/file.plagiarism_platform.md). For general-purpose event subscriptions see [Live Events](/services/canvas/data-services/live-events/overview/file.data_service_introduction.md).

The tool proxy must also have the appropriate enabled capabilities (See appendix).

Webhooks from Canvas are your way to know that a change (e.g. new or updated submission, new or updated assignment, etc.) has taken place.

Webhooks are available via HTTPS to an endpoint you own and specify, or via an AWS SQS queue that you provision, own, and specify. We recommend SQS for the most robust integration, but do support HTTPS for lower volume applications.

We do not deduplicate or batch messages before transmission. Avoid creating multiple identical subscriptions. Webhooks always identify the ID of the subscription that caused them to be sent, allowing you to identify problematic or high volume subscriptions.

We cannot guarantee the transmission order of webhooks. If order is important to your application, you must check the "event\_time" attribute in the "metadata" hash to determine sequence.

### [Create a Webhook Subscription](#method.lti/subscriptions_api.create) <a href="#method.lti-subscriptions_api.create" id="method.lti-subscriptions_api.create"></a>

[Lti::SubscriptionsApiController#create](https://github.com/instructure/canvas-lms/blob/master/app/controllers/lti/subscriptions_api_controller.rb)

**`POST /api/lti/subscriptions`**

**Scope:** `url:POST|/api/lti/subscriptions`

Creates a webook subscription for the specified event type and context.

**Request Parameters:**

| Parameter                         | Type              | Description                                                                                       |
| --------------------------------- | ----------------- | ------------------------------------------------------------------------------------------------- |
| `subscription[ContextId]`         | Required `string` | The id of the context for the subscription.                                                       |
| `subscription[ContextType]`       | Required `string` | <p>The type of context for the subscription. Must be 'assignment',<br>'account', or 'course'.</p> |
| `subscription[EventTypes]`        | Required `Array`  | <p>Array of strings representing the event types for<br>the subscription.</p>                     |
| `subscription[Format]`            | Required `string` | Format to deliver the live events. Must be 'live-event' or 'caliper'.                             |
| `subscription[TransportMetadata]` | Required `Object` | An object with a single key: 'Url'. Example: { "Url": "sqs.example" }                             |
| `subscription[TransportType]`     | Required `string` | Must be either 'sqs' or 'https'.                                                                  |

### [Delete a Webhook Subscription](#method.lti/subscriptions_api.destroy) <a href="#method.lti-subscriptions_api.destroy" id="method.lti-subscriptions_api.destroy"></a>

[Lti::SubscriptionsApiController#destroy](https://github.com/instructure/canvas-lms/blob/master/app/controllers/lti/subscriptions_api_controller.rb)

**`DELETE /api/lti/subscriptions/:id`**

**Scope:** `url:DELETE|/api/lti/subscriptions/:id`

### [Show a single Webhook Subscription](#method.lti/subscriptions_api.show) <a href="#method.lti-subscriptions_api.show" id="method.lti-subscriptions_api.show"></a>

[Lti::SubscriptionsApiController#show](https://github.com/instructure/canvas-lms/blob/master/app/controllers/lti/subscriptions_api_controller.rb)

**`GET /api/lti/subscriptions/:id`**

**Scope:** `url:GET|/api/lti/subscriptions/:id`

### [Update a Webhook Subscription](#method.lti/subscriptions_api.update) <a href="#method.lti-subscriptions_api.update" id="method.lti-subscriptions_api.update"></a>

[Lti::SubscriptionsApiController#update](https://github.com/instructure/canvas-lms/blob/master/app/controllers/lti/subscriptions_api_controller.rb)

**`PUT /api/lti/subscriptions/:id`**

**Scope:** `url:PUT|/api/lti/subscriptions/:id`

This endpoint uses the same parameters as the create endpoint

### [List all Webhook Subscription for a tool proxy](#method.lti/subscriptions_api.index) <a href="#method.lti-subscriptions_api.index" id="method.lti-subscriptions_api.index"></a>

[Lti::SubscriptionsApiController#index](https://github.com/instructure/canvas-lms/blob/master/app/controllers/lti/subscriptions_api_controller.rb)

**`GET /api/lti/subscriptions`**

**Scope:** `url:GET|/api/lti/subscriptions`

This endpoint returns a paginated list with a default limit of 100 items per result set. You can retrieve the next result set by setting a 'StartKey' header in your next request with the value of the 'EndKey' header in the response.

Example use of a 'StartKey' header object: { "Id":"71d6dfba-0547-477d-b41d-db8cb528c6d1","DeveloperKey":"10000000000001" }

### Appendixes

#### Appendix: Webhook Subscription Required Capabilities <a href="#webhooksubscriptionrequiredcapabilities-appendix" id="webhooksubscriptionrequiredcapabilities-appendix"></a>

A tool must have certain capabilities enabled in order to create webhook subscriptions for a given event type in a given context. These capabilities can only be obtained through the use of a custom tool consumer profile.

All available event types are listed bellow along with the capability that will allow creating subscriptions of the associated type.

#### `QUIZ_SUBMITTED` Event Type <a href="#quiz_submitted-event-type" id="quiz_submitted-event-type"></a>

* vnd.instructure.webhooks.root\_account.quiz\_submitted
* vnd.instructure.webhooks.assignment.quiz\_submitted

#### `GRADE_CHANGE` Event Type <a href="#grade_change-event-type" id="grade_change-event-type"></a>

* vnd.instructure.webhooks.root\_account.grade\_change

#### `ATTACHMENT_CREATED` Event Type <a href="#attachment_created-event-type" id="attachment_created-event-type"></a>

* vnd.instructure.webhooks.root\_account.attachment\_created
* vnd.instructure.webhooks.assignment.attachment\_created

#### `SUBMISSION_CREATED` Event Type <a href="#submission_created-event-type" id="submission_created-event-type"></a>

* vnd.instructure.webhooks.root\_account.submission\_created
* vnd.instructure.webhooks.assignment.submission\_created

#### `SUBMISSION_UPDATED` Event Type <a href="#submission_updated-event-type" id="submission_updated-event-type"></a>

* vnd.instructure.webhooks.root\_account.submission\_updated
* vnd.instructure.webhooks.assignment.submission\_updated

#### `PLAGIARISM_RESUBMIT` Event Type <a href="#plagiarism_resubmit-event-type" id="plagiarism_resubmit-event-type"></a>

* vnd.instructure.webhooks.root\_account.plagiarism\_resubmit
* vnd.instructure.webhooks.assignment.plagiarism\_resubmit

#### All Event Types <a href="#all-event-types" id="all-event-types"></a>

* vnd.instructure.webhooks.root\_account.all

***

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/external-tools/plagiarism-detection-platform/webhooks_subscriptions_for_plagiarism_platform.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.
