---
title: "[beta] Adds items to a campaign."
method: POST
path: "/maintenance/campaigns/items/batch"
tags: ["Beta APIs"]
---

# \[beta\] Adds items to a campaign.

`POST /maintenance/campaigns/items/batch`

## Request

- Base URL: `https://api.samsara.com`
- URL: `https://api.samsara.com/maintenance/campaigns/items/batch`
- Auth: HTTP bearer

Adds assets to a campaign by VIN or asset ID, for campaigns whose membership is managed outside Samsara. Up to 5000 entries per request; the rate limit applies to this endpoint, not to the individual entries. Each entry is processed independently and the response reports a result per entry, in request order: `created`, `alreadyPresent`, `unresolvedVin`, `unresolvedAssetId`, `invalid` or `overCap`. A campaign holds at most 100000 items. Items are created in `pending` with `sourceBasis` `api`. An asset joins a campaign at most once, so requests are idempotent: an asset that already has an item, including a dismissed one, is reported as `alreadyPresent` and never re-added. Ingesting items never creates work orders or places holds. Not accepted for `complete` or `cancelled` campaigns.

 <b>Rate limit:</b> 100 requests/min (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).

To use this endpoint, select **Write Campaigns** under the Work Orders category when creating or editing an API token. <a href="https://developers.samsara.com/docs/authentication#scopes-for-api-tokens" target="_blank">Learn More.</a>
 

 **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> to our support team.

## Query parameters

- `campaignId` string, required

## Request body

- CampaignsPostCampaignItemsBatchRequestBody: Entries to ingest.
  - `data` CampaignItemIngestEntryObjectRequestBody[], required: Entries to add to the campaign.
    - `assetId` string: ID of the asset. Takes precedence over `vin` when both are given; the `vin` is then recorded on the item as provided. Required unless `vin` is given.
    - `sourceRef` string: Opaque reference to the row in your source feed, stored on the item for reconciliation.
    - `vin` string: VIN of the asset. Matched case-insensitively against the VINs of your organization's assets. Required unless `assetId` is given.

## Response `200`

OK response.

- CampaignsPostCampaignItemsBatchResponseBody
  - `requestId` string, uuid, required: UUID for this batch request; used when reaching out to support.
  - `responses` CampaignItemIngestResponseItemObjectResponseBody[], required: One result per entry, in request order.
    - `assetId` string: ID of the asset the entry resolved to, when it resolved.
    - `message` string: Explanation for an entry that did not result in an item.
    - `result` 'created' | 'alreadyPresent' | 'unresolvedVin' | 'unresolvedAssetId' | 'invalid' | 'overCap', required: Outcome of the entry. `alreadyPresent` means the asset already has an item on the campaign, in any state including `dismissed`; the existing item is left untouched, so a retried request is safe. Valid values: `created`, `alreadyPresent`, `unresolvedVin`, `unresolvedAssetId`, `invalid`, `overCap`
    - `status` integer, required: HTTP status for this entry: 200 for `created` and `alreadyPresent`, 400 for `invalid`, 404 for `unresolvedVin` and `unresolvedAssetId`, 409 for `overCap`.

## Other responses

- `401`: Unauthorized response.
- `404`: Not Found response.
- `405`: Method Not Allowed response.
- `413`: Content Too Large response.
- `429`: Too Many Requests response.
- `500`: Internal Server Error response.
- `501`: Not Implemented response.
- `502`: Bad Gateway response.
- `503`: Service Unavailable response.
- `504`: Gateway Timeout response.
- `default`: Bad Request response.

---

[API](https://skmtc.dev/samsara/apis/samsara-api.md) - [All operations](https://skmtc.dev/samsara/apis/samsara-api/llms.txt) - [OpenAPI document](https://skmtc.dev/samsara/apis/samsara-api/revisions/a9e35d4999be?raw)
