Zum Inhalt springen

Create data source

POST
/api/sources
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)

Media typeapplication/json
object
name
required
string
type
required

JSON key is “type”; not supported combined with syncSchedule for “sharepoint” sources

string
Allowed values: webcrawl sharepoint nextcloud git
config
object
key
additional properties
any
enabled
boolean
syncSchedule

Not supported for “sharepoint” sources

string
nullable
Allowed values: hourly daily weekly
collectionId
string format: uuid
nullable

Source created

Media typeapplication/json

Data source configuration (database.SourceConfig)

object
id
required
string format: uuid
name
required
string
sourceType
required
string
Allowed values: webcrawl sharepoint nextcloud git
config
required

Source-specific configuration

object
key
additional properties
any
enabled
required
boolean
syncSchedule
string
nullable
Allowed values: hourly daily weekly
collectionId
string format: uuid
nullable
createdBy
string format: uuid
nullable
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
lastSyncAt
string format: date-time
nullable
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