# Delete or archive a campaign

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /campaign/delete:
    delete:
      summary: Delete or archive a campaign
      deprecated: false
      description: |+
        Deletes or archives a campaign based on the provided parameters. 

        **Important Notes:**
        - This operation cannot be undone. Please handle with care.

      operationId: deleteCampaign
      tags:
        - Campaign
        - Campaigns
      parameters:
        - name: x-api-key
          in: header
          description: Your PlusVibe.ai account's API Key
          required: false
          example: ''
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                workspace_id:
                  type: string
                  description: workspace identifier
                campaign_id:
                  type: string
                  description: campaign Id
                is_archive:
                  type: string
                  description: >-
                    If "yes", campaign will be archived instead of deleted. If
                    "no", campaign will be deleted.
                is_save_lead_data:
                  type: string
                  description: If "yes", lead data would be saved to "list"
              required:
                - workspace_id
                - campaign_id
                - is_archive
                - is_save_lead_data
              x-apidog-orders:
                - workspace_id
                - campaign_id
                - is_archive
                - is_save_lead_data
              x-apidog-ignore-properties: []
            examples:
              archive_campaign:
                value:
                  workspace_id: 65f3c92d3dbe5dbb35374a9a
                  campaign_id: 6853fa4d7d934a9e2da39846
                  is_archive: 'yes'
                  is_save_lead_data: 'yes'
                summary: Archive campaign with lead data preservation
                description: Archive a campaign while preserving all lead data
      responses:
        '200':
          description: Campaign successfully deleted or archived
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse'
              example:
                status: success
          headers: {}
          x-apidog-name: OK
        '400':
          description: Bad request - Invalid input parameters
          content:
            application/json:
              schema: &ref_0
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                '2':
                  summary: Validation error
                  value:
                    message: Validation error
                    error: Validation error
                    errors:
                      - campaign_id must be a valid 24 character hex string
                '3':
                  summary: Resource not found
                  value:
                    message: Campaign not found
                    error: The specified campaign does not exist
          headers: {}
          x-apidog-name: Bad Request
        '401':
          description: Unauthorized - Invalid API key
          content:
            application/json:
              schema: *ref_0
              example:
                message: Invalid API key
                error: Unauthorized access
          headers: {}
          x-apidog-name: Unauthorized
        '403':
          description: Forbidden - Insufficient permissions
          content:
            application/json:
              schema: *ref_0
              example:
                message: Insufficient permissions
                error: Access denied
          headers: {}
          x-apidog-name: Forbidden
        '500':
          description: Internal server error
          content:
            application/json:
              schema: *ref_0
              example:
                message: Internal server error occurred
                error: Database connection failed
          headers: {}
          x-apidog-name: Server Error
      security: []
      x-apidog-folder: Campaign
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/929054/apis/api-21411384-run
components:
  schemas:
    SuccessResponse:
      type: object
      properties:
        status:
          type: integer
          examples:
            - 1
        message:
          type: string
          examples:
            - Operation successful
        data:
          type: object
          x-apidog-orders: []
          properties: {}
          x-apidog-ignore-properties: []
      x-apidog-orders:
        - status
        - message
        - data
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    ErrorResponse:
      type: object
      required:
        - code
        - message
        - data
      properties:
        code:
          type: integer
          enum:
            - 0
        message:
          type: string
        data:
          type: object
          x-apidog-orders: []
          properties: {}
          x-apidog-ignore-properties: []
      x-apidog-orders:
        - code
        - message
        - data
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
  securitySchemes:
    ApiKeyAuth:
      type: apikey
      in: header
      name: x-api-key
      description: |
        API key issued in the PlusVibe dashboard. The server reads it
        from the `x-api-key` header and injects it into the request as
        the `api_key` query parameter, which is why you will see
        `api_key` referenced in validation errors.
    apiKey:
      type: apikey
      in: body
      name: api_key
      description: API key passed in request body
servers:
  - url: https://api.plusvibe.ai/api/v1
    description: Prod Env
security:
  - ApiKeyAuth: []
    x-apidog:
      schemeGroups:
        - id: uS5KiuC4wfZHK42AzOfA_
          schemeIds:
            - ApiKeyAuth
      required: true
      use:
        id: uS5KiuC4wfZHK42AzOfA_
      scopes:
        uS5KiuC4wfZHK42AzOfA_:
          ApiKeyAuth: []

```
