Skip to content
Moodle logo

Connectors / Human resources · HTTP Connector

Automate Moodle with Tray.ai

Create courses and create grade categories in Moodle. Connect Moodle to the rest of your human resources stack with Tray.ai.

What can you do with Moodle on Tray.ai?

Moodle is an open-source learning management system that schools and companies use to run online courses, enrol learners, and track grades. Tray.ai connects to Moodle through the HTTP Connector, so your workflows can call the Moodle API alongside the rest of your stack.

  • Create users in Moodle when new hires are added to your HR system.
  • Enrol users in compliance training when their role changes in your HR system.
  • Get grades for completed courses and record them in your training records.
  • Unenrol users when an employee leaves, based on your HR system's offboarding list.
Connects through
HTTP Connector
Authentication
An API key in the query string
Base URL
https://{your-moodle-site}/webservice/rest/server.php

Set it up

Connect Moodle to Tray.ai

Each step uses Moodle's own API details, from its documentation.

Step 1

Save Moodle's API key

Save the key as a Tray.ai authentication and add it to the query string from $.auth, so it never sits in the workflow itself.

Step 2

Point the HTTP Client at the API

Add an HTTP Client step and use https://{your-moodle-site}/webservice/rest/server.php as the base URL. Or paste a cURL example from Moodle's API docs, and Tray.ai fills in the method, URL, and headers.

Step 3

Start with “List courses”

It's one of 15 documented actions, under Courses. The response comes back as data the next step can map into your other apps.

Step 4

Hand it to an AI agent

Wrap “Create courses” and “Update courses” in workflows, and Tray.ai's Agent Gateway for MCP publishes them as governed tools Claude and other AI agents can call.

Workflows to build with Moodle

Each one uses actions and events from Moodle's own API documentation.

Enroll new Workday hires in Moodle onboarding

When

A worker is hired in Workday REST

Then

  1. Create users in Moodle for the new hire
  2. Enrol users in the onboarding course

With Workday REST

Remove departed BambooHR employees from Moodle courses

When

An employee is terminated in BambooHR

Then

  1. Get users by ID in Moodle
  2. Unenrol users from their active courses

With BambooHR

Sync Moodle training grades to Google Sheets

When

On a schedule

Then

  1. List courses in Moodle
  2. Get grades in Moodle for each course
  3. Update the compliance training sheet in Google Sheets

With Google Sheets

Apps you can build on Moodle data

Internal tools your team can build with an AI assistant, each one using Moodle calls from its API documentation.

Course enrollment desk

Lists Moodle courses and enrolled users and lets an admin enroll or unenroll learners.

Learner grade report

Shows enrolled users for a course with their grades and lets an instructor correct a grade.

Give your AI agents Moodle tools

Build an MCP server on Moodle in Agent Gateway and choose which actions your agents can call. Every call runs with access control and an audit trail. How Agent Gateway works

  • List courses
  • Get users by ID
  • Enrol users
  • Get grades
  • Create courses
  • Update courses
  • Delete courses
  • Create users

What the Moodle API covers

4 resources and 15 documented actions, each one a call the HTTP Connector can make from a Tray.ai workflow. Connecting it takes a few clicks: here's how.

Courses

  • List courses
  • Create courses
  • Update courses
  • Delete courses

Users

  • Get users by ID
  • Create users
  • Update users
  • Delete users

Enrolments

  • Enrol users
  • List enrolled users
  • Edit a user enrolment
  • Unenrol users

Grades

  • Get grades
  • Update grades
  • Create grade categories

Checked against Moodle's own documentation on 2026-10-22

docs.moodle.org/dev/Web_service_API_functions

Frequently asked questions

What can a Tray.ai workflow do in Moodle?

+

The Moodle API documents 15 actions across 4 resources (Courses, Users, Enrolments, Grades). For example: List courses; Get users by ID; Enrol users. A workflow can make any documented call through the HTTP Connector.

How does Tray.ai authenticate with Moodle?

+

The Moodle API uses an API key in the query string. You save it once as a Tray.ai authentication, and the HTTP Connector adds it to every request.

See Moodle working against your stack.

We'll walk through a tailored demo with your systems plugged in.

Great — a couple more details

This helps us connect you with the right person. Optional, and you can skip it.