Skip to content
Dashboard

Get a survey by ID

client.surveys.retrieve(stringid, SurveyRetrieveParams { featurebaseVersion } params?, RequestOptionsoptions?): Survey { id, createdAt, isActive, 8 more }
GET/v2/surveys/{id}

Retrieves a single survey by its unique identifier.

Returns the survey object if found in your organization.

Response

Returns a survey object with:

  • id - Unique identifier
  • title - Survey title
  • description - Survey description
  • isActive - Whether the survey is active
  • responseCount - Number of responses received
  • targeting - Targeting configuration
  • pages - Array of survey pages/questions
  • createdAt - ISO 8601 timestamp when created
  • updatedAt - ISO 8601 timestamp when last updated

Survey Pages

Each page represents a question or screen in the survey:

  • type - Page type (text, link, rating, multiple-choice)
  • title - Question title
  • description - Optional description
  • logic - Conditional logic rules
  • defaultAction - Default action when no logic matches

Errors

  • 404 - Survey not found in your organization
ParametersExpand Collapse
id: string

Survey unique identifier

params: SurveyRetrieveParams { featurebaseVersion }
featurebaseVersion?: "2026-01-01.nova" | "2025-12-12.clover"

API version for this request. Defaults to your organization’s configured API version if not specified.

One of the following:
"2026-01-01.nova"
"2025-12-12.clover"
ReturnsExpand Collapse
Survey { id, createdAt, isActive, 8 more }
id: string

Unique identifier

createdAt: string

ISO 8601 timestamp when created

isActive: boolean

Whether the survey is active

object: "survey"

Object type identifier

organization: string

Organization ID

pages: Array<Page>

Survey pages

id: string

Page ID

title: string

Page title

type: "text" | "link" | "rating" | "multiple-choice"

Page type

One of the following:
"text"
"link"
"rating"
"multiple-choice"
allowSelectMultiple?: boolean

Allow multiple selections

choices?: Array<Choice>

Available choices

id: string

Choice ID

choice?: string

Choice text

defaultAction?: SurveyNextAction { type, pageId }

Action to take if condition matches

type: "page" | "end" | "next"

Type of next action

One of the following:
"page"
"end"
"next"
pageId?: string

Page ID to navigate to

description?: string

Page description

highLabel?: string

Label for high rating

linkButtonText?: string

Button text for link

linkRedirectUrl?: string

URL to redirect to

linkTarget?: "_blank" | "_self" | "_parent" | "_top"

Link target

One of the following:
"_blank"
"_self"
"_parent"
"_top"
logic?: Array<Logic>

Conditional logic rules

comparator: string

Comparison operator

One of the following:
value: string | number | Array<string>

Value to compare against

One of the following:
string
number
Array<string>
id?: string

Logic rule ID

lowLabel?: string

Label for low rating

placeholder?: string

Placeholder for text input

scale?: number

Rating scale

subType?: "number" | "emoji" | "generic" | 2 more

Sub-type for rating/multiple-choice

One of the following:
"number"
"emoji"
"generic"
"featurebase-posts"
"nps"
responseCount: number

Number of responses

title: string

Survey title

updatedAt: string

ISO 8601 timestamp when last updated

description?: string

Survey description

targeting?: Targeting { css, loginRequired, segmentIds, url }

Targeting configuration

css?: Array<Css>

CSS selector targeting rules

value: string

CSS selector

loginRequired?: boolean

Whether login is required

segmentIds?: Array<string>

Segment IDs to target

url?: Array<URL>

URL targeting rules

matchType: "exact" | "contains" | "regex"

Type of URL matching

One of the following:
"exact"
"contains"
"regex"
value: string

URL pattern to match

id?: string

Rule ID

Get a survey by ID

import Featurebase from 'featurebase-node';

const client = new Featurebase({
  apiKey: process.env['FEATUREBASE_API_KEY'], // This is the default and can be omitted
});

const survey = await client.surveys.retrieve('6743752ca81ae59d25cf834b');

console.log(survey.id);
{
  "id": "6743752ca81ae59d25cf834b",
  "createdAt": "2024-11-24T18:49:16.755Z",
  "isActive": true,
  "object": "survey",
  "organization": "5febde12dc56d60012d47db6",
  "pages": [
    {
      "id": "6743752ca81ae59d25cf834c",
      "title": "How happy are you with our product?",
      "type": "rating",
      "allowSelectMultiple": false,
      "choices": [
        {
          "id": "66dc54128b989696d050008b",
          "choice": "Very satisfied"
        }
      ],
      "defaultAction": {
        "type": "page",
        "pageId": "6743754dd8bf964ec2562cda"
      },
      "description": "We really want to hear from you.",
      "highLabel": "It's awesome!",
      "linkButtonText": "Visit our website",
      "linkRedirectUrl": "https://example.com",
      "linkTarget": "_blank",
      "logic": [
        {
          "comparator": "less than",
          "next": {
            "type": "page",
            "pageId": "6743754dd8bf964ec2562cda"
          },
          "value": 4,
          "id": "6743755fd8bf964ec2562cdb"
        }
      ],
      "lowLabel": "Could be improved",
      "placeholder": "Type your answer here",
      "scale": 5,
      "subType": "emoji"
    }
  ],
  "responseCount": 85,
  "title": "Get feedback for Feedback module",
  "updatedAt": "2025-04-10T08:58:51.148Z",
  "description": "Measure what we can improve",
  "targeting": {
    "css": [
      {
        "value": ".feedback-button"
      }
    ],
    "loginRequired": false,
    "segmentIds": [
      "6636438b7fcdc515999042eb"
    ],
    "url": [
      {
        "matchType": "contains",
        "value": "/dashboard/posts",
        "id": "674375cfd8bf964ec2562cdc"
      }
    ]
  }
}
Returns Examples
{
  "id": "6743752ca81ae59d25cf834b",
  "createdAt": "2024-11-24T18:49:16.755Z",
  "isActive": true,
  "object": "survey",
  "organization": "5febde12dc56d60012d47db6",
  "pages": [
    {
      "id": "6743752ca81ae59d25cf834c",
      "title": "How happy are you with our product?",
      "type": "rating",
      "allowSelectMultiple": false,
      "choices": [
        {
          "id": "66dc54128b989696d050008b",
          "choice": "Very satisfied"
        }
      ],
      "defaultAction": {
        "type": "page",
        "pageId": "6743754dd8bf964ec2562cda"
      },
      "description": "We really want to hear from you.",
      "highLabel": "It's awesome!",
      "linkButtonText": "Visit our website",
      "linkRedirectUrl": "https://example.com",
      "linkTarget": "_blank",
      "logic": [
        {
          "comparator": "less than",
          "next": {
            "type": "page",
            "pageId": "6743754dd8bf964ec2562cda"
          },
          "value": 4,
          "id": "6743755fd8bf964ec2562cdb"
        }
      ],
      "lowLabel": "Could be improved",
      "placeholder": "Type your answer here",
      "scale": 5,
      "subType": "emoji"
    }
  ],
  "responseCount": 85,
  "title": "Get feedback for Feedback module",
  "updatedAt": "2025-04-10T08:58:51.148Z",
  "description": "Measure what we can improve",
  "targeting": {
    "css": [
      {
        "value": ".feedback-button"
      }
    ],
    "loginRequired": false,
    "segmentIds": [
      "6636438b7fcdc515999042eb"
    ],
    "url": [
      {
        "matchType": "contains",
        "value": "/dashboard/posts",
        "id": "674375cfd8bf964ec2562cdc"
      }
    ]
  }
}