Client API – Get Environment State

Modified on Thu, Oct 23 at 7:37 AM

Fetch the current configuration and state of your environment.
The Survey Tale SDK uses this endpoint to load surveys, action classes, and project-level styling before displaying any survey to users.


Endpoint

GET /api/v1/client/{environmentId}/environment


Path Parameters

NameTypeRequiredDescription
environmentIdstringThe environment ID is available under Project’s Configuration → Website & App Connection.

Response – 200 OK

{
  "data": {
    "actionClasses": [
      {
        "id": "cm6orqtdd000b19wjec82bpp2",
        "key": null,
        "name": "New Session",
        "noCodeConfig": null,
        "type": "automatic"
      },
      {
        "id": "cm6oryki3000i19wj860utcnn",
        "key": "code",
        "name": "code action",
        "noCodeConfig": null,
        "type": "code"
      }
    ],
    "project": {
      "clickOutsideClose": true,
      "darkOverlay": false,
      "id": "cm6orqtcl000319wj9wb7dltl",
      "inAppSurveyBranding": true,
      "placement": "bottomRight",
      "recontactDays": 7,
      "styling": {
        "allowStyleOverwrite": true,
        "brandColor": {
          "light": "#64748b"
        }
      }
    },
    "surveys": [
      {
        "autoClose": null,
        "delay": 0,
        "displayLimit": 5,
        "displayOption": "respondMultiple",
        "displayPercentage": null,
        "endings": [
          {
            "buttonLabel": "Create your own Survey",
            "buttonLink": "https://formbricks.com",
            "headline": "Thank you!",
            "id": "o729tod5klhix62njmk262dk",
            "subheader": "We appreciate your feedback.",
            "type": "endScreen"
          }
        ],
        "hiddenFields": {
          "enabled": true,
          "fieldIds": [
            "<string>"
          ]
        },
        "id": "cm6orr901000g19wjwwa690eo",
        "languages": [
          "<string>"
        ],
        "name": "Start from scratch",
        "questions": [
          {
            "buttonLabel": "Next",
            "charLimit": false,
            "headline": "What would you like to know?",
            "id": "dd5c8w2a4ttkbnjb9nwhtb17",
            "inputType": "text",
            "placeholder": "Type your answer here...",
            "required": true,
            "type": "openText"
          }
        ],
        "recontactDays": 0,
        "segment": {
          "createdAt": "2025-02-03T08:08:33.377Z",
          "description": null,
          "filters": [
            "<string>"
          ],
          "id": "cm6orr90h000h19wj1lnwoxwg",
          "isPrivate": true,
          "title": "cm6orr901000g19wjwwa690eo",
          "updatedAt": "2025-02-03T08:08:33.377Z"
        },
        "showLanguageSwitch": null,
        "status": "inProgress",
        "styling": null,
        "triggers": [
          {
            "actionClass": "code action"
          }
        ],
        "type": "app",
        "variables": [
          "<string>"
        ],
        "welcomeCard": {
          "buttonLabel": "Next",
          "enabled": false,
          "headline": "Welcome!",
          "html": "Thanks for providing your feedback - let's go!",
          "showResponseCount": false,
          "timeToFinish": false
        }
      }
    ]
  }
}

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article