curl --request GET \
--url https://app.formbricks.com/api/v3/surveys/{surveyId}/visibility \
--cookie next-auth.session-token=import requests
url = "https://app.formbricks.com/api/v3/surveys/{surveyId}/visibility"
headers = {"cookie": "next-auth.session-token="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'next-auth.session-token='}};
fetch('https://app.formbricks.com/api/v3/surveys/{surveyId}/visibility', 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/v3/surveys/{surveyId}/visibility",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_COOKIE => "next-auth.session-token=",
]);
$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/v3/surveys/{surveyId}/visibility"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("cookie", "next-auth.session-token=")
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/v3/surveys/{surveyId}/visibility")
.header("cookie", "next-auth.session-token=")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.formbricks.com/api/v3/surveys/{surveyId}/visibility")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["cookie"] = 'next-auth.session-token='
response = http.request(request)
puts response.read_body{
"data": {
"id": "clsv1234567890123456789012",
"visibility": "workspace",
"owner": {
"name": "Alice Example"
},
"access": {
"via": "workspace",
"canManageVisibility": true
},
"blockers": [
{
"type": "webhook",
"id": "clwh1234567890123456789012",
"name": "Zapier — new responses"
},
{
"type": "workflow",
"id": "clwf1234567890123456789012",
"name": "Notify #product on completion"
}
],
"impact": {
"memberCount": 7,
"responseCount": 212
},
"pending": null,
"version": 2,
"allowedTargets": []
}
}Read a survey's visibility and the impact of changing it
Returns the survey’s enforced visibility, its owner, the caller’s access, and what a change would do: blockers[] lists the outbound connections that currently make restricted refusable (webhooks, integrations, active feedback sources, and draft or enabled workflows), impact carries the numbers the confirmation dialogues show, allowedTargets[] the values a POST would act on right now, and pending / version describe a change still in flight. Read this before offering “Make restricted”; the POST answers 409 while blockers[] is non-empty.
Requires survey.change_visibility, the same permission as the POST: the survey’s owner while they still hold read access to the workspace, or an organisation owner/manager, with the feature enabled. Everyone else — read or write members, team-level managers, every API key, and anyone who cannot see the survey at all — answers 403 with the same body as an unknown id. Connection names and ids are configuration, not survey content, and only the people who may act on them get to read them.
While pending is non-null the survey is restricted for everyone but its owner (within their workspace access: read to view, write to edit) and the organisation’s owners and managers, whichever direction is queued — the application fails closed until the graph acknowledges the change — so visibility reads restricted in that state and allowedTargets includes the value that cancels the pending change.
curl --request GET \
--url https://app.formbricks.com/api/v3/surveys/{surveyId}/visibility \
--cookie next-auth.session-token=import requests
url = "https://app.formbricks.com/api/v3/surveys/{surveyId}/visibility"
headers = {"cookie": "next-auth.session-token="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'next-auth.session-token='}};
fetch('https://app.formbricks.com/api/v3/surveys/{surveyId}/visibility', 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/v3/surveys/{surveyId}/visibility",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_COOKIE => "next-auth.session-token=",
]);
$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/v3/surveys/{surveyId}/visibility"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("cookie", "next-auth.session-token=")
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/v3/surveys/{surveyId}/visibility")
.header("cookie", "next-auth.session-token=")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.formbricks.com/api/v3/surveys/{surveyId}/visibility")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["cookie"] = 'next-auth.session-token='
response = http.request(request)
puts response.read_body{
"data": {
"id": "clsv1234567890123456789012",
"visibility": "workspace",
"owner": {
"name": "Alice Example"
},
"access": {
"via": "workspace",
"canManageVisibility": true
},
"blockers": [
{
"type": "webhook",
"id": "clwh1234567890123456789012",
"name": "Zapier — new responses"
},
{
"type": "workflow",
"id": "clwf1234567890123456789012",
"name": "Notify #product on completion"
}
],
"impact": {
"memberCount": 7,
"responseCount": 212
},
"pending": null,
"version": 2,
"allowedTargets": []
}
}Authorizations
NextAuth session JWT cookie. Development: often next-auth.session-token.
Production (HTTPS): often __Secure-next-auth.session-token. Send the cookie your browser receives after sign-in.
Path Parameters
Survey identifier.
Response
Visibility state retrieved
The three fields every SurveyListItem and SurveyResource carries, merged into both via allOf. All required, always present.
Show child attributes
Show child attributes
Was this page helpful?