Skip to main content
POST
/
api
/
v1
/
materials
/
batch
Create batch upload URLs for multiple materials
const url = 'https://studyfetchapi.com/api/v1/materials/batch';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
  body: '{"materials":[{"name":"Chapter 1","filename":"document.pdf","contentType":"application/pdf","folderId":"<string>"}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
[
  {
    "name": "<string>",
    "uploadUrl": "<string>",
    "s3Key": "<string>",
    "materialId": "<string>"
  }
]

Authorizations

x-api-key
string
header
required

API Key for authentication

Body

application/json
materials
object[]
required

Array of materials to create

Response

Batch upload URLs created successfully

name
string
required

Material name

uploadUrl
string
required

Presigned upload URL

s3Key
string
required

S3 key

materialId
string
required

Material ID

I