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

# Delete ad

> Permanently remove an ad from the publisher

## Overview

Permanently remove an ad. Targeter uses this when the campaign should not remain in your system.

Prefer [Pause ad](/integrations/ads/pause) when delivery should stop but insights must still be available.

Return **204** with no body. Subsequent status or insight calls for this `ad_id` should return **404**.

## Request

### Headers

* `Authorization: Bearer {token}` (required)

### Path Parameters

<ParamField path="ad_id" type="string" required>
  Publisher-generated ad id returned from [Create ad](/integrations/ads/create)
</ParamField>

### Example Request

```bash theme={null}
curl -X DELETE "https://publisher.example.com/v1/ads/ad_9pL2wR" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

## Response

### Success (204)

Empty body.

## Error Responses

### 401 - Unauthorized

```json theme={null}
{
    "error": "Missing or invalid Authorization header"
}
```

### 404 - Ad not found

```json theme={null}
{
    "error": "Ad not found"
}
```

### 409 - Ad cannot be deleted

```json theme={null}
{
    "error": "Ad cannot be deleted while delivery is still settling"
}
```

### 500 - Server Error

```json theme={null}
{
    "error": "Unexpected server error. Please try again later."
}
```


## OpenAPI

````yaml integrations/openapi.json DELETE /ads/{ad_id}
openapi: 3.1.0
info:
  title: Targeter Ideal Publisher API
  description: >-
    Contract Targeter expects from publisher and media platforms it creates ads
    on and fetches insights from. Implement these endpoints so Targeter can
    manage offices, ads, and reporting against your system.
  version: 1.0.0
  contact:
    name: Targeter Integration Support
servers:
  - url: https://{publisher_host}/v1
    description: Publisher API host (provided during integration setup)
    variables:
      publisher_host:
        default: publisher.example.com
security:
  - BearerAuth: []
tags:
  - name: Offices
    description: Broker or advertiser offices that ads are billed and attributed to
  - name: Ads
    description: Create, update, pause, resume, and delete ads
  - name: Insights
    description: Performance reporting for ads Targeter has created
  - name: Platforms
    description: Publisher channels available for delivery
paths:
  /ads/{ad_id}:
    delete:
      tags:
        - Ads
      summary: Delete ad
      description: >-
        Permanently remove an ad from the publisher. Prefer pause when the ad
        should stop delivery but remain available for reporting.
      operationId: deleteAd
      parameters:
        - $ref: '#/components/parameters/AdId'
      responses:
        '204':
          description: Ad deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/AdNotFound'
        '409':
          description: Ad cannot be deleted in its current status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Ad cannot be deleted while delivery is still settling
        '500':
          $ref: '#/components/responses/ServerError'
components:
  parameters:
    AdId:
      name: ad_id
      in: path
      required: true
      description: Publisher-generated ad id returned from `POST /ads`
      schema:
        type: string
      example: ad_9pL2wR
  responses:
    Unauthorized:
      description: Missing Authorization header, or invalid or expired token
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            missingHeader:
              value:
                error: Missing or invalid Authorization header
            invalidToken:
              value:
                error: Invalid or expired token
    AdNotFound:
      description: Ad not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Ad not found
    ServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Unexpected server error. Please try again later.
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Error message
          example: Missing required field
        details:
          type: array
          description: Per-field validation issues
          items:
            type: object
            required:
              - message
            properties:
              path:
                type: array
                items:
                  type: string
                example:
                  - material
                  - target_url
              message:
                type: string
                example: Target URL is required
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        API token issued to Targeter during integration setup. Send as
        `Authorization: Bearer <token>`.

````