> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omnicommerce.sg/llms.txt
> Use this file to discover all available pages before exploring further.

# Archive Campaigns

> Archive campaigns, or restore archived campaigns by id or by the current archived list filters. Requires `promotions:write`.



## OpenAPI

````yaml /openapi.json post /api/v1/campaigns/archive
openapi: 3.1.0
info:
  title: OmniCommerce API
  version: 1.0.0
  license:
    name: Proprietary
    url: https://omnicommerce.sg/terms
  description: >-
    OmniCommerce API surface for agents and developer integrations. Includes
    public endpoints (merchant discovery, product search, compare, catalog, ACO
    retrieval) and authenticated endpoints (product management via API key
    Bearer tokens).
servers:
  - url: https://omnicommerce.sg
    description: Production
  - url: http://localhost:3000
    description: Local development
security: []
tags:
  - name: agentic-checkout
    description: Merchant-fulfilled agentic checkout
    x-group: Agentic Checkout
  - name: aops
    description: Agent operating procedures
    x-group: AOPs
  - name: campaigns
    description: Campaign briefs, offer windows, and marketplace runs
    x-group: Campaigns
  - name: commerce
    description: Root commerce discovery
    x-group: Commerce
  - name: developer-platform
    description: Authenticated developer platform APIs
    x-group: Developer Platform
  - name: looks
    description: AI-styled product looks
    x-group: Looks
  - name: oauth
    description: OAuth token endpoints
    x-group: OAuth
  - name: orders
    description: Workspace and agentic orders
    x-group: Orders
  - name: organizations
    description: Organization management
    x-group: Organizations
  - name: price-books
    description: Marketplace list-price markup rules
    x-group: Price Books
  - name: products
    description: Product CRUD, bulk import, enrichment, publish, and delist
    x-group: Products
  - name: promotions
    description: Central promotions and marketplace sync
    x-group: Promotions
  - name: public-agent
    description: Public agent discovery and catalog APIs
    x-group: Public Agent
  - name: returns
    description: returns
    x-group: Returns
  - name: settlements
    description: settlements
    x-group: Settlements
  - name: ucp
    description: Universal Commerce Protocol
    x-group: UCP
paths:
  /api/v1/campaigns/archive:
    post:
      tags:
        - campaigns
      summary: Archive Campaigns
      description: >-
        Archive campaigns, or restore archived campaigns by id or by the current
        archived list filters. Requires `promotions:write`.
      operationId: post_v1_campaigns_archive
      requestBody:
        required: true
        content:
          application/json:
            schema:
              anyOf:
                - type: object
                  properties:
                    campaignIds:
                      maxItems: 50
                      type: array
                      items:
                        type: string
                        minLength: 1
                        maxLength: 160
                    action:
                      type: string
                      enum:
                        - archive
                        - restore
                    organizationId:
                      description: >-
                        Required for session auth. Optional for an API key,
                        which already identifies the organization.
                      type: string
                      minLength: 1
                      maxLength: 120
                  required:
                    - campaignIds
                    - action
                  additionalProperties: false
                - type: object
                  properties:
                    action:
                      type: string
                      const: restore
                    selection:
                      type: object
                      properties:
                        mode:
                          type: string
                          const: all_matching
                        filters:
                          type: object
                          properties:
                            q:
                              default: ''
                              type: string
                              maxLength: 160
                            stage:
                              default: all
                              type: string
                              enum:
                                - all
                                - draft
                                - approved
                                - running
                                - ending
                                - completed
                                - archived
                          additionalProperties: false
                        excludedCampaignIds:
                          default: []
                          maxItems: 500
                          type: array
                          items:
                            type: string
                            minLength: 1
                            maxLength: 160
                      required:
                        - mode
                        - filters
                      additionalProperties: false
                    organizationId:
                      description: >-
                        Required for session auth. Optional for an API key,
                        which already identifies the organization.
                      type: string
                      minLength: 1
                      maxLength: 120
                  required:
                    - action
                    - selection
                  additionalProperties: false
      responses:
        '200':
          description: >-
            Aggregate result plus one result per campaign. `success` is true
            only when every requested campaign succeeds.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: True only when every requested campaign succeeds.
                  campaignIds:
                    type: array
                    items:
                      type: string
                  succeededCount:
                    type: integer
                    minimum: 0
                    maximum: 9007199254740991
                  failedCount:
                    type: integer
                    minimum: 0
                    maximum: 9007199254740991
                  results:
                    type: array
                    items:
                      type: object
                      properties:
                        success:
                          type: boolean
                        campaignId:
                          type: string
                        stage:
                          type: string
                          enum:
                            - draft
                            - approved
                            - running
                            - ending
                            - completed
                            - archived
                        error:
                          type: string
                      required:
                        - success
                        - campaignId
                required:
                  - success
                  - campaignIds
                  - succeededCount
                  - failedCount
                  - results
        '400':
          description: Invalid campaign payload or plan state.
        '401':
          description: Unauthorized
        '403':
          description: >-
            Forbidden: missing `promotions:write` scope, or a session member
            without organization-wide access
        '429':
          description: Rate limit exceeded
        '500':
          description: Internal Server Error
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        Bearer API key for server-to-server access. Session auth is also
        supported in first-party UI flows.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.