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

# Campaign API - Sponsored Listings Enhancements

> The Campaign API now supports audience targeting and frequency capping for sponsored listings campaigns.

export const ChangelogActions = () => {
  return <>
      <style>{`
        .changelog-actions {
          display: flex;
          justify-content: center;
          gap: 12px;
          margin-top: 2rem;
          padding-top: 1.5rem;
          border-top: 1px solid #e5e7eb;
        }
        
        [data-theme="dark"] .changelog-actions {
          border-top-color: #374151;
        }
        
        .changelog-btn {
          display: inline-flex;
          align-items: center;
          gap: 6px;
          padding: 8px 16px;
          border-radius: 9999px;
          border: 1px solid #d1d5db;
          background: transparent;
          color: #6b7280;
          font-size: 14px;
          cursor: pointer;
          transition: all 0.2s ease;
        }
        
        .changelog-btn:hover {
          border-color: #9ca3af;
          background: #f9fafb;
        }
        
        [data-theme="dark"] .changelog-btn {
          border-color: #4b5563;
          color: #9ca3af;
        }
        
        [data-theme="dark"] .changelog-btn:hover {
          border-color: #6b7280;
          background: #1f2937;
        }
      `}</style>
      <div className="changelog-actions">
        <button className="changelog-btn" onClick={() => {
    const btn = event.target.closest("button");
    btn.innerHTML = "❤️ Like";
    btn.style.borderColor = "#ec4899";
  }}>
          🤍 Like
        </button>
        <button className="changelog-btn" onClick={() => {
    const btn = event.target.closest("button");
    navigator.clipboard.writeText(window.location.href);
    const originalContent = btn.innerHTML;
    btn.innerHTML = "✓ Copied";
    btn.style.borderColor = "#22c55e";
    btn.style.color = "#22c55e";
    setTimeout(() => {
      btn.innerHTML = originalContent;
      btn.style.borderColor = "";
      btn.style.color = "";
    }, 2000);
  }}>
          ↗ Share
        </button>
      </div>
    </>;
};

<div style={{ display: "flex", gap: "8px", flexWrap: "wrap", marginBottom: "16px" }}>
  <Badge color="gray" size="sm" icon="calendar">August 12, 2025</Badge>
  <Badge color="purple" size="sm" icon="server">Ad Server</Badge>
  <Badge color="orange" size="sm" icon="arrow-up">Improvement</Badge>
</div>

The **Campaign API** has been enhanced to support audience targeting and frequency capping for **Sponsored Listings** campaigns, giving developers programmatic access to advanced campaign controls.

## Key Enhancements

**Audience Targeting**:
Apply user segment filters to include or exclude specific audiences from
your sponsored listings campaigns.

**Frequency Capping**:
Control how often users see your ads within a specific timeframe to prevent
ad fatigue.

## Audience Targeting via API

Configure audience segments and bid multipliers during campaign creation:

```bash title="Create Campaign with Audience Targeting" theme={null}
curl --request POST \
  --url https://api.topsort.com/public/v1/campaign-service/campaigns \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "adFormat": "listing",
  "name": "Targeted Sponsored Listing",
  "campaignType": "manual",
  "chargeType": "CPC",
  "budget": {
    "amount": 1000,
    "type": "daily"
  },
  "targetingFilters": {
    "isActive": true,
    "targetingFilters": [
      {
        "segmentId": "DFJ9R4",
        "type": "user_segment"
      },
      {
        "segmentId": "984103",
        "type": "user_segment"
      }
    ]
  },
  "multiplierConfig": {
    "isActive": true,
    "multipliers": [
      {
        "multiplier": 2.5,
        "segmentId": "DFJ9R4",
        "type": "user_segment"
      }
    ]
  }
}'
```

The audience targeting configuration supports up to three segments with OR logic and bid multipliers between 1.0x and 5.0x for boosting strategies.

## Frequency Cap via API

Configure impression limits using the campaign restrictions endpoint:

```bash title="Create Frequency Cap" theme={null}
curl --request POST \
  --url https://api.topsort.com/public/v1/campaign-service/campaigns/{campaign-id}/restrictions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "limit": 10,
  "restrictionTypeId": 1
}'
```

```json title="Response" theme={null}
{
  "campaignId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "createdAt": "2025-08-13T05:31:56Z",
  "id": 123,
  "limit": 10,
  "marketplaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "restrictionType": {
    "frequencyType": "daily",
    "id": 1,
    "interactionType": "impressions",
    "level": "campaign"
  },
  "status": "active",
  "updatedAt": "2025-08-13T05:31:56Z"
}
```

Retrieve existing frequency caps for a campaign:

```bash title="Get Campaign Restrictions" theme={null}
curl --request GET \
  --url https://api.topsort.com/public/v1/campaign-service/campaigns/{campaign-id}/restrictions \
  --header 'Authorization: Bearer <token>'
```

***

These enhancements are now live in the Campaign API. To learn more, check out the [Campaign API reference](/en/api-reference/campaign-api/get-campaigns).

<ChangelogActions />
