Skip to main content

API Reference

This document provides a comprehensive reference for all REST API endpoints in Jet Admin.

Base URL

All API V1 routes are prefixed with /api/v1.

Production: https://your-domain.com/api/v1
Development: http://localhost:4000/api/v1

Authentication

Most endpoints require a Bearer token in the Authorization header:

Authorization: Bearer <FIREBASE_ID_TOKEN>

Additionally, tenant-scoped endpoints require a tenant context header:

x-tenant-id: <TENANT_UUID>

Auth Module

Base path: /api/v1/auth

MethodEndpointDescriptionAuth Required
GET/Get current user info
GET/config/:tenantIDGet user configuration for a tenant
POST/config/:tenantIDUpdate user configuration

Tenant Module

Base path: /api/v1/tenants

MethodEndpointDescriptionPermission
GET/List all tenants for current userAuthenticated
POST/Create a new tenantAuthenticated
GET/:tenantIDGet tenant detailstenant:read
PATCH/:tenantIDUpdate tenanttenant:update

Workflow Module

Base path: /api/v1/tenants/:tenantID/workflows

MethodEndpointDescriptionPermission
GET/List all workflowsworkflow:list
POST/Create a new workflowworkflow:create
GET/:workflowIDGet workflow detailsworkflow:read
PATCH/:workflowIDUpdate workflowworkflow:update
DELETE/:workflowIDDelete workflowworkflow:delete
POST/:workflowID/executeExecute workflow (async)workflow:execute
POST/testTest run without savingworkflow:execute
GET/instances/:instanceIDGet run statusworkflow:read
DELETE/instances/:instanceID/stopStop a running instanceworkflow:execute

Datasource Module

Base path: /api/v1/tenants/:tenantID/datasources

MethodEndpointDescriptionPermission
GET/List all datasourcesdatasource:list
POST/Create a new datasourcedatasource:create
GET/:datasourceIDGet datasource detailsdatasource:read
PATCH/:datasourceIDUpdate datasourcedatasource:update
DELETE/:datasourceIDDelete datasourcedatasource:delete
POST/testTest connection (without saving)datasource:test
POST/:datasourceID/cloneClone a datasourcedatasource:clone

Data Query Module

Base path: /api/v1/tenants/:tenantID/data-queries

MethodEndpointDescriptionPermission
GET/List all data queriesdataquery:list
POST/Create a new querydataquery:create
GET/:queryIDGet query detailsdataquery:read
PATCH/:queryIDUpdate querydataquery:update
DELETE/:queryIDDelete querydataquery:delete
POST/:queryID/executeExecute querydataquery:execute

Widget Module

Base path: /api/v1/tenants/:tenantID/widgets

MethodEndpointDescriptionPermission
GET/List all widgetswidget:list
POST/Create a new widgetwidget:create
GET/:widgetIDGet widget detailswidget:read
PATCH/:widgetIDUpdate widgetwidget:update
DELETE/:widgetIDDelete widgetwidget:delete

Dashboard Module

Base path: /api/v1/tenants/:tenantID/dashboards

MethodEndpointDescriptionPermission
GET/List all dashboardsdashboard:list
POST/Create a new dashboarddashboard:create
GET/:dashboardIDGet dashboard with widgetsdashboard:read
PATCH/:dashboardIDUpdate dashboard layoutdashboard:update
DELETE/:dashboardIDDelete dashboarddashboard:delete

Error Responses

All API errors follow a consistent format:

{
"error": {
"code": "ERROR_CODE",
"message": "Human-readable error message"
}
}

Common Error Codes

CodeHTTP StatusDescription
PERMISSION_DENIED403User lacks required permission
INVALID_REQUEST400Malformed request or validation error
INVALID_TENANT400Invalid or missing tenant context
USER_AUTH_TOKEN_EXPIRED401Firebase token has expired
SERVER_ERROR500Internal server error