Skip to content

Backend Routes

API endpoint definitions - REST API and WebSocket route configurations.


The backend exposes two types of routes:

  1. REST API Routes (api.go) - HTTP endpoints for CRUD operations
  2. Channel Routes (channels.go) - WebSocket endpoints for real-time communication

FilePurpose
routes/api.goREST API endpoints
routes/channels.goWebSocket endpoints

graph TD
A["/api"] --> B["/api/2.0/webcomponent"]
A --> C["/api/1.0/tenants/{tenantId}"]
B --> D[WebComponent Auth]
C --> E[JWT + Tenant Auth]

No authentication required:

MethodEndpointControllerDescription
ANY/webhook/{tenantId}/{webhookUuid}WebhookCompanyExecutionCompany webhook
ANY/webhook/{webhookUuid}HandleAccountWebhookAccount webhook
GET/oauth/callbackHandleOAuth2CallbackOAuth2 callback

WebComponent Routes (/api/2.0/webcomponent)

Section titled “WebComponent Routes (/api/2.0/webcomponent)”

Authenticated via WebComponent middleware:

Connections:

MethodEndpointController
POST/connectionsNewAttempt
GET/connections/{attemptId}/testTestConnection
GET/connections/{connectionId}/checkCheckConnection
GET/connections/{connectionId}GetConnection

Integrations:

MethodEndpointController
GET/integrations/{integrationId}/boardGetIntegrationBoard
POST/integrationsInstallIntegration
PUT/integrations/{integrationId}UpdateIntegration
POST/integrations/{integrationId}/executeExecuteIntegration

Flows:

MethodEndpointController
GET/flows/{flowId}FindAccountFlow
POST/flowsNewAccountFlow
PUT/flows/{flowId}UpdateAccountFlow
DELETE/flows/{flowId}DeleteAccountFlow
GET/flows/{flowId}/intentAccountIntentExecution
GET/flows-schemasListAccountFlowsWithSchemas

Flow Version Control:

MethodEndpointController
GET/flows/{flowId}/commitsListAccountFlowCommits
POST/flows/{flowId}/commitsNewAccountFlowCommit
GET/flows/{flowId}/commits/{hash}GetAccountFlowCommit
GET/flows/{flowId}/branchesListAccountFlowBranches
POST/flows/{flowId}/branchesNewAccountFlowBranch
POST/flows/{flowId}/checkoutCheckoutAccountFlow
POST/flows/{flowId}/restoreRestoreAccountFlow

Data Storage:

MethodEndpointController
GET/data-storeListDataStores
POST/data-storeNewDataStore
PUT/data-store/{dataStoreId}UpdateDataStore
GET/data-store/{dataStoreId}/contentGetDataStoreContent
GET/data-structureListDataStructures
POST/data-structureNewDataStructure
PUT/data-structure/{dataStructureId}UpdateDataStructure
GET/data-structure/{dataStructureId}GetDataStructure

Apps:

MethodEndpointController
GET/app-nodesGetAppAccountNodes
POST/apps-node/{appName}GetAppNode

Tenant Routes (/api/1.0/tenants/{tenantId})

Section titled “Tenant Routes (/api/1.0/tenants/{tenantId})”

JWT + Tenant authentication required:

Flows:

MethodEndpointController
GET/flows/{flowId}FindCompanyFlow
POST/flowsNewCompanyFlow
PUT/flows/{flowId}UpdateCompanyFlow
DELETE/flows/{flowId}DeleteCompanyFlow
POST/flows/{flowId}/run-mapperRunMapper
GET/flows/{flowId}/intentIntentExecution
GET/flows-schemasListCompanyFlowsWithSchemas

Connections:

MethodEndpointController
POST/connectionsNewIntegration
GET/connections/{attemptId}/testTestIntegration
GET/connections/{connectionId}/checkCheckIntegration
GET/connections/{integrationId}GetIntegration

Apps:

MethodEndpointController
GET/apps-tenant-nodesListAppCompanyNodes
POST/apps-tenant-node/{tenantAppName}GetTenantAppNode
GET/apps-nodesListAppServiceNodes
POST/apps-node/{appName}GetAppNode
GET/appsListCompanyApps
GET/apps/{appId}GetCompanyApp

App Webhooks:

MethodEndpointController
GET/apps/{appId}/app-webhooksGetCompanyAppWebhooks
GET/app-webhooks/{appWbId}GetCompanyAppWebhookByID

App Actions:

MethodEndpointController
GET/apps/{appId}/app-actionsGetCompanyAppActions
GET/app-actions/{appActId}GetCompanyAppActionByID

App Connections:

MethodEndpointController
GET/apps/{appId}/app-connectionsGetCompanyAppConnections
GET/app-connections/{appConnId}GetCompanyAppConnectionByID

EndpointControllerDescription
/tenant/{tenantId}/wsChannelCompanyControllerCompany WebSocket
/webcomponent/{accountId}/wsChannelAccountControllerAccount WebSocket

Client to Server:

{
"command": "start|pause|resume|stop|input",
"payload": { /* command-specific data */ }
}

Server to Client:

{
"command": "log|progress|error|waiting|complete",
"payload": { /* message data */ }
}

Request
├─► Public Webhooks (no auth)
├─► /api/2.0/webcomponent
│ └─► WebComponentAuthMiddleware
└─► /api/1.0/tenants/{tenantId}
├─► JWTAuthMiddleware
└─► TenantAuthMiddleware