Surveys

Surveys allow you to collect targeted feedback from your users within your product. On this page, we'll explore the different survey endpoints you can use to retrieve information about your surveys and their responses programmatically.

The survey model

The Survey model contains information about feedback surveys configured in your Featurebase platform. Surveys can be targeted to specific user segments or pages and can contain multiple questions with conditional logic.

Properties

  • Name
    _id
    Type
    string
    Description

    The unique identifier of the survey. Example: "6743752ca81ae59d25cf834b"

  • Name
    title
    Type
    string
    Description

    The title of the survey.

  • Name
    description
    Type
    string
    Description

    A description of the survey's purpose.

  • Name
    isActive
    Type
    boolean
    Description

    Flag indicating whether the survey is currently active.

  • Name
    organization
    Type
    string
    Description

    The ID of the organization that owns the survey.

  • Name
    responseCount
    Type
    number
    Description

    The number of responses received for this survey.

  • Name
    targeting
    Type
    object
    Description

    The targeting configuration for the survey.

  • Name
    pages
    Type
    Array<object>
    Description

    Array of survey pages (questions).

  • Name
    createdAt
    Type
    Date
    Description

    The timestamp when the survey was created.

  • Name
    updatedAt
    Type
    Date
    Description

    The timestamp when the survey was last updated.


GET/v2/surveys

List surveys

This endpoint allows you to retrieve a list of all surveys configured in your Featurebase organization.

Request

GET
/v2/surveys
curl -G https://do.featurebase.app/v2/surveys \
  -H "X-API-Key: {token}"

Response

{
  "results": [
    {
      "title": "Get feedback for Feedback module",
      "description": "Measure what we can improve with the Feedback module",
      "isActive": true,
      "helpcenterMode": false,
      "organization": "5febde12dc56d60012d47db6",
      "articleId": null,
      "articleHelpCenterId": null,
      "responseCount": 85,
      "targeting": {
        "segmentIds": [
          "6636438b7fcdc515999042eb"
        ],
        "url": [
          {
            "value": "/dashboard/posts",
            "matchType": "contains",
            "_id": "674375cfd8bf964ec2562cdc"
          }
        ],
        "css": [],
        "loginRequired": false
      },
      "pages": [
        {
          "type": "rating",
          "title": "How happy are you with our Feedback module?",
          "description": "",
          "subType": "emoji",
          "scale": 5,
          "lowLabel": "Could be improved",
          "highLabel": "It's awesome!",
          "logic": [
            {
              "comparator": "less than",
              "value": 4,
              "next": {
                "type": "page",
                "pageId": "6743754dd8bf964ec2562cda"
              },
              "_id": "6743755fd8bf964ec2562cdb"
            }
          ],
          "defaultAction": {
            "type": "page",
            "pageId": "6770215d3b1e57c64d3132aa"
          },
          "_id": "6743752ca81ae59d25cf834c"
        },
        {
          "type": "text",
          "title": "What could be improved?",
          "description": "We really want to make it the perfect solution for you.",
          "placeholder": "Type your answer here",
          "logic": [],
          "defaultAction": {
            "type": "end"
          },
          "_id": "6743754dd8bf964ec2562cda"
        },
        {
          "type": "text",
          "title": "What's your favourite thing about the Feedback module?",
          "description": "",
          "placeholder": "Type your answer here",
          "logic": [],
          "defaultAction": {
            "type": "end"
          },
          "_id": "6770215d3b1e57c64d3132aa"
        }
      ],
      "_id": "6743752ca81ae59d25cf834b",
      "createdAt": "2024-11-24T18:49:16.755Z",
      "updatedAt": "2025-04-10T08:58:51.148Z",
      "__v": 0
    }
  ]
}

GET/v2/surveys/:id

Get survey by ID

This endpoint allows you to retrieve details for a specific survey by providing its unique identifier.

Required URL Parameters

  • Name
    id
    Type
    string
    Description

    The unique identifier of the survey to retrieve.

Request

GET
/v2/surveys/:id
curl -G https://do.featurebase.app/v2/surveys/6743752ca81ae59d25cf834b \
  -H "X-API-Key: {token}"

Response

{
  "title": "Get feedback for Feedback module",
  "description": "Measure what we can improve with the Feedback module",
  "isActive": true,
  "helpcenterMode": false,
  "organization": "5febde12dc56d60012d47db6",
  "articleId": null,
  "articleHelpCenterId": null,
  "responseCount": 85,
  "targeting": {
    "segmentIds": [
      "6636438b7fcdc515999042eb"
    ],
    "url": [
      {
        "value": "/dashboard/posts",
        "matchType": "contains",
        "_id": "674375cfd8bf964ec2562cdc"
      }
    ],
    "css": [],
    "loginRequired": false
  },
  "pages": [
    {
      "type": "rating",
      "title": "How happy are you with our Feedback module?",
      "description": "",
      "subType": "emoji",
      "scale": 5,
      "lowLabel": "Could be improved",
      "highLabel": "It's awesome!",
      "logic": [
        {
          "comparator": "less than",
          "value": 4,
          "next": {
            "type": "page",
            "pageId": "6743754dd8bf964ec2562cda"
          },
          "_id": "6743755fd8bf964ec2562cdb"
        }
      ],
      "defaultAction": {
        "type": "page",
        "pageId": "6770215d3b1e57c64d3132aa"
      },
      "_id": "6743752ca81ae59d25cf834c"
    },
    {
      "type": "text",
      "title": "What could be improved?",
      "description": "We really want to make it the perfect solution for you.",
      "placeholder": "Type your answer here",
      "logic": [],
      "defaultAction": {
        "type": "end"
      },
      "_id": "6743754dd8bf964ec2562cda"
    },
    {
      "type": "text",
      "title": "What's your favourite thing about the Feedback module?",
      "description": "",
      "placeholder": "Type your answer here",
      "logic": [],
      "defaultAction": {
        "type": "end"
      },
      "_id": "6770215d3b1e57c64d3132aa"
    }
  ],
  "_id": "6743752ca81ae59d25cf834b",
  "createdAt": "2024-11-24T18:49:16.755Z",
  "updatedAt": "2025-04-10T08:58:51.148Z",
  "__v": 0
}

GET/v2/surveys/:id/responses

Get survey responses

This endpoint allows you to retrieve all user responses for a specific survey by providing its unique identifier.

Required URL Parameters

  • Name
    id
    Type
    string
    Description

    The unique identifier of the survey to retrieve responses for.

Request

GET
/v2/surveys/:id/responses
curl -G https://do.featurebase.app/v2/surveys/6743752ca81ae59d25cf834b/responses \
  -H "X-API-Key: {token}"

Response

{
  "results": [
    {
      "_id": "6712e2d175904ce24b2f9637",
      "user": {
        "id": "6712e2c130b0e478cdb66550",
        "userId": "6712e2c02fa32ba1a48f9087",
        "organizationId": "5febde12dc56d60012d47db6",
        "customFields": {
          "Location": "Canada"
        },
        "companies": [
          {
            "id": "67ee58985a5934814c489c13",
            "name": "Awesome Company",
            "monthlySpend": 0,
            "createdAt": "1970-01-21T04:21:13.496Z",
            "_id": "67f5e28f783d29d86435622c"
          }
        ],
        "email": "user@example.com",
        "name": "User",
        "profilePicture": "https://6595518396205e06b897ad65.featurebase-attachments.com/c/static/0195be85-2d96-724c-8396-97b87beacdab/me0n7he75n.png",
        "commentsCreated": 0,
        "postsCreated": 1,
        "lastActivity": "2025-04-09T02:59:27.772Z",
        "subscribedToChangelog": true,
        "manuallyOptedOutFromChangelog": false,
        "roles": [],
        "locale": "en",
        "verified": true,
        "type": "customer",
        "description": ""
      },
      "responses": [
        {
          "pageId": "66dc53c5a64824f0e84a4c1e",
          "type": "multiple-choice",
          "value": [
            "66dc54128b989696d050008b"
          ],
          "_id": "6712e2d175904ce24b2f9638",
          "createdAt": "2024-10-18T22:36:01.270Z",
          "updatedAt": "2024-10-18T22:36:01.270Z"
        }
      ],
      "createdAt": "2024-10-18T22:36:01.269Z"
    }
  ]
}