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

# Survey webhooks

> Receive survey responses in your backend: survey.response.completed, survey.response.answered and survey.response.partial events, payload and migration from ticket webhooks.

Add a webhook under **Project settings → Integrations → Webhooks** and pick the survey events you need. Responses no longer create tickets, so survey integrations use these events instead of `ticket.created`.

## Events

| Event | When | Default |
| - | - | - |
| `survey.response.completed` | A respondent reached an ending. | On for new webhooks |
| `survey.response.answered` | A question was answered (the response may still be in progress). High volume — one event per answer. | Opt-in |
| `survey.response.partial` | A response stopped without reaching an ending: no new answer for 30 minutes. | Opt-in |

A response sends `survey.response.partial` at most once. If the person comes back and finishes, `survey.response.completed` follows.

## Payload

Answers are keyed by each question's answer `key`, so payloads stay stable when you reword or reorder questions.

```json theme={null}
{
  "event": "survey.response.completed",
  "data": {
    "response": {
      "id": "rsp_4kq9X2mT7vB1nR8sLp3Z",
      "status": "completed",
      "version": 3,
      "answers": { "nps_score": 4, "detractor_reason": "Slack sync stopped twice this week" },
      "path": ["q_nps", "q_detractor", "end_thanks"],
      "endingId": "end_thanks",
      "channel": "web",
      "fields": { "plan": "pro" },
      "language": "en",
      "pageUrl": "https://app.yourcompany.com/settings",
      "startedAt": "2026-10-06T09:12:03.000Z",
      "completedAt": "2026-10-06T09:12:41.000Z"
    },
    "survey": { "id": "q7x2kd", "name": "Post-onboarding NPS", "version": 3 },
    "contact": { "userId": "user_1842", "name": "Ada Lovelace", "email": "ada@example.com" }
  }
}
```

* `survey.id` is the survey's SDK id — the value you pass to `Gleap.showSurvey`.
* `contact` is `null` for anonymous respondents.
* Answer values: numbers for scales and `number`, the choice id for `single`, an array of choice ids for `multi`, `true` / `false` for `yesno`, strings for text inputs and `YYYY-MM-DD` for dates. "Other" answers are `{ "other": "…" }`. See [Survey definition](/documentation/surveys/definition#blocks).
* `survey.response.answered` carries the response as it is at that moment (`status: "in_progress"`), including all answers so far.

## Migrating from ticket webhooks

Before Surveys 2.0, every survey response created a ticket of type Survey, and integrations listened to `ticket.created` filtered to surveys.

<Note>
  **Legacy compatibility until January 5, 2027.** Webhooks on `ticket.created` that received survey tickets before — filtered to the Survey type, or without a type filter — keep receiving a ticket-shaped payload for every completed response: `formData` keyed by the old question names (migrated surveys) or answer keys with choices as their label text, `session` with the same contact fields as before, and `surveyResponse` with the response id. Move those integrations to `survey.response.completed` before then.
</Note>

The ticket-type filter of a webhook only narrows ticket and message events, so a webhook filtered to Survey also receives the `survey.response.*` events you add to it.

To act on responses inside Gleap — email the respondent, open a ticket, notify a teammate — use a [survey automation](/documentation/surveys/automations).

Mapping from the old payload:

| Old (`ticket.created`, type Survey) | New (`survey.response.completed`) |
| - | - |
| `formData.<question name>` | `data.response.answers.<answer key>` (migrated surveys use the old question names, converted to snake\_case, as keys) |
| `session` | `data.contact` |
| ticket `outbound` | `data.survey.id` / `data.survey.name` |
| `createdAt` | `data.response.completedAt` |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.