---
title: "Customer contact details in responses"
description: "When the UserLoop API masks customers' email addresses, names and phone numbers, which fields that affects, and how to get them in full."
---

> 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.

# Customer contact details in responses

The API masks customers' email addresses, names and phone numbers unless two things are true: the API key was created to allow contact details, and the request asks for them. Masked values still tell customers apart, so most code never needs the real ones.

## Two switches, both needed

| The key | The request | What you get |
| --- | --- | --- |
| Created without contact details | Doesn't ask | Masked |
| Created without contact details | Asks with `include_contact_details=true` | `403` `contact_details_not_allowed` |
| Created with contact details | Doesn't ask | Masked |
| Created with contact details | Asks with `include_contact_details=true` | In full |

- **The key:** tick **Include customers’ contact details when asked** when you create it on the API keys page. It can't be changed afterwards. `GET /me` shows it as `key.contact_details`, and the API keys page in the **Contact details** column.
- **The request:** add `include_contact_details=true` to the query. It works on the endpoints that return customers, which all need the `responses:read` scope:
  - `GET /responses` and `GET /responses/{response_id}`
  - `GET /written-answers`
  - `GET /customers` and `GET /customers/{email}`
  - `GET /surveys/{survey_id}/analytics`, for the written answers it quotes

Ask only when your code needs the details. Masked data is safer to log, cache and pass to other tools.

## What a masked value looks like

```bash
curl -s "https://app.userloop.io/api/v1/responses?limit=1" \
  -H "Authorization: Bearer ulk_live_…"
```

```json
{
  "data": [
    {
      "response_id": "jh72kd9x4c1v8b5n3m6q0w7e2r4t8y1u",
      "survey": { "public_id": "Nq8XcT2w", "title": "Post-purchase survey" },
      "received_at": "2026-11-10T14:03:22.000Z",
      "channel": "thank_you",
      "customer": {
        "name": "J. D.",
        "email": "ja**@ex*****.com",
        "shopify_customer_id": "7712345678901",
        "masked": true
      },
      "answers": [
        {
          "question_id": "Xb3kP9qR",
          "question": "Anything we could do better?",
          "type": "open_ended",
          "answer": ["The box was damaged. Email me at ja**@ex*****.com"]
        },
        {
          "question_id": "Tm7wL2cN",
          "question": "Can we call you about it?",
          "type": "phone",
          "answer": ["+** **** ****23"]
        }
      ]
    }
  ],
  "has_more": true,
  "next_cursor": "eyJ2IjoxLCJ0Ijoic2VhcmNoX3Jlc3BvbnNlcyIsImMiOiIxNzYyNzgzNDAyMDAwIiwicSI6ImUzYjBjNDQyIn0",
  "partial": false
}
```

With a key that allows contact details, the same request with `&include_contact_details=true` returns `"name": "Jane Doe"`, `"email": "jane@example.com"`, the full phone number and the written answer as the customer typed it, and leaves out `masked`.

## How each value is masked

| Value | In full | Masked |
| --- | --- | --- |
| Email address | `jane@example.com` | `ja**@ex*****.com`: the first two characters of the name and of the domain, the rest as `*`, then the ending |
| Something in an email field that isn't one clean address, such as `Jane <jane@example.com>` | as typed | `***` |
| Name | `Jane Doe` | `J. D.`: the first letter of each word |
| Phone number | `+44 7700 900123` | `+** **** ****23`: every digit but the last two as `*` |
| An email address inside text | `Email me at jane@example.com` | `Email me at ja**@ex*****.com` |

## Which fields are masked

| Field | Where | What is masked |
| --- | --- | --- |
| `customer.email` | Responses, written answers, customers, a customer's history | The address |
| `customer.name` | The same | The name |
| `customer.masked` | The same | Present, as `true`, when the name and email are masked |
| `answers[].answer` of an `email` question | Responses | The address |
| `answers[].answer` of a `phone` question | Responses | The number |
| `answers[].answer` of other questions, `answers[].other_text` | Responses | Email addresses inside the text |
| `text` and `choice` | Written answers | Email addresses inside the text |
| `latest.quote` and `latest.answers` | Customers | Email addresses inside the text |
| `attribution.landing_site` | Responses | Email addresses inside the address |
| Quoted written answers | Survey analytics | Email addresses inside the text |

Never masked: `shopify_customer_id`, IDs, the order, scores, chosen answers' IDs, and UTM values.

Masking is the same everywhere a submission appears, so a value you see in a list matches the one in `GET /responses/{response_id}`.

## What a key without contact details can't do

A key created without contact details can't be used to find out a customer's details another way:

- **Look a customer up by email:** the `email` filter on `GET /responses`, `GET /written-answers` and `GET /customers`, and `GET /customers/{email}`, answer `403` `contact_details_not_allowed`.
- **Search by email or name:** `search` matches the words of written answers only.
- **Download a file with contact details:** an export made with the `customer` columns, or a PDF report made with `customer_details`, answers `403` `contact_details_not_allowed` on its download. Asking for a PDF report with `"customer_details": true` is refused the same way.
- **Create a webhook that sends contact details:** `POST /webhooks` with `"include_contact_details": true` is refused the same way. See [Receive responses as they happen](https://docs.userloop.io/developers/webhooks/receive-responses/).

```json
{
  "type": "https://app.userloop.io/api/v1/problems/contact_details_not_allowed",
  "title": "Contact details not allowed",
  "status": 403,
  "detail": "This API key was created without access to customers' contact details. Leave out include_contact_details and customer_details, or create a key with that option.",
  "instance": "req_5Rb8YmC3nX0vK2qT",
  "code": "contact_details_not_allowed"
}
```

To use any of these, create a new key with **Include customers’ contact details when asked** ticked.

Even with such a key, `GET /customers/{email}` masks the customer's name and email in the body unless you add `include_contact_details=true`.

## Related

- [Authentication and scopes](https://docs.userloop.io/developers/api/authentication/)
- [List and search responses](https://docs.userloop.io/developers/api/list-and-search-responses/)
- [Shopper privacy: what UserLoop collects](https://docs.userloop.io/account/shopper-privacy/)

Source: https://docs.userloop.io/developers/api/contact-details/index.mdx
