def build_trials_response(trials: list):
    """
    Build the response representing a list of trials according to the API specification.

    Parameters
    ----------
    trials: list
        A list of :class:`orion.core.worker.trial.Trial`.

    Returns
    -------
    A JSON-serializable list of trials as defined in the API specification.
    """
    response = []
    for trial in trials:
        response.append({"id": trial.id})
    return response