Skip to content

Latest commit

Β 

History

History
1996 lines (1420 loc) Β· 66.7 KB

File metadata and controls

1996 lines (1420 loc) Β· 66.7 KB

CampaignsApi

All URIs are relative to https://up.go-adserver.com

Method HTTP request Description
apiV1CampaignsGet GET /api/v1/campaigns List the caller's campaigns across all types (or one type).
apiV1CampaignsRonCampaignIdAdsAdIdZoneBidsGet GET /api/v1/campaigns/ron/{campaignId}/ads/{adId}/zone-bids List per-zone bid overrides for a RON ad.
apiV1CampaignsRonCampaignIdAdsAdIdZoneBidsPut PUT /api/v1/campaigns/ron/{campaignId}/ads/{adId}/zone-bids Replace the per-zone bid overrides on a RON ad.
apiV1CampaignsRonCampaignIdAdsAdIdZoneBidsZoneIdDelete DELETE /api/v1/campaigns/ron/{campaignId}/ads/{adId}/zone-bids/{zoneId} Clear a single per-zone bid override.
apiV1CampaignsTypeCampaignIdAdsAdIdActivePatch PATCH /api/v1/campaigns/{type}/{campaignId}/ads/{adId}/active Pause or unpause a single ad.
apiV1CampaignsTypeCampaignIdAdsAdIdBidPatch PATCH /api/v1/campaigns/{type}/{campaignId}/ads/{adId}/bid Set a single ad's bid.
apiV1CampaignsTypeCampaignIdAdsAdIdClonePost POST /api/v1/campaigns/{type}/{campaignId}/ads/{adId}/clone Clone a single ad within a campaign.
apiV1CampaignsTypeCampaignIdAdsAdIdDelete DELETE /api/v1/campaigns/{type}/{campaignId}/ads/{adId} Soft-delete an ad.
apiV1CampaignsTypeCampaignIdAdsAdIdGet GET /api/v1/campaigns/{type}/{campaignId}/ads/{adId} Show one ad.
apiV1CampaignsTypeCampaignIdAdsAdIdPut PUT /api/v1/campaigns/{type}/{campaignId}/ads/{adId} Update an ad.
apiV1CampaignsTypeCampaignIdAdsGet GET /api/v1/campaigns/{type}/{campaignId}/ads List ads on a campaign.
apiV1CampaignsTypeCampaignIdAdsPost POST /api/v1/campaigns/{type}/{campaignId}/ads Create an ad on a campaign (smart-default, JSON-only).
apiV1CampaignsTypeCampaignIdSchemaAdsGet GET /api/v1/campaigns/{type}/{campaignId}/_schema/ads Field metadata for ad creation, scoped to a campaign.
apiV1CampaignsTypeIdActivePatch PATCH /api/v1/campaigns/{type}/{id}/active Pause or unpause a campaign.
apiV1CampaignsTypeIdBidsPatch PATCH /api/v1/campaigns/{type}/{id}/bids Mass update bids on every ad in a campaign.
apiV1CampaignsTypeIdClonePost POST /api/v1/campaigns/{type}/{id}/clone Clone a campaign and all its ads.
apiV1CampaignsTypeIdDelete DELETE /api/v1/campaigns/{type}/{id} Soft-delete a campaign.
apiV1CampaignsTypeIdFiltersFilterTypeFilterIdDelete DELETE /api/v1/campaigns/{type}/{id}/filters/{filter_type}/{filter_id} Detach a filter from this campaign.
apiV1CampaignsTypeIdFiltersGet GET /api/v1/campaigns/{type}/{id}/filters List filters attached to this campaign.
apiV1CampaignsTypeIdFiltersPost POST /api/v1/campaigns/{type}/{id}/filters Attach a filter to this campaign.
apiV1CampaignsTypeIdGet GET /api/v1/campaigns/{type}/{id} Get a single campaign.
apiV1CampaignsTypeIdMinBidGet GET /api/v1/campaigns/{type}/{id}/min-bid Get the campaign's minimum acceptable CPC bid.
apiV1CampaignsTypePost POST /api/v1/campaigns/{type} Create a new campaign (smart-default).
apiV1CampaignsTypeSchemaAdsGet GET /api/v1/campaigns/{type}/_schema/ads Field metadata for ad creation.
apiV1CampaignsTypeSchemaGet GET /api/v1/campaigns/{type}/_schema Field metadata for create/update.

apiV1CampaignsGet

ApiV1CampaignsGet200Response apiV1CampaignsGet(type, page, perPage, fields)

List the caller's campaigns across all types (or one type).

Returns the caller's campaigns. By default each row carries a rich-but-bounded projection: identity (`id`, `name`, `campaign_type`, `ad_type` + `ad_type_label`, `selling_type`), lifecycle (`is_paused`, `is_active`, `is_deleted`, `is_complete`, `pending_state`), budget (`daily_budget`, `daily_spent`, `total_budget`, `total_spent`, `use_campaign_budget`), bidding (`bid_default`, `min_bid`), targeting summary (`countries`, `languages`, `categories`, `device_type_ids`, …), capping, schedule, linked filter/pool ids, and timestamps. Use `?fields=` to opt in or out of fields: - `?fields=*` β€” return every column on the underlying campaign row (70+ fields, type-dependent). Convenient for AI agents that want the full picture in one call. - `?fields=name,daily_budget,countries` β€” narrow to just those fields. `id` is always included. - (omitted) β€” default rich projection above.

Example

import {
  Configuration,
  CampaignsApi,
} from 'goadserver-sdk';
import type { ApiV1CampaignsGetRequest } from 'goadserver-sdk';

async function example() {
  console.log("πŸš€ Testing goadserver-sdk SDK...");
  const config = new Configuration({ 
    // Configure HTTP bearer authorization: apiKey
    accessToken: "YOUR BEARER TOKEN",
  });
  const api = new CampaignsApi(config);

  const body = {
    // 'all' | 'ron' | 'cpm' | 'flatrate' | 'directdeal' | 'rtb' (optional)
    type: type_example,
    // number (optional)
    page: 56,
    // number (optional)
    perPage: 56,
    // string | CSV of fields to return; `*` returns everything available. (optional)
    fields: fields_example,
  } satisfies ApiV1CampaignsGetRequest;

  try {
    const data = await api.apiV1CampaignsGet(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
type all, ron, cpm, flatrate, directdeal, rtb [Optional] [Defaults to 'all'] [Enum: all, ron, cpm, flatrate, directdeal, rtb]
page number [Optional] [Defaults to 1]
perPage number [Optional] [Defaults to 50]
fields string CSV of fields to return; `*` returns everything available. [Optional] [Defaults to undefined]

Return type

ApiV1CampaignsGet200Response

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Paginated campaign list (projected to a stable subset of fields). -
401 Missing or invalid API key. -
403 Key lacks the required scope, or IP not in allowlist, or account suspended. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

apiV1CampaignsRonCampaignIdAdsAdIdZoneBidsGet

ApiV1CampaignsRonCampaignIdAdsAdIdZoneBidsGet200Response apiV1CampaignsRonCampaignIdAdsAdIdZoneBidsGet(campaignId, adId)

List per-zone bid overrides for a RON ad.

RON ads carry a per-adzone bid map (`bids_per_zone` JSON), letting an advertiser bid different amounts on different publisher zones. This endpoint returns each override enriched with the zone + site names, so an auto-optimiser can correlate ids ↔ human labels in one call. Empty list if the ad has no overrides β€” the global ad bid applies to every zone.

Example

import {
  Configuration,
  CampaignsApi,
} from 'goadserver-sdk';
import type { ApiV1CampaignsRonCampaignIdAdsAdIdZoneBidsGetRequest } from 'goadserver-sdk';

async function example() {
  console.log("πŸš€ Testing goadserver-sdk SDK...");
  const config = new Configuration({ 
    // Configure HTTP bearer authorization: apiKey
    accessToken: "YOUR BEARER TOKEN",
  });
  const api = new CampaignsApi(config);

  const body = {
    // number
    campaignId: 56,
    // number
    adId: 56,
  } satisfies ApiV1CampaignsRonCampaignIdAdsAdIdZoneBidsGetRequest;

  try {
    const data = await api.apiV1CampaignsRonCampaignIdAdsAdIdZoneBidsGet(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
campaignId number [Defaults to undefined]
adId number [Defaults to undefined]

Return type

ApiV1CampaignsRonCampaignIdAdsAdIdZoneBidsGet200Response

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Zone bid map. -
403 Key lacks the required scope, or IP not in allowlist, or account suspended. -
404 Ad not found. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

apiV1CampaignsRonCampaignIdAdsAdIdZoneBidsPut

ApiV1CampaignsRonCampaignIdAdsAdIdZoneBidsPut200Response apiV1CampaignsRonCampaignIdAdsAdIdZoneBidsPut(campaignId, adId, apiV1CampaignsRonCampaignIdAdsAdIdZoneBidsPutRequest)

Replace the per-zone bid overrides on a RON ad.

Full-replace semantics β€” any zone NOT in the request body has its override cleared. If you only want to update a few zones, pass the complete current set merged with your changes. Auto-optimisers usually recompute the full bid sheet per cycle so this fits the common loop. Negative or zero `zone_id` and negative `bid` entries are silently dropped.

Example

import {
  Configuration,
  CampaignsApi,
} from 'goadserver-sdk';
import type { ApiV1CampaignsRonCampaignIdAdsAdIdZoneBidsPutOperationRequest } from 'goadserver-sdk';

async function example() {
  console.log("πŸš€ Testing goadserver-sdk SDK...");
  const config = new Configuration({ 
    // Configure HTTP bearer authorization: apiKey
    accessToken: "YOUR BEARER TOKEN",
  });
  const api = new CampaignsApi(config);

  const body = {
    // number
    campaignId: 56,
    // number
    adId: 56,
    // ApiV1CampaignsRonCampaignIdAdsAdIdZoneBidsPutRequest
    apiV1CampaignsRonCampaignIdAdsAdIdZoneBidsPutRequest: {"zone_bids":[{"zone_id":12,"bid":0.002},{"zone_id":19,"bid":8.0E-4}]},
  } satisfies ApiV1CampaignsRonCampaignIdAdsAdIdZoneBidsPutOperationRequest;

  try {
    const data = await api.apiV1CampaignsRonCampaignIdAdsAdIdZoneBidsPut(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
campaignId number [Defaults to undefined]
adId number [Defaults to undefined]
apiV1CampaignsRonCampaignIdAdsAdIdZoneBidsPutRequest ApiV1CampaignsRonCampaignIdAdsAdIdZoneBidsPutRequest

Return type

ApiV1CampaignsRonCampaignIdAdsAdIdZoneBidsPut200Response

Authorization

apiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Replaced. -
403 Key lacks the required scope, or IP not in allowlist, or account suspended. -
404 Ad not found. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

apiV1CampaignsRonCampaignIdAdsAdIdZoneBidsZoneIdDelete

ApiV1CampaignsRonCampaignIdAdsAdIdZoneBidsZoneIdDelete200Response apiV1CampaignsRonCampaignIdAdsAdIdZoneBidsZoneIdDelete(campaignId, adId, zoneId)

Clear a single per-zone bid override.

Removes the override for one zone. The global ad bid takes over again for that zone. Returns 404 if no override exists for the given zone.

Example

import {
  Configuration,
  CampaignsApi,
} from 'goadserver-sdk';
import type { ApiV1CampaignsRonCampaignIdAdsAdIdZoneBidsZoneIdDeleteRequest } from 'goadserver-sdk';

async function example() {
  console.log("πŸš€ Testing goadserver-sdk SDK...");
  const config = new Configuration({ 
    // Configure HTTP bearer authorization: apiKey
    accessToken: "YOUR BEARER TOKEN",
  });
  const api = new CampaignsApi(config);

  const body = {
    // number
    campaignId: 56,
    // number
    adId: 56,
    // number
    zoneId: 56,
  } satisfies ApiV1CampaignsRonCampaignIdAdsAdIdZoneBidsZoneIdDeleteRequest;

  try {
    const data = await api.apiV1CampaignsRonCampaignIdAdsAdIdZoneBidsZoneIdDelete(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
campaignId number [Defaults to undefined]
adId number [Defaults to undefined]
zoneId number [Defaults to undefined]

Return type

ApiV1CampaignsRonCampaignIdAdsAdIdZoneBidsZoneIdDelete200Response

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Override cleared. -
403 Key lacks the required scope, or IP not in allowlist, or account suspended. -
404 Ad not found, or no override for that zone. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

apiV1CampaignsTypeCampaignIdAdsAdIdActivePatch

ApiV1CampaignsTypeIdActivePatch200Response apiV1CampaignsTypeCampaignIdAdsAdIdActivePatch(type, campaignId, adId, apiV1CampaignsTypeIdActivePatchRequest)

Pause or unpause a single ad.

Idempotent set. `active=true` activates the ad, `active=false` pauses it. Useful for granular pause/resume from an optimiser without touching the campaign-level pause state.

Example

import {
  Configuration,
  CampaignsApi,
} from 'goadserver-sdk';
import type { ApiV1CampaignsTypeCampaignIdAdsAdIdActivePatchRequest } from 'goadserver-sdk';

async function example() {
  console.log("πŸš€ Testing goadserver-sdk SDK...");
  const config = new Configuration({ 
    // Configure HTTP bearer authorization: apiKey
    accessToken: "YOUR BEARER TOKEN",
  });
  const api = new CampaignsApi(config);

  const body = {
    // 'ron' | 'cpm' | 'flatrate' | 'directdeal' | 'rtb'
    type: type_example,
    // number
    campaignId: 56,
    // number
    adId: 56,
    // ApiV1CampaignsTypeIdActivePatchRequest
    apiV1CampaignsTypeIdActivePatchRequest: ...,
  } satisfies ApiV1CampaignsTypeCampaignIdAdsAdIdActivePatchRequest;

  try {
    const data = await api.apiV1CampaignsTypeCampaignIdAdsAdIdActivePatch(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
type ron, cpm, flatrate, directdeal, rtb [Defaults to undefined] [Enum: ron, cpm, flatrate, directdeal, rtb]
campaignId number [Defaults to undefined]
adId number [Defaults to undefined]
apiV1CampaignsTypeIdActivePatchRequest ApiV1CampaignsTypeIdActivePatchRequest

Return type

ApiV1CampaignsTypeIdActivePatch200Response

Authorization

apiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 New state. -
403 Key lacks the required scope, or IP not in allowlist, or account suspended. -
404 Ad not found. -
422 Validation error. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

apiV1CampaignsTypeCampaignIdAdsAdIdBidPatch

ApiV1CampaignsTypeCampaignIdAdsAdIdBidPatch200Response apiV1CampaignsTypeCampaignIdAdsAdIdBidPatch(type, campaignId, adId, apiV1CampaignsTypeCampaignIdAdsAdIdBidPatchRequest)

Set a single ad's bid.

Updates one ad's bid. Value is in main-currency units (the same scale `bid` is stored in). For the legal floor on the parent campaign, query `GET /campaigns/{type}/{id}/min-bid` first.

Example

import {
  Configuration,
  CampaignsApi,
} from 'goadserver-sdk';
import type { ApiV1CampaignsTypeCampaignIdAdsAdIdBidPatchOperationRequest } from 'goadserver-sdk';

async function example() {
  console.log("πŸš€ Testing goadserver-sdk SDK...");
  const config = new Configuration({ 
    // Configure HTTP bearer authorization: apiKey
    accessToken: "YOUR BEARER TOKEN",
  });
  const api = new CampaignsApi(config);

  const body = {
    // 'ron' | 'cpm' | 'flatrate' | 'directdeal' | 'rtb'
    type: type_example,
    // number
    campaignId: 56,
    // number
    adId: 56,
    // ApiV1CampaignsTypeCampaignIdAdsAdIdBidPatchRequest
    apiV1CampaignsTypeCampaignIdAdsAdIdBidPatchRequest: ...,
  } satisfies ApiV1CampaignsTypeCampaignIdAdsAdIdBidPatchOperationRequest;

  try {
    const data = await api.apiV1CampaignsTypeCampaignIdAdsAdIdBidPatch(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
type ron, cpm, flatrate, directdeal, rtb [Defaults to undefined] [Enum: ron, cpm, flatrate, directdeal, rtb]
campaignId number [Defaults to undefined]
adId number [Defaults to undefined]
apiV1CampaignsTypeCampaignIdAdsAdIdBidPatchRequest ApiV1CampaignsTypeCampaignIdAdsAdIdBidPatchRequest

Return type

ApiV1CampaignsTypeCampaignIdAdsAdIdBidPatch200Response

Authorization

apiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Bid updated. -
403 Key lacks the required scope, or IP not in allowlist, or account suspended. -
404 Ad not found. -
422 Validation error (negative bid, missing field). -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

apiV1CampaignsTypeCampaignIdAdsAdIdClonePost

ApiV1CampaignsTypeCampaignIdAdsAdIdClonePost200Response apiV1CampaignsTypeCampaignIdAdsAdIdClonePost(type, campaignId, adId)

Clone a single ad within a campaign.

Duplicates one ad. The clone is attached to the same campaign as the source. Useful for A/B-testing creative variants without rebuilding the whole record from scratch.

Example

import {
  Configuration,
  CampaignsApi,
} from 'goadserver-sdk';
import type { ApiV1CampaignsTypeCampaignIdAdsAdIdClonePostRequest } from 'goadserver-sdk';

async function example() {
  console.log("πŸš€ Testing goadserver-sdk SDK...");
  const config = new Configuration({ 
    // Configure HTTP bearer authorization: apiKey
    accessToken: "YOUR BEARER TOKEN",
  });
  const api = new CampaignsApi(config);

  const body = {
    // 'ron' | 'cpm' | 'flatrate' | 'directdeal' | 'rtb'
    type: type_example,
    // number
    campaignId: 56,
    // number
    adId: 56,
  } satisfies ApiV1CampaignsTypeCampaignIdAdsAdIdClonePostRequest;

  try {
    const data = await api.apiV1CampaignsTypeCampaignIdAdsAdIdClonePost(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
type ron, cpm, flatrate, directdeal, rtb [Defaults to undefined] [Enum: ron, cpm, flatrate, directdeal, rtb]
campaignId number [Defaults to undefined]
adId number [Defaults to undefined]

Return type

ApiV1CampaignsTypeCampaignIdAdsAdIdClonePost200Response

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Ad cloned. -
403 Key lacks the required scope, or IP not in allowlist, or account suspended. -
404 Source ad not found or not owned by caller. -
422 Clone failed. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

apiV1CampaignsTypeCampaignIdAdsAdIdDelete

apiV1CampaignsTypeCampaignIdAdsAdIdDelete(type, campaignId, adId)

Soft-delete an ad.

Example

import {
  Configuration,
  CampaignsApi,
} from 'goadserver-sdk';
import type { ApiV1CampaignsTypeCampaignIdAdsAdIdDeleteRequest } from 'goadserver-sdk';

async function example() {
  console.log("πŸš€ Testing goadserver-sdk SDK...");
  const config = new Configuration({ 
    // Configure HTTP bearer authorization: apiKey
    accessToken: "YOUR BEARER TOKEN",
  });
  const api = new CampaignsApi(config);

  const body = {
    // 'ron' | 'cpm' | 'flatrate' | 'directdeal' | 'rtb'
    type: type_example,
    // number
    campaignId: 56,
    // number
    adId: 56,
  } satisfies ApiV1CampaignsTypeCampaignIdAdsAdIdDeleteRequest;

  try {
    const data = await api.apiV1CampaignsTypeCampaignIdAdsAdIdDelete(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
type ron, cpm, flatrate, directdeal, rtb [Defaults to undefined] [Enum: ron, cpm, flatrate, directdeal, rtb]
campaignId number [Defaults to undefined]
adId number [Defaults to undefined]

Return type

void (Empty response body)

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
200 Deleted. -
404 Ad not found. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

apiV1CampaignsTypeCampaignIdAdsAdIdGet

apiV1CampaignsTypeCampaignIdAdsAdIdGet(type, campaignId, adId)

Show one ad.

Example

import {
  Configuration,
  CampaignsApi,
} from 'goadserver-sdk';
import type { ApiV1CampaignsTypeCampaignIdAdsAdIdGetRequest } from 'goadserver-sdk';

async function example() {
  console.log("πŸš€ Testing goadserver-sdk SDK...");
  const config = new Configuration({ 
    // Configure HTTP bearer authorization: apiKey
    accessToken: "YOUR BEARER TOKEN",
  });
  const api = new CampaignsApi(config);

  const body = {
    // 'ron' | 'cpm' | 'flatrate' | 'directdeal' | 'rtb'
    type: type_example,
    // number
    campaignId: 56,
    // number
    adId: 56,
  } satisfies ApiV1CampaignsTypeCampaignIdAdsAdIdGetRequest;

  try {
    const data = await api.apiV1CampaignsTypeCampaignIdAdsAdIdGet(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
type ron, cpm, flatrate, directdeal, rtb [Defaults to undefined] [Enum: ron, cpm, flatrate, directdeal, rtb]
campaignId number [Defaults to undefined]
adId number [Defaults to undefined]

Return type

void (Empty response body)

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
200 Ad detail. -
404 Ad not found. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

apiV1CampaignsTypeCampaignIdAdsAdIdPut

apiV1CampaignsTypeCampaignIdAdsAdIdPut(type, campaignId, adId, apiV1CampaignsTypeCampaignIdAdsAdIdPutRequest)

Update an ad.

Editable fields depend on ad type. Common fields: `bid`, `isactive`, `creatives` (banner/video/native blob).

Example

import {
  Configuration,
  CampaignsApi,
} from 'goadserver-sdk';
import type { ApiV1CampaignsTypeCampaignIdAdsAdIdPutOperationRequest } from 'goadserver-sdk';

async function example() {
  console.log("πŸš€ Testing goadserver-sdk SDK...");
  const config = new Configuration({ 
    // Configure HTTP bearer authorization: apiKey
    accessToken: "YOUR BEARER TOKEN",
  });
  const api = new CampaignsApi(config);

  const body = {
    // 'ron' | 'cpm' | 'flatrate' | 'directdeal' | 'rtb'
    type: type_example,
    // number
    campaignId: 56,
    // number
    adId: 56,
    // ApiV1CampaignsTypeCampaignIdAdsAdIdPutRequest
    apiV1CampaignsTypeCampaignIdAdsAdIdPutRequest: ...,
  } satisfies ApiV1CampaignsTypeCampaignIdAdsAdIdPutOperationRequest;

  try {
    const data = await api.apiV1CampaignsTypeCampaignIdAdsAdIdPut(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
type ron, cpm, flatrate, directdeal, rtb [Defaults to undefined] [Enum: ron, cpm, flatrate, directdeal, rtb]
campaignId number [Defaults to undefined]
adId number [Defaults to undefined]
apiV1CampaignsTypeCampaignIdAdsAdIdPutRequest ApiV1CampaignsTypeCampaignIdAdsAdIdPutRequest

Return type

void (Empty response body)

Authorization

apiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

HTTP response details

Status code Description Response headers
200 Updated. -
404 Ad not found. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

apiV1CampaignsTypeCampaignIdAdsGet

ApiV1CampaignsTypeCampaignIdAdsGet200Response apiV1CampaignsTypeCampaignIdAdsGet(type, campaignId, page, perPage)

List ads on a campaign.

Returns every ad attached to the campaign (paginated). Each row carries `id`, `bid`, `isactive`, `bansizeid`, the underlying `creatives` JSON (banner/video/native, with file paths and creative_id refs), and lifetime stats from the campaign-side rollup.

Example

import {
  Configuration,
  CampaignsApi,
} from 'goadserver-sdk';
import type { ApiV1CampaignsTypeCampaignIdAdsGetRequest } from 'goadserver-sdk';

async function example() {
  console.log("πŸš€ Testing goadserver-sdk SDK...");
  const config = new Configuration({ 
    // Configure HTTP bearer authorization: apiKey
    accessToken: "YOUR BEARER TOKEN",
  });
  const api = new CampaignsApi(config);

  const body = {
    // 'ron' | 'cpm' | 'flatrate' | 'directdeal' | 'rtb'
    type: type_example,
    // number
    campaignId: 56,
    // number (optional)
    page: 56,
    // number (optional)
    perPage: 56,
  } satisfies ApiV1CampaignsTypeCampaignIdAdsGetRequest;

  try {
    const data = await api.apiV1CampaignsTypeCampaignIdAdsGet(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
type ron, cpm, flatrate, directdeal, rtb [Defaults to undefined] [Enum: ron, cpm, flatrate, directdeal, rtb]
campaignId number [Defaults to undefined]
page number [Optional] [Defaults to 1]
perPage number [Optional] [Defaults to 50]

Return type

ApiV1CampaignsTypeCampaignIdAdsGet200Response

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Ads. -
404 Campaign not found. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

apiV1CampaignsTypeCampaignIdAdsPost

apiV1CampaignsTypeCampaignIdAdsPost(type, campaignId, apiV1CampaignsTypeCampaignIdAdsPostRequest, dryRun, strict)

Create an ad on a campaign (smart-default, JSON-only).

Creates a new ad attached to the campaign. JSON-only β€” agents reference an existing creative (banner pool, single creative, URL or HTML) instead of uploading files. The panel handler at the same path still accepts `multipart/form-data` for file uploads β€” this docs entry covers the JSON path only. Required: `title` + `bid` + exactly one creative reference (`banner_pool_id` / `creative_id` / `banner_url` / `banner_html` / `video_pool_id`). `destination_url` is required unless the creative carries its own URL (popunder/JS) or you set `url_pool_id`. Modes: - `?dry_run=1` β€” return the resolved field map + computed `creatives` JSON without inserting. - `?strict=1` β€” reject unknown field names with a 422.

Example

import {
  Configuration,
  CampaignsApi,
} from 'goadserver-sdk';
import type { ApiV1CampaignsTypeCampaignIdAdsPostOperationRequest } from 'goadserver-sdk';

async function example() {
  console.log("πŸš€ Testing goadserver-sdk SDK...");
  const config = new Configuration({ 
    // Configure HTTP bearer authorization: apiKey
    accessToken: "YOUR BEARER TOKEN",
  });
  const api = new CampaignsApi(config);

  const body = {
    // 'ron' | 'cpm' | 'flatrate' | 'directdeal' | 'rtb'
    type: type_example,
    // number
    campaignId: 56,
    // ApiV1CampaignsTypeCampaignIdAdsPostRequest
    apiV1CampaignsTypeCampaignIdAdsPostRequest: {"title":"My banner ad","bid":0.0042,"banner_pool_id":129481,"destination_url":"https://example.com/lander"},
    // '1' (optional)
    dryRun: dryRun_example,
    // '1' (optional)
    strict: strict_example,
  } satisfies ApiV1CampaignsTypeCampaignIdAdsPostOperationRequest;

  try {
    const data = await api.apiV1CampaignsTypeCampaignIdAdsPost(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
type ron, cpm, flatrate, directdeal, rtb [Defaults to undefined] [Enum: ron, cpm, flatrate, directdeal, rtb]
campaignId number [Defaults to undefined]
apiV1CampaignsTypeCampaignIdAdsPostRequest ApiV1CampaignsTypeCampaignIdAdsPostRequest
dryRun 1 [Optional] [Defaults to undefined] [Enum: 1]
strict 1 [Optional] [Defaults to undefined] [Enum: 1]

Return type

void (Empty response body)

Authorization

apiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 Created. Body is the freshly-created ad in the same shape as `GET /campaigns/{type}/{campaignId}/ads/{adId}`. -
200 When `?dry_run=1` β€” body is `{ dry_run: true, resolved: ..., creatives: ..., would_insert: ... }`. -
422 Validation error. -
404 Campaign not found. -
403 Key lacks the required scope, or IP not in allowlist, or account suspended. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

apiV1CampaignsTypeCampaignIdSchemaAdsGet

apiV1CampaignsTypeCampaignIdSchemaAdsGet(type, campaignId)

Field metadata for ad creation, scoped to a campaign.

Same as `/_schema/ads` above, but uses the campaign's ad type to return only the fields that apply (e.g. video pools omitted for a banner-only campaign). Sets `campaign_ad_type` in the response.

Example

import {
  Configuration,
  CampaignsApi,
} from 'goadserver-sdk';
import type { ApiV1CampaignsTypeCampaignIdSchemaAdsGetRequest } from 'goadserver-sdk';

async function example() {
  console.log("πŸš€ Testing goadserver-sdk SDK...");
  const config = new Configuration({ 
    // Configure HTTP bearer authorization: apiKey
    accessToken: "YOUR BEARER TOKEN",
  });
  const api = new CampaignsApi(config);

  const body = {
    // 'ron' | 'cpm' | 'flatrate' | 'directdeal' | 'rtb'
    type: type_example,
    // number
    campaignId: 56,
  } satisfies ApiV1CampaignsTypeCampaignIdSchemaAdsGetRequest;

  try {
    const data = await api.apiV1CampaignsTypeCampaignIdSchemaAdsGet(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
type ron, cpm, flatrate, directdeal, rtb [Defaults to undefined] [Enum: ron, cpm, flatrate, directdeal, rtb]
campaignId number [Defaults to undefined]

Return type

void (Empty response body)

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
200 Ad-create field metadata, narrowed to the campaign's ad type. -
404 Campaign not found. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

apiV1CampaignsTypeIdActivePatch

ApiV1CampaignsTypeIdActivePatch200Response apiV1CampaignsTypeIdActivePatch(type, id, apiV1CampaignsTypeIdActivePatchRequest)

Pause or unpause a campaign.

Idempotent. `active=true` unpauses, `active=false` pauses. Reuses the same panel-side guards: flat-rate campaigns with running deals cannot be paused; offer campaigns require >= 5 ads to be unpaused. This is the endpoint behind the "On / off only" key preset.

Example

import {
  Configuration,
  CampaignsApi,
} from 'goadserver-sdk';
import type { ApiV1CampaignsTypeIdActivePatchOperationRequest } from 'goadserver-sdk';

async function example() {
  console.log("πŸš€ Testing goadserver-sdk SDK...");
  const config = new Configuration({ 
    // Configure HTTP bearer authorization: apiKey
    accessToken: "YOUR BEARER TOKEN",
  });
  const api = new CampaignsApi(config);

  const body = {
    // 'ron' | 'cpm' | 'flatrate' | 'directdeal' | 'rtb'
    type: type_example,
    // number
    id: 56,
    // ApiV1CampaignsTypeIdActivePatchRequest
    apiV1CampaignsTypeIdActivePatchRequest: ...,
  } satisfies ApiV1CampaignsTypeIdActivePatchOperationRequest;

  try {
    const data = await api.apiV1CampaignsTypeIdActivePatch(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
type ron, cpm, flatrate, directdeal, rtb [Defaults to undefined] [Enum: ron, cpm, flatrate, directdeal, rtb]
id number [Defaults to undefined]
apiV1CampaignsTypeIdActivePatchRequest ApiV1CampaignsTypeIdActivePatchRequest

Return type

ApiV1CampaignsTypeIdActivePatch200Response

Authorization

apiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 New state -
403 Key lacks the required scope, or IP not in allowlist, or account suspended. -
404 Not found -
422 Toggle blocked by a business rule (e.g. flat-rate running deals, offer min-ads). -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

apiV1CampaignsTypeIdBidsPatch

ApiV1CampaignsTypeIdBidsPatch200Response apiV1CampaignsTypeIdBidsPatch(type, id, apiV1CampaignsTypeIdBidsPatchRequest)

Mass update bids on every ad in a campaign.

Update every (or a subset of) ad's bid in one call. Three modes: - `set` β€” overwrite each target ad's bid with `value`. - `pct_inc` β€” raise each target ad's bid by `pct` percent. - `pct_dec` β€” lower each target ad's bid by `pct` percent. Optional `ad_ids` narrows the update to a subset (omit or empty list = every non-deleted ad on the campaign). Bids are clamped at 0 β€” anything that would resolve below 0 is set to 0. Bid values are in main-currency units (the same scale `bid` is stored in). For minimum-acceptable-bid floors call `GET /api/v1/campaigns/{type}/{id}/min-bid` first.

Example

import {
  Configuration,
  CampaignsApi,
} from 'goadserver-sdk';
import type { ApiV1CampaignsTypeIdBidsPatchOperationRequest } from 'goadserver-sdk';

async function example() {
  console.log("πŸš€ Testing goadserver-sdk SDK...");
  const config = new Configuration({ 
    // Configure HTTP bearer authorization: apiKey
    accessToken: "YOUR BEARER TOKEN",
  });
  const api = new CampaignsApi(config);

  const body = {
    // 'ron' | 'cpm' | 'rtb'
    type: type_example,
    // number
    id: 56,
    // ApiV1CampaignsTypeIdBidsPatchRequest
    apiV1CampaignsTypeIdBidsPatchRequest: {"mode":"set","value":0.0042},
  } satisfies ApiV1CampaignsTypeIdBidsPatchOperationRequest;

  try {
    const data = await api.apiV1CampaignsTypeIdBidsPatch(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
type ron, cpm, rtb [Defaults to undefined] [Enum: ron, cpm, rtb]
id number [Defaults to undefined]
apiV1CampaignsTypeIdBidsPatchRequest ApiV1CampaignsTypeIdBidsPatchRequest

Return type

ApiV1CampaignsTypeIdBidsPatch200Response

Authorization

apiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Updated. -
403 Key lacks the required scope, or IP not in allowlist, or account suspended. -
404 Campaign not found. -
422 Validation error (invalid mode / value / pct). -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

apiV1CampaignsTypeIdClonePost

ApiV1CampaignsTypeIdClonePost201Response apiV1CampaignsTypeIdClonePost(type, id, apiV1CampaignsTypeIdClonePostRequest)

Clone a campaign and all its ads.

Duplicates the campaign row and every ad attached to it. The clone lands paused (`is_active=false`) so you can review and tweak it before activating. Targeting filters, bids, daily caps and budget settings are all carried over verbatim β€” only `name` (suffix " Copy" by default, overridable via the body) and reset bookkeeping fields (`num_ads`, `pending_state`, `dateadded`, `wl_zoneids`) differ from the original. For `ron` campaigns the clone also strips any flat-rate deals (the new campaign starts with no running placements) and copies offer screenshot files from the original so the cloned offer-mode campaign retains its preview imagery.

Example

import {
  Configuration,
  CampaignsApi,
} from 'goadserver-sdk';
import type { ApiV1CampaignsTypeIdClonePostOperationRequest } from 'goadserver-sdk';

async function example() {
  console.log("πŸš€ Testing goadserver-sdk SDK...");
  const config = new Configuration({ 
    // Configure HTTP bearer authorization: apiKey
    accessToken: "YOUR BEARER TOKEN",
  });
  const api = new CampaignsApi(config);

  const body = {
    // 'ron' | 'cpm' | 'flatrate' | 'directdeal' | 'rtb'
    type: type_example,
    // number
    id: 56,
    // ApiV1CampaignsTypeIdClonePostRequest (optional)
    apiV1CampaignsTypeIdClonePostRequest: ...,
  } satisfies ApiV1CampaignsTypeIdClonePostOperationRequest;

  try {
    const data = await api.apiV1CampaignsTypeIdClonePost(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
type ron, cpm, flatrate, directdeal, rtb [Defaults to undefined] [Enum: ron, cpm, flatrate, directdeal, rtb]
id number [Defaults to undefined]
apiV1CampaignsTypeIdClonePostRequest ApiV1CampaignsTypeIdClonePostRequest [Optional]

Return type

ApiV1CampaignsTypeIdClonePost201Response

Authorization

apiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 Clone created. -
403 Key lacks the required scope, or IP not in allowlist, or account suspended. -
404 Source campaign not found or not owned by caller. -
422 Clone failed (invalid type, schema mismatch, etc.). -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

apiV1CampaignsTypeIdDelete

ApiV1CampaignsTypeIdDelete200Response apiV1CampaignsTypeIdDelete(type, id)

Soft-delete a campaign.

Sets `isdeleted=1`, `ispaused=1`, `dayactive=0`. The campaign and its history remain in the database for billing/stats reconciliation but stop serving immediately. Idempotent β€” deleting an already- deleted campaign returns 404.

Example

import {
  Configuration,
  CampaignsApi,
} from 'goadserver-sdk';
import type { ApiV1CampaignsTypeIdDeleteRequest } from 'goadserver-sdk';

async function example() {
  console.log("πŸš€ Testing goadserver-sdk SDK...");
  const config = new Configuration({ 
    // Configure HTTP bearer authorization: apiKey
    accessToken: "YOUR BEARER TOKEN",
  });
  const api = new CampaignsApi(config);

  const body = {
    // 'ron' | 'cpm' | 'flatrate' | 'directdeal' | 'rtb'
    type: type_example,
    // number
    id: 56,
  } satisfies ApiV1CampaignsTypeIdDeleteRequest;

  try {
    const data = await api.apiV1CampaignsTypeIdDelete(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
type ron, cpm, flatrate, directdeal, rtb [Defaults to undefined] [Enum: ron, cpm, flatrate, directdeal, rtb]
id number [Defaults to undefined]

Return type

ApiV1CampaignsTypeIdDelete200Response

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Deleted. -
403 Key lacks the required scope, or IP not in allowlist, or account suspended. -
404 Campaign not found or already deleted. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

apiV1CampaignsTypeIdFiltersFilterTypeFilterIdDelete

apiV1CampaignsTypeIdFiltersFilterTypeFilterIdDelete(type, id, filterType, filterId)

Detach a filter from this campaign.

Exclusion filter: removes the campaign id from the filter's `campaignids` CSV (if the CSV becomes empty, falls back to "0" meaning "applies to all campaigns" β€” same legacy sentinel). Inclusion filter: clears the campaign's FK column only if it currently points to this filter; otherwise returns 404.

Example

import {
  Configuration,
  CampaignsApi,
} from 'goadserver-sdk';
import type { ApiV1CampaignsTypeIdFiltersFilterTypeFilterIdDeleteRequest } from 'goadserver-sdk';

async function example() {
  console.log("πŸš€ Testing goadserver-sdk SDK...");
  const config = new Configuration({ 
    // Configure HTTP bearer authorization: apiKey
    accessToken: "YOUR BEARER TOKEN",
  });
  const api = new CampaignsApi(config);

  const body = {
    // 'ron' | 'rtb'
    type: type_example,
    // number
    id: 56,
    // string
    filterType: filterType_example,
    // number
    filterId: 56,
  } satisfies ApiV1CampaignsTypeIdFiltersFilterTypeFilterIdDeleteRequest;

  try {
    const data = await api.apiV1CampaignsTypeIdFiltersFilterTypeFilterIdDelete(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
type ron, rtb [Defaults to undefined] [Enum: ron, rtb]
id number [Defaults to undefined]
filterType string [Defaults to undefined]
filterId number [Defaults to undefined]

Return type

void (Empty response body)

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
200 Detached -
404 Not attached / campaign not found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

apiV1CampaignsTypeIdFiltersGet

ApiV1CampaignsTypeIdFiltersGet200Response apiV1CampaignsTypeIdFiltersGet(type, id)

List filters attached to this campaign.

Returns every filter (exclusion via `campaignids` membership, inclusion via FK columns) currently linked to this campaign. Only `ron` and `rtb` campaign types support filter linkage.

Example

import {
  Configuration,
  CampaignsApi,
} from 'goadserver-sdk';
import type { ApiV1CampaignsTypeIdFiltersGetRequest } from 'goadserver-sdk';

async function example() {
  console.log("πŸš€ Testing goadserver-sdk SDK...");
  const config = new Configuration({ 
    // Configure HTTP bearer authorization: apiKey
    accessToken: "YOUR BEARER TOKEN",
  });
  const api = new CampaignsApi(config);

  const body = {
    // 'ron' | 'rtb'
    type: type_example,
    // number
    id: 56,
  } satisfies ApiV1CampaignsTypeIdFiltersGetRequest;

  try {
    const data = await api.apiV1CampaignsTypeIdFiltersGet(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
type ron, rtb [Defaults to undefined] [Enum: ron, rtb]
id number [Defaults to undefined]

Return type

ApiV1CampaignsTypeIdFiltersGet200Response

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Linked filters -
404 Campaign not found -
422 Unsupported campaign type -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

apiV1CampaignsTypeIdFiltersPost

ApiV1CampaignsTypeIdFiltersPost200Response apiV1CampaignsTypeIdFiltersPost(type, id, apiV1CampaignsTypeIdFiltersPostRequest)

Attach a filter to this campaign.

For exclusion filters, appends the campaign id to the filter's `campaignids` CSV. For inclusion filters, sets the campaign's FK column to this filter (replacing any previous inclusion filter of the same kind).

Example

import {
  Configuration,
  CampaignsApi,
} from 'goadserver-sdk';
import type { ApiV1CampaignsTypeIdFiltersPostOperationRequest } from 'goadserver-sdk';

async function example() {
  console.log("πŸš€ Testing goadserver-sdk SDK...");
  const config = new Configuration({ 
    // Configure HTTP bearer authorization: apiKey
    accessToken: "YOUR BEARER TOKEN",
  });
  const api = new CampaignsApi(config);

  const body = {
    // 'ron' | 'rtb'
    type: type_example,
    // number
    id: 56,
    // ApiV1CampaignsTypeIdFiltersPostRequest
    apiV1CampaignsTypeIdFiltersPostRequest: ...,
  } satisfies ApiV1CampaignsTypeIdFiltersPostOperationRequest;

  try {
    const data = await api.apiV1CampaignsTypeIdFiltersPost(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
type ron, rtb [Defaults to undefined] [Enum: ron, rtb]
id number [Defaults to undefined]
apiV1CampaignsTypeIdFiltersPostRequest ApiV1CampaignsTypeIdFiltersPostRequest

Return type

ApiV1CampaignsTypeIdFiltersPost200Response

Authorization

apiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Attached -
404 Campaign or filter not found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

apiV1CampaignsTypeIdGet

object apiV1CampaignsTypeIdGet(type, id)

Get a single campaign.

Example

import {
  Configuration,
  CampaignsApi,
} from 'goadserver-sdk';
import type { ApiV1CampaignsTypeIdGetRequest } from 'goadserver-sdk';

async function example() {
  console.log("πŸš€ Testing goadserver-sdk SDK...");
  const config = new Configuration({ 
    // Configure HTTP bearer authorization: apiKey
    accessToken: "YOUR BEARER TOKEN",
  });
  const api = new CampaignsApi(config);

  const body = {
    // 'ron' | 'cpm' | 'flatrate' | 'directdeal' | 'rtb'
    type: type_example,
    // number
    id: 56,
  } satisfies ApiV1CampaignsTypeIdGetRequest;

  try {
    const data = await api.apiV1CampaignsTypeIdGet(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
type ron, cpm, flatrate, directdeal, rtb [Defaults to undefined] [Enum: ron, cpm, flatrate, directdeal, rtb]
id number [Defaults to undefined]

Return type

object

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Campaign -
404 Not found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

apiV1CampaignsTypeIdMinBidGet

ApiV1CampaignsTypeIdMinBidGet200Response apiV1CampaignsTypeIdMinBidGet(type, id)

Get the campaign's minimum acceptable CPC bid.

Returns the floor the platform will accept for this campaign, derived from the same logic the panel uses (admanager β†’ effectively zero, custom `fx_minprice`, or the `min_prices_ron` table matched against the campaign's targeting). Use this before bulk-updating bids so the optimiser doesn't push values below the floor and have them clamped or rejected.

Example

import {
  Configuration,
  CampaignsApi,
} from 'goadserver-sdk';
import type { ApiV1CampaignsTypeIdMinBidGetRequest } from 'goadserver-sdk';

async function example() {
  console.log("πŸš€ Testing goadserver-sdk SDK...");
  const config = new Configuration({ 
    // Configure HTTP bearer authorization: apiKey
    accessToken: "YOUR BEARER TOKEN",
  });
  const api = new CampaignsApi(config);

  const body = {
    // 'ron' | 'cpm' | 'flatrate' | 'directdeal' | 'rtb'
    type: type_example,
    // number
    id: 56,
  } satisfies ApiV1CampaignsTypeIdMinBidGetRequest;

  try {
    const data = await api.apiV1CampaignsTypeIdMinBidGet(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
type ron, cpm, flatrate, directdeal, rtb [Defaults to undefined] [Enum: ron, cpm, flatrate, directdeal, rtb]
id number [Defaults to undefined]

Return type

ApiV1CampaignsTypeIdMinBidGet200Response

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Minimum bid. -
403 Key lacks the required scope, or IP not in allowlist, or account suspended. -
404 Campaign not found. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

apiV1CampaignsTypePost

apiV1CampaignsTypePost(type, apiV1CampaignsTypePostRequest, dryRun, strict)

Create a new campaign (smart-default).

Creates a new campaign with sensible defaults applied for any field you don't send. Required: `name` + `ad_type`. Everything else (targeting, capping, schedule, …) defaults to "all/none" unless explicitly supplied β€” see `GET /api/v1/campaigns/{type}/_schema` for the full field list. The campaign always starts paused (`is_paused=true`) so you can attach ads via `POST /api/v1/campaigns/{type}/{id}/ads` and verify before activating. Flip the active flag when ready via `PATCH /api/v1/campaigns/{type}/{id}/active`. Modes: - `?dry_run=1` β€” validate and return the resolved field map without inserting. Useful for previewing what an LLM would create before charging it. - `?strict=1` β€” reject unknown field names with a 422 listing them. Without this, unknown keys are silently ignored.

Example

import {
  Configuration,
  CampaignsApi,
} from 'goadserver-sdk';
import type { ApiV1CampaignsTypePostOperationRequest } from 'goadserver-sdk';

async function example() {
  console.log("πŸš€ Testing goadserver-sdk SDK...");
  const config = new Configuration({ 
    // Configure HTTP bearer authorization: apiKey
    accessToken: "YOUR BEARER TOKEN",
  });
  const api = new CampaignsApi(config);

  const body = {
    // 'ron' | 'cpm' | 'flatrate' | 'directdeal' | 'rtb'
    type: type_example,
    // ApiV1CampaignsTypePostRequest
    apiV1CampaignsTypePostRequest: {"name":"My first API campaign","ad_type":2},
    // '1' (optional)
    dryRun: dryRun_example,
    // '1' (optional)
    strict: strict_example,
  } satisfies ApiV1CampaignsTypePostOperationRequest;

  try {
    const data = await api.apiV1CampaignsTypePost(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
type ron, cpm, flatrate, directdeal, rtb [Defaults to undefined] [Enum: ron, cpm, flatrate, directdeal, rtb]
apiV1CampaignsTypePostRequest ApiV1CampaignsTypePostRequest
dryRun 1 [Optional] [Defaults to undefined] [Enum: 1]
strict 1 [Optional] [Defaults to undefined] [Enum: 1]

Return type

void (Empty response body)

Authorization

apiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 Created. Body is the freshly-created campaign in the public projection (same shape as `GET /api/v1/campaigns/{type}/{id}`). -
200 When `?dry_run=1` β€” body is `{ dry_run: true, resolved: ..., would_insert: ... }`. -
422 Validation error (missing required, unknown field with `?strict=1`, …). -
403 Key lacks the required scope, or IP not in allowlist, or account suspended. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

apiV1CampaignsTypeSchemaAdsGet

ApiV1CampaignsTypeSchemaAdsGet200Response apiV1CampaignsTypeSchemaAdsGet(type)

Field metadata for ad creation.

Discovery endpoint mirroring `/_schema` for campaigns, scoped to ads. Lists every public field a `POST /campaigns/{type}/{campaignId}/ads` accepts, with type, required-flag, default, example, and description. Also returns a `creative_choice` block reminding the caller that exactly one of `banner_pool_id` / `creative_id` / `banner_url` / `banner_html` / `video_pool_id` must be set. Use the campaign-scoped variant `/api/v1/campaigns/{type}/{campaignId}/_schema/ads` to get the same payload narrowed to fields that apply to that specific campaign's ad type (returns `campaign_ad_type` so AI agents know which creative shape is appropriate).

Example

import {
  Configuration,
  CampaignsApi,
} from 'goadserver-sdk';
import type { ApiV1CampaignsTypeSchemaAdsGetRequest } from 'goadserver-sdk';

async function example() {
  console.log("πŸš€ Testing goadserver-sdk SDK...");
  const config = new Configuration({ 
    // Configure HTTP bearer authorization: apiKey
    accessToken: "YOUR BEARER TOKEN",
  });
  const api = new CampaignsApi(config);

  const body = {
    // 'ron' | 'cpm' | 'flatrate' | 'directdeal' | 'rtb'
    type: type_example,
  } satisfies ApiV1CampaignsTypeSchemaAdsGetRequest;

  try {
    const data = await api.apiV1CampaignsTypeSchemaAdsGet(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
type ron, cpm, flatrate, directdeal, rtb [Defaults to undefined] [Enum: ron, cpm, flatrate, directdeal, rtb]

Return type

ApiV1CampaignsTypeSchemaAdsGet200Response

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Ad-create field metadata. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

apiV1CampaignsTypeSchemaGet

ApiV1CampaignsTypeSchemaGet200Response apiV1CampaignsTypeSchemaGet(type)

Field metadata for create/update.

Discovery endpoint for AI agents and integrators. Returns the canonical list of public field names a `POST /api/v1/campaigns/{type}` accepts, with type, required-flag, default value, an example, and a one-line description. `ad_type` enumerates the active ad-type ids on the caller's tenant. Use this to drive form UIs, validate agent-generated payloads client-side, or feed into a function-calling LLM.

Example

import {
  Configuration,
  CampaignsApi,
} from 'goadserver-sdk';
import type { ApiV1CampaignsTypeSchemaGetRequest } from 'goadserver-sdk';

async function example() {
  console.log("πŸš€ Testing goadserver-sdk SDK...");
  const config = new Configuration({ 
    // Configure HTTP bearer authorization: apiKey
    accessToken: "YOUR BEARER TOKEN",
  });
  const api = new CampaignsApi(config);

  const body = {
    // 'ron' | 'cpm' | 'flatrate' | 'directdeal' | 'rtb'
    type: type_example,
  } satisfies ApiV1CampaignsTypeSchemaGetRequest;

  try {
    const data = await api.apiV1CampaignsTypeSchemaGet(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

Name Type Description Notes
type ron, cpm, flatrate, directdeal, rtb [Defaults to undefined] [Enum: ron, cpm, flatrate, directdeal, rtb]

Return type

ApiV1CampaignsTypeSchemaGet200Response

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Schema. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]