---
title: "Save a campaign"
method: POST
path: "/campaigns"
tags: ["Campaigns"]
---

# Save a campaign

`POST /campaigns`

Save a campaign details

## Request body

- CampaignDetails
  - `info` object — common data about campaign
    - `id` string, uuid — Campaign id
    - `name` string — Campaign name
    - `description` string — Campaign description
    - `status` union
      - CampaignStatusEnabled — Campaign status
        - `value` string, enabled
      - CampaignStatusDisabled — Campaign status
        - `value` string, disabled
        - `reason` string — Reason of to disable this campaign
      - CampaignStatusArchived — Campaign status
        - `value` string, archived
        - `reason` string — Reason of to archive this campaign
        - `date` string, rfc3339 — Date when the campaign was archived
    - `schedule` union
      - CampaignScheduleDaily
        - `start` object — Date when the campaign should start
          - `hour` integer — Hour of the day the campaign should start
          - `minute` integer — Minute of the hour the campaign should start
        - `end` object — Date when the campaign should end
          - `hour` integer — Hour of the day the campaign should end
          - `minute` integer — Minute of the hour the campaign should end
        - `tz` string — IANA timezone ID associated with the start and end times of the campaign schedule
        - `type` string, daily
      - CampaignScheduleWeekly
        - `start` object — Date when the campaign should start
          - `day` integer — Day of the week the campaign should start
          - `hour` integer — Hour of the day the campaign should start
          - `minute` integer — Minute of the hour the campaign should start
        - `end` object — Date when the campaign should end
          - `day` integer — Day of the week the campaign should end
          - `hour` integer — Hour of the day the campaign should end
          - `minute` integer — Minute of the hour the campaign should end
        - `tz` string — IANA timezone ID associated with the start and end times of the campaign schedule
        - `type` string, weekly
      - CampaignScheduleOneshot
        - `start` string, rfc3339 — Date when the campaign should start
        - `end` string, rfc3339 — Date when the campaign should end
        - `type` string, one-shot
      - CampaignScheduleMonthly
        - `start` object — Date when the campaign should start
          - `day` integer — Day of the week the campaign should start
          - `hour` integer — Hour of the day the campaign should start
          - `minute` integer — Minute of the hour the campaign should start
        - `end` object — Date when the campaign should end
          - `day` integer — Day of the week the campaign should end
          - `hour` integer — Hour of the day the campaign should end
          - `minute` integer — Minute of the hour the campaign should end
        - `tz` string — IANA timezone ID associated with the start and end times of the campaign schedule
        - `position` integer — Week during the month in which our campaign start, 1/2/3 means first/second/last, -1/-2 means Last/secondLast
        - `type` string, monthly
  - `campaignType` 'system-update' | 'software-update' — Type of campaign (with version determine what kind of campaign you handle and the details object)
  - `version` integer — Version of campaign (with type determine what kind of campaign you handle and the details object)
  - `details` union
    - CampaignSystemUpdate — System update campaign details (type system-update, version 2)
      - `reboot` 'as-needed' | 'disabled' | 'always' | 'services-only' — Define the behavior after update
      - `targets` RuleTargets[] — List of all groups of node to target the campaign
        - object[] — Node and special groups targeted by that rule
          - `include` object, required — list of groups to include in rule application
            - `or` RuleTarget[]
          - `exclude` object, required — list of groups to exclude from rule application
            - `or` RuleTarget[]
    - CampaignSoftwareUpdate — Software update campaign details (type software-update, version 1)
      - `reboot` 'as-needed' | 'disabled' | 'always' | 'services-only' — Define the behavior after update
      - `targets` RuleTargets[] — List of all groups of node to target the campaign
        - object[] — Node and special groups targeted by that rule
          - `include` object, required — list of groups to include in rule application
            - `or` RuleTarget[]
          - `exclude` object, required — list of groups to exclude from rule application
            - `or` RuleTarget[]
      - `softwareUpdate` object[] — List of all software to update
        - `name` string — Name of the package to update
        - `version` string — Target version of the package to update to
        - `architecture` string — Architecture of the package to update

## Response `200`

Campaign details result

- object
  - `result` 'success' | 'error', required — Result of the request
  - `action` 'saveCampaign', required — The id of the action
  - `data` object, required
    - `campaigns` CampaignDetails[], required
      - `info` object — common data about campaign
        - `id` string, uuid — Campaign id
        - `name` string — Campaign name
        - `description` string — Campaign description
        - `status` union
          - CampaignStatusEnabled — Campaign status
            - `value` string, enabled
          - CampaignStatusDisabled — Campaign status
            - `value` string, disabled
            - `reason` string — Reason of to disable this campaign
          - CampaignStatusArchived — Campaign status
            - `value` string, archived
            - `reason` string — Reason of to archive this campaign
            - `date` string, rfc3339 — Date when the campaign was archived
        - `schedule` union
          - CampaignScheduleDaily
            - `start` object — Date when the campaign should start
              - …
            - `end` object — Date when the campaign should end
              - …
            - `tz` string — IANA timezone ID associated with the start and end times of the campaign schedule
            - `type` string, daily
          - CampaignScheduleWeekly
            - `start` object — Date when the campaign should start
              - …
            - `end` object — Date when the campaign should end
              - …
            - `tz` string — IANA timezone ID associated with the start and end times of the campaign schedule
            - `type` string, weekly
          - CampaignScheduleOneshot
            - `start` string, rfc3339 — Date when the campaign should start
            - `end` string, rfc3339 — Date when the campaign should end
            - `type` string, one-shot
          - CampaignScheduleMonthly
            - `start` object — Date when the campaign should start
              - …
            - `end` object — Date when the campaign should end
              - …
            - `tz` string — IANA timezone ID associated with the start and end times of the campaign schedule
            - `position` integer — Week during the month in which our campaign start, 1/2/3 means first/second/last, -1/-2 means Last/secondLast
            - `type` string, monthly
      - `campaignType` 'system-update' | 'software-update' — Type of campaign (with version determine what kind of campaign you handle and the details object)
      - `version` integer — Version of campaign (with type determine what kind of campaign you handle and the details object)
      - `details` union
        - CampaignSystemUpdate — System update campaign details (type system-update, version 2)
          - `reboot` 'as-needed' | 'disabled' | 'always' | 'services-only' — Define the behavior after update
          - `targets` RuleTargets[] — List of all groups of node to target the campaign
            - object[] — Node and special groups targeted by that rule
              - …
        - CampaignSoftwareUpdate — Software update campaign details (type software-update, version 1)
          - `reboot` 'as-needed' | 'disabled' | 'always' | 'services-only' — Define the behavior after update
          - `targets` RuleTargets[] — List of all groups of node to target the campaign
            - object[] — Node and special groups targeted by that rule
              - …
          - `softwareUpdate` object[] — List of all software to update
            - `name` string — Name of the package to update
            - `version` string — Target version of the package to update to
            - `architecture` string — Architecture of the package to update

---

[API](https://skmtc.net/rudder/apis/rudder-api.md) · [All operations](https://skmtc.net/rudder/apis/rudder-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/rudder/rudder-api/versions/eab988254fba/schema)
