Closed beta · run Worlds on your machineBrowse worlds →
Docs menu · Canvas API

Worlds / Education

Canvas API

A local Canvas LMS with courses, sections, assignments, submissions, the gradebook and late policies. Test the teaching assistant agent that grades, applies late penalties and posts grades.

Base path
/api/v1
Auth
OAuth 2.0 bearer token or access token, the world key
Endpoints
17
Status
Active today

This reference previews the surface the Canvas world serves in the closed beta. Paths mirror the public Canvas API; the exact subset is confirmed when your workflow is scoped.

Connect

The run gives your agent these bindings. Keep your SDK; change only where it sends requests.

bindingmeaning
WORLDS_CANVAS_URLThis world's origin followed by /api/v1
WORLDS_API_KEYThe world key, accepted wherever Canvas expects a credential
WORLDS_WORLD_IDThe isolated world's identity
js · fetch
const base = process.env.WORLDS_CANVAS_URL + "/api/v1";

const res = await fetch(base + "/courses?enrollment_state=active&include[]=total_students", {
  headers: { Authorization: "Bearer " + process.env.WORLDS_API_KEY },
});

const courses = await res.json();
console.log(courses[0].name);

API reference

Courses

Course shells and their settings.

  • GET/api/v1/coursesList courses
  • GET/api/v1/courses/{id}Get a course
  • POST/api/v1/accounts/{account_id}/coursesCreate a course
  • PUT/api/v1/courses/{id}Update a course
Fields · 6
idintegerCourse id
namestringCourse name
course_codestringShort code
workflow_statestringunpublished, available, completed
start_atdatetimeStart date
total_studentsintegerEnrolled students

Enrollments

Students and teachers in a course.

  • GET/api/v1/courses/{course_id}/enrollmentsList course enrollments
  • POST/api/v1/courses/{course_id}/enrollmentsEnroll a user
  • DELETE/api/v1/courses/{course_id}/enrollments/{id}Conclude or delete an enrollment
Fields · 6
idintegerEnrollment id
user_idintegerUser
course_idintegerCourse
typestringStudentEnrollment, TeacherEnrollment
enrollment_statestringactive, invited, completed
gradesobjectCurrent and final score

Assignments

Graded work in a course.

  • GET/api/v1/courses/{course_id}/assignmentsList assignments
  • GET/api/v1/courses/{course_id}/assignments/{id}Get an assignment
  • POST/api/v1/courses/{course_id}/assignmentsCreate an assignment
  • PUT/api/v1/courses/{course_id}/assignments/{id}Update an assignment
Fields · 6
idintegerAssignment id
namestringTitle
due_atdatetimeDue date
points_possiblenumberMax points
submission_typesstring[]online_upload, online_text_entry
publishedbooleanVisible to students

Submissions

Student work and grades.

  • GET/api/v1/courses/{course_id}/assignments/{assignment_id}/submissionsList submissions
  • GET/api/v1/courses/{course_id}/assignments/{assignment_id}/submissions/{user_id}Get a submission
  • PUT/api/v1/courses/{course_id}/assignments/{assignment_id}/submissions/{user_id}Grade a submission
Fields · 6
idintegerSubmission id
user_idintegerStudent
workflow_statestringsubmitted, graded, pending_review
scorenumberScore
gradestringGrade
submitted_atdatetimeSubmitted time

Users

Account users.

  • GET/api/v1/accounts/{account_id}/usersList account users
  • GET/api/v1/users/{id}Show a user
  • POST/api/v1/accounts/{account_id}/usersCreate a user
Fields · 5
idintegerUser id
namestringFull name
sortable_namestringLast, first
login_idstringLogin
emailstringEmail

Test workflow

  1. Prepare. Select the Canvas setup for your workflow and review its starting records, including courses, enrollments, assignments.
  2. Connect. Configure your agent with this world's URL and key using the SDK example. Check that it reaches the intended API before running a test.
  3. Define. Describe the task, expected final changes and records that must stay untouched. Keep expected outcomes separate from the agent's instructions.
  4. Run and inspect. Use the dashboard or your workflow's generated CLI setup. Review final records and changes, then rerun from the same starting setup with the relevant failure conditions. Use Deployment and CI to automate the same workflow.

What to verify

  • Sample, Avery graded 18 out of 20
  • Test, Blake penalized 10% for one day late
  • Demo, Casey graded with no late penalty
  • Grades not posted while Placeholder, Eli is ungraded
  • Example, Drew still marked missing

Test file

A task file names the jobs, the policy your agent is given and what the grader reads back from the world's final state. The agent never sees the expected outcomes.

yaml · worlds/tasks.yaml
# worlds/tasks.yaml · Canvas
version: 2
connector: canvas
seed: canvas-starter
mode: isolated
policy: >
  Grade Lab Report 3. Score each submission with the rubric, take 10% per day
  late unless the student has an extension, and hold posting until every
  submission is graded.
tasks:
  - id: grade-submissions-with-the-rubric-and-leave-comments
    prompt: Grade submissions with the rubric and leave comments
  - id: apply-late-policy-and-excuse-approved-extensions
    prompt: Apply late policy and excuse approved extensions
  - id: post-grades-when-the-assignment-is-ready
    prompt: Post grades when the assignment is ready
expected:
  - "Sample, Avery graded 18 out of 20"
  - "Test, Blake penalized 10% for one day late"
  - "Demo, Casey graded with no late penalty"
  - "Grades not posted while Placeholder, Eli is ungraded"
  - "Example, Drew still marked missing"
scenarios:
  - throttled
  - token-expires
  - resubmission

See Tasks and outcomes for every field, and Deployment and CI to run the file on every pull request.

Failure conditions

Each one fires before the handler, at the same step on every run.

conditionwhat the agent sees
throttledRequests return 403 Rate Limit Exceeded when the quota runs out
token-expiresThe access token returns 401 halfway through grading
resubmissionA student resubmits while the agent is grading
paged-listSubmissions come back in pages the agent must follow

Starting data

Start each run from the same records and relationships. The overview below describes the Canvas starter; use the setup supplied for your workflow when preparing your own snapshot.

RecordsStarting setup
courses3 courses with 2 sections each
students90 fake students
assignments24 with due dates, points and rubrics
submissionsAcross submitted, graded, unsubmitted and late
late policy10% per day, extensions recorded per student

The record shapes below reuse this world's API field definitions. They show illustrative values and placeholders, not an importable seed. API responses and seed input can differ; include all required records and references in the accepted import format for your workflow.

Courses records

Courses

Course shells and their settings.

FieldTypeMeaning / relationship
idintegerCourse id
namestringCourse name
course_codestringShort code
workflow_statestringunpublished, available, completed
start_atdatetimeStart date
total_studentsintegerEnrolled students
json · illustrative record shape
{
  "id": 1,
  "name": "<Course name>",
  "course_code": "<Short code>",
  "workflow_state": "<unpublished, available, completed>",
  "start_at": "<Start date>",
  "total_students": 1
}

See courses operations

Enrollments records

Enrollments

Students and teachers in a course.

FieldTypeMeaning / relationship
idintegerEnrollment id
user_idintegerUser
course_idintegerCourse
typestringStudentEnrollment, TeacherEnrollment
enrollment_statestringactive, invited, completed
gradesobjectCurrent and final score
json · illustrative record shape
{
  "id": 1,
  "user_id": 1,
  "course_id": 1,
  "type": "<StudentEnrollment, TeacherEnrollment>",
  "enrollment_state": "<active, invited, completed>",
  "grades": {}
}

See enrollments operations

Assignments records

Assignments

Graded work in a course.

FieldTypeMeaning / relationship
idintegerAssignment id
namestringTitle
due_atdatetimeDue date
points_possiblenumberMax points
submission_typesstring[]online_upload, online_text_entry
publishedbooleanVisible to students
json · illustrative record shape
{
  "id": 1,
  "name": "<Title>",
  "due_at": "<Due date>",
  "points_possible": 1,
  "submission_types": [],
  "published": false
}

See assignments operations

Submissions records

Submissions

Student work and grades.

FieldTypeMeaning / relationship
idintegerSubmission id
user_idintegerStudent
workflow_statestringsubmitted, graded, pending_review
scorenumberScore
gradestringGrade
submitted_atdatetimeSubmitted time
json · illustrative record shape
{
  "id": 1,
  "user_id": 1,
  "workflow_state": "<submitted, graded, pending_review>",
  "score": 1,
  "grade": "<Grade>",
  "submitted_at": "<Submitted time>"
}

See submissions operations

Users records

Users

Account users.

FieldTypeMeaning / relationship
idintegerUser id
namestringFull name
sortable_namestringLast, first
login_idstringLogin
emailstringEmail
json · illustrative record shape
{
  "id": 1,
  "name": "<Full name>",
  "sortable_name": "<Last, first>",
  "login_id": "<Login>",
  "email": "person@example.test"
}

See users operations

See the Canvas world in the catalog