Skip to main content

EcoFlowJS HTTP API

Response Types

The response type is a object with the following properties:

interface ApiResponse {
/**
* Flag indicating the presence of an error.
*/
error?: boolean;

/**
* Flag indicating the success status.
*/
success?: boolean;

/**
* Response payload data for the response.
*/
payload?: any;
}

Endpoints

Available Endpoints :

MethodEndpointsDescription
POST/directoriesStatusFetch directory and sub-directory.

Initialize Endpoints

Available Endpoints :

MethodEndpointsDescription
GET/init/statusInitializes the status of the application.

Authentication Endpoints

Available Endpoints :

MethodEndpointsDescription
GET/users/isAuthenticatedChecks if a user is authenticated.
PATCH/users/refreshTokenRefreshing user authentication token.
POST/users/loginUser login authentication.
DELETE/users/logoutLogging out a user.

Admin Endpoints

Available Endpoints :

Configuration Endpoints

MethodEndpointsDescription
GET/admin/configRetrieve configurations.
GET/admin/config/:configIDRetrieve a specific configuration based on the configID.
PUT/admin/configUpdates the configuration settings.

Environment Endpoints

MethodEndpointsDescription
GET/admin/environment/envsRetrieve environment information.
GET/admin/environment/env/:envIDretrieve environment details based on the environment Name as ID.
GET/admin/environment/userEnvsRetrieve user environments.
GET/admin/environment/userEnv/:envIDRetrieve a user environment based on the environment Name as ID.
GET/admin/environment/systemEnvsRetrieve system environment variables.
GET/admin/environment/systemEnv/:envIDretrieving system environment information based on the environment Name as ID.
POST/admin/environment/envsCommitting new environments.

User Endpoints

MethodEndpointsDescription
GET/admin/users/usernamesRetrieving usernames of all users.
GET/admin/users/usernames/:isSystemRetrieve usernames based on whether they are system users or not..
GET/admin/users/:userIDRetrieving details of a specific user.
POST/admin/usersThe endpoint for creating a new user.
PATCH/admin/users/:userIDUpdating a user with a specific userID.
PATCH/admin/users/:userID/ToggleUserToggles the user enable/disable for the specified user ID.

Schema Editor Endpoints

Available Endpoints :

Connection Endpoints

MethodEndpointsDescription
GET/schema/connectionsRetrieves the list of available connections.
POST/schema/connectionCreating a new connection.
PATCH/schema/connectionThe endpoint for updating a connection.
DELETE/schema/connection/:ConnectionNameDelete a connection based on the ConnectionName parameter.

Connection Configuration Endpoints

MethodEndpointsDescription
GET/schema/connectionConfigsRetrieves the list of available connection configurations.
GET/schema/connectionConfig/:idRetrieves the connection configuration by ID.

Connection Collection Endpoints

MethodEndpointsDescription
GET/schema/collectionsORtables/:connectionNameRetrieves the collections or tables for a specific connection.
POST/schema/collectionsORtables/:connectionNameCreating collections or tables for a given connection.
PATCH/schema/collectionsORtables/:connectionNameRenaming collections or tables for a specific connection.
DELETE/schema/collectionsORtables/:connectionName/:collectionOrTableNameDeleting a collection or table based on the connection name and collection/table name.

Connection Collection Table Endpoints

MethodEndpointsDescription
GET/schema/tableColumn/:connectionName/:collectionORtableNameRetrieving information about the columns of a table in a database.
POST/schema/tableColumn/:connectionName/:collectionORtableNameSaving table columns to a specific collection or table in the database.

Connection Collection Data Endpoints

MethodEndpointsDescription
GET/schema/DatabaseData/:connectionName/:collectionORtableNameRetrieving data from a specific database collection or table.
POST/schema/DatabaseData/:connectionName/:collectionORtableName/insertInserting data into a specific collection/table in the database.
PATCH/schema/DatabaseData/:connectionName/:collectionORtableName/updateUpdating database data for a specific connection and collection/table.
DELETE/schema/DatabaseData/:connectionName/:collectionORtableName/delete/:dataIDDeleting data from a specific collection or table in the database.

Server Endpoints

Available Endpoints :

MethodEndpointsDescription
GET/server/isOnlineChecking if the server is online.
POST/serverHandles the server close and restart functionality based on the mode provided in the request body.

Setup Endpoints

Available Endpoints :

Black Setup Endpoints

MethodEndpointsDescription
POST/setup/blank/validateDBChecking if the database connection is valid.
POST/setup/blankProcesses the setup for a blank context by creating user credentials, updating database configuration, and restarting the server if necessary.

Import Setup Endpoints

MethodEndpointsDescription
POST/setup/importUpload the import configuration zip and processes the setup of the application

Role Endpoints

Available Endpoints :

MethodEndpointsDescription
GET/roleFetches all roles.
GET/role/:idFetches role for the ID provided.
POST/roleCreating a new role.
PATCH/roleUpdating a role.
DELETE/role/:idRemove a role by its ID.

Users Endpoints

Available Endpoints :

MethodEndpointsDescription
GET/usersRetrieves users information.
PATCH/usersUpdating user information.

Users Permissions Endpoints

MethodEndpointsDescription
GET/users/permissionsRetrieve user permissions.
GET/users/permissions/:modeFetches permissions based on the mode specified.

Users Roles Endpoints

MethodEndpointsDescription
GET/users/rolesRetrieves user roles and fetches role names for each role ID.

Module Package Endpoints

Available Endpoints :

MethodEndpointsDescription
GET/moduleFetching all modules.
GET/module/id/:moduleIDFetching a module based on the provided module ID.
GET/module/installPackagesFetching the list of installed modules
GET/module/installPackages/id/:nameFetches the description of an installed module based on the provided module name.
GET/module/searchPackagesCountsFetches the count of available search packages.
GET/module/searchPackages/:packageNameSearching packages in the npm repository by package name.
POST/module/installPackagesInstalling packages in the application.
POST/module/installPackages/importImporting packages and installing packages in the application.
PATCH/module/installPackagesUpgrades or downgrades a package based on the provided package name and version.
DELETE/module/installPackages/:packageNameRemoves a package from the application based on the provided package name.

Module Nodes Endpoints

MethodEndpointsDescription
GET/module/nodesRetrieves all nodes data.
GET/module/nodes/id/:nodeIdRetrieves nodes data based on the ID provided

Flow Editor Endpoints

Available Endpoints :

MethodEndpointsDescription
GET/flowsRetrieves all the flows description.
GET/flows/id/:flowNameRetrieves the flows description for a given flow name from the flow editor.
GET/flows/settingsRetrieves the settings of the flow editor.
POST/flows/settingsUpdating the settings of the flow editor.
POST/flows/deployDeploys the flow configuration of the flow editor.

Dashboard Endpoints

Available Endpoints :

MethodEndpointsDescription
GET/dashboard/statusRetrieves the information to display on the dashboard

Backup Restore Endpoints

Available Endpoints :

MethodEndpointsDescription
GET/backupRestoreFetch the information for backup.
GET/backupRestore/backupFetch the backed file names that are saved of the server directory.
POST/backupRestore/backupGenerate backup file, save on the server directory and download it.
POST/backupRestore/restoreUpload a zip containing backed details and restore accordingly.
DELETE/backupRestore/backup/:fileNameDelete a backed file that is saved on the server directory.

Export Endpoints

Available Endpoints :

MethodEndpointsDescription
GET/exportsExports the project with all information like: configurationsENV variables, etc

Audit Logs Endpoints

Available Endpoints :

MethodEndpointsDescription
GET/auditLogsFetches audit logs for the 1st page.
GET/auditLogs/:pageFetches audit logs based on the page number.