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

# Using optionalFields in queries

> Request additional fields not returned by default from Automation API endpoints using the optionalFields query parameter.

## Overview

By default, some endpoints do not return every field upon resource request.
Retrieve these additional fields by specifying them in the `optionalFields` query parameter.

This guide demonstrates how to **request optional fields** using the [Get All Feature Flags](/api-reference/featureflag/get-all-feature-flags) endpoint as an example.

## Requesting optionalFields

### Example 1: Query without optionalFields

#### Request

```bash theme={null}
curl -L -X GET 'https://api.kameleoon.com/feature-flags' \
  -H 'Content-Type: application/json' \
  -H 'Accept: */*' \
  -H 'Authorization: Bearer <ACCESS_TOKEN>'
```

#### Response

```json theme={null}
[
  {
    "id": 395,
    "featureKey": "plp___4_products_per_row",
    "name": "PLP : 4 products per row",
    "description": "",
    "tags": [],
    ...
  },
  ...
]
```

Notice that the `tags` field is empty.
**Optional fields return empty values unless they are explicitly requested.**

### Example 2: Query including the tags field

#### Request

<Note>
  Request multiple optional fields by separating them with commas in the `optionalFields` parameter.
  For example, use `optionalFields=tags,description`.
</Note>

```bash theme={null}
curl -L -X GET 'https://api.kameleoon.com/feature-flags?optionalFields=tags' \
  -H 'Content-Type: application/json' \
  -H 'Accept: */*' \
  -H 'Authorization: Bearer <ACCESS_TOKEN>'
```

#### Response

```json theme={null}
[
  {
    "id": 395,
    "featureKey": "plp___4_products_per_row",
    "name": "PLP : 4 products per row",
    "description": "",
    "tags": [
      "product page"
    ],
    ...
  },
  ...
]
```
