## Best Practices
diff --git a/docs/docs/tutorial/tooljet-api.md b/docs/docs/tutorial/tooljet-api.md
index 16d1b5fb4b..3af82bed77 100644
--- a/docs/docs/tutorial/tooljet-api.md
+++ b/docs/docs/tutorial/tooljet-api.md
@@ -9,13 +9,14 @@ title: ToolJet API
ToolJet API allows you to interact with the ToolJet platform programmatically. You can use the APIs to manage users and their workspaces relations. The API endpoints are secured with an access token. You can perform various operations using the API such as:
- [Get All Users](#get-all-users)
+- [Get All Workspaces](#get-all-workspaces)
+- [Get All App Details](#get-all-app-details)
- [Get User by ID](#get-user-by-id)
- [Create User](#create-user)
- [Update User](#update-user)
- [Update User Role](#update-user-role)
- [Replace User Workspace](#replace-user-workspace)
- [Replace User Workspaces Relations](#replace-user-workspaces-relations)
-- [Get All Workspaces](#get-all-workspaces)
- [Export Application](#export-application)
- [Import Application](#import-application)
@@ -130,6 +131,112 @@ curl -X GET 'https://your-tooljet-instance.com/api/ext/users' \
```
+### Get All Workspaces
+
+ - **Description:** Retrieves a list of all workspaces.
+ - **URL:** `/api/ext/workspaces`
+ - **Method:** GET
+ - **Authorization:** `Basic
`
+ - **Content-Type:** `application/json`
+ - **Response:** Array of Workspace objects.
+
+
+Response Example
+
+```json
+[
+ {
+ "id": "a831db72-c3d2-4b36-a98e-0023ffb15e66",
+ "name": "demo-workspace",
+ "status": "active",
+ "groups": [
+ {
+ "id": "b3ae95dd-b1ca-4a21-abac-b321ee76698e",
+ "name": "all_users"
+ },
+ {
+ "id": "1830a113-24e5-4e33-8af2-e6502d477239",
+ "name": "admin"
+ }
+ ]
+ },
+ {
+ "id": "b8a0c07d-2430-46fd-ba71-2a71e48fde30",
+ "name": "team-spac",
+ "status": "active",
+ "groups": [
+ {
+ "id": "7f7af977-a7e7-49e3-a08a-2dffce6f5942",
+ "name": "all_users"
+ },
+ {
+ "id": "eda68cf3-b70d-455f-8a2a-8cd4bbff77a6",
+ "name": "admin"
+ }
+ ]
+ }
+]
+```
+
+
+
+### Get All App Details
+
+ - **Description:** Get the app details for all the applications in the workspace.
+ - **URL:** `/api/ext/workspace/:workspace_id/apps`
+ - **Method:** GET
+ - **Authorization:** `Basic `
+ - **Content-Type:** `application/json`
+ - **Params:**
+ - **workspace_id**: The ID of the workspace.
+ - **Response:** Array of app details for all the applications in the workspace.
+
+
+ **Response Example**
+ ```json
+ [
+ {
+ "id": "ae06cc7a-2922-4fe7-9064-462741558813",
+ "name": "Applicant tracking system",
+ "slug": "ae06cc7a-2922-4fe7-9064-462741558813",
+ "versions": [
+ {
+ "id": "37be6442-ca1b-4a5a-a6f4-f929e00a0ac1",
+ "name": "v1"
+ },
+ {
+ "id": "be8a96c3-f7a4-4f82-b282-23678c52c973",
+ "name": "v3"
+ },
+ {
+ "id": "19405d8c-be75-47ad-aa96-36f2b1728e77",
+ "name": "v2"
+ },
+ {
+ "id": "15bd421d-54ce-44d5-8eef-39911fc2d4cb",
+ "name": "v4"
+ }
+ ]
+ },
+ {
+ "id": "b68f87ca-6620-4cbf-83d6-becf073d8e96",
+ "name": "Aws Tracker",
+ "slug": "b68f87ca-6620-4cbf-83d6-becf073d8e96",
+ "versions": [
+ {
+ "id": "466a1cc4-62cf-4b46-b71d-114af61c04ca",
+ "name": "v1"
+ },
+ {
+ "id": "b65f1ae2-3702-4cba-91f3-3e5bddd55dbc",
+ "name": "v2"
+ }
+ ]
+ }
+ ]
+ ```
+
+
### Get User by ID
- **Description:** Returns a user by their ID.
@@ -351,55 +458,6 @@ curl -X GET 'https://your-tooljet-instance.com/api/ext/users' \
- **Note:** If no body is given or body is an empty object, it will not do anything.
- **Response:** `200 OK`
-### Get All Workspaces
-
- - **Description:** Retrieves a list of all workspaces.
- - **URL:** `/api/ext/workspaces`
- - **Method:** GET
- - **Authorization:** `Basic `
- - **Content-Type:** `application/json`
- - **Response:** Array of Workspace objects.
-
-
-Response Example
-
-```json
-[
- {
- "id": "a831db72-c3d2-4b36-a98e-0023ffb15e66",
- "name": "demo-workspace",
- "status": "active",
- "groups": [
- {
- "id": "b3ae95dd-b1ca-4a21-abac-b321ee76698e",
- "name": "all_users"
- },
- {
- "id": "1830a113-24e5-4e33-8af2-e6502d477239",
- "name": "admin"
- }
- ]
- },
- {
- "id": "b8a0c07d-2430-46fd-ba71-2a71e48fde30",
- "name": "team-spac",
- "status": "active",
- "groups": [
- {
- "id": "7f7af977-a7e7-49e3-a08a-2dffce6f5942",
- "name": "all_users"
- },
- {
- "id": "eda68cf3-b70d-455f-8a2a-8cd4bbff77a6",
- "name": "admin"
- }
- ]
- }
-]
-```
-
-
-
### Export Application
From version **`v3.5.7-ee-lts`**, you can use ToolJet API to export application.
diff --git a/docs/static/img/workspace-const/const-mapping.png b/docs/static/img/workspace-const/const-mapping.png
new file mode 100644
index 0000000000..59325ad541
Binary files /dev/null and b/docs/static/img/workspace-const/const-mapping.png differ
diff --git a/docs/versioned_docs/version-3.0.0-LTS/org-management/workspaces/workspace_constants.md b/docs/versioned_docs/version-3.0.0-LTS/org-management/workspaces/workspace_constants.md
index d58457cc06..0b5d862f81 100644
--- a/docs/versioned_docs/version-3.0.0-LTS/org-management/workspaces/workspace_constants.md
+++ b/docs/versioned_docs/version-3.0.0-LTS/org-management/workspaces/workspace_constants.md
@@ -1,8 +1,6 @@
---
-
id: workspace_constants
title: Workspace Constants and Secrets
-
---
Workspace constants and secrets are predefined values that can be used across your application to maintain consistency, facilitate easy updates, and securely store sensitive information. This document will guide you through the usage and management of workspace constants and secrets within your workspaces.
@@ -150,6 +148,43 @@ Secrets cannot be used within the App Builder or workflows.
+## Mapping Workspace Constants from Environment Variables
+
+From version **`v3.5.8-ee-lts`**, you can use environment variables to set global and secret constants. Workspace constants set using environment variables will have a `.env` tag in front of them. If there are two constants with the same name, the one set through the environment variable will be used in the app builder, while the constant set through the UI will have a `duplicate` tag in front of it.
+
+Users cannot edit or delete constants created from environment variables through the UI. To add, update, or delete any values from an environment variable, the container must be restarted.
+
+