Saltar para o conteúdo principal
POST
/
public
/
v1
/
offsite-ads
/
campaigns
Create Campaign
curl --request POST \
  --url https://api.topsort.com/public/v1/offsite-ads/campaigns \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "dsp": "google_ads",
  "name": "<string>",
  "budget": 123,
  "locationIds": [
    "<string>"
  ],
  "startDate": "2023-11-07T05:31:56Z",
  "endDate": "2023-11-07T05:31:56Z",
  "productIds": [
    "prod1",
    "prod2",
    "prod3",
    "prod4",
    "prod5"
  ],
  "audienceIds": [
    "123456"
  ]
}
'
{
  "jobId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}

Autorizações

Authorization
string
header
obrigatório

A valid API key generated in Topsort's UI. Use the TSE API key if calling auctions or events API, otherwise use the TSC API key.

Parâmetros de consulta

vendor_id
string
obrigatório

The ID of the vendor to create the campaign for.

Corpo

application/json
dsp
enum<string>
obrigatório

The DSP to create the campaign for.

Opções disponíveis:
google_ads,
meta
name
string
obrigatório
budget
integer<int64>
obrigatório

The amount of money in the budget in minor units of currency according to ISO 4217.

Exemplo:

1000

locationIds
string[]
obrigatório

The DSP-native location IDs to target. Retrieve available IDs via GET /offsite-ads/marketplace/geolocations and use the values from dspLocationIds for the target DSP. Reference: Google Ads geo targets (https://developers.google.com/google-ads/api/data/geotargets), Meta region IDs (https://developers.facebook.com/docs/marketing-api/audiences/reference/targeting-search#regions).

Minimum array length: 1
Exemplo:
["123456"]
startDate
string<date-time>
endDate
string<date-time>
productIds
string[] | null

The product ids to target. These are the product ids from the catalog. If not provided, all products will be targeted.

Minimum array length: 5
Exemplo:
["prod1", "prod2", "prod3", "prod4", "prod5"]
audienceIds
string[] | null

The audience ids to target. These are the audience ids from each DSP platform. Currently, only one audience is supported. If not provided, no audience will be targeted.

Maximum array length: 1
Exemplo:
["123456"]

Resposta

Successful Response

jobId
string<uuid>
obrigatório

The unique identifier for the queued job.