Replace Line Item

Fully replace an existing line item with new data. Unlike Update Line Item (PATCH), this endpoint replaces the entire line item configuration — any fields not included in the request will be reset to their defaults.

Endpoint

PUT

https://lifeapi.pulsepoint.com/RestApi/v2/account/{accountId}/lineitems/{lineItemId}

Path Parameters

NameData TypeRequiredNotes
accountIdintegeryesThe account ID the line item belongs to
lineItemIdintegeryesThe unique identifier of the line item to replace

Request Field List

lineItem

NameData TypeRequiredDefaultNotes
namestringyes1–255 characters
campaignIdintegeryesThe campaign the line item belongs to
costModelENUM stringyesValid Values: CPM, Fixed CPM, CPC. CPC is only allowed for Native and Search inventory types. Fixed CPM is only available for managed service accounts
cpmPricenumberconditionalRequired when costModel is Fixed CPM. Valid range: 0.01–2000
descriptionstringnoMax 1000 characters
inventoryTypeENUM stringyesValid Values: Display, Video, Audio, Native, Search, DOOH, NativeVideo
budgetDistributionENUM stringnoDollarsValid Values: Dollars, Percent, Priority
timeZoneENUM stringyesValid Values: Eastern Time, Central Time, Mountain Time, Pacific Time, Greenwich Mean Time, Central European Time, India Standard Time, China Standard Time, Australian Eastern Time, Eastern European Time, Moscow Time, Samara Time, Maldives Time, Omsk Time, Christmas Island Time, Japan Standard Time, Sakhalin Time, New Zealand Time, Azores Time, Argentina Time, Atlantic Time (Canada), Alaska Time (USA), Hawaii Time
customFieldSettingsarray of objectsnoSee customFieldSettings below
flightsarray of objectsyesAt least one flight required. See flights below
frequencyCapobjectnoIf omitted, campaign-level frequency cap settings are used. See frequencyCap below
dayPartingobjectnoSee dayParting below
managementFeeobjectnoCannot be used with CPC cost model. See managementFee below

lineItem.customFieldSettings

NameData TypeRequiredNotes
isNewFieldbooleanyesValid Values: true, false
fieldNamestringyes1–100 characters. Must be unique to the account if isNewField is true
fieldValuestringyes1–500 characters

lineItem.flights

NameData TypeRequiredDefaultNotes
idintegernoID of an existing flight to update. If omitted, a new flight is created
budgetnumberyesFlight budget amount. Must be greater than 0, max 999999.99
startDatestringyesFormat: MM-dd-yyyy HH:mm:ss
endDatestringyesFormat: MM-dd-yyyy HH:mm:ss
pacingModeENUM stringyesValid Values: EVEN, ASAP, AHEAD
paceAheadPercentintegerconditionalRequired when pacingMode is AHEAD. Valid range: 1–99
totalImpressionCapintegernoTotal impressions allowed for the flight. Valid range: 1–999999999
dailyImpressionCapintegernoMax impressions per day for the flight. Valid range: 1–999999999
maxDailySpendOverrideobjectnoSafety cap on daily spend. Default is 2x even pacing. See maxDailySpendOverride below

lineItem.flights.maxDailySpendOverride

NameData TypeRequiredNotes
enabledbooleanyesWhen true, the type and value fields are required. When false, the default 2x multiplier is used
typeENUM stringconditionalRequired when enabled is true. Valid Values: amount, multiplier
valuenumberconditionalRequired when enabled is true. Must be greater than 0.01

lineItem.frequencyCap

NameData TypeRequiredDefaultNotes
applyFrequencyCapbooleanyes
timesintegerconditionalRequired when applyFrequencyCap is true. Valid range: 1–100
periodENUM stringconditionalRequired when applyFrequencyCap is true. Valid Values: day, hour(s), week, month
hoursValueintegerconditionalRequired when period is hour(s). Valid range: 1–1000
crossDeviceENUM stringconditionalRequired when applyFrequencyCap is true. Valid Values: Per Device, Per Person, Per Household
untrackablebooleannoInclude untrackable users
ipUntrackablebooleannoInclude IP-untrackable users

lineItem.dayParting

NameData TypeRequiredNotes
enabledbooleanyesIf false, the line item runs the full day
schedulearray of objectsyesIf enabled is true, at least one schedule entry is required

lineItem.dayParting.schedule

NameData TypeRequiredNotes
daysarray of ENUM stringsyesValid Values: mon, tue, wed, thu, fri, sat, sun
hoursarray of stringsyesMilitary time ranges on the hour. Example: 06:00-10:00

lineItem.managementFee

NameData TypeRequiredNotes
typeENUM stringyesValid Values: Percentage, CPM, PercentageAndCPM, FixedCPM
percentagenumberconditionalRequired for types Percentage or PercentageAndCPM. Valid range: 0.01–99.99
cpmnumberconditionalRequired for types CPM, PercentageAndCPM, or FixedCPM. Must be greater than 0.01

Response Field List

NameData TypeNotes
successbooleanReturns true on a successful replacement
messagestringHuman-readable result message
requestIdstringUnique identifier for the request
dataobjectThe replaced line item
data.idintegerThe line item ID
data.namestringLine item name
data.campaignIdintegerParent campaign ID
data.costModelstringPricing model
data.cpmPricenumberCPM price (Fixed CPM only)
data.descriptionstringLine item description
data.inventoryTypestringAd inventory type
data.budgetDistributionstringBudget distribution method
data.timeZonestringTimezone
data.customFieldSettingsarray of objectsSee customFieldSettings response fields below
data.customFieldSettings.fieldIdintegerCustom field setting ID
data.customFieldSettings.fieldNamestringField name
data.customFieldSettings.fieldValuestringField value
data.flightsarray of objectsSee flights response fields below
data.flights.idintegerFlight ID
data.flights.budgetnumberFlight budget amount
data.flights.startDatestringFormat: MM-dd-yyyy HH:mm:ss
data.flights.endDatestringFormat: MM-dd-yyyy HH:mm:ss
data.flights.pacingModestringValid Values: EVEN, ASAP, AHEAD
data.flights.paceAheadPercentnumberPacing percentage modifier
data.flights.totalImpressionCapintegerTotal impression cap
data.flights.dailyImpressionCapintegerDaily impression cap
data.flights.maxDailySpendOverrideobjectDaily spend override settings
data.flights.maxDailySpendOverride.enabledbooleanWhether the override is enabled
data.flights.maxDailySpendOverride.typestringValid Values: amount, multiplier
data.flights.maxDailySpendOverride.valuenumberOverride value
data.frequencyCapobjectFrequency cap settings
data.frequencyCap.applyFrequencyCapbooleanWhether frequency capping is enabled
data.frequencyCap.timesintegerImpression limit
data.frequencyCap.periodstringValid Values: day, hour(s), week, month
data.frequencyCap.hoursValueintegerCustom hours value when period is hour(s)
data.frequencyCap.crossDevicestringValid Values: Per Device, Per Person, Per Household
data.frequencyCap.untrackablebooleanInclude untrackable users
data.frequencyCap.ipUntrackablebooleanInclude IP-untrackable users
data.dayPartingobjectDay-parting settings
data.dayParting.enabledbooleanWhether day-parting is enabled
data.dayParting.schedulearray of objectsDay-parting schedule entries
data.dayParting.schedule.daysarray of stringsValid Values: mon, tue, wed, thu, fri, sat, sun
data.dayParting.schedule.hoursarray of stringsTime ranges in HH:00-HH:00 format
data.managementFeeobjectManagement fee settings
data.managementFee.typestringValid Values: Percentage, CPM, PercentageAndCPM, FixedCPM
data.managementFee.percentagenumberPercentage fee value
data.managementFee.cpmnumberCPM fee value
metaobjectMetadata about what changed
meta.changesobjectSummary of changes applied
meta.changes.updatedFieldsarray of stringsTop-level field names that changed
meta.changes.flightsModifiedintegerNumber of flights modified
meta.changes.flightsAddedintegerNumber of flights added
meta.changes.flightsRemovedintegerNumber of flights removed
meta.changes.customFieldsAddedintegerNumber of custom fields added
meta.changes.customFieldsModifiedintegerNumber of custom fields modified
meta.changes.customFieldsRemovedintegerNumber of custom fields removed

Sample Request

{
  "name": "Q2 Display Targeting",
  "campaignId": 831840,
  "costModel": "CPM",
  "description": "Targeted display advertising for Q2 campaign",
  "inventoryType": "Display",
  "timeZone": "Eastern Time",
  "budgetDistribution": "Dollars",
  "customFieldSettings": [
    {
      "isNewField": false,
      "fieldName": "CMI Placement_ID",
      "fieldValue": "CMI_12345"
    }
  ],
  "flights": [
    {
      "budget": 1500.00,
      "startDate": "04-01-2025 00:00:00",
      "endDate": "04-30-2025 23:59:59",
      "pacingMode": "EVEN",
      "totalImpressionCap": 50000
    }
  ],
  "frequencyCap": {
    "applyFrequencyCap": true,
    "times": 5,
    "period": "day",
    "crossDevice": "Per Device"
  },
  "dayParting": {
    "enabled": true,
    "schedule": [
      {
        "days": ["mon", "tue", "wed", "thu", "fri"],
        "hours": ["06:00-10:00", "17:00-23:00"]
      }
    ]
  },
  "managementFee": {
    "type": "Percentage",
    "percentage": 25
  }
}

Sample Response

{
  "success": true,
  "message": "Line item replaced successfully",
  "requestId": "550e8400-e29b-41d4-a716-446655440000",
  "data": {
    "id": 22345,
    "name": "Q2 Display Targeting",
    "campaignId": 831840,
    "costModel": "CPM",
    "description": "Targeted display advertising for Q2 campaign",
    "inventoryType": "Display",
    "budgetDistribution": "Dollars",
    "timeZone": "Eastern Time",
    "customFieldSettings": [
      {
        "fieldId": 101,
        "fieldName": "CMI Placement_ID",
        "fieldValue": "CMI_12345"
      }
    ],
    "flights": [
      {
        "id": 5001,
        "budget": 1500.00,
        "startDate": "04-01-2025 00:00:00",
        "endDate": "04-30-2025 23:59:59",
        "pacingMode": "EVEN",
        "totalImpressionCap": 50000,
        "maxDailySpendOverride": {
          "enabled": false,
          "type": "multiplier",
          "value": 2
        }
      }
    ],
    "frequencyCap": {
      "applyFrequencyCap": true,
      "times": 5,
      "period": "day",
      "crossDevice": "Per Device",
      "untrackable": false,
      "ipUntrackable": false
    },
    "dayParting": {
      "enabled": true,
      "schedule": [
        {
          "days": ["mon", "tue", "wed", "thu", "fri"],
          "hours": ["06:00-10:00", "17:00-23:00"]
        }
      ]
    },
    "managementFee": {
      "type": "Percentage",
      "percentage": 25
    }
  },
  "meta": {
    "changes": {
      "updatedFields": ["name", "inventoryType", "flights"],
      "flightsModified": 1,
      "flightsAdded": 0,
      "flightsRemoved": 1,
      "customFieldsAdded": 0,
      "customFieldsModified": 1,
      "customFieldsRemoved": 0
    }
  }
}

Errors

HTTP StatusErrorDescription
400Validation ErrorOne or more fields failed validation. See the details array in the response for field-level messages
401UnauthorizedInvalid or expired access token
403ForbiddenYou do not have permission to modify line item {lineItemId}
404Not FoundLine item with ID {lineItemId} does not exist
422Unprocessable EntityBusiness rule violation — e.g., conflicting flight dates, budget exceeded, or invalid flight end date
429Too Many RequestsRate limit exceeded
500Internal Server Error