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

# Download Survey Rows

> Download the selected mobility survey rows as an Excel file, exactly as the table shows them

[← Employees API](/api-reference/employees/overview)

Download the selected rows of [List Survey Rows](/api-reference/employees/survey-rows) as an Excel (`.xlsx`) file: one
sheet, one line per row (answered, pending or blank), in the list's order. The file always has the same columns in the
same order, whatever the table shows on screen, so queries built on it keep working: a new column is only ever added at
the end. It writes nothing, so a Viewer can download too.

## Request

### Headers

<ParamField header="x-api-key" type="string" required>
  Your API key for authentication
</ParamField>

<ParamField header="x-organization-id" type="string" required>
  Your organization UUID
</ParamField>

### Query Parameters

The list's own query: the same perimeter, `search` and column filters as
[List Survey Rows](/api-reference/employees/survey-rows). With `filter_hash` they must be the ones the list was loaded
with.

<ParamField query="sort_by" type="string">
  The list's sort (`field:asc$other:desc`), so the file keeps the table's order.
</ParamField>

<ParamField query="lang" type="string">
  Language of the headers and labels: `es` or `en`. Catalan or no language gives Spanish; any other, English.
</ParamField>

### Body

Send either `row_ids` or `filter_hash`.

<ParamField body="row_ids" type="array[string]">
  The ticked rows (at most 5,000), looked up in the whole perimeter.
</ParamField>

<ParamField body="filter_hash" type="string">
  Every row the list matches: the `filter_hash` of [List Survey Rows](/api-reference/employees/survey-rows).
</ParamField>

<ParamField body="excluded_ids" type="array[string]">
  With `filter_hash`, the rows to leave out.
</ParamField>

## Response

`200` with the file (`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`). Columns, in order (Spanish
headers in brackets): Organization (Organización), Email, Name or ID (Nombre o ID), Period start (Inicio del periodo),
Period end (Fin del periodo), Status (Estado), Source (Fuente), File (Archivo), Survey (Encuesta), Sent (Enviada),
Times sent (Nº de envíos), Answered (Respondida), CO₂e (kg), Number of commutes (Nº de trayectos), Commuting type
(Tipo de desplazamiento), Origin (Origen), Destination (Destino), Transport (Transporte), Fuel type (Tipo de
combustible), Km to work (Km hasta el trabajo), Daily trips (Trayectos diarios), Hours worked per day (Horas trabajadas
por día), Days per week (Días por semana), Telecommuting days (Días de teletrabajo), Carpool (Coche compartido),
Creation date (Fecha de creación), Update date (Fecha de actualización).

A response with several commutes leaves the mobility columns empty and counts them in Number of commutes. An anonymous
response shows `Anonymous` instead of the email and no name.

### Errors

| Status | Code | When |
| - | - | - |
| `409` | `FILTER_HASH_MISMATCH` | The query params are not the ones the list hashed: reload the list. |
| `422` | `TOO_MANY_ROWS` | The selection holds more than 50,000 rows: narrow the filters. |


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