> For the complete documentation index, see [llms.txt](https://api-docs.intratool.help/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api-docs.intratool.help/api-reference/surveys/surveys.md).

# Surveys

## Introduction

`Surveys` collect one or more selections from targeted users and departments.

The `description` field uses the shared [Rich Text](/introduction/rich-text.md) HTML format.

## Model Definition

**Alias**

`survey`

**Computed Properties**

* `hash` - Hashed survey ID.
* `url` - Stable survey URL.
* `answer_options_summary` - Vote count per answer option when explicitly appended.
* `current_vote` - Current user's vote when explicitly appended.

**Capabilities**

* [Targetables](/introduction/resource-capabilities/targetables.md) - Explicit users and departments or a supported targetable parent define eligible voters.
* [Entity Permissions](/introduction/resource-capabilities/entity-permissions.md) - Direct administration grants supplement module permissions.
* [URL Context](/introduction/resource-capabilities/url-context.md) - Survey URLs resolve to access-checked context.
* [Translations](/introduction/resource-capabilities/translations.md) - Localizes `title` and `description`; examples use `en-US`.

**Relations**

| Key                   | Relation                                                               | Type            | Relation Field(s)                       |
| --------------------- | ---------------------------------------------------------------------- | --------------- | --------------------------------------- |
| `user`                | [User](/api-reference/users.md)                                        | Belongs to      | `user_id`                               |
| `folder`              | [Folder](/api-reference/folders.md)                                    | Belongs to      | `folder_id`                             |
| `targetable`          | Supported targetable entity                                            | Morph to        | `targetable_type`, `targetable_id`      |
| `users`               | [Users](/api-reference/users.md)                                       | Belongs to many | `survey_user`                           |
| `departments`         | [Departments](/api-reference/departments.md)                           | Belongs to many | `department_survey`                     |
| `surveyAnswerOptions` | [SurveyAnswerOptions](/api-reference/surveys/survey-answer-options.md) | Has many        | `survey_id`                             |
| `surveyVotes`         | [SurveyVotes](/api-reference/surveys/survey-votes.md)                  | Has many        | `survey_id`                             |
| `currentVote`         | [SurveyVote](/api-reference/surveys/survey-votes.md)                   | Has one         | `survey_id`, `department_id`, `user_id` |
| `entityPermissions`   | [EntityPermissions](/api-reference/entity-permissions.md)              | Morph many      | `target_entity`, `target_entity_id`     |

**Types**

* `singleChoice` - Allows one selected answer option per vote.
* `multipleChoice` - Allows multiple selected answer options per vote.

**Show Votes Types**

* `none` - Does not expose vote results to voters.
* `always` - Exposes vote results while the survey is available.
* `after_vote` - Exposes vote results after the current voter has submitted a vote.
* `after_survey_end` - Exposes vote results after the survey has ended.

**Targetable Types**

* `chatMessage` - Targets the audience of a [ChatMessage](/api-reference/chat/chat-messages.md).
* `infoboardPost` - Targets the audience of an [InfoboardPost](/api-reference/infoboard/infoboard-posts.md).
* `manualEntry` - Targets the audience of a [ManualEntry](/api-reference/manual/manual-entries.md).

## List

List visible `Surveys`.

**Definition**

<mark style="color:green;">`GET`</mark> `/api/surveys`

**Request Keys**

| Key         | Type      | Default           | Description                                                                            |
| ----------- | --------- | ----------------- | -------------------------------------------------------------------------------------- |
| `selects`   | `string`  | All fields        | Comma-separated fields to return.                                                      |
| `relations` | `string`  | Default relations | Pipe-separated relations to include.                                                   |
| `appends`   | `string`  | Default appends   | Pipe-separated computed properties such as `answer_options_summary` or `current_vote`. |
| `limit`     | `integer` | No limit          | Maximum number of surveys.                                                             |
| `filters`   | `object`  | No filters        | [Value filters](/introduction/query-manipulation/value-filters.md).                    |

**Example Request**

{% tabs %}
{% tab title="PHP" %}

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('GET', '/api/surveys', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
[
  {
    "id": 31,
    "user_id": 7,
    "folder_id": 10,
    "targetable_id": null,
    "targetable_type": null,
    "lang_id": "en-US",
    "type": "singleChoice",
    "active": true,
    "title": "Cafeteria satisfaction",
    "description": "<p>How satisfied are you with the cafeteria?</p>",
    "show_votes_type": "after_vote",
    "assign_mode": "any_of",
    "user_confirmation_required": false,
    "one_vote_per_department": false,
    "anonymous": false,
    "sort_number": 1,
    "start_date": "2026-08-01 00:00:00",
    "end_date": "2026-08-31 23:59:59",
    "hash": "qR"
  },
  {
    "id": 32,
    "user_id": 8,
    "folder_id": null,
    "targetable_id": 204,
    "targetable_type": "infoboardPost",
    "lang_id": "en-US",
    "type": "multipleChoice",
    "active": true,
    "title": "Choose the next training topics",
    "description": "<p>Select every topic that interests you.</p>",
    "show_votes_type": "after_survey_end",
    "assign_mode": null,
    "user_confirmation_required": true,
    "one_vote_per_department": true,
    "anonymous": true,
    "sort_number": 2,
    "start_date": null,
    "end_date": "2026-09-15 17:00:00",
    "hash": "rS"
  }
]
```

## Show

Show one visible `Survey`.

**Definition**

<mark style="color:green;">`GET`</mark> `/api/surveys/{survey}`

**Route Parameters**

| Parameter | Type      | Description |
| --------- | --------- | ----------- |
| `survey`  | `integer` | Survey ID.  |

**Request Keys**

| Key         | Type     | Default           | Description                          |
| ----------- | -------- | ----------------- | ------------------------------------ |
| `selects`   | `string` | All fields        | Comma-separated fields to return.    |
| `relations` | `string` | Default relations | Pipe-separated relations to include. |
| `appends`   | `string` | Default appends   | Pipe-separated computed properties.  |

**Behavior**

For anonymous surveys, voter-specific attributes and relations are removed from nested vote data.

**Example Request**

{% tabs %}
{% tab title="PHP" %}

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('GET', '/api/surveys/31', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "id": 31,
  "user_id": 7,
  "folder_id": 10,
  "targetable_id": null,
  "targetable_type": null,
  "lang_id": "en-US",
  "type": "singleChoice",
  "active": true,
  "title": "Cafeteria satisfaction",
  "description": "<p>How satisfied are you with the cafeteria?</p>",
  "show_votes_type": "after_vote",
  "assign_mode": "any_of",
  "user_confirmation_required": false,
  "one_vote_per_department": false,
  "anonymous": false,
  "sort_number": 1,
  "start_date": "2026-08-01 00:00:00",
  "end_date": "2026-08-31 23:59:59",
  "hash": "qR"
}
```

## Admin: List

List all `Surveys` in administration scope.

**Definition**

<mark style="color:green;">`GET`</mark> `/api/administration/surveys`

**Request Keys**

| Key         | Type      | Default           | Description                                                                            |
| ----------- | --------- | ----------------- | -------------------------------------------------------------------------------------- |
| `selects`   | `string`  | All fields        | Comma-separated fields to return.                                                      |
| `relations` | `string`  | Default relations | Pipe-separated relations to include.                                                   |
| `appends`   | `string`  | Default appends   | Pipe-separated computed properties such as `answer_options_summary` or `current_vote`. |
| `limit`     | `integer` | No limit          | Maximum number of surveys.                                                             |
| `filters`   | `object`  | No filters        | [Value filters](/introduction/query-manipulation/value-filters.md).                    |

**Behavior**

Administration results can include inactive and soft-deleted surveys.

**Example Request**

{% tabs %}
{% tab title="PHP" %}

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('GET', '/api/administration/surveys', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
[
  {
    "id": 31,
    "user_id": 7,
    "folder_id": 10,
    "targetable_id": null,
    "targetable_type": null,
    "lang_id": "en-US",
    "type": "singleChoice",
    "active": true,
    "title": "Cafeteria satisfaction",
    "description": "<p>How satisfied are you with the cafeteria?</p>",
    "show_votes_type": "after_vote",
    "assign_mode": "any_of",
    "user_confirmation_required": false,
    "one_vote_per_department": false,
    "anonymous": false,
    "sort_number": 1,
    "start_date": "2026-08-01 00:00:00",
    "end_date": "2026-08-31 23:59:59",
    "hash": "qR"
  },
  {
    "id": 32,
    "user_id": 8,
    "folder_id": null,
    "targetable_id": 204,
    "targetable_type": "infoboardPost",
    "lang_id": "en-US",
    "type": "multipleChoice",
    "active": false,
    "title": "Choose the next training topics",
    "description": "<p>Select every topic that interests you.</p>",
    "show_votes_type": "after_survey_end",
    "assign_mode": null,
    "user_confirmation_required": true,
    "one_vote_per_department": true,
    "anonymous": true,
    "sort_number": 2,
    "start_date": null,
    "end_date": "2026-09-15 17:00:00",
    "hash": "rS",
    "deleted_at": "2026-08-02 09:00:00"
  }
]
```

## Admin: Show

Show one `Survey` in administration scope.

**Definition**

<mark style="color:green;">`GET`</mark> `/api/administration/surveys/{survey}`

**Route Parameters**

| Parameter | Type      | Description |
| --------- | --------- | ----------- |
| `survey`  | `integer` | Survey ID.  |

**Request Keys**

| Key         | Type     | Default           | Description                          |
| ----------- | -------- | ----------------- | ------------------------------------ |
| `selects`   | `string` | All fields        | Comma-separated fields to return.    |
| `relations` | `string` | Default relations | Pipe-separated relations to include. |
| `appends`   | `string` | Default appends   | Pipe-separated computed properties.  |

**Example Request**

{% tabs %}
{% tab title="PHP" %}

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('GET', '/api/administration/surveys/32', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "id": 32,
  "user_id": 8,
  "folder_id": null,
  "targetable_id": 204,
  "targetable_type": "infoboardPost",
  "lang_id": "en-US",
  "type": "multipleChoice",
  "active": true,
  "title": "Choose the next training topics",
  "description": "<p>Select every topic that interests you.</p>",
  "show_votes_type": "after_survey_end",
  "assign_mode": null,
  "user_confirmation_required": true,
  "one_vote_per_department": true,
  "anonymous": true,
  "sort_number": 2,
  "start_date": null,
  "end_date": "2026-09-15 17:00:00",
  "hash": "rS"
}
```

## Admin: Create

Create a new `Survey`.

**Definition**

<mark style="color:yellow;">`POST`</mark> `/api/administration/surveys`

**Request Keys**

| Key                          | Type                 | Default                 | Description                                                                                    |
| ---------------------------- | -------------------- | ----------------------- | ---------------------------------------------------------------------------------------------- |
| `lang_id`                    | `string`             | System language         | Language key. Use `en-US` for this example.                                                    |
| `type`\*                     | `string`             | -                       | Selects one of the supported [Types](#types).                                                  |
| `title`\*                    | `string`             | -                       | Survey title.                                                                                  |
| `description`                | `string` \| `null`   | `null`                  | HTML description.                                                                              |
| `active`                     | `boolean`            | `false`                 | Whether the survey can be answered.                                                            |
| `show_votes_type`            | `string`             | System default          | Selects one of the supported [Show Votes Types](#show-votes-types).                            |
| `assign_mode`                | `string` \| `null`   | Default assignment mode | [Assignment mode](/introduction/assignment-and-targeting.md); ignored for a targetable parent. |
| `user_ids`                   | `array` \| `null`    | `[]`                    | Directly targeted user IDs.                                                                    |
| `department_ids`             | `array` \| `null`    | `[]`                    | Directly targeted department IDs.                                                              |
| `targetable_type`            | `string` \| `null`   | `null`                  | Supported targetable morph alias.                                                              |
| `targetable_id`              | `integer` \| `null`  | `null`                  | Targetable entity ID.                                                                          |
| `user_confirmation_required` | `boolean`            | `false`                 | Require confirmed user identity.                                                               |
| `one_vote_per_department`    | `boolean`            | `false`                 | Limit voting by department instead of user.                                                    |
| `anonymous`                  | `boolean`            | `false`                 | Suppress voter information in permitted responses.                                             |
| `start_date`                 | `datetime` \| `null` | `null`                  | Voting start.                                                                                  |
| `end_date`                   | `datetime` \| `null` | `null`                  | Voting end.                                                                                    |
| `folder_id`                  | `integer` \| `null`  | `null`                  | Folder ID.                                                                                     |
| `sort_number`                | `integer`            | Auto                    | Display order.                                                                                 |
| `entity_permissions`         | `object`             | Unrestricted            | [Entity Permissions](/introduction/resource-capabilities/entity-permissions.md).               |

Keys with `*` are required for creation.

**Example Request**

{% tabs %}
{% tab title="PHP" %}

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('POST', '/api/administration/surveys', [
    'headers' => ['Authorization' => "Bearer {accessToken}"],
    'json' => [
        'lang_id' => 'en-US',
        'type' => 'singleChoice',
        'title' => 'Cafeteria satisfaction',
        'description' => '<p>How satisfied are you with the cafeteria?</p>',
        'active' => true,
        'show_votes_type' => 'after_vote',
        'assign_mode' => 'any_of',
        'user_ids' => [7, 8],
        'department_ids' => [6, 9],
        'user_confirmation_required' => false,
        'one_vote_per_department' => false,
        'anonymous' => false,
        'start_date' => '2026-08-01 00:00:00',
        'end_date' => '2026-08-31 23:59:59',
        'folder_id' => 10,
        'sort_number' => 1
    ]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "status": "success",
  "data": {
    "id": 31,
    "user_id": 7,
    "folder_id": 10,
    "targetable_id": null,
    "targetable_type": null,
    "lang_id": "en-US",
    "type": "singleChoice",
    "active": true,
    "title": "Cafeteria satisfaction",
    "description": "<p>How satisfied are you with the cafeteria?</p>",
    "show_votes_type": "after_vote",
    "assign_mode": "any_of",
    "user_confirmation_required": false,
    "one_vote_per_department": false,
    "anonymous": false,
    "sort_number": 1,
    "start_date": "2026-08-01 00:00:00",
    "end_date": "2026-08-31 23:59:59",
    "hash": "qR"
  }
}
```

## Admin: Update

Update an existing `Survey`.

**Definition**

<mark style="color:blue;">`PUT`</mark> `/api/administration/surveys/{survey}`

**Route Parameters**

| Parameter | Type      | Description |
| --------- | --------- | ----------- |
| `survey`  | `integer` | Survey ID.  |

**Request Keys**

| Key                          | Type                 | Default                 | Description                                                                                    |
| ---------------------------- | -------------------- | ----------------------- | ---------------------------------------------------------------------------------------------- |
| `lang_id`                    | `string`             | System language         | Language key. Use `en-US` for this example.                                                    |
| `type`\*                     | `string`             | -                       | Selects one of the supported [Types](#types).                                                  |
| `title`\*                    | `string`             | -                       | Survey title.                                                                                  |
| `description`                | `string` \| `null`   | `null`                  | HTML description.                                                                              |
| `active`                     | `boolean`            | `false`                 | Whether the survey can be answered.                                                            |
| `show_votes_type`            | `string`             | System default          | Selects one of the supported [Show Votes Types](#show-votes-types).                            |
| `assign_mode`                | `string` \| `null`   | Default assignment mode | [Assignment mode](/introduction/assignment-and-targeting.md); ignored for a targetable parent. |
| `user_ids`                   | `array` \| `null`    | `[]`                    | Directly targeted user IDs.                                                                    |
| `department_ids`             | `array` \| `null`    | `[]`                    | Directly targeted department IDs.                                                              |
| `targetable_type`            | `string` \| `null`   | `null`                  | Supported targetable morph alias.                                                              |
| `targetable_id`              | `integer` \| `null`  | `null`                  | Targetable entity ID.                                                                          |
| `user_confirmation_required` | `boolean`            | `false`                 | Require confirmed user identity.                                                               |
| `one_vote_per_department`    | `boolean`            | `false`                 | Limit voting by department instead of user.                                                    |
| `anonymous`                  | `boolean`            | `false`                 | Suppress voter information in permitted responses.                                             |
| `start_date`                 | `datetime` \| `null` | `null`                  | Voting start.                                                                                  |
| `end_date`                   | `datetime` \| `null` | `null`                  | Voting end.                                                                                    |
| `folder_id`                  | `integer` \| `null`  | `null`                  | Folder ID.                                                                                     |
| `sort_number`                | `integer`            | Auto                    | Display order.                                                                                 |
| `entity_permissions`         | `object`             | Unrestricted            | [Entity Permissions](/introduction/resource-capabilities/entity-permissions.md).               |

**Behavior**

After the first vote, configured immutable attributes such as survey type cannot be changed. Use Reset when those settings must change and existing votes may be removed.

**Example Request**

{% tabs %}
{% tab title="PHP" %}

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('PUT', '/api/administration/surveys/31', [
    'headers' => ['Authorization' => "Bearer {accessToken}"],
    'json' => [
        'lang_id' => 'en-US',
        'title' => 'Cafeteria and catering satisfaction',
        'description' => '<p>How satisfied are you with food services?</p>',
        'end_date' => '2026-09-07 23:59:59',
        'user_ids' => [7, 8],
        'department_ids' => [6, 9]
    ]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "status": "success",
  "data": {
    "id": 31,
    "user_id": 7,
    "folder_id": 10,
    "targetable_id": null,
    "targetable_type": null,
    "lang_id": "en-US",
    "type": "singleChoice",
    "active": true,
    "title": "Cafeteria and catering satisfaction",
    "description": "<p>How satisfied are you with food services?</p>",
    "show_votes_type": "after_vote",
    "assign_mode": "any_of",
    "user_confirmation_required": false,
    "one_vote_per_department": false,
    "anonymous": false,
    "sort_number": 1,
    "start_date": "2026-08-01 00:00:00",
    "end_date": "2026-09-07 23:59:59",
    "hash": "qR"
  }
}
```

## Admin: Reset

Reset an existing `Survey`.

**Definition**

<mark style="color:blue;">`PUT`</mark> `/api/administration/surveys/{survey}/reset`

**Route Parameters**

| Parameter | Type      | Description |
| --------- | --------- | ----------- |
| `survey`  | `integer` | Survey ID.  |

**Request Keys**

| Key                          | Type                 | Default                 | Description                                                                                    |
| ---------------------------- | -------------------- | ----------------------- | ---------------------------------------------------------------------------------------------- |
| `lang_id`                    | `string`             | System language         | Language key. Use `en-US` for this example.                                                    |
| `type`\*                     | `string`             | -                       | Selects one of the supported [Types](#types).                                                  |
| `title`\*                    | `string`             | -                       | Survey title.                                                                                  |
| `description`                | `string` \| `null`   | `null`                  | HTML description.                                                                              |
| `active`                     | `boolean`            | `false`                 | Whether the survey can be answered.                                                            |
| `show_votes_type`            | `string`             | System default          | Selects one of the supported [Show Votes Types](#show-votes-types).                            |
| `assign_mode`                | `string` \| `null`   | Default assignment mode | [Assignment mode](/introduction/assignment-and-targeting.md); ignored for a targetable parent. |
| `user_ids`                   | `array` \| `null`    | `[]`                    | Directly targeted user IDs.                                                                    |
| `department_ids`             | `array` \| `null`    | `[]`                    | Directly targeted department IDs.                                                              |
| `targetable_type`            | `string` \| `null`   | `null`                  | Supported targetable morph alias.                                                              |
| `targetable_id`              | `integer` \| `null`  | `null`                  | Targetable entity ID.                                                                          |
| `user_confirmation_required` | `boolean`            | `false`                 | Require confirmed user identity.                                                               |
| `one_vote_per_department`    | `boolean`            | `false`                 | Limit voting by department instead of user.                                                    |
| `anonymous`                  | `boolean`            | `false`                 | Suppress voter information in permitted responses.                                             |
| `start_date`                 | `datetime` \| `null` | `null`                  | Voting start.                                                                                  |
| `end_date`                   | `datetime` \| `null` | `null`                  | Voting end.                                                                                    |
| `folder_id`                  | `integer` \| `null`  | `null`                  | Folder ID.                                                                                     |
| `sort_number`                | `integer`            | Auto                    | Display order.                                                                                 |
| `entity_permissions`         | `object`             | Unrestricted            | [Entity Permissions](/introduction/resource-capabilities/entity-permissions.md).               |

**Behavior**

Applies the supplied changes and soft-deletes every existing vote for the survey. Omitted settings keep their current values.

**Example Request**

{% tabs %}
{% tab title="PHP" %}

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('PUT', '/api/administration/surveys/31/reset', [
    'headers' => ['Authorization' => "Bearer {accessToken}"],
    'json' => [
        'type' => 'multipleChoice',
        'show_votes_type' => 'after_survey_end',
        'anonymous' => true,
        'user_ids' => [7, 8],
        'department_ids' => [6, 9]
    ]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "status": "success",
  "data": {
    "id": 31,
    "user_id": 7,
    "folder_id": 10,
    "targetable_id": null,
    "targetable_type": null,
    "lang_id": "en-US",
    "type": "multipleChoice",
    "active": true,
    "title": "Cafeteria satisfaction",
    "description": "<p>How satisfied are you with the cafeteria?</p>",
    "show_votes_type": "after_survey_end",
    "assign_mode": "any_of",
    "user_confirmation_required": false,
    "one_vote_per_department": false,
    "anonymous": true,
    "sort_number": 1,
    "start_date": "2026-08-01 00:00:00",
    "end_date": "2026-08-31 23:59:59",
    "hash": "qR"
  }
}
```

## Admin: Delete

Delete an existing `Survey`.

**Definition**

<mark style="color:red;">`DELETE`</mark> `/api/administration/surveys/{survey}`

**Route Parameters**

| Parameter | Type      | Description |
| --------- | --------- | ----------- |
| `survey`  | `integer` | Survey ID.  |

**Example Request**

{% tabs %}
{% tab title="PHP" %}

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('DELETE', '/api/administration/surveys/31', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "status": "success",
  "data": null
}
```

## Admin: List Targeted Users

List users targeted by one `Survey`.

**Definition**

<mark style="color:green;">`GET`</mark> `/api/administration/surveys/{survey}/targeted/users`

**Route Parameters**

| Parameter | Type      | Description |
| --------- | --------- | ----------- |
| `survey`  | `integer` | Survey ID.  |

**Request Keys**

| Key       | Type      | Default    | Description                            |
| --------- | --------- | ---------- | -------------------------------------- |
| `selects` | `string`  | All fields | Comma-separated user fields to return. |
| `limit`   | `integer` | No limit   | Maximum number of users.               |

**Example Request**

{% tabs %}
{% tab title="PHP" %}

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('GET', '/api/administration/surveys/31/targeted/users', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
[
  {
    "id": 7,
    "firstname": "Ada",
    "lastname": "Lovelace",
    "email": "ada@example.com",
    "active": true
  },
  {
    "id": 8,
    "firstname": "Grace",
    "lastname": "Hopper",
    "email": "grace@example.com",
    "active": true
  }
]
```

## Admin: List Targeted Departments

List departments targeted by one `Survey`.

**Definition**

<mark style="color:green;">`GET`</mark> `/api/administration/surveys/{survey}/targeted/departments`

**Route Parameters**

| Parameter | Type      | Description |
| --------- | --------- | ----------- |
| `survey`  | `integer` | Survey ID.  |

**Request Keys**

| Key       | Type      | Default    | Description                                  |
| --------- | --------- | ---------- | -------------------------------------------- |
| `selects` | `string`  | All fields | Comma-separated department fields to return. |
| `limit`   | `integer` | No limit   | Maximum number of departments.               |

**Example Request**

{% tabs %}
{% tab title="PHP" %}

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('GET', '/api/administration/surveys/31/targeted/departments', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
[
  {
    "id": 6,
    "name": "Engineering",
    "active": true
  },
  {
    "id": 9,
    "name": "Product",
    "active": true
  }
]
```
