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 '{
  "audienceIds": [
    "123456"
  ],
  "budget": 1000,
  "dsp": "google_ads",
  "endDate": "2023-11-07T05:31:56Z",
  "locationIds": [
    "123456"
  ],
  "name": "<string>",
  "productIds": [
    "123456"
  ],
  "startDate": "2023-11-07T05:31:56Z"
}'
{
  "jobId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}

Authorizations

Authorization
string
header
required

A valid API key generated in Topsort's UI.

Query Parameters

vendor_id
string
required

The ID of the vendor to create the campaign for.

Body

application/json
budget
integer
required

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

Required range: 0 < x < 2000000000
Example:

1000

dsp
enum<string>
required

The DSP to create the campaign for.

Available options:
google_ads,
meta
locationIds
string[]
required

The location ids to target. Google ads geo target ids can be found here: https://developers.google.com/google-ads/api/data/geotargets. Facebook region ids can be found here: https://developers.facebook.com/docs/marketing-api/audiences/reference/targeting-search#regions

Minimum length: 1
Example:
["123456"]
name
string
required
audienceIds
string[]

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 length: 1
Example:
["123456"]
endDate
string<date-time>
productIds
string[]

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

Minimum length: 5
Example:
["123456"]
startDate
string<date-time>

Response

Successful Response

jobId
string<uuid>
required

The unique identifier for the queued job.