> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://fastpix.com/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://fastpix.com/docs/_mcp/server.

# Set up the Moodle local plugin

The `local_fastpix` plugin connects your Moodle site to FastPix. It's a foundation plugin: it provides the shared HTTP gateway, asset cache, webhook ingestion, and playback-token signing that the other FastPix plugins build on. On its own, it ships only an admin settings page, a webhook endpoint, and a health probe.

The audience for this guide is Moodle site administrators. A first-time setup takes about 15 minutes.

\


## Before you begin

Make sure you have:

* A Moodle site running version 4.5 LTS or later.
* PHP 8.1 or later. The plugin is tested through PHP 8.3.
* Site administrator access to your Moodle dashboard.
* A FastPix account. If you don't have one, [sign up](https://dashboard.fastpix.com/signup).
* A shared Moodle Universal Cache (MUC) backend Redis, Memcached, or the file store on a single-server install.

The gateway circuit breaker and rate limiter rely on cache state shared across all PHP workers, so a shared MUC backend is required. The plugin bundles `firebase/php-jwt` (BSD-3-Clause) and has no runtime Composer dependencies.

\


## Get your FastPix API credentials

To connect Moodle to your FastPix account, generate API credentials in the FastPix Dashboard:

1. Sign in to your [FastPix Dashboard](https://dashboard.fastpix.com).
2. Go to **Settings** > **API Keys**.
3. Create a new key and give it a recognizable name, such as `Moodle production`.
4. Copy the **API Key** and the **API Secret**.

> **Important:** FastPix shows the **API Secret** only once. If you leave the page without copying it, you have to create a new key. For more detail, see [Generate API credentials](/getting-started/activate-your-account#generate-api-credentials).

\


## Install the plugin

You can install `local_fastpix` from the Moodle plugins directory or from a ZIP file.

### Install from the Moodle plugins directory

1. Sign in to Moodle as a site administrator.
2. Go to **Site administration** > **Plugins** > **Install plugins**.
3. Search for `FastPix` and follow the prompts.

### Install from a ZIP file

1. Download the latest release from the [GitHub Releases page](https://github.com/FastPix/moodle-local_fastpix/releases).
2. Sign in to Moodle as a site administrator.
3. Go to **Site administration** > **Plugins** > **Install plugins**.
4. Drag the ZIP onto the drop zone, or select **Choose a file** to upload it. Don't unzip the file first; Moodle installs the package directly from the ZIP.
5. Select **Install plugin from the ZIP file**, then continue through the validation screen.
6. On the **Plugins requiring attention** screen, select **Upgrade Moodle database now**.
7. When the upgrade finishes, select **Continue**.

\


## Connect the plugin to FastPix

After you install the plugin and have your API credentials, open the settings page at **Site administration** > **Server** > **FastPix**.

1. In the **API credentials** section, paste your **API Key** and **API Secret**.
2. Select **Save changes**.
3. Select **Test connection**. A green check and an `Authenticated · <n> ms` message confirm that Moodle can authenticate with FastPix.

> **Important:** The **Test connection** and **Send test event** buttons act on the *saved* settings, not on the values currently typed into the fields. Always select **Save changes** first.

Moodle stores the API Secret in the `config_plugins` table using the standard masked-password field. The browser hides the value, but the database doesn't encrypt it. Protect your database and backups accordingly.

\


## Set upload defaults

In the **Upload defaults** section, set the values applied to every newly ingested video. Both settings are optional, and consumer plugins can override them per activity.

| Setting                        | Values                                                                                                               |
| ------------------------------ | -------------------------------------------------------------------------------------------------------------------- |
| **Default access policy**      | `public` (no authentication), `private` (signed-token playback, the default), or `drm` (requires DRM configuration). |
| **Default maximum resolution** | Up to `1080p` (the default).                                                                                         |

### Enable DRM

DRM is disabled by default. To turn it on, set both of the following. If either is missing, DRM stays off.

1. On the settings page, select **Enable DRM**.
2. Paste your FastPix **DRM Configuration ID** into the matching field.

For how to obtain a DRM configuration, see [Set up DRM encryption](/video-security/set-up-drm-encryption). DRM adds cost on FastPix, so enable it only for content that needs Widevine or FairPlay protection.

\


## Configure retention and cleanup

In the **Retention & cleanup** section, set how long the plugin keeps abandoned uploads and unattached videos before sweeping them. The defaults are safe; adjust them only if your site has specific retention needs.

| Setting                                    | Description                                                                                                                                                                                                                 | Default  |
| ------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
| **Stale upload-session lifetime**          | How long an upload session that never became a video is kept before the orphan sweeper cancels the FastPix upload and deletes the session row.                                                                              | 1 day    |
| **Unattached video grace period**          | How long a ready video may stay unattached to any activity before it is released. Released videos are soft-deleted, then permanently removed by the 7-day purge.                                                            | 1 week   |
| **Unattached video warning lead time**     | How long before release the owner is warned that an unattached video will be removed, giving them time to attach it. Must be less than the grace period.                                                                    | 2 days   |
| **Automatically remove unattached videos** | When enabled, ready videos with no activity reference that haven't been rendered anywhere for the grace period are soft-deleted, then purged. When disabled, owners are only notified and nothing is deleted automatically. | Disabled |

> **Important:** Keep **Automatically remove unattached videos** disabled until the FastPix filter and editor plugins report video usage. Otherwise a video embedded through one of those plugins could be removed while still in use.

\


## Register the webhook

FastPix uses webhooks to tell Moodle when an upload finishes processing and when assets change. The webhook URL is fixed; the signing secret is generated by FastPix and pasted into Moodle so that Moodle can verify each event's signature. For background, see [Set up webhooks](/webhooks/set-up-webhooks).

1. On the Moodle settings page, in the **Webhooks** section, select **Copy** next to the **Webhook URL**. The URL looks like `https://your.moodle.example/local/fastpix/webhook.php`.
2. In the FastPix Dashboard, go to **Webhooks**, add a new destination, and paste the URL.
3. Subscribe the destination to at least the following events:
   * `video.media.created`
   * `video.media.ready`
   * `video.media.updated`
   * `video.media.failed`
   * `video.media.deleted`
4. Copy the **signing secret** that FastPix shows for the destination.
5. Back on the Moodle settings page, paste the secret into **Webhook signing secret**, then select **Save changes**.

> **Note:** The secret must be at least 32 characters; FastPix generates 64-character secrets by default. Until a secret is saved, Moodle rejects all incoming events and shows a warning on the settings page. When you rotate the secret later, Moodle continues to accept the previous value for 30 minutes, so you can update both sides without losing deliveries.

\


## Verify your installation

After you configure the plugin, run these three checks to confirm that the integration is healthy.

### Test the connection

On the settings page, select **Test connection**. A green check and an `Authenticated · <n> ms` message confirm success. If the test fails, Moodle shows a descriptive error. Re-check your API Key and API Secret, save the changes, and try again.

### Verify the webhook handshake

Select **Send test event**. This drives the full verify-record-enqueue pipeline without leaving Moodle. On success, you see `Test event delivered (ledger id <n>)`.

To confirm that the event was ingested:

1. Go to **Site administration** > **Reports** > **Logs**.
2. Filter by the component `local_fastpix`.
3. Confirm that the test event appears in the log.

Ingestion is unchanged. If the same event arrives twice, the plugin silently ignores the duplicate, and no second row is recorded.

### Verify the scheduled tasks

Go to **Site administration** > **Server** > **Scheduled tasks** and confirm that the FastPix tasks are present and enabled with their default schedules. They run on Moodle's standard cron, no separate infrastructure is required.

\


## Monitor the integration

The plugin exposes a public health-check endpoint for monitoring tools such as Pingdom, UptimeRobot, or a Prometheus blackbox exporter:

```
https://your.moodle.example/local/fastpix/health.php
```

The endpoint requires no authentication and is rate-limited to 30 requests per minute per IP address. It makes an authenticated check against FastPix and never returns a 500. Every server-side problem surfaces as a 503 so monitoring can tell a hard failure from a slow probe. The response is JSON with `status`, `fastpix_reachable`, `latency_ms`, and `timestamp` fields.

### Response codes

| Code  | `status`       | Meaning                                                   | What to do                                                                                                                                            |
| ----- | -------------- | --------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `200` | `ok`           | Moodle reached FastPix and got an authenticated 2xx.      | Nothing. Treat this as "up" in your monitoring.                                                                                                       |
| `503` | `degraded`     | The probe ran, but FastPix didn't return a 2xx.           | See [Diagnose a degraded 503](#diagnose-a-degraded-503).                                                                                              |
| `503` | `error`        | Something inside Moodle threw before the probe completed. | Usually the MUC cache backend is unreachable. Confirm that your shared cache (Redis, Memcached, or the file store) is up, then check the Moodle logs. |
| `429` | `rate_limited` | More than 30 requests per minute came from one IP.        | The endpoint is throttling, not failing. Poll every 30–60 seconds, or spread checks across sources.                                                   |

### Diagnose a degraded 503

Because the probe is authenticated, a `degraded` response collapses three different problems into one code:

* **FastPix is down or slow.** Check the [FastPix status page](https://status.fastpix.io).
* **The network path is blocked.** Confirm that Moodle can reach the FastPix API outbound through any proxy, firewall, or DNS.
* **API credentials are wrong or revoked.** A 401 or 403 from FastPix also lands here.

To tell these apart, select **Test connection** on the settings page. Unlike the health endpoint, **Test connection** surfaces the underlying error message, so it immediately distinguishes a credentials problem from a genuine outage.

\


## Scheduled tasks

The plugin registers the following scheduled tasks. All of them run on Moodle's standard cron and are enabled by default. To adjust the schedules, go to **Site administration** > **Server** > **Scheduled tasks**.

| Task                               | Purpose                                                     | Default schedule |
| ---------------------------------- | ----------------------------------------------------------- | ---------------- |
| Sweep expired upload sessions      | Clears upload sessions that were never completed.           | Daily, 03:17     |
| Prune old processed webhook events | Trims the webhook ledger after the 90-day retention window. | Daily, 04:23     |
| Hard-delete soft-deleted assets    | Removes asset rows past the GDPR retention window.          | Daily, 04:47     |
| Retry pending GDPR deletions       | Re-attempts remote deletions that previously failed.        | Every 15 minutes |
| Hard-purge soft-deleted assets     | Permanently purges assets after the 7-day grace window.     | Daily, 02:30     |
| Rotate JWT signing key             | Rotates the playback signing key every 90 days.             | Daily, 05:11     |

\


## Privacy

`local_fastpix` includes a full Moodle Privacy API provider. It never sends raw Moodle user IDs to FastPix; instead, it sends a site-specific HMAC value (`user_hash`). The webhook ledger is pruned after 90 days, and soft-deleted assets are permanently purged after a 7-day grace window. GDPR export and per-asset delete requests are handled on the Moodle side.

For full details, go to **Site administration** > **Users** > **Privacy and policies** > **Data registry** in your Moodle site.

\


## Troubleshooting

### Test connection fails

If the connection test fails, try the following:

* Confirm that the API Key and API Secret are correct and haven't been revoked in FastPix.
* Confirm that Moodle can reach the FastPix API outbound. If you use a proxy, route the request through it.
* Save your changes before testing. The button uses saved settings, not typed values.

### Webhook returns 401

A 401 means that the signing secret in Moodle doesn't match what FastPix is signing with. To resolve it:

* Re-copy the secret from the correct webhook destination in FastPix, watching for trailing whitespace.
* Paste it into **Webhook signing secret** in Moodle and save the changes.
* If you just rotated the secret, the previous value still works for 30 minutes.

### Webhook returns 400

A 400 is usually an unrecognized validation-probe body. Make sure you're on plugin version `2026051201` or later. Real events always carry top-level `id` and `type` fields.

### Private videos don't play, but public ones do

The RS256 signing key hasn't been minted yet. The plugin creates it on first need. Saving valid API credentials and loading a private asset triggers it.

### Videos show "Video unavailable"

This is expected if a course was restored onto a Moodle site that points at a different FastPix account. The asset IDs don't exist in the new account.

### Scheduled tasks aren't running

Confirm that Moodle cron is configured and running. The plugin's tasks depend on standard Moodle cron, not on separate infrastructure.

### Moodle is slow or unresponsive

Confirm that a shared MUC backend (Redis, Memcached, or the file store) is configured. The gateway circuit breaker and rate limiter need cache state shared across all PHP workers.

\


## What's next

* Read the [plugin README and source](https://github.com/FastPix/moodle-local_fastpix).
* Explore the [FastPix API documentation](/platform-api/overview).
* Join the [FastPix community discussions](https://github.com/orgs/fastpix/discussions).
* Contact [FastPix support](https://www.fastpix.com/technical-support).