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
| Name | Data Type | Required | Notes |
|---|---|---|---|
| accountId | integer | yes | The account ID the line item belongs to |
| lineItemId | integer | yes | The unique identifier of the line item to replace |
Request Field List
lineItem
| Name | Data Type | Required | Default | Notes |
|---|---|---|---|---|
| name | string | yes | 1–255 characters | |
| campaignId | integer | yes | The campaign the line item belongs to | |
| costModel | ENUM string | yes | Valid Values: CPM, Fixed CPM, CPC. CPC is only allowed for Native and Search inventory types. Fixed CPM is only available for managed service accounts | |
| cpmPrice | number | conditional | Required when costModel is Fixed CPM. Valid range: 0.01–2000 | |
| description | string | no | Max 1000 characters | |
| inventoryType | ENUM string | yes | Valid Values: Display, Video, Audio, Native, Search, DOOH, NativeVideo | |
| budgetDistribution | ENUM string | no | Dollars | Valid Values: Dollars, Percent, Priority |
| timeZone | ENUM string | yes | Valid 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 | |
| customFieldSettings | array of objects | no | See customFieldSettings below | |
| flights | array of objects | yes | At least one flight required. See flights below | |
| frequencyCap | object | no | If omitted, campaign-level frequency cap settings are used. See frequencyCap below | |
| dayParting | object | no | See dayParting below | |
| managementFee | object | no | Cannot be used with CPC cost model. See managementFee below |
lineItem.customFieldSettings
| Name | Data Type | Required | Notes |
|---|---|---|---|
| isNewField | boolean | yes | Valid Values: true, false |
| fieldName | string | yes | 1–100 characters. Must be unique to the account if isNewField is true |
| fieldValue | string | yes | 1–500 characters |
lineItem.flights
| Name | Data Type | Required | Default | Notes |
|---|---|---|---|---|
| id | integer | no | ID of an existing flight to update. If omitted, a new flight is created | |
| budget | number | yes | Flight budget amount. Must be greater than 0, max 999999.99 | |
| startDate | string | yes | Format: MM-dd-yyyy HH:mm:ss | |
| endDate | string | yes | Format: MM-dd-yyyy HH:mm:ss | |
| pacingMode | ENUM string | yes | Valid Values: EVEN, ASAP, AHEAD | |
| paceAheadPercent | integer | conditional | Required when pacingMode is AHEAD. Valid range: 1–99 | |
| totalImpressionCap | integer | no | Total impressions allowed for the flight. Valid range: 1–999999999 | |
| dailyImpressionCap | integer | no | Max impressions per day for the flight. Valid range: 1–999999999 | |
| maxDailySpendOverride | object | no | Safety cap on daily spend. Default is 2x even pacing. See maxDailySpendOverride below |
lineItem.flights.maxDailySpendOverride
| Name | Data Type | Required | Notes |
|---|---|---|---|
| enabled | boolean | yes | When true, the type and value fields are required. When false, the default 2x multiplier is used |
| type | ENUM string | conditional | Required when enabled is true. Valid Values: amount, multiplier |
| value | number | conditional | Required when enabled is true. Must be greater than 0.01 |
lineItem.frequencyCap
| Name | Data Type | Required | Default | Notes |
|---|---|---|---|---|
| applyFrequencyCap | boolean | yes | ||
| times | integer | conditional | Required when applyFrequencyCap is true. Valid range: 1–100 | |
| period | ENUM string | conditional | Required when applyFrequencyCap is true. Valid Values: day, hour(s), week, month | |
| hoursValue | integer | conditional | Required when period is hour(s). Valid range: 1–1000 | |
| crossDevice | ENUM string | conditional | Required when applyFrequencyCap is true. Valid Values: Per Device, Per Person, Per Household | |
| untrackable | boolean | no | Include untrackable users | |
| ipUntrackable | boolean | no | Include IP-untrackable users |
lineItem.dayParting
| Name | Data Type | Required | Notes |
|---|---|---|---|
| enabled | boolean | yes | If false, the line item runs the full day |
| schedule | array of objects | yes | If enabled is true, at least one schedule entry is required |
lineItem.dayParting.schedule
| Name | Data Type | Required | Notes |
|---|---|---|---|
| days | array of ENUM strings | yes | Valid Values: mon, tue, wed, thu, fri, sat, sun |
| hours | array of strings | yes | Military time ranges on the hour. Example: 06:00-10:00 |
lineItem.managementFee
| Name | Data Type | Required | Notes |
|---|---|---|---|
| type | ENUM string | yes | Valid Values: Percentage, CPM, PercentageAndCPM, FixedCPM |
| percentage | number | conditional | Required for types Percentage or PercentageAndCPM. Valid range: 0.01–99.99 |
| cpm | number | conditional | Required for types CPM, PercentageAndCPM, or FixedCPM. Must be greater than 0.01 |
Response Field List
| Name | Data Type | Notes |
|---|---|---|
| success | boolean | Returns true on a successful replacement |
| message | string | Human-readable result message |
| requestId | string | Unique identifier for the request |
| data | object | The replaced line item |
| data.id | integer | The line item ID |
| data.name | string | Line item name |
| data.campaignId | integer | Parent campaign ID |
| data.costModel | string | Pricing model |
| data.cpmPrice | number | CPM price (Fixed CPM only) |
| data.description | string | Line item description |
| data.inventoryType | string | Ad inventory type |
| data.budgetDistribution | string | Budget distribution method |
| data.timeZone | string | Timezone |
| data.customFieldSettings | array of objects | See customFieldSettings response fields below |
| data.customFieldSettings.fieldId | integer | Custom field setting ID |
| data.customFieldSettings.fieldName | string | Field name |
| data.customFieldSettings.fieldValue | string | Field value |
| data.flights | array of objects | See flights response fields below |
| data.flights.id | integer | Flight ID |
| data.flights.budget | number | Flight budget amount |
| data.flights.startDate | string | Format: MM-dd-yyyy HH:mm:ss |
| data.flights.endDate | string | Format: MM-dd-yyyy HH:mm:ss |
| data.flights.pacingMode | string | Valid Values: EVEN, ASAP, AHEAD |
| data.flights.paceAheadPercent | number | Pacing percentage modifier |
| data.flights.totalImpressionCap | integer | Total impression cap |
| data.flights.dailyImpressionCap | integer | Daily impression cap |
| data.flights.maxDailySpendOverride | object | Daily spend override settings |
| data.flights.maxDailySpendOverride.enabled | boolean | Whether the override is enabled |
| data.flights.maxDailySpendOverride.type | string | Valid Values: amount, multiplier |
| data.flights.maxDailySpendOverride.value | number | Override value |
| data.frequencyCap | object | Frequency cap settings |
| data.frequencyCap.applyFrequencyCap | boolean | Whether frequency capping is enabled |
| data.frequencyCap.times | integer | Impression limit |
| data.frequencyCap.period | string | Valid Values: day, hour(s), week, month |
| data.frequencyCap.hoursValue | integer | Custom hours value when period is hour(s) |
| data.frequencyCap.crossDevice | string | Valid Values: Per Device, Per Person, Per Household |
| data.frequencyCap.untrackable | boolean | Include untrackable users |
| data.frequencyCap.ipUntrackable | boolean | Include IP-untrackable users |
| data.dayParting | object | Day-parting settings |
| data.dayParting.enabled | boolean | Whether day-parting is enabled |
| data.dayParting.schedule | array of objects | Day-parting schedule entries |
| data.dayParting.schedule.days | array of strings | Valid Values: mon, tue, wed, thu, fri, sat, sun |
| data.dayParting.schedule.hours | array of strings | Time ranges in HH:00-HH:00 format |
| data.managementFee | object | Management fee settings |
| data.managementFee.type | string | Valid Values: Percentage, CPM, PercentageAndCPM, FixedCPM |
| data.managementFee.percentage | number | Percentage fee value |
| data.managementFee.cpm | number | CPM fee value |
| meta | object | Metadata about what changed |
| meta.changes | object | Summary of changes applied |
| meta.changes.updatedFields | array of strings | Top-level field names that changed |
| meta.changes.flightsModified | integer | Number of flights modified |
| meta.changes.flightsAdded | integer | Number of flights added |
| meta.changes.flightsRemoved | integer | Number of flights removed |
| meta.changes.customFieldsAdded | integer | Number of custom fields added |
| meta.changes.customFieldsModified | integer | Number of custom fields modified |
| meta.changes.customFieldsRemoved | integer | Number 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 Status | Error | Description |
|---|---|---|
| 400 | Validation Error | One or more fields failed validation. See the details array in the response for field-level messages |
| 401 | Unauthorized | Invalid or expired access token |
| 403 | Forbidden | You do not have permission to modify line item {lineItemId} |
| 404 | Not Found | Line item with ID {lineItemId} does not exist |
| 422 | Unprocessable Entity | Business rule violation — e.g., conflicting flight dates, budget exceeded, or invalid flight end date |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error |
Updated about 1 month ago
