Create a new material
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Chapter 1 - Introduction',
content: {text: '<string>', url: '<string>', sourceUrl: '<string>'},
folderId: '<string>',
references: [{title: 'Understanding Photosynthesis', url: 'https://example.com/article'}]
})
};
fetch('https://studyfetchapi.com/api/v1/materials', 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 \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "Chapter 1 - Introduction",
"content": {
"text": "<string>",
"url": "<string>",
"sourceUrl": "<string>"
},
"folderId": "<string>",
"references": [
{
"title": "Understanding Photosynthesis",
"url": "https://example.com/article"
}
]
}
'import requests
url = "https://studyfetchapi.com/api/v1/materials"
payload = {
"name": "Chapter 1 - Introduction",
"content": {
"text": "<string>",
"url": "<string>",
"sourceUrl": "<string>"
},
"folderId": "<string>",
"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){
"_id": "<string>",
"name": "<string>",
"organizationId": "<string>",
"folderId": "<string>",
"contentType": "text",
"content": {
"text": "<string>",
"url": "<string>",
"s3Key": "<string>",
"s3Url": "<string>",
"filename": "<string>",
"fileSize": 123,
"mimeType": "<string>"
},
"status": "active",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"metadata": {},
"usage": {},
"references": [
{
"title": "Understanding Photosynthesis",
"url": "https://example.com/article"
}
]
}Materials
Create a new material
POST
/
api
/
v1
/
materials
Create a new material
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Chapter 1 - Introduction',
content: {text: '<string>', url: '<string>', sourceUrl: '<string>'},
folderId: '<string>',
references: [{title: 'Understanding Photosynthesis', url: 'https://example.com/article'}]
})
};
fetch('https://studyfetchapi.com/api/v1/materials', 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 \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "Chapter 1 - Introduction",
"content": {
"text": "<string>",
"url": "<string>",
"sourceUrl": "<string>"
},
"folderId": "<string>",
"references": [
{
"title": "Understanding Photosynthesis",
"url": "https://example.com/article"
}
]
}
'import requests
url = "https://studyfetchapi.com/api/v1/materials"
payload = {
"name": "Chapter 1 - Introduction",
"content": {
"text": "<string>",
"url": "<string>",
"sourceUrl": "<string>"
},
"folderId": "<string>",
"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){
"_id": "<string>",
"name": "<string>",
"organizationId": "<string>",
"folderId": "<string>",
"contentType": "text",
"content": {
"text": "<string>",
"url": "<string>",
"s3Key": "<string>",
"s3Url": "<string>",
"filename": "<string>",
"fileSize": 123,
"mimeType": "<string>"
},
"status": "active",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"metadata": {},
"usage": {},
"references": [
{
"title": "Understanding Photosynthesis",
"url": "https://example.com/article"
}
]
}Authorizations
API Key for server-to-server authentication. Resolves to the owning organization.
Body
application/json
Response
Material created successfully
Material ID
Material name
Organization ID
Folder ID
Content type
Available options:
text, pdf, video, audio, image, epub Material content
Show child attributes
Show child attributes
Material status
Available options:
active, processing, pending_upload, error, deleted Creation timestamp
Last update timestamp
Material metadata
Usage information
References that this material cites
Show child attributes
Show child attributes
Was this page helpful?