---
title: "GET /projects/{project_id}/surveys"
method: GET
path: "/projects/{project_id}/surveys"
tags: ["Surveys"]
---

# GET /projects/{project_id}/surveys

`GET /projects/{project_id}/surveys`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/projects/{project_id}/surveys`
- Auth: HTTP bearer

## Path parameters

- `project_id` integer, required

## Query parameters

- `status` 'draft' | 'active' | 'paused' | 'completed': Where a survey is in its life. Only `active` surveys reach browsers.
- `page` integer
- `page_size` integer

## Response `200`

Surveys, newest first

- SurveyListResponse
  - `page` integer, required
  - `page_size` integer, required
  - `surveys` SurveyResponse[], required
    - `created_at` string, required
    - `description` string, nullable
    - `id` integer, required
    - `name` string, required
    - `project_id` integer, required
    - `questions` SurveyQuestion[], required
      - `choices` string[]: Options for `single_choice` and `multiple_choice`: 2-20, unique.
      - `id` string, required: Stable id the answer is recorded under: `[a-z0-9_]`, 1-32 characters, unique within the survey. Keep it when rewording a question so its answers stay together.
      - `kind` 'open_text' | 'rating' | 'nps' | 'single_choice' | 'multiple_choice', required
      - `lower_label` string, nullable: Label under the low end of a `rating` or `nps` scale.
      - `optional` boolean: When true the visitor may skip it.
      - `prompt` string, required
      - `scale` integer, nullable: Top of a `rating` scale: 3, 5, 7 or 10. Defaults to 5.
      - `upper_label` string, nullable: Label under the high end of a `rating` or `nps` scale.
    - `status` 'draft' | 'active' | 'paused' | 'completed', required: Where a survey is in its life. Only `active` surveys reach browsers.
    - `targeting` SurveyTargeting, required: When a browser shows the survey. Every condition set must hold.
      - `flag` SurveyFlagCondition, nullable: Show the survey only to visitors for whom a feature flag serves a value.
        - `key` string, required: Flag key in the same project.
        - `value` unknown
      - `once_per_visitor` boolean: Never show the survey again to a visitor who saw it. Defaults to true.
      - `path_pattern` string, nullable: Page path the survey appears on, e.g. `/checkout/*`. `*` matches any run of characters; the pattern must match the whole path. Omit for every page.
      - `sample_rate` number, double: Share of visitors, `0..=1`, who may see it. Below 1 the visitor must be identifiable (the Temps visitor cookie or an explicit key), so the decision is the same on every page.
      - `trigger_event` string, nullable: Show only after the app tracks an analytics event with this name (`trackEvent("checkout_completed")`). Omit to show on page load.
    - `updated_at` string, required: Send back as `expected_updated_at` to guard an update.
  - `total` integer, required
  - `total_pages` integer, required

## Other responses

- `401`: Unauthorized
- `403`: Insufficient permissions (requires surveys:read)
- `500`: Internal server error

## Changes

- **2026-11-20** `1167397f1408`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/projects/:project_id/surveys/get.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
