Beta APIs

[beta] Creates a campaign.

Creates a campaign. The campaign is created in your organization's Draft status with createdSource set to api. Creating a campaign never creates work orders or places items on hold.

<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.

post/maintenance/campaigns

Request

  • Base URL
    https://api.samsara.com
  • Auth
    HTTP bearer

Request body

campaignNumberstring

Customer or OEM-aligned campaign number.

campaignType'safetyRecall' | 'mandatoryCampaign' | 'voluntary' | 'internal' required

Type of the campaign. Valid values: safetyRecall, mandatoryCampaign, voluntary, internal

descriptionstring

Free-form description of the campaign.

endTimestring date-time

End of the campaign in RFC 3339 format. Must not be before startTime.

isWarrantyboolean

Whether campaign work is expected to be claimable as warranty or recall work. Defaults to false.

namestring required

Display name of the campaign.

startTimestring date-time

Start of the campaign in RFC 3339 format.

workOrderPriority'High' | 'Low' | 'Medium' | 'Urgent'

Priority applied to work orders generated from the campaign. Uses the same values as the priority field of the Work Orders API. Defaults to no priority. Valid values: High, Low, Medium, Urgent

workOrderTemplateIdstring

ID of a work order template, as returned by GET /maintenance/work-order-templates, that pre-populates work orders generated from the campaign.

Example request

{
  "campaignNumber": "26S38",
  "campaignType": "safetyRecall",
  "description": "Replace rear brake hose per OEM bulletin.",
  "endTime": "2026-08-01T00:00:00Z",
  "isWarranty": true,
  "name": "Rear brake hose recall",
  "recallMetadata": {
    "nhtsaRecallNumber": "24V-123",
    "oemNotificationTime": "2026-01-15T00:00:00Z",
    "oemRecallNumber": "26S38",
    "ownerNotificationTime": "2026-02-01T00:00:00Z",
    "partsAvailableTime": "2026-03-01T00:00:00Z",
    "recallSource": "recallMasters",
    "remedyAvailableTime": "2026-03-01T00:00:00Z",
    "supersededByRecallNumber": "26S40"
  },
  "startTime": "2026-02-01T00:00:00Z",
  "workOrderPriority": "High",
  "workOrderTemplateId": "5523a39f-42ef-4820-83d0-dfe73dbe7853"
}

Response

OK response.

Example response

{
  "data": {
    "campaignNumber": "26S38",
    "campaignType": "safetyRecall",
    "createdAtTime": "2026-01-20T15:04:05Z",
    "createdSource": "api",
    "description": "Replace rear brake hose per OEM bulletin.",
    "endTime": "2026-08-01T00:00:00Z",
    "id": "2d0e5e9b-4b2a-4e4e-9b8e-6c3f8a7d1e2f",
    "isWarranty": true,
    "name": "Rear brake hose recall",
    "recallMetadata": {
      "nhtsaRecallNumber": "24V-123",
      "oemNotificationTime": "2026-01-15T00:00:00Z",
      "oemRecallNumber": "26S38",
      "ownerNotificationTime": "2026-02-01T00:00:00Z",
      "partsAvailableTime": "2026-03-01T00:00:00Z",
      "recallSource": "recallMasters",
      "remedyAvailableTime": "2026-03-01T00:00:00Z",
      "supersededByRecallNumber": "26S40"
    },
    "startTime": "2026-02-01T00:00:00Z",
    "status": {
      "id": "f6e83fa8-c1fb-5d15-8832-693161b9c6e7",
      "name": "Draft",
      "state": "draft"
    },
    "updatedAtTime": "2026-01-21T09:30:00Z",
    "workOrderPriority": "High",
    "workOrderTemplateId": "5523a39f-42ef-4820-83d0-dfe73dbe7853"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.