post
https://sandbox-api.viantinc.com/{basePath}/batch/flight
Bulk update Order Flight caps.
Allows setting daily and lifetime impression caps for several flights at once. Input is an array of sparse flight objects with only three fields each: id, dailyImpCap, and lifetimeImpCap.
Request
POST /batch/flight
Request Body
| Name | Type | Description | Required |
|---|---|---|---|
| id | Number | Yes | |
| status | String | ||
| budgetType | string |
One of:
|
|
| dailyBudget | string | ||
| dailyFrontload | integer | ||
| maxBudget | integer | ||
| remainingBudget | integer | ||
| dailyImpCap | integer | ||
| lifetimeImpCap | integer | ||
| startDate | integer | ||
| endDate | integer |
Response
| JSON Fields | Type | Description |
|---|---|---|
| messages | Object Array | An array of any error messages. |
| messages[].level | String | Error level. |
| messages[].code | String | Error code. |
| messages[].message | String | Error message. |
| entity | Number | Number of order flights successfully updated |
Example
Request to update caps for two flights
curl -u <user>:<password> -X POST -H "Content-Type: application/json" -d '[{"id": 12345, "dailyImpCap": 1000, "lifetimeImpCap": 5000 },{ "id": 67890, "dailyImpCap": 2000, "lifetimeImpCap": 10000 }]' https://sandbox-api.viant.com/v1/batch/flight
Any errors will be in the messages field. Flights will only be updated if they are eligible (e.g. a locked or completed flight can't be updated).
Response
{ "messages": [], "entity": 2 }