client.media.patch_optimizations

A method of the Media endpoint.

patch_optimizations(id: int, *, name: str = None, runs: List[dict] = None, programs: List[str] = None, networks: List[str] = None, exclude_programs: bool = None, exclude_networks: bool = None, time_slot_percentages: dict = None) Response

Edit an existing optimization

API URL: PATCH /media/optimizations/{id}

import civis
client = civis.APIClient()
response = client.media.patch_optimizations(...)
Parameters:
idint

The optimization ID.

namestr, optional

The name of the optimization.

runsList[dict], optional

The runs of the optimization.

  • market_idint

    The market ID.

  • start_datestr (date)

    The start date for the media run.

  • end_datestr (date)

    The end date for the media run.

  • force_cpmbool

    Whether to force optimization to use CPM data even if partition data is available.

  • reach_alphafloat (float)

    A tuning parameter used to adjust RF.

  • syscodesList[int]

    The syscodes for the media run.

  • rate_cardsList[str]

    The ratecards for the media run.

  • constraintsList[dict]

    The constraints for the media run.

    • targetsList[str]

      The targets to constrain.

    • budgetfloat (float)

      The maximum budget for these targets.

    • frequencyfloat (float)

      The maximum frequency for these targets.

programsList[str], optional

An array of programs that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_programs is not also set.

networksList[str], optional

An array of networks that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_networks is not also set.

exclude_programsbool, optional

If Civis Media Optimizer should exclude the programs in the programs parameter.If this value is set to false, it will make the optimization limit itself to the programs supplied through the programs parameter.An error will be thrown if programs is not also set.

exclude_networksbool, optional

If Civis Media Optimizer should exclude the networks in the networks parameter.If this value is set to false, it will make the optimization limit itself to the networks supplied through the networks.An error will be thrown if networks is not also set.

time_slot_percentagesdict, optional

The maximum amount of the budget spent on that particular day of the week, daypart, or specific time slot for broadcast and cable.

Returns:
civis.Response
  • idint

    The optimization ID.

  • authorcivis.Response
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • namestr

    The name of the optimization.

  • created_at : str (time)

  • updated_at : str (time)

  • finished_atstr (date-time)

    The end time of the last run.

  • statestr

    The state of the last run.

  • last_run_idint

    The ID of the last run.

  • spot_order_idint

    The ID for the spot order produced by the optimization.

  • archivedbool

    The archival status of the requested item(s).

  • report_linkstr

    A link to the visual report for the optimization.

  • spot_order_linkstr

    A link to the json version of the spot order.

  • file_linksList[str]

    Links to the csv and xml versions of the spot order.

  • runsList[civis.Response]

    The runs of the optimization.

    • market_idint

      The market ID.

    • start_datestr (date)

      The start date for the media run.

    • end_datestr (date)

      The end date for the media run.

    • force_cpmbool

      Whether to force optimization to use CPM data even if partition data is available.

    • reach_alphafloat (float)

      A tuning parameter used to adjust RF.

    • syscodesList[int]

      The syscodes for the media run.

    • rate_cardsList[str]

      The ratecards for the media run.

    • constraintsList[civis.Response]

      The constraints for the media run.

      • targetsList[str]

        The targets to constrain.

      • budgetfloat (float)

        The maximum budget for these targets.

      • frequencyfloat (float)

        The maximum frequency for these targets.

  • programsList[str]

    An array of programs that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_programs is not also set.

  • networksList[str]

    An array of networks that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_networks is not also set.

  • exclude_programsbool

    If Civis Media Optimizer should exclude the programs in the programs parameter.If this value is set to false, it will make the optimization limit itself to the programs supplied through the programs parameter.An error will be thrown if programs is not also set.

  • exclude_networksbool

    If Civis Media Optimizer should exclude the networks in the networks parameter.If this value is set to false, it will make the optimization limit itself to the networks supplied through the networks.An error will be thrown if networks is not also set.

  • time_slot_percentagescivis.Response

    The maximum amount of the budget spent on that particular day of the week, daypart, or specific time slot for broadcast and cable.