Saltar para o conteúdo principal
PATCH
/
public
/
v1
/
campaign-service
/
campaigns
/
{campaign-id}
Update Campaign By Id
curl --request PATCH \
  --url https://api.topsort.com/public/v1/campaign-service/campaigns/{campaign-id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Bola-Bola Ad campaign",
  "budget": {
    "amount": "<unknown>",
    "type": "daily"
  },
  "startDate": "2023-11-07T05:31:56Z",
  "endDate": "2023-11-07T05:31:56Z",
  "isActive": true,
  "isSmart": true,
  "campaignType": "autobidding",
  "status": "approved",
  "statusUpdatedBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "isAutoTrigger": true,
  "targetRoas": 10.25,
  "externalCampaignId": "<string>",
  "multiplierConfig": {
    "isActive": true,
    "multipliers": [
      {
        "type": "<string>",
        "segmentId": 123,
        "multiplier": 2
      }
    ]
  },
  "targetingFilters": {
    "isActive": true,
    "targetingFilters": [
      {
        "type": "<string>",
        "segmentId": 123
      }
    ]
  },
  "exclusionFilters": {
    "isActive": true,
    "exclusionFilters": [
      {
        "type": "<string>",
        "segmentId": 123
      }
    ]
  },
  "chargeType": "CPM",
  "autobiddingObjective": "impressions",
  "productIds": [
    "<string>"
  ],
  "bannerAdRejectionReason": {
    "declineReason": "<string>",
    "reasonDetails": "<string>"
  }
}
'
{
  "campaignId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "marketplaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "startDate": "2023-11-07T05:31:56Z",
  "endDate": "2023-11-07T05:31:56Z",
  "isActive": true,
  "isSmart": true,
  "campaignType": "manual",
  "status": "approved",
  "createdAt": "2023-11-07T05:31:56Z",
  "chargeType": "CPM",
  "externalVendorId": "<string>",
  "adFormat": "listing",
  "isAutoTrigger": true,
  "vendorId": "<string>",
  "walletId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "bidCount": 123,
  "budget": {
    "amount": 123,
    "amountRemaining": 123,
    "amountCarryover": 123,
    "amountUsed": 123,
    "type": "daily"
  },
  "statusUpdatedBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "campaignBehaviorData": "<string>",
  "campaignBehaviorDataByDay": "<string>",
  "exclusivityPrice": 123,
  "targetRoas": 123,
  "externalCampaignId": "<string>",
  "autobiddingObjective": "impressions",
  "multiplierConfig": {
    "isActive": true,
    "multipliers": [
      {
        "type": "<string>",
        "segmentId": 123,
        "multiplier": 2
      }
    ]
  },
  "targetingFilters": {
    "isActive": true,
    "targetingFilters": [
      {
        "type": "<string>",
        "segmentId": 123
      }
    ]
  },
  "exclusionFilters": {
    "isActive": true,
    "exclusionFilters": [
      {
        "type": "<string>",
        "segmentId": 123
      }
    ]
  },
  "promotionType": {
    "bannerAssets": [
      {
        "dimensions": {
          "width": 123,
          "height": 123
        },
        "url": "<string>",
        "contentType": "image/png",
        "size": 123,
        "assetId": "asset_01j713j64yfsvtj4bs3ccpy5ca",
        "content": {},
        "jsonTemplateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      }
    ],
    "slotId": "<string>",
    "adFormat": "<string>",
    "deviceType": "desktop"
  }
}

Autorizações

Authorization
string
header
obrigatório

A valid API key generated in Topsort's UI.

Parâmetros de caminho

campaign-id
string<uuid>
obrigatório

The ID of the campaign.

Corpo

application/json

Public Campaign Update Request Body

name
string | null

The name of the campaign.

Minimum string length: 1
Exemplo:

"Bola-Bola Ad campaign"

budget
BudgetUpdate · object

The budget of the campaign.

startDate
string<date-time> | null

When should the campaign start. If the start date is in the past, it will be set to the current date.

endDate
string<date-time> | null

When should the campaign stop. Must be greater than start date.

isActive
boolean | null

Whether the campaign should be active/inactive.

isSmart
boolean | null

Whether the campaign is smart.

campaignType
enum<string> | null

The bidding type of the campaign. Can only be updated to autobidding.

Opções disponíveis:
autobidding
status
enum<string> | null

The approval status of the campaign, if it's a banner campaign.

Opções disponíveis:
approved,
pending,
rejected
statusUpdatedBy
string<uuid> | null

The ID of the user who approved the banner campaign.

isAutoTrigger
boolean | null

Whether the campaign is auto-triggered.

targetRoas
number | null

Indicates the vendor's goal. For banners, use autobiddingObjective instead. ROAS >12 is rare and depends on product metrics and attribution model.

Intervalo necessário: 0.5 <= x <= 20
externalCampaignId
string | null

The external ID of the campaign in the marketplace. Must be unique per marketplace and format combination.

multiplierConfig
CampaignMultiplierConfig · object

The multipliers of the campaign.

targetingFilters
CampaignTargetingFilters · object

The segments that the campaign will participate for (and will not for other segments not here).

exclusionFilters
CampaignExclusionFilters · object

The segments that the campaign will not target.

chargeType
enum<string> | null

How campaigns are going to be charged, by click, by per mille impressions, or by action.

Opções disponíveis:
CPM,
CPC,
CPA
autobiddingObjective
enum<string> | null

The objective of the campaign, only for autobidding campaigns.

Opções disponíveis:
impressions,
clicks,
conversions,
revenue
productIds
string[] | null

The product IDs to be used in the banner campaign. This is only allowed for banner campaigns. When provided, the assets will be associated to the given product IDs.

Required array length: 1 - 200 elements
bannerAdRejectionReason
BannerAdRejectionReason · object

Resposta

Successful Response

The campaign model.

campaignId
string<uuid>
obrigatório

The ID of the campaign.

marketplaceId
string<uuid>
obrigatório

The ID of the marketplace.

name
string
obrigatório

The name of the campaign.

Minimum string length: 1
Exemplo:

"Bola-Bola Ad campaign"

startDate
string<date-time>
obrigatório

The starting date of the campaign.

endDate
string<date-time>
obrigatório

The end date of the campaign.

isActive
boolean
obrigatório

Whether this campaign is active.

isSmart
boolean
obrigatório

Whether this campaign is "smart".

campaignType
enum<string>
obrigatório

The bidding method for the campaign.

Opções disponíveis:
manual,
autobidding,
exclusive
status
enum<string>
obrigatório

Represents the review status of a banner campaign.

Opções disponíveis:
approved,
pending,
rejected
createdAt
string<date-time>
obrigatório

When was this campaign created.

chargeType
obrigatório

Campaign charge type.

CPM: cost per mille impressions CPC: cost per click CPA: cost per action. CPA reflects the total cost to achieve a conversion.

Opções disponíveis:
CPM,
CPC,
CPA
externalVendorId
string
obrigatório
obsoleto

The ID of the vendor. Deprecated. Use vendor_id instead.

Minimum string length: 1
adFormat
enum<string>
obrigatório

The ad format of the campaign. Can be listing or banner.

Opções disponíveis:
listing,
banner,
sponsored_brand,
exclusive_listing,
exclusive_banner,
travel_listing,
flight_listing
Exemplo:

"listing"

isAutoTrigger
boolean
obrigatório

Whether the campaign is auto-triggered.

vendorId
string
obrigatório

The ID of the vendor.

Minimum string length: 1
walletId
string<uuid>
obrigatório

The uuid of the wallet to be used with this campaign.

bidCount
integer
obrigatório

The amount of active bids associated with this campaign.

budget
Budget · object

The budget assigned to the campaign.

statusUpdatedBy
string<uuid> | null

The ID of the user who reviewed the campaign. If it's null and the status is not "pending" then it means this campaign has autoapproval status.

campaignBehaviorData
string | null
obsoleto

Deprecated. This field is always null. For behavioral data use reporting service.

campaignBehaviorDataByDay
string | null
obsoleto

Deprecated. This field is always null. For behavioral data use reporting service.

exclusivityPrice
integer | null

Daily price for an exclusive campaign, can only be set if a campaign is exclusive

targetRoas
number | null

The target return on ad spend (ROAS) for this campaign. This is only applicable for autobidding listing campaigns.

externalCampaignId
string | null

The external ID of the campaign in the marketplace. Must be unique per marketplace and format combination.

autobiddingObjective
enum<string> | null

The autobidding objective for the campaign.

Opções disponíveis:
impressions,
clicks,
conversions,
revenue
multiplierConfig
CampaignMultiplierConfig · object

The multiplier configuration for the campaign.

targetingFilters
CampaignTargetingFilters · object

The segments that the campaign will participate for (and will not for other segments not here).

exclusionFilters
CampaignExclusionFilters · object

The segments that the campaign will not target.

promotionType
BannerAd · object
obsoleto

Deprecated. Use adFormat field instead and format properties inside bids. The promotion type and attributes. Ad format must set to 'banner' for exclusive campaigns.