Create data source
POST
/api/sources
const url = 'https://firma.company-gpt.com/companygpt/rag/api/api/sources';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","type":"webcrawl","config":{},"enabled":true,"syncSchedule":"hourly","collectionId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://firma.company-gpt.com/companygpt/rag/api/api/sources \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "type": "webcrawl", "config": {}, "enabled": true, "syncSchedule": "hourly", "collectionId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'Configure a new data source (webcrawl, SharePoint, Nextcloud or Git)
Authorizations
Abschnitt betitelt „Authorizations“Request Bodyrequired
Abschnitt betitelt „Request Bodyrequired“Media typeapplication/json
object
name
required
string
type
required
JSON key is “type”; not supported combined with syncSchedule for “sharepoint” sources
string
config
object
key
additional properties
any
enabled
boolean
syncSchedule
Not supported for “sharepoint” sources
string
collectionId
string format: uuid
Responses
Abschnitt betitelt „Responses“Source created
Media typeapplication/json
Data source configuration (database.SourceConfig)
object
id
required
string format: uuid
name
required
string
sourceType
required
string
config
required
Source-specific configuration
object
key
additional properties
any
enabled
required
boolean
syncSchedule
string
collectionId
string format: uuid
createdBy
string format: uuid
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
lastSyncAt
string format: date-time
Example
{ "sourceType": "webcrawl", "syncSchedule": "hourly"}Invalid request (missing/invalid name or type, or syncSchedule not supported for sharepoint)
Media typeapplication/json
object
error
required
Error message
string
Examplegenerated
{ "error": "example"}Unauthorized