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.
| binding | meaning |
|---|---|
WORLDS_CANVAS_URL | This world's origin followed by /api/v1 |
WORLDS_API_KEY | The world key, accepted wherever Canvas expects a credential |
WORLDS_WORLD_ID | The isolated world's identity |
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
id | integer | Course id |
name | string | Course name |
course_code | string | Short code |
workflow_state | string | unpublished, available, completed |
start_at | datetime | Start date |
total_students | integer | Enrolled 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
id | integer | Enrollment id |
user_id | integer | User |
course_id | integer | Course |
type | string | StudentEnrollment, TeacherEnrollment |
enrollment_state | string | active, invited, completed |
grades | object | Current 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
id | integer | Assignment id |
name | string | Title |
due_at | datetime | Due date |
points_possible | number | Max points |
submission_types | string[] | online_upload, online_text_entry |
published | boolean | Visible 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
id | integer | Submission id |
user_id | integer | Student |
workflow_state | string | submitted, graded, pending_review |
score | number | Score |
grade | string | Grade |
submitted_at | datetime | Submitted 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
id | integer | User id |
name | string | Full name |
sortable_name | string | Last, first |
login_id | string | Login |
email | string |
Test workflow
- Prepare. Select the Canvas setup for your workflow and review its starting records, including courses, enrollments, assignments.
- 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.
- Define. Describe the task, expected final changes and records that must stay untouched. Keep expected outcomes separate from the agent's instructions.
- 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.
# 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
- resubmissionSee 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.
| condition | what the agent sees |
|---|---|
throttled | Requests return 403 Rate Limit Exceeded when the quota runs out |
token-expires | The access token returns 401 halfway through grading |
resubmission | A student resubmits while the agent is grading |
paged-list | Submissions 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.
| Records | Starting setup |
|---|---|
| courses | 3 courses with 2 sections each |
| students | 90 fake students |
| assignments | 24 with due dates, points and rubrics |
| submissions | Across submitted, graded, unsubmitted and late |
| late policy | 10% 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.
| Field | Type | Meaning / relationship |
|---|---|---|
id | integer | Course id |
name | string | Course name |
course_code | string | Short code |
workflow_state | string | unpublished, available, completed |
start_at | datetime | Start date |
total_students | integer | Enrolled students |
{
"id": 1,
"name": "<Course name>",
"course_code": "<Short code>",
"workflow_state": "<unpublished, available, completed>",
"start_at": "<Start date>",
"total_students": 1
}Enrollments records
Enrollments
Students and teachers in a course.
| Field | Type | Meaning / relationship |
|---|---|---|
id | integer | Enrollment id |
user_id | integer | User |
course_id | integer | Course |
type | string | StudentEnrollment, TeacherEnrollment |
enrollment_state | string | active, invited, completed |
grades | object | Current and final score |
{
"id": 1,
"user_id": 1,
"course_id": 1,
"type": "<StudentEnrollment, TeacherEnrollment>",
"enrollment_state": "<active, invited, completed>",
"grades": {}
}Assignments records
Assignments
Graded work in a course.
| Field | Type | Meaning / relationship |
|---|---|---|
id | integer | Assignment id |
name | string | Title |
due_at | datetime | Due date |
points_possible | number | Max points |
submission_types | string[] | online_upload, online_text_entry |
published | boolean | Visible to students |
{
"id": 1,
"name": "<Title>",
"due_at": "<Due date>",
"points_possible": 1,
"submission_types": [],
"published": false
}Submissions records
Submissions
Student work and grades.
| Field | Type | Meaning / relationship |
|---|---|---|
id | integer | Submission id |
user_id | integer | Student |
workflow_state | string | submitted, graded, pending_review |
score | number | Score |
grade | string | Grade |
submitted_at | datetime | Submitted time |
{
"id": 1,
"user_id": 1,
"workflow_state": "<submitted, graded, pending_review>",
"score": 1,
"grade": "<Grade>",
"submitted_at": "<Submitted time>"
}Users records
Users
Account users.
| Field | Type | Meaning / relationship |
|---|---|---|
id | integer | User id |
name | string | Full name |
sortable_name | string | Last, first |
login_id | string | Login |
email | string |
{
"id": 1,
"name": "<Full name>",
"sortable_name": "<Last, first>",
"login_id": "<Login>",
"email": "person@example.test"
}