Get Workspace State
curl --request GET \
--url https://app.formbricks.com/api/v2/client/{workspaceId}/environmentimport requests
url = "https://app.formbricks.com/api/v2/client/{workspaceId}/environment"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://app.formbricks.com/api/v2/client/{workspaceId}/environment', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.formbricks.com/api/v2/client/{workspaceId}/environment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.formbricks.com/api/v2/client/{workspaceId}/environment"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.formbricks.com/api/v2/client/{workspaceId}/environment")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.formbricks.com/api/v2/client/{workspaceId}/environment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"workspaceId": "ws_01h2xce9q8p3w4x5y6z7a8b9c0",
"environmentId": "env_01h2xce9q8p3w4x5y6z7a8b9c0",
"state": "active"
}Client API - Workspace
Get Workspace State
Retrieves the Workspace state to be used in Formbricks SDKs. Note - Environments are deprecated. Use Workspace/workspaceId terminology. Cache Behavior: This endpoint uses server-side caching with a 5-minute TTL (Time To Live). Any changes to surveys, action classes, Workspace settings, or other Workspace data will take up to 5 minutes to reflect in the API response. This caching is implemented to improve performance for high-frequency SDK requests.
GET
/
client
/
{workspaceId}
/
environment
Get Workspace State
curl --request GET \
--url https://app.formbricks.com/api/v2/client/{workspaceId}/environmentimport requests
url = "https://app.formbricks.com/api/v2/client/{workspaceId}/environment"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://app.formbricks.com/api/v2/client/{workspaceId}/environment', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.formbricks.com/api/v2/client/{workspaceId}/environment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.formbricks.com/api/v2/client/{workspaceId}/environment"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.formbricks.com/api/v2/client/{workspaceId}/environment")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.formbricks.com/api/v2/client/{workspaceId}/environment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"workspaceId": "ws_01h2xce9q8p3w4x5y6z7a8b9c0",
"environmentId": "env_01h2xce9q8p3w4x5y6z7a8b9c0",
"state": "active"
}Path Parameters
The ID of the Workspace. Deprecated alias environmentId.
Response
200 - application/json
OK
The response is of type object.
Was this page helpful?