Skip to content
Proud to collaborate with Microsoft for Startups

canvas.courses.upload-file ​

Upload a file to the course. This API endpoint is the first step in uploading a file to a course. See the {file:file.file_uploads.html File Upload Documentation} for details on the file upload workflow. Only those with the "Manage Files" permission on a course can upload files to the course. By default, this is Teachers, TAs and Designers.

Upload a file

Overview ​

PropertyValue
Workflow typeAtomic
LibraryApp-canvas
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
base_urlstringYes—Canvas API root, e.g. https://<host>/api
api_tokenstringNo—Bearer token; omit to use the workflow's token env var
course_idstringYes—ID

Output Schema ​

FieldTypeRequiredDefaultDescription
base_urlstringYes—Canvas API root, e.g. https://<host>/api
api_tokenstringNo—Bearer token; omit to use the workflow's token env var
course_idstringYes—ID
status_codeintegerNo—HTTP status code of the completed call
responsejsonNo—Parsed JSON response body
failure_reasonstringNo——
failure_typestringNo——
failed_atstringNo——
failed_stepstringNo——
failed_layerstringNo——
failed_at_statestringNo——
errorstringNo——
error_typestringNo——

States ​

StateInitialTerminalSuccessAuto-advanceDescription
pendingYesNo—executeWaiting to call POST /v1/courses/{course_id}/files
completedNoYesYes—HTTP call succeeded
failedNoYesNo—HTTP call failed

State Diagram ​

Transitions ​

FromActionToDescription
pendingexecutecompletedPerform POST /v1/courses/{course_id}/files
* (any state)failfailedRecord the failure reason

API Usage ​

bash
POST /api/workflows/start
Content-Type: application/json

{
  "workflow_type": "canvas.courses.upload-file",
  "initial_data": {
    "base_url": "value",
    "course_id": "value"
  }
}