Connectors API
Manage data source connectors programmatically.
List Connectors
Endpoint
GET /v1/connectors
Response
{
"data": [
{
"id": "conn_abc123",
"name": "Engineering Confluence",
"type": "confluence",
"status": "active",
"collection": "col_xyz",
"lastSync": "2024-01-20T14:00:00Z",
"createdAt": "2024-01-15T10:00:00Z"
}
]
}
Create Connector
Endpoint
POST /v1/connectors
Request Body (S3 Example)
{
"name": "Document Storage",
"type": "s3",
"collection": "col_abc123",
"config": {
"bucket": "my-documents",
"region": "us-east-1",
"prefix": "/documents/"
},
"credentials": {
"accessKeyId": "AKIA...",
"secretAccessKey": "..."
}
}
Connector Types
| Type | Config Fields |
|---|---|
s3 | bucket, region, prefix, endpoint |
google_drive | OAuth handled separately |
confluence | instanceUrl, spaceKeys |
github | repos, branch, pathFilter |
slack | channels, dateRange |
notion | OAuth handled separately |
salesforce | objects, soqlFilter |
postgresql | host, port, database, schema |
Get Connector
Endpoint
GET /v1/connectors/{id}
Update Connector
Endpoint
PUT /v1/connectors/{id}
Request Body
{
"name": "Updated Name",
"config": {
"prefix": "/new-prefix/"
}
}
Delete Connector
Endpoint
DELETE /v1/connectors/{id}
Trigger Sync
Endpoint
POST /v1/connectors/{id}/sync
Response
{
"data": {
"jobId": "job_abc123",
"status": "queued",
"startedAt": "2024-01-20T14:00:00Z"
}
}
Get Sync Status
Endpoint
GET /v1/connectors/{id}/sync/{jobId}
Response
{
"data": {
"jobId": "job_abc123",
"status": "running",
"progress": {
"collected": 150,
"parsed": 120,
"indexed": 100
},
"startedAt": "2024-01-20T14:00:00Z"
}
}
OAuth Connectors
For OAuth-based connectors:
Get Auth URL
GET /v1/connectors/oauth/{type}/authorize
Response
{
"data": {
"authUrl": "https://accounts.google.com/o/oauth2/..."
}
}
Complete OAuth
POST /v1/connectors/oauth/{type}/callback
Example Usage
Create S3 Connector
const connector = await client.connectors.create({
name: 'Document Storage',
type: 's3',
collection: 'col_abc123',
config: {
bucket: 'my-docs',
region: 'us-east-1'
},
credentials: {
accessKeyId: process.env.AWS_ACCESS_KEY,
secretAccessKey: process.env.AWS_SECRET_KEY
}
});
Trigger Sync
const job = await client.connectors.sync('conn_abc123');
console.log('Sync started:', job.jobId);
Next Steps
- Webhooks - Real-time updates
- Collections API - Manage collections