Canvas LMS icon

Canvas LMS

Work with Canvas LMS API and receive events

Overview

This node integrates with the Canvas LMS API to manage enrollments within courses. Specifically, the "Enrollment" resource with the "Create" operation allows you to enroll a user into a course with a specified role. This is useful in educational automation workflows where you want to programmatically add users (students, teachers, TAs, etc.) to courses without manual intervention.

Common scenarios:

  • Automatically enrolling new students into a course after registration.
  • Assigning teaching assistants or observers to courses based on external triggers.
  • Managing course roles dynamically as part of an onboarding process.

Practical example:
You could use this node to enroll a user with ID 12345 as a "Student" in a course by specifying their user ID and selecting the "Student" role. This automates the enrollment step in your learning management workflow.

Properties

Name Meaning
User ID The unique identifier of the user to enroll in the course.
Role The role to assign to the user in the course. Options are: Student, Teacher, TA, Observer, Designer.

Output

The node outputs JSON data containing the response from the Canvas API about the created enrollment. The output structure includes a data field which holds the enrollment details returned by the API, such as enrollment ID, user ID, role, and other metadata related to the enrollment.

Example output JSON structure:

{
  "data": {
    "id": "enrollment_id",
    "user_id": "user_id",
    "type": "StudentEnrollment",
    "course_id": "course_id",
    ...
  }
}

No binary data output is produced by this operation.

Dependencies

  • Requires an API key credential for authenticating with the Canvas LMS API.
  • The node expects the Canvas LMS base URL and access token to be configured in the credentials.
  • Network connectivity to the Canvas LMS API endpoint is necessary.

Troubleshooting

  • Common issues:

    • Invalid or missing user ID or role parameters will cause the API call to fail.
    • Insufficient permissions or invalid API credentials can result in authorization errors.
    • If the course ID is not provided or incorrect, enrollment creation will fail.
  • Error messages:

    • Errors from the Canvas API are wrapped and surfaced as node operation errors with messages like Error in "enrollment" operation "create": <API error message>.
    • To resolve, verify that all required fields (User ID, Role, Course ID) are correctly set and that the API credentials have sufficient permissions.
    • Check network connectivity and ensure the Canvas API URL is correct.

Links and References

Discussion