Optional Fields

Each response returned by API endpoints can have fields that are not returned by default, for improved performance,
in many use cases where those fields would not be needed.

Important: Object returned as a response of a created/update operation would include also the optional fields of that object.

Those requests which can return optional fields specify the list of
possible values for those fields names in an include parameter, described either as part of the URL, either as part of the request body.

Format

The include parameter must be an array when present. In URL parameters, use the following format:

include[]=field1&include[]=field2

Valid Examples

  • Including stats and variations in an experience response:
include[]=stats&include[]=variations
  • Including rules and stats in an audience response:
include[]=rules&include[]=stats.experiences_usage

Error Cases

  • Invalid format (string instead of array):
include=stats  # ❌ Wrong
include[]=stats  # ✅ Correct

Response:

{
    "code": 422,
    "message": [
        "The 'include' parameter must be a array."
    ],
    "parameters": [
        "include"
    ]
}

Fields mentioned in the include parameter can belong to Expandable Fields
in which case that respective field would be expanded by default.
Example: include[]=variations.changes for a getExperience operation, variations.changes is an expandable field of that response,
which would then be expanded by default.