API Overview
The Datalinx AI REST API provides programmatic access to all platform capabilities. Use the API to automate workflows, integrate with external systems, and build custom applications.
Auto-generated from codebase analysis
Base URL
https://your-instance.datalinx.ai/api
For self-hosted deployments, replace with your instance URL.
Authentication
All API requests require authentication. Datalinx AI supports two authentication methods:
Bearer Token (Users)
For user-initiated requests, use JWT bearer tokens:
curl -X GET "https://your-instance.datalinx.ai/api/workspaces" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
Obtain a token by authenticating:
curl -X POST "https://your-instance.datalinx.ai/api/auth/login" \
-H "Content-Type: application/json" \
-d '{"email": "user@example.com", "password": "your-password"}'
Response:
{
"access_token": "eyJhbGciOiJIUzI1NiIs...",
"token_type": "bearer",
"expires_in": 3600
}
API Key (Service Accounts)
For automated systems, use API keys:
curl -X GET "https://your-instance.datalinx.ai/api/workspaces" \
-H "X-API-Key: YOUR_API_KEY"
Request Format
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes* | Bearer token for user auth |
X-API-Key | Yes* | API key for service account auth |
Content-Type | For POST/PUT | Always application/json |
X-Workspace | Sometimes | Workspace name for workspace-scoped operations |
*One of Authorization or X-API-Key is required.
Request Body
POST and PUT requests accept JSON bodies:
{
"name": "my-workspace",
"config": {
"description": "Production workspace"
}
}
Response Format
All responses are JSON:
Success Response
{
"status": "success",
"data": {
"id": "ws_123",
"name": "my-workspace",
"created_at": "2024-01-15T10:30:00Z"
}
}
Error Response
{
"status": "failed",
"message": "Workspace not found",
"error_code": "WORKSPACE_NOT_FOUND"
}
HTTP Status Codes
| Code | Meaning |
|---|---|
200 | Success |
201 | Created |
400 | Bad Request - Invalid input |
401 | Unauthorized - Invalid/missing credentials |
403 | Forbidden - Insufficient permissions |
404 | Not Found |
422 | Validation Error |
429 | Rate Limited |
500 | Internal Server Error |
Pagination
List endpoints support pagination:
GET /api/mappings?page=1&page_size=50
Response includes pagination metadata:
{
"status": "success",
"data": [...],
"pagination": {
"page": 1,
"page_size": 50,
"total_items": 150,
"total_pages": 3
}
}
Rate Limiting
API requests are rate limited per organization:
| Tier | Requests/Minute | Burst |
|---|---|---|
| Free | 60 | 10 |
| Pro | 300 | 50 |
| Enterprise | 1000+ | Custom |
Rate limit headers:
X-RateLimit-Limit: 300
X-RateLimit-Remaining: 295
X-RateLimit-Reset: 1705320000
API Categories
Core APIs
- Workspaces - Manage workspaces
- Sources - Configure data sources
- Schemas - Manage schema definitions
- Mappings - Create and manage mappings
- Pipelines - Execute data pipelines
Administration APIs
- Users - User management
- Roles - Role and permission management
- Organizations - Organization settings
- Service Accounts - API access management
Analytics APIs
- Analytics - Run analytics queries
- Audiences - Manage audience segments
- Queries - Saved query management
Monitoring APIs
- Monitoring - Monitoring configuration
- Alerts - Alert management
SDK and Tools
Python SDK (Coming Soon)
from datalinx import Datalinx AI
client = Datalinx AI(api_key="YOUR_API_KEY")
workspaces = client.workspaces.list()
CLI Tool (Coming Soon)
datalinx workspaces list
datalinx pipeline run --workspace production
Webhooks
Datalinx AI can send webhooks for events:
{
"event": "pipeline.completed",
"workspace": "production",
"pipeline_id": "pl_123",
"status": "success",
"timestamp": "2024-01-15T10:30:00Z"
}
Configure webhooks in workspace settings.
API Versioning
The current API version is v1. Version is implicit in the URL structure.
Future versions will use explicit versioning:
/api/v2/workspaces
Breaking changes will only occur in new major versions.
OpenAPI Specification
Download the OpenAPI specification:
curl https://your-instance.datalinx.ai/api/openapi.json
Use with tools like Swagger UI or Postman for interactive exploration.
Next Steps
- Authentication - Detailed authentication guide
- Workspaces API - Start managing workspaces
- Error Reference - Error code details