Get presigned URL for direct S3 upload
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
filename: 'document.pdf',
contentType: 'application/pdf',
name: 'Chapter 1 Notes',
folderId: '<string>',
extractImages: true,
references: [{title: 'Understanding Photosynthesis', url: 'https://example.com/article'}]
})
};
fetch('https://studyfetchapi.com/api/v1/materials/upload/presigned-url', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://studyfetchapi.com/api/v1/materials/upload/presigned-url \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"filename": "document.pdf",
"contentType": "application/pdf",
"name": "Chapter 1 Notes",
"folderId": "<string>",
"extractImages": true,
"references": [
{
"title": "Understanding Photosynthesis",
"url": "https://example.com/article"
}
]
}
'import requests
url = "https://studyfetchapi.com/api/v1/materials/upload/presigned-url"
payload = {
"filename": "document.pdf",
"contentType": "application/pdf",
"name": "Chapter 1 Notes",
"folderId": "<string>",
"extractImages": True,
"references": [
{
"title": "Understanding Photosynthesis",
"url": "https://example.com/article"
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"uploadUrl": "<string>",
"s3Key": "<string>",
"materialId": "<string>"
}Materials
Get presigned URL for direct S3 upload
POST
/
api
/
v1
/
materials
/
upload
/
presigned-url
Get presigned URL for direct S3 upload
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
filename: 'document.pdf',
contentType: 'application/pdf',
name: 'Chapter 1 Notes',
folderId: '<string>',
extractImages: true,
references: [{title: 'Understanding Photosynthesis', url: 'https://example.com/article'}]
})
};
fetch('https://studyfetchapi.com/api/v1/materials/upload/presigned-url', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://studyfetchapi.com/api/v1/materials/upload/presigned-url \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"filename": "document.pdf",
"contentType": "application/pdf",
"name": "Chapter 1 Notes",
"folderId": "<string>",
"extractImages": true,
"references": [
{
"title": "Understanding Photosynthesis",
"url": "https://example.com/article"
}
]
}
'import requests
url = "https://studyfetchapi.com/api/v1/materials/upload/presigned-url"
payload = {
"filename": "document.pdf",
"contentType": "application/pdf",
"name": "Chapter 1 Notes",
"folderId": "<string>",
"extractImages": True,
"references": [
{
"title": "Understanding Photosynthesis",
"url": "https://example.com/article"
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"uploadUrl": "<string>",
"s3Key": "<string>",
"materialId": "<string>"
}Authorizations
API Key for server-to-server authentication. Resolves to the owning organization.
Body
application/json
Filename to upload
Example:
"document.pdf"
MIME type of the file
Example:
"application/pdf"
Display name for the material
Example:
"Chapter 1 Notes"
Folder ID to place the material in
Whether to extract images from files
Example:
true
References that this material cites
Show child attributes
Show child attributes
Was this page helpful?