Authentication
SourceSync uses API keys to authenticate requests and tenant headers for data isolation.
API Keys
Get your API key by subscribing on our pricing page. After subscription, you'll receive your API key via email. Include it in the Authorization header for all API requests:
Authorization Header
Authorization: Bearer your_api_key
Keep your API key secure and never expose it in client-side code or public repositories.
Tenant Header
SourceSync optionally supports multitenancy through the X-Tenant-ID
header. This header is only required if you need to isolate data between different tenants in your application. When provided, this header ensures automatic data isolation between tenants:
Tenant Header
X-Tenant-ID: tenant-123
Usage Guidelines
-
Format:
- Use URL-safe characters (alphanumeric, hyphens, underscores)
- Keep IDs short but meaningful
- Maximum length: 64 characters
- Example:
tenant-123
,org-456-dept-789
-
Behavior:
- All document operations are automatically scoped to the tenant
- Search results only include documents from the specified tenant
- Document management operations are tenant-isolated
Example Request
curl -X POST "https://api.sourcesync.ai/v1/search" \
-H "Authorization: Bearer $RAGAAS_API_KEY" \
-H "X-Tenant-ID: tenant-123" \
-H "Content-Type: application/json" \
-d '{
"query": "security policy",
"namespaceId": "shared-namespace"
}'
Making Requests
Example of an authenticated request:
curl -X GET "https://api.sourcesync.ai/v1/ingest-job-runs/ijr_abc123?namespaceId=ns_abc123" \
-H "Authorization: Bearer $RAGAAS_API_KEY"
Error Responses
Status Code | Description |
---|---|
401 | Invalid or missing API key |
403 | Valid key but insufficient permissions |
429 | Rate limit exceeded |
Rate Limits
The API has the following rate limits:
Plan | Rate Limit |
---|---|
Pilot | ~50 requests per minute |
Pro | ~200 requests per minute |
Team | ~500 requests per minute |
Enterprise | Custom limits |
Rate limit headers are included in all responses:
Response Headers
X-RateLimit-Limit: 200 # Your current rate limit
X-RateLimit-Remaining: 199 # Requests remaining
X-RateLimit-Reset: 1640995200 # Timestamp when limit resets