Create a new component
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'My Study Component',
config: {
model: 'gpt-4o-mini-2024-07-18',
materials: ['<string>'],
folders: ['<string>'],
systemPrompt: '<string>',
temperature: 1,
maxTokens: 123,
enableWebSearch: true,
enableRAGSearch: true,
enableHistory: true,
enableVoice: true,
enableFollowUps: true,
enableComponentCreation: true,
maxSteps: 123,
enableGuardrails: true,
enableMessageGrading: true,
guardrailRules: [
{
id: 'rule-1',
description: 'No direct homework answers',
condition: 'The AI response provides direct answers to homework',
action: 'block',
message: 'I cannot provide direct answers to homework questions.'
}
],
enableReferenceMode: true
},
description: 'A component for studying biology',
metadata: {}
})
};
fetch('https://studyfetchapi.com/api/v1/components', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://studyfetchapi.com/api/v1/components \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "My Study Component",
"config": {
"model": "gpt-4o-mini-2024-07-18",
"materials": [
"<string>"
],
"folders": [
"<string>"
],
"systemPrompt": "<string>",
"temperature": 1,
"maxTokens": 123,
"enableWebSearch": true,
"enableRAGSearch": true,
"enableHistory": true,
"enableVoice": true,
"enableFollowUps": true,
"enableComponentCreation": true,
"maxSteps": 123,
"enableGuardrails": true,
"enableMessageGrading": true,
"guardrailRules": [
{
"id": "rule-1",
"description": "No direct homework answers",
"condition": "The AI response provides direct answers to homework",
"action": "block",
"message": "I cannot provide direct answers to homework questions."
}
],
"enableReferenceMode": true
},
"description": "A component for studying biology",
"metadata": {}
}
'import requests
url = "https://studyfetchapi.com/api/v1/components"
payload = {
"name": "My Study Component",
"config": {
"model": "gpt-4o-mini-2024-07-18",
"materials": ["<string>"],
"folders": ["<string>"],
"systemPrompt": "<string>",
"temperature": 1,
"maxTokens": 123,
"enableWebSearch": True,
"enableRAGSearch": True,
"enableHistory": True,
"enableVoice": True,
"enableFollowUps": True,
"enableComponentCreation": True,
"maxSteps": 123,
"enableGuardrails": True,
"enableMessageGrading": True,
"guardrailRules": [
{
"id": "rule-1",
"description": "No direct homework answers",
"condition": "The AI response provides direct answers to homework",
"action": "block",
"message": "I cannot provide direct answers to homework questions."
}
],
"enableReferenceMode": True
},
"description": "A component for studying biology",
"metadata": {}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"_id": "<string>",
"componentId": "<string>",
"type": "chat",
"name": "<string>",
"organization": "<string>",
"config": {},
"status": "active",
"usage": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"description": "<string>"
}Components
Create a new component
POST
/
api
/
v1
/
components
Create a new component
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'My Study Component',
config: {
model: 'gpt-4o-mini-2024-07-18',
materials: ['<string>'],
folders: ['<string>'],
systemPrompt: '<string>',
temperature: 1,
maxTokens: 123,
enableWebSearch: true,
enableRAGSearch: true,
enableHistory: true,
enableVoice: true,
enableFollowUps: true,
enableComponentCreation: true,
maxSteps: 123,
enableGuardrails: true,
enableMessageGrading: true,
guardrailRules: [
{
id: 'rule-1',
description: 'No direct homework answers',
condition: 'The AI response provides direct answers to homework',
action: 'block',
message: 'I cannot provide direct answers to homework questions.'
}
],
enableReferenceMode: true
},
description: 'A component for studying biology',
metadata: {}
})
};
fetch('https://studyfetchapi.com/api/v1/components', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://studyfetchapi.com/api/v1/components \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "My Study Component",
"config": {
"model": "gpt-4o-mini-2024-07-18",
"materials": [
"<string>"
],
"folders": [
"<string>"
],
"systemPrompt": "<string>",
"temperature": 1,
"maxTokens": 123,
"enableWebSearch": true,
"enableRAGSearch": true,
"enableHistory": true,
"enableVoice": true,
"enableFollowUps": true,
"enableComponentCreation": true,
"maxSteps": 123,
"enableGuardrails": true,
"enableMessageGrading": true,
"guardrailRules": [
{
"id": "rule-1",
"description": "No direct homework answers",
"condition": "The AI response provides direct answers to homework",
"action": "block",
"message": "I cannot provide direct answers to homework questions."
}
],
"enableReferenceMode": true
},
"description": "A component for studying biology",
"metadata": {}
}
'import requests
url = "https://studyfetchapi.com/api/v1/components"
payload = {
"name": "My Study Component",
"config": {
"model": "gpt-4o-mini-2024-07-18",
"materials": ["<string>"],
"folders": ["<string>"],
"systemPrompt": "<string>",
"temperature": 1,
"maxTokens": 123,
"enableWebSearch": True,
"enableRAGSearch": True,
"enableHistory": True,
"enableVoice": True,
"enableFollowUps": True,
"enableComponentCreation": True,
"maxSteps": 123,
"enableGuardrails": True,
"enableMessageGrading": True,
"guardrailRules": [
{
"id": "rule-1",
"description": "No direct homework answers",
"condition": "The AI response provides direct answers to homework",
"action": "block",
"message": "I cannot provide direct answers to homework questions."
}
],
"enableReferenceMode": True
},
"description": "A component for studying biology",
"metadata": {}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"_id": "<string>",
"componentId": "<string>",
"type": "chat",
"name": "<string>",
"organization": "<string>",
"config": {},
"status": "active",
"usage": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"description": "<string>"
}Authorizations
API Key for server-to-server authentication. Resolves to the owning organization.
Body
application/json
Type of component to create
Available options:
chat, data_analyst, flashcards, scenarios, practice_test, audio_recap, tutor_me, explainers, uploads, chat_analytics Name of the component
Example:
"My Study Component"
Component-specific configuration
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
- Option 9
- Option 10
Show child attributes
Show child attributes
Component description
Example:
"A component for studying biology"
Additional metadata
Response
201 - application/json
Component created successfully
Component ID (MongoDB ObjectId)
Unique component identifier
Component type
Available options:
chat, data_analyst, flashcards, scenarios, practice_test, audio_recap, tutor_me, explainers, uploads, chat_analytics Component name
Organization ID
Component configuration
Component status
Available options:
active, inactive, draft Usage statistics
Creation timestamp
Last update timestamp
Component description
Was this page helpful?