For Developers
Create File
POST https://ed.link/api/v2/graph/classes/:class_id/files
Upload a new File to be associated with a Class.
Request Parameters
Parameter | Type | Description |
---|---|---|
class_id | string | The UUID of the desired Class. |
The following fields are allowed: title
, description
, data
, size
.
The following fields are required: title
, data
.
Request Body
Required field details:
title
is typically the filename, but can be any alphanumeric string. We recommend avoiding emojis, and other esoteric UTF-8 codepoints, since not all underlying LMSs will accept "strange" names.data
a Uint8Array of the file contents.
See our guide on Uploading Files to learn how to generate the data
array from a file.
Uploading Files
Developer Guide
Click to Read
Optional field details:
size
must be a number matching the number of bytes indata
(i.e. the length of thedata
array). Ifsize
does not match thedata
, we will issue a warning and ignore thesize
field.description
is ignored by most LMSs but can be any string you like for the LMSs that support it.
To send a sample plain text file with the contents of hello
the json payload would look like:
{
"title": "mysamplefile.txt",
"size": 5,
"data": [104, 101, 108, 108, 111]
}
Sample Request
axios.post(
`https://ed.link/api/v2/graph/classes/${class_id}/files`,
{
title: 'mysamplefile.txt',
size: 5,
data: [104, 101, 108, 108, 111]
},
{
headers: {
authorization: `Bearer ${integration_access_token}`
}
}
);
Response Data
On success, this endpoint returns a normal File object.
{
"$request": "00000000-0000-0000-0000-000000000000",
"$data": {
"type": "file",
"title": "mysamplefile.txt",
"description": "",
"url": "https://ed.link/api/v2/graph/classes/11111111-1111-1111-1111-111111111111/files/22222222-2222-2222-2222-222222222222/download",
"size": 5,
"thumbnail_url": null,
"created_date": "2025-07-21T20:02:32.000Z",
"updated_date": "2025-07-21T20:02:32.000Z",
"share_mode": "view",
"identifiers": [
{
"type": "canvas_id",
"value": "123"
}
],
"rule_ids": [],
"references": {},
"id": "22222222-2222-2222-2222-222222222222"
}
}
Supported Providers
- canvas
- schoology