@makehq/sdk
    Preparing search index...

    Class ScenarioCustomProperties

    Class providing methods for working with the custom properties data of scenarios. The available keys and their types are defined by the organization's custom property structure — see make.customPropertyStructures.items.

    Index

    Constructors

    Methods

    • Fill in custom properties data for a scenario for the first time. Fails with IM005 if the scenario already has data — use update() or replace() instead. Every item marked required in the organization's custom property structure must be given a value, or the call fails.

      Parameters

      • scenarioId: number

        The scenario ID to fill in custom properties data for

      • data: ScenarioCustomPropertiesData

        The custom properties data, keyed by structure item name

      Returns Promise<ScenarioCustomPropertiesData>

      Promise with the scenario's custom properties data

      const data = await make.scenarios.customProperties.create(80, { companyTeam: 'marketing' });
      
    • Delete all custom properties data for a scenario. This is irreversible. Unlike deleting a structure item, the underlying API does not use a confirmation flag for this call.

      Parameters

      • scenarioId: number

        The scenario ID to delete custom properties data for

      Returns Promise<void>

      await make.scenarios.customProperties.delete(80);
      
    • Replace all custom properties data for a scenario. The scenario must already have data — fails with IM013 otherwise; use create() first. Every item marked required in the structure must be given a value, or the call fails.

      Parameters

      • scenarioId: number

        The scenario ID to replace custom properties data for

      • data: ScenarioCustomPropertiesData

        The complete replacement custom properties data, keyed by structure item name

      Returns Promise<ScenarioCustomPropertiesData>

      Promise with the scenario's custom properties data

      const data = await make.scenarios.customProperties.replace(80, { companyTeam: 'engineering' });
      
    • Merge-update custom properties data for a scenario; only the specified keys are changed. The scenario must already have data — fails with IM013 otherwise; use create() first. Pass null, not undefined, to clear a key — undefined values vanish on JSON serialization and won't reach the API at all.

      Parameters

      • scenarioId: number

        The scenario ID to update custom properties data for

      • data: ScenarioCustomPropertiesData

        The custom properties data to merge in, keyed by structure item name

      Returns Promise<ScenarioCustomPropertiesData>

      Promise with the scenario's custom properties data

      const data = await make.scenarios.customProperties.update(80, { location: 'Wien, AUS' });