Skip to content

Ad Units

An ad unit represents a named advertising surface in your application - a specific slot where deal creatives can be displayed. Each ad unit has a format (determining the creative type it can show) and a channel (identifying where it appears).

Formats

Ad units support the following formats:

FormatDescription
bannerA banner-style creative with title, summary, optional image, and reward info
cardA card-style creative with title, summary, optional image, and reward info

The format of an ad unit determines what type of creative content is returned when querying eligible deals for that unit.

Channels

The channel field is a free-form string identifying the surface where the ad unit appears. Use it to distinguish between different parts of your application:

  • "mobile-app" - In-app placements
  • "web" - Website placements
  • "email" - Email campaign slots
  • "pos" - Point-of-sale displays

Relationship to Delivery

Ad units are one of the two inputs to the delivery endpoint. When you call list-eligible with a member ID and ad unit ID, the system returns deals whose creatives match the ad unit's format and whose targeting rules match the member's attributes.

Deals and their placement configurations are managed on the K42 platform side. As a publisher, you create ad units to define your available surfaces, and the platform configures which deals are eligible to appear in each unit.

Creating an Ad Unit

bash
curl -X POST https://<your-instance-url>/publisher.v1/ad-unit/create \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Homepage Banner",
    "format": "banner",
    "channel": "web"
  }'

Listing Ad Units

json
{
  "pagination": { "limit": 50 },
  "filters": [
    { "key": "name", "regex": { "pattern": "banner", "case_insensitive": true } }
  ]
}

Deleting an Ad Unit

Ad units are soft-deleted. Once deleted, they cannot be used in delivery requests.

json
{
  "id": "au_abc123"
}