CONNECT APP
Build with Moodle
The open source learning platform, Moodle LMS.
Learning & Education
- API key
MCP
Give your agent Moodle tools
Every Moodle action is exposed as an MCP tool on Pipedream's remote server. Point a client at it with your end user's ID and Connect resolves that user's Moodle account for each tool call — you store no tokens.
// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
"x-pd-app-slug": "moodle",
},
},
},
)
const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)
const { tools } = await mcp.listTools()
// e.g. run Add a Content Item to a User's Favorites:
const result = await mcp.callTool({
name: "moodle-add-content-item-to-favorites",
arguments: {
courseId: "Course ID",
sectionId: "Section ID",
},
})# access_token: mint a short-lived token with the Connect SDK — see the MCP guide
headers = {
"Authorization": f"Bearer {access_token}",
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", # any stable ID for this user in your system
"x-pd-app-slug": "moodle",
}
async with streamablehttp_client("https://remote.mcp.pipedream.net/v3", headers=headers) as (read, write, _):
async with ClientSession(read, write) as session:
await session.initialize()
tools = await session.list_tools()
# e.g. run Add a Content Item to a User's Favorites:
result = await session.call_tool("moodle-add-content-item-to-favorites", {
"courseId": "Course ID",
"sectionId": "Section ID",
})API PROXY
Call the Moodle API directly
For an endpoint with no pre-built tool, the Connect proxy forwards your request to the Moodle API with the connected user's credentials attached. You store no tokens and write no refresh logic.
const resp = await pd.proxy.get({
externalUserId: "{external_user_id}", // any stable ID for this user in your system
accountId: "apn_xxxxxxx",
url: "https://api.example.com/v1/me",
})
// Any allowed Moodle endpoint works here. Pipedream attaches the
// connected account's credentials to the outgoing request.# The path segment is the target URL, URL-safe base64 encoded:
# https://api.example.com/v1/me
curl "https://api.pipedream.com/v1/connect/{project_id}/proxy/aHR0cHM6Ly9hcGkuZXhhbXBsZS5jb20vdjEvbWU?external_user_id={external_user_id}&account_id=apn_xxxxxxx" \
-H "Authorization: Bearer {access_token}" \
-H "x-pd-environment: production"SDK
Run Moodle actions from your backend
Connect a user's Moodle account once, then run Add a Content Item to a User's Favorites on their behalf from your own code — TypeScript, Python, or plain HTTP.
import { PipedreamClient } from "@pipedream/sdk"
const pd = new PipedreamClient({
projectId: process.env.PIPEDREAM_PROJECT_ID!,
clientId: process.env.PIPEDREAM_CLIENT_ID!,
clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
projectEnvironment: "production",
})
const result = await pd.actions.run({
id: "moodle-add-content-item-to-favorites",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
moodle: { authProvisionId: "apn_xxxxxxx" },
courseId: "Course ID",
sectionId: "Section ID",
},
})from pipedream import Pipedream
pd = Pipedream(
client_id="{oauth_client_id}",
client_secret="{oauth_client_secret}",
project_id="{project_id}",
project_environment="production",
)
result = pd.actions.run(
id="moodle-add-content-item-to-favorites",
external_user_id="{external_user_id}", # any stable ID for this user in your system
configured_props={
"moodle": {"authProvisionId": "apn_xxxxxxx"},
"courseId": "Course ID",
"sectionId": "Section ID",
},
)curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
-H "Content-Type: application/json" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}" \
-d '{
"external_user_id": "{external_user_id}",
"id": "moodle-add-content-item-to-favorites",
"configured_props": {
"moodle": { "authProvisionId": "apn_xxxxxxx" },
"courseId": "Course ID",
"sectionId": "Section ID"
}
}'TOOLS
Moodle actions
On-demand operations your product or agent can configure and run on behalf of a connected user.
-
Add a Content Item to a User's Favorites
actionAdds a content item (activity, resource, or subtype) to the user's list of favorites. See the documentationWritev0.0.1 -
Create a Category
actionCreates a new course category in Moodle. See the documentationWritev0.0.1 -
Create a Course
actionCreates a new course in Moodle. See the documentationWritev0.0.1 -
Create a User
actionCreates a new user in Moodle. See the documentationWritev0.0.1 -
Delete a Category
actionDeletes a course category in Moodle. Setting recursive to true will remove all courses and subcategories inside this category. See the documentationWritev0.0.2 -
Delete Courses
actionDeletes one or more existing Moodle courses by ID. See the documentationWritev0.0.1 -
Duplicate a Course
actionDuplicates an existing course, creating a new course with optional settings. See the documentationWritev0.0.1 -
Enroll a User in a Course
actionManually enrolls a user into a specified course with a given role and optional start and end dates. See the documentationWritev0.0.2 -
Get a Course by Field
actionRetrieves courses that match a specific field such as ID, short name, ID number, category, or section ID. See the documentationRead-onlyv0.0.2 -
Get a Course Module
actionRetrieves detailed information about a specific course module using its CMID. See the documentationRead-onlyv0.0.1 -
Get a Course Update
actionChecks if there are any updates affecting the current user in a specified Moodle course since a given timestamp. See the documentationRead-onlyv0.0.1 -
Get Categories
actionRetrieves a list of existing categories with ID and category name. See the documentationRead-onlyv0.0.1 -
Get Course Content
actionRetrieves the sections and modules (activities/resources) inside a course. See the documentationRead-onlyv0.0.1 -
Get Course Content Items
actionFetches all available content items, including activities, resources, and their subtypes, for the activity picker. See the documentationRead-onlyv0.0.1 -
Get Courses
actionReturns course details. If no IDs are provided, returns all courses except the front page. See the documentationRead-onlyv0.0.2 -
Get Enrolled Courses by Timeline Classification
actionReturns a list of courses the current user is enrolled in, filtered by timeline (future, inprogress, or past). See the documentationRead-onlyv0.0.2 -
Get Enrolled Users
actionRetrieves a list of users enrolled in a specific course, including their roles and groups. See the documentationRead-onlyv0.0.1 -
Import Course
actionImports course data from one course into another without user data. See the documentationWritev0.0.1 -
List Category ID Options
actionRetrieves available options for the Category ID field.Read-onlyv0.0.1 -
Log a Course Viewed
actionLogs that a specific course has been viewed by the current user. See the documentationWritev0.0.1 -
Remove a Content Item from Favourites
actionRemoves a specific content item from a user's list of favourites in Moodle. See the documentationWritev0.0.1 -
Search Courses
actionSearches Moodle courses by name, module, block, or tag. See the documentationRead-onlyv0.0.1 -
Search Users
actionSearches for Moodle users that match specific criteria such as username, email, or ID. See the documentationRead-onlyv0.0.1 -
Set Favourite Courses
actionAdds or removes a course from the user's list of favourite courses. See the documentationWritev0.0.1 -
Update a Category
actionUpdates an existing course category's name, ID number, or description. See the documentationWritev0.0.1 -
Update a Course
actionUpdates an existing course in Moodle, including name, summary, and visibility. See the documentationWritev0.0.1 -
Update a User
actionUpdates an existing user's details such as name, email, password, or department. See the documentationWritev0.0.1
No Moodle triggers are available yet.
- App slug
- moodle
- Authentication
- API key
- Categories
- Learning & Education
- Actions
- 27
- Triggers
- 0
- API proxy
- Available