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

# Surveys

> Send and manage employee mobility surveys for commuting data collection

<Note>
  **Early Access** - The Dcycle CLI is currently available for enterprise customers.
  [Contact us](/docs/support) to learn more about access.
</Note>

## Overview

The `survey` command sends and manages employee mobility surveys to collect commuting data for Scope 3 Category 7 calculations. Surveys are emailed to employees who fill in their commuting patterns (transport mode, distance, frequency).

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
dcy survey <subcommand> [flags]
```

### Available Commands

| Command  | Description                            |
| -------- | -------------------------------------- |
| `send`   | Send mobility surveys to employees     |
| `resend` | Resend surveys to pending employees    |
| `list`   | List survey employees and their status |

***

## Send Surveys

Send surveys to one or more employees. Creates the employee record and sends the survey email in one step.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
dcy survey send <emails> [flags]
```

### Examples

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
# Single employee
dcy survey send "jane@company.com" --start-date 2024-01-01 --end-date 2024-12-31

# Multiple employees (comma-separated)
dcy survey send "jane@company.com,john@company.com" --start-date 2024-01-01 --end-date 2024-12-31

# In a different language
dcy survey send "user@company.com" --start-date 2024-01-01 --end-date 2024-12-31 --lang en

# With a custom subject line
dcy survey send "team@company.com" --start-date 2024-01-01 --end-date 2024-12-31 --subject "Your commuting survey"
```

### Flags

| Flag           | Short | Required | Default | Description                                                |
| -------------- | ----- | -------- | ------- | ---------------------------------------------------------- |
| `--start-date` | —     | Yes      | —       | Survey period start (YYYY-MM-DD)                           |
| `--end-date`   | —     | Yes      | —       | Survey period end (YYYY-MM-DD)                             |
| `--lang`       | `-l`  | No       | `es`    | Survey language (`es`, `en`, `pt`, `ca`, `fr`, `de`, `it`) |
| `--subject`    | `-s`  | No       | —       | Custom email subject line                                  |
| `--org`        | —     | No       | —       | Organization ID override                                   |

***

## Resend Surveys

Resend survey emails to employees who haven't completed them. Does not create new employee records — only re-sends the survey email.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
dcy survey resend <emails> [flags]
```

### Examples

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
dcy survey resend "jane@company.com" --start-date 2024-01-01 --end-date 2024-12-31

# Change language on resend
dcy survey resend "jane@company.com,john@company.com" --start-date 2024-01-01 --end-date 2024-12-31 --lang en
```

### Flags

Same flags as `send` except `--subject`.

***

## List Survey Employees

View employees and their survey status.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
dcy survey list [flags]

# Aliases
dcy survey ls
```

### Examples

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
# List all survey employees
dcy survey list

# Filter by status
dcy survey list --status pending
dcy survey list --status loading

# Pagination
dcy survey list --page 2 --size 100

# JSON output for scripting
dcy survey list --format json
```

### Flags

| Flag       | Short | Default | Description                                       |
| ---------- | ----- | ------- | ------------------------------------------------- |
| `--status` | `-s`  | —       | Filter by status (`pending`, `loading`, `active`) |
| `--page`   | —     | `1`     | Page number                                       |
| `--size`   | —     | `50`    | Page size                                         |
| `--org`    | —     | —       | Organization ID override                          |

<Tip>
  Use `dcy survey list --status pending` to find employees who haven't completed their survey, then `dcy survey resend` to nudge them.
</Tip>

***

## Common Options

All survey commands support:

| Flag            | Description                        |
| --------------- | ---------------------------------- |
| `--format json` | JSON output (default: `text`)      |
| `--verbose`     | Show HTTP request/response details |
| `--timeout`     | Request timeout in seconds         |

***

## Workflows

### Employee Commuting Data Collection

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
# 1. Send surveys to all employees for the current year
dcy survey send "alice@company.com,bob@company.com,carol@company.com" \
  --start-date 2024-01-01 --end-date 2024-12-31 --lang en

# 2. Check who hasn't responded
dcy survey list --status pending

# 3. Resend to non-respondents
dcy survey resend "bob@company.com" \
  --start-date 2024-01-01 --end-date 2024-12-31

# 4. Review collected commute data
dcy employee list --year 2024
```
