API Reference
Zingle exposes a RESTful API built on FastAPI. All endpoints are prefixed with /api/v1 and require authentication via JWT bearer tokens.
Authentication
| Method | Endpoint | Description |
|---|---|---|
POST | /api/v1/auth/signup | Create a new user account |
POST | /api/v1/auth/login | Authenticate and receive JWT tokens |
POST | /api/v1/auth/refresh | Refresh an expired access token |
POST | /api/v1/auth/logout | Invalidate the current session |
GET | /api/v1/auth/me | Get the authenticated user's profile |
GET | /api/v1/auth/token | Get current token details |
GitHub OAuth
| Method | Endpoint | Description |
|---|---|---|
GET | /api/v1/auth/github/authorize-url | Get the GitHub OAuth authorization URL |
POST | /api/v1/auth/github/callback | Exchange GitHub OAuth code for access token |
Repositories
| Method | Endpoint | Description |
|---|---|---|
GET | /api/v1/repositories | List all connected repositories |
GET | /api/v1/repositories/available | List available repositories for connection |
GET | /api/v1/repositories/branches | List branches for a repository |
POST | /api/v1/repositories/connect | Connect a new repository |
GET | /api/v1/repositories/sync-status | Get sync status for a repository |
POST | /api/v1/repositories/sync | Trigger a repository re-sync |
DELETE | /api/v1/repositories/{id} | Disconnect a repository |
Connections
Snowflake
| Method | Endpoint | Description |
|---|---|---|
GET | /api/v1/connections/snowflake | Get current Snowflake connection details |
POST | /api/v1/connections/snowflake | Create or update Snowflake connection |
DELETE | /api/v1/connections/snowflake | Disconnect Snowflake |
Airflow
| Method | Endpoint | Description |
|---|---|---|
GET | /api/v1/connections/airflow | Get current Airflow connection details |
POST | /api/v1/connections/airflow | Create or update Airflow connection |
DELETE | /api/v1/connections/airflow | Disconnect Airflow |
Data Pipelines (Models)
| Method | Endpoint | Description |
|---|---|---|
POST | /api/v1/models/create-pr | Create a GitHub PR for model changes |
Request body
{
"repo_id": "string",
"model_name": "string",
"sql_content": "string",
"yaml_content": "string",
"test_content": "string"
}
The endpoint validates the repository belongs to the current workspace and retrieves the stored GitHub access token before creating the PR.
Semantic Layer
| Method | Endpoint | Description |
|---|---|---|
POST | /api/v1/semantic-layer/create-pr | Create a GitHub PR for semantic layer changes |
Creates or updates YAML semantic definitions in the connected repository.
Compute Engine
| Method | Endpoint | Description |
|---|---|---|
POST | /api/v1/compute-engine/pipelines/{pipeline_id}/create-pr | Create a PR for compute optimization |
Applies a compute engine change suggestion to a specific pipeline via pull request.
Data Model Optimization
| Method | Endpoint | Description |
|---|---|---|
POST | /api/v1/manage-model/merge/{opportunity_id}/create-pr | Create a PR for model merge optimization |
Consolidates duplicate model logic into a single model via pull request.
Workspace Settings
| Method | Endpoint | Description |
|---|---|---|
GET | /api/v1/settings | Retrieve current workspace settings |
PUT | /api/v1/settings | Update workspace settings (supports partial updates) |
Error responses
All error responses follow a consistent format:
{
"detail": {
"error_code": "SNOWFLAKE_AUTH_FAILED",
"message": "Authentication failed for the provided credentials"
}
}
Common error codes
| Code | Description |
|---|---|
ACCESS_TOKEN_REQUIRED | GitHub access token not found on the connection |
REPO_NOT_FOUND | Repository doesn't belong to the workspace |
SNOWFLAKE_AUTH_FAILED | Snowflake credential validation failed |
SNOWFLAKE_INVALID_ACCOUNT | Snowflake account identifier is incorrect |
SNOWFLAKE_RESOURCE_NOT_FOUND | Warehouse, database, or schema not found |
SNOWFLAKE_CONNECTION_TIMEOUT | Connection to Snowflake timed out (30s limit) |
AIRFLOW_TIMEOUT | Airflow API did not respond in time |
AIRFLOW_CONNECTION_FAILED | Could not reach the Airflow instance |