---
title: "List and search responses"
description: "Page through survey responses with the dashboard's filters, open one submission, read what customers wrote, and look a customer up by email."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.userloop.io/llms.txt
> Use this file to discover all available pages before exploring further.

# List and search responses

`GET /responses` returns survey submissions (one customer’s answers to one survey in one sitting), newest first, with the same filters as the dashboard's **Responses** page. Use it to copy answers into your own systems, quote customers, or find every response from one person.

> **Plus plan**
>
> The API is on the Plus plan.

## Before you start

- You need an API key with the `responses:read` scope. See [Authentication and scopes](https://docs.userloop.io/developers/api/authentication/).
- Customers' emails and names come back masked (`ja**@ex*****.com`, `J. D.`). To read them in full, or to look a customer up by email, the key must have been created with **Include customers’ contact details when asked**. See [Customer contact details in responses](https://docs.userloop.io/developers/api/contact-details/).

## List responses

1. **Ask for the first page**

   Name the survey with `survey_id` (its `id` or `public_id` from `GET /surveys`) and a date range:

   ```bash
   curl -G https://app.userloop.io/api/v1/responses \
     -H "Authorization: Bearer ulk_live_…" \
     --data-urlencode "survey_id=1710884429805x361876466030084100" \
     --data-urlencode "range=30d" \
     --data-urlencode "limit=20"
   ```
2. **Read the page**

   You get one item per submission in `data`:

   ```json
   {
     "data": [
       {
         "response_id": "3f9c1a7e5b2d48c6a0e1f7b9d3c5a8e2f4b6d8a0c2e4f6a8b0d2c4e6f8a0b2c4",
         "survey": { "public_id": "1710884429805x361876466030084100", "title": "Post-purchase survey" },
         "received_at": "2026-11-09T18:04:11.000Z",
         "started_at": "2026-11-09T18:03:40.000Z",
         "channel": "thank_you",
         "customer": { "name": "J. D.", "email": "ja**@ex*****.com", "shopify_customer_id": "7781234567890", "masked": true },
         "order": {
           "order_id": "5839201847361",
           "order_number": 1042,
           "total": 64.5,
           "currency": "GBP",
           "products": ["Rose face oil"],
           "discount_code": "WELCOME10",
           "discount_amount": 6.45
         },
         "attribution": { "source": "instagram", "medium": "social", "landing_site": "/products/rose-face-oil" },
         "answers": [
           {
             "question_id": "1710884436289x589566297607766000",
             "question": "How likely are you to recommend us to a friend?",
             "type": "number_score",
             "score": 4
           },
           {
             "question_id": "1710884441102x447120985331204100",
             "question": "How did you hear about us?",
             "type": "single_select",
             "answer": ["Instagram"],
             "answer_ids": ["1710884441108x118605297512448000"]
           },
           {
             "question_id": "1710884447730x902114583120896000",
             "question": "What could we do better?",
             "type": "open_ended",
             "answer": ["Delivery took a week longer than promised."]
           }
         ]
       }
     ],
     "has_more": true,
     "next_cursor": "eyJ2IjoxLCJ0Ijoic2VhcmNoX3Jlc3BvbnNlcyIsImMiOiIxNzYyMTA2NjUxMDAwIiwicSI6Ijk4YzEifQ",
     "partial": false
   }
   ```
3. **Get the next page**

   While `has_more` is `true`, send the same query again with `cursor` set to `next_cursor`. Change nothing else: a cursor used with other filters is refused with `invalid_cursor`. See [Pagination](https://docs.userloop.io/developers/api/pagination/).

`limit` is 1 to 50, 20 by default.

## Responses recorded by another app

`POST /responses` records a new submission to a live link, email or website survey. It needs `responses:write`. Checkout, store popup and theme block surveys cannot receive responses this way. Read the survey with `GET /surveys/{survey_id}` and use its question and answer `public_id` values.

Start with `validate_only: true`. Replace the IDs with a live survey and one of its open-ended questions:

```bash
curl https://app.userloop.io/api/v1/responses \
  -H "Authorization: Bearer ulk_live_…" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: ticket-1042-validate" \
  -d '{
    "survey_id": "SURVEY_ID",
    "external_id": "ticket-1042",
    "validate_only": true,
    "answers": [{ "question_id": "QUESTION_PUBLIC_ID", "text": "Helpful support" }]
  }'
```

A valid check returns `status: "validated"` without recording anything. To record it, remove `validate_only` and use a new `Idempotency-Key`; reusing the validation key with a changed body is refused.

- Every answer is checked against the live published version before any is accepted. A `400` lists problems in `errors`, with their fields. Questions left out count as unanswered.
- An accepted request returns `202`, `status: "accepted"` and `dry_run: false`. It can take about a minute to appear; reading it sooner may return `404`.
- The response appears under the **API** channel. `response_id` and any returned answer `row_id` open it; a list or webhook may identify it with a different returned row ID.
- Use the same `external_id` and answers on retries, including after a partial failure. Without an external ID, retrying can create duplicate answers. This endpoint is for new responses, not editing existing ones.
- Retrying with the same external ID can update the stored response date. The same email address giving the same answer to the same question can share a stored answer row, even across separate requests.
- A non-production deployment normally validates only and returns `dry_run: true`.

The [API reference](https://docs.userloop.io/developers/api/reference/#post-responses) lists the fields for each question type, including **Other** text, scores and dates.

## Filter the list

Every filter is a query parameter. Combine as many as you need; a response must match all of them. Parameters marked "repeat" take several values when you repeat them (`survey_id=…&survey_id=…`), and a response matches any of the values.

| Parameter | What it keeps |
| --- | --- |
| `range` | `24h`, `7d`, `30d`, `90d`, `12m` or `all` (the default). Counted back from now: `7d` is the last 168 hours. Not with `from` or `to`. |
| `from`, `to` | A custom range, `YYYY-MM-DD`, in UTC, both days included. |
| `survey_id` (repeat) | Responses to this survey, by `id` or `public_id`. |
| `channel` (repeat) | Where it was answered: `thank_you`, `order_status`, `checkout`, `link`, `website`, `email`, `popup`, `app_block`, `feedback_tab`, `sdk`, `api`, `imported` or `other`. |
| `search` | Words in a written answer. With a key that may read contact details, also part of the customer's email or name. At most 200 characters. |
| `answer` (repeat) | An answer condition, with question and answer `public_id`s: `is:<question>:<answer>\|<answer>` (chose any of them), `is_not:<question>:<answer>\|<answer>` (answered, chose none of them) or `answered:<question>`. At most 20. |
| `score` (repeat) | A score range on a number score or NPS question: `<question>:<min>-<max>`. Either bound may be empty. NPS detractors are `<question>:0-6`. At most 20. |
| `written_only` | `true`: only responses with a written answer (text typed with an "Other" answer counts). |
| `video_only` | `true`: only responses with a video answer. |
| `landing_page_contains` | The landing page contains this text. |
| `order_min`, `order_max` | Order total, both included. |
| `any_discount` | `true`: the order used a discount code. Not with `discount_code`. |
| `discount_code` (repeat) | The order used this discount code. |
| `product` (repeat) | The order contains this product (its line item title). |
| `utm_source`, `utm_medium`, `utm_campaign`, `utm_term`, `utm_content` (repeat) | The UTM value of the visit. |
| `email` | One customer, by their exact address. See [Look a customer up by email](#look-a-customer-up-by-email). |
| `include_contact_details` | `true`: full emails and names. Needs a key that allows contact details. |

A parameter the API doesn't know, or one given twice where only one is allowed, is refused with `400 invalid_request`, and `errors` names it. The dashboard's own address parameters (`survey`, `q`, `written=1`) are not API parameters.

For example, the NPS detractors of one survey in October who wrote something:

```bash
curl -G https://app.userloop.io/api/v1/responses \
  -H "Authorization: Bearer ulk_live_…" \
  --data-urlencode "survey_id=1710884429805x361876466030084100" \
  --data-urlencode "from=2026-10-01" \
  --data-urlencode "to=2026-10-31" \
  --data-urlencode "score=1710884436289x589566297607766000:0-6" \
  --data-urlencode "written_only=true"
```

Question and answer `public_id`s are in `GET /surveys/{survey_id}`, and on every answer you read back.

> **When partial is true**
>
> `partial: true` means a condition matched more stored answers than UserLoop reads for one request, so older matches may be missing from the list. Narrow the date range to get them all. To count responses rather than list them, use [the analytics endpoints](https://docs.userloop.io/developers/api/read-scores-and-analytics/), which count every response.

## Open one submission

```bash
curl https://app.userloop.io/api/v1/responses/3f9c1a7e5b2d48c6a0e1f7b9d3c5a8e2f4b6d8a0c2e4f6a8b0d2c4e6f8a0b2c4 \
  -H "Authorization: Bearer ulk_live_…"
```

The submission comes back under `response`, with a short summary of the customer:

```json
{
  "response": {
    "response_id": "3f9c1a7e5b2d48c6a0e1f7b9d3c5a8e2f4b6d8a0c2e4f6a8b0d2c4e6f8a0b2c4",
    "survey": { "public_id": "1710884429805x361876466030084100", "title": "Post-purchase survey" },
    "received_at": "2026-11-09T18:04:11.000Z",
    "channel": "thank_you",
    "customer": { "name": "J. D.", "email": "ja**@ex*****.com", "masked": true },
    "answers": [
      {
        "question_id": "1710884436289x589566297607766000",
        "question": "How likely are you to recommend us to a friend?",
        "type": "number_score",
        "score": 4
      }
    ]
  },
  "customer_summary": { "responses": 3, "orders": 2, "surveys": 2 }
}
```

`response_id` is the ID of the submission's first answer. The path also takes the ID of any other answer in the submission, so an ID from a webhook, from `GET /written-answers` or from a list always opens the whole submission.

## The shape of a submission

A submission is one customer's answers to one survey in one sitting. Each answer counts as a response, including each selected multi select option. The API keeps its existing names: `/responses` and `response_id` refer to submissions. The same object comes back from `GET /responses`, `GET /responses/{response_id}`, the history of `GET /customers/{email}` and the `response.completed` webhook. Fields without a value are left out, never `null`.

| Field | What it holds |
| --- | --- |
| `response_id` | The submission's ID. |
| `survey` | `public_id` and the survey's current `title` ("Deleted survey" or "Unknown survey" when it can't be named). |
| `received_at` | When the latest answer arrived (ISO 8601, UTC). |
| `started_at` | When the first answer arrived, when that was earlier. |
| `channel` | Where it was answered (the values of the `channel` filter). With `other`, `surface` holds the place as stored. |
| `customer` | `name`, `email`, `shopify_customer_id`. `masked: true` when the name and email are masked; `anonymous: true` when there is neither. |
| `order` | `order_id` (Shopify's), `order_number`, `total`, `currency`, `products` (at most 10, with `more_products` counting the rest), `discount_code`, `discount_amount`. |
| `attribution` | `source`, `medium`, `campaign`, `term` and `content` (the UTM values), and `landing_site`. |
| `answers` | Every answer, in the order given. |

Each answer has `question` (the question's current wording, else the wording the customer saw), and usually `question_id` and `type`. What else it has depends on the type:

| `type` | Fields |
| --- | --- |
| `single_select`, `multi_select`, `csat` | `answer`: the chosen answers' text. `answer_ids`: their `public_id`s. `other_text`: what the customer typed with an "Other" answer. |
| `number_score` (NPS and number scores) | `score`. No `answer`. |
| `open_ended`, `date`, `phone`, `email` | `answer`: one item, the text. Emails and phone numbers in answers are masked like the customer's. |
| `video` | `video_url`, the playback address. |
| `info_screen` | Nothing more. |

Treat these lists as open: new channels, question types and fields can be added within v1, so ignore values you don't know rather than fail on them.

## Read only what customers wrote

`GET /written-answers` lists open-ended answers, text typed with an "Other" answer, and video transcripts, newest first, one item per answer. It takes the same filters as `GET /responses`; `limit` is 1 to 100, 30 by default.

```bash
curl -G https://app.userloop.io/api/v1/written-answers \
  -H "Authorization: Bearer ulk_live_…" \
  --data-urlencode "survey_id=1710884429805x361876466030084100" \
  --data-urlencode "search=delivery"
```

```json
{
  "data": [
    {
      "response_id": "3f9c1a7e5b2d48c6a0e1f7b9d3c5a8e2f4b6d8a0c2e4f6a8b0d2c4e6f8a0b2c4",
      "row_id": "b71e0c94d2a6483f95e8c1d7a0f3b6e2c9d4a8f1e7b0c3d6a9f2e5b8c1d4a7f0",
      "text": "Delivery took a week longer than promised.",
      "kind": "text",
      "question_id": "1710884447730x902114583120896000",
      "question": "What could we do better?",
      "survey": { "public_id": "1710884429805x361876466030084100", "title": "Post-purchase survey" },
      "customer": { "name": "J. D.", "email": "ja**@ex*****.com", "masked": true },
      "order": { "order_number": 1042, "total": 64.5, "currency": "GBP" },
      "channel": "thank_you",
      "received_at": "2026-11-09T18:04:11.000Z"
    }
  ],
  "has_more": false,
  "next_cursor": null,
  "partial": false
}
```

`kind` is `text` (an open-ended answer), `other` (typed with an "Other" answer; `choice` names the answer it was typed for) or `video` (a transcript). `text` is at most 2,000 characters; `text_truncated: true` says it was cut. `row_id` is the answer's own ID, which tells two written answers of one submission apart.

## Look a customer up by email

UserLoop has no customer ID: a customer is known by their email address. Both lookups need a key created with **Include customers’ contact details when asked**; any other key gets `403 contact_details_not_allowed`. The address matches its spelling as supplied, with surrounding spaces removed, or in lower case. An older address stored only with a different mix of capitals may not match; use its stored spelling.

To list every response from one person, add `email` to `GET /responses` (it works on `GET /written-answers` and `GET /customers` too):

```bash
curl -G https://app.userloop.io/api/v1/responses \
  -H "Authorization: Bearer ulk_live_…" \
  --data-urlencode "email=jane@example.com" \
  --data-urlencode "include_contact_details=true"
```

For their profile, put the address in the path of `GET /customers/{email}`, URL-encoded (`@` is `%40`):

```bash
curl "https://app.userloop.io/api/v1/customers/jane%40example.com?include_contact_details=true" \
  -H "Authorization: Bearer ulk_live_…"
```

```json
{
  "customer": { "name": "Jane Doe", "email": "jane@example.com", "shopify_customer_id": "7781234567890" },
  "first_seen": "2026-06-02T09:15:22.000Z",
  "last_seen": "2026-11-09T18:04:11.000Z",
  "responses": 3,
  "surveys": [{ "public_id": "1710884429805x361876466030084100", "title": "Post-purchase survey" }],
  "orders": 2,
  "order_value": [{ "amount": 129.0, "currency": "GBP" }],
  "recent_orders": [
    { "order_id": "5839201847361", "order_number": 1042, "total": 64.5, "currency": "GBP", "at": "2026-11-09T18:03:40.000Z", "survey": "Post-purchase survey" }
  ],
  "history": [
    {
      "response_id": "3f9c1a7e5b2d48c6a0e1f7b9d3c5a8e2f4b6d8a0c2e4f6a8b0d2c4e6f8a0b2c4",
      "survey": { "public_id": "1710884429805x361876466030084100", "title": "Post-purchase survey" },
      "received_at": "2026-11-09T18:04:11.000Z",
      "channel": "thank_you",
      "customer": { "name": "Jane Doe", "email": "jane@example.com" },
      "answers": [{ "question_id": "1710884436289x589566297607766000", "question": "How likely are you to recommend us to a friend?", "type": "number_score", "score": 4 }]
    }
  ]
}
```

`history` holds their submissions, newest first: 20 by default, up to 50 with `max_responses`. `history_truncated: true` says older ones were left out. Without `include_contact_details=true` the lookup still works, but the body masks the name and email. Nobody has answered with that address: `404 not_found`.

Customer `responses` and `customer_summary.responses` count answers, including each selected multi select option. They do not count the items in `history`.

`GET /customers` lists people rather than submissions, one item per customer across all surveys, most recently active first, with the same filters. An `answer` condition there matches across all of a customer's responses, so it finds, for example, everyone who has ever answered "Instagram".

## Check it worked

The first request returns `200` with a `data` array. If it is empty, widen the range (`range=all`) or drop a filter: an empty list with `has_more: false` means nothing matched.

## What can go wrong

| You see | What to do |
| --- | --- |
| `400 invalid_request`, with `errors` naming a parameter | The parameter is unknown, given twice, or has a value the endpoint doesn't take. Check its name against the table above. |
| `400 invalid_cursor` | Send `next_cursor` back unchanged, with exactly the query that gave it. |
| `403 insufficient_scope`, `required_scope: "responses:read"` | Create a key with the `responses:read` scope. |
| `403 contact_details_not_allowed` | You asked for contact details or used `email` with a key that doesn't allow them. Create a key with **Include customers’ contact details when asked**. |
| `404 not_found` on `/responses/{response_id}` | No response in this organisation has that ID. |
| `partial: true` | Narrow the date range; see above. |

Every error is a problem document; [Errors](https://docs.userloop.io/developers/api/errors/) lists them all.

## Related

- [Read scores and analytics](https://docs.userloop.io/developers/api/read-scores-and-analytics/)
- [Receive responses as they happen](https://docs.userloop.io/developers/webhooks/receive-responses/)
- [Customer contact details in responses](https://docs.userloop.io/developers/api/contact-details/)
- [API reference](https://docs.userloop.io/developers/api/reference/)

Source: https://docs.userloop.io/developers/api/list-and-search-responses/index.mdx
