Skip to main content
PATCH
/
public
/
v1
/
offsite-ads
/
campaigns
/
{campaign-id}
Update Campaign
curl --request PATCH \
  --url https://api.topsort.com/public/v1/offsite-ads/campaigns/{campaign-id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "<string>",
  "startDate": "2023-11-07T05:31:56Z",
  "endDate": "2023-11-07T05:31:56Z",
  "budget": 123,
  "status": "ENABLED",
  "locationIds": [
    "<string>"
  ],
  "productIds": [
    "<string>"
  ],
  "audienceIds": [
    "123456"
  ]
}'
{
  "jobId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}

Authorizations

Authorization
string
header
required

A valid API key generated in Topsort's UI.

Path Parameters

campaign-id
string<uuid>
required

The ID of the campaign to update.

Query Parameters

vendor_id
string
required

The ID of the vendor to update the campaign for.

Body

application/json
name
string | null

The name of the campaign

startDate
string<date-time> | null

The start date of the campaign

endDate
string<date-time> | null

The end date of the campaign

budget
integer | null

The budget of the campaign

status
enum<string> | null

The status of the campaign

Available options:
ENABLED,
PAUSED
locationIds
string[] | null

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
productIds
string[] | null

The product ids to target. These are the product ids from the catalog. When updating product_ids, you must provide at least 5 products. Use an empty list [] to select all products, or None to keep the current selection.

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 won't be updated. If empty, the audience will be removed.

Maximum length: 1
Examples:
["123456"]

Response

Successful Response

jobId
string<uuid>
required

The unique identifier for the queued job.