All URIs are relative to https://zernio.com/api
| Method | HTTP request | Description |
|---|---|---|
| bulkUpdateAdCampaignStatus | POST /v1/ads/campaigns/bulk-status | Pause or resume many campaigns |
| bulkUpdateAdCampaignStatusWithHttpInfo | POST /v1/ads/campaigns/bulk-status | Pause or resume many campaigns |
| deleteAdCampaign | DELETE /v1/ads/campaigns/{campaignId} | Delete a campaign |
| deleteAdCampaignWithHttpInfo | DELETE /v1/ads/campaigns/{campaignId} | Delete a campaign |
| duplicateAdCampaign | POST /v1/ads/campaigns/{campaignId}/duplicate | Duplicate a campaign |
| duplicateAdCampaignWithHttpInfo | POST /v1/ads/campaigns/{campaignId}/duplicate | Duplicate a campaign |
| getAdTree | GET /v1/ads/tree | Get campaign tree |
| getAdTreeWithHttpInfo | GET /v1/ads/tree | Get campaign tree |
| listAdCampaigns | GET /v1/ads/campaigns | List campaigns |
| listAdCampaignsWithHttpInfo | GET /v1/ads/campaigns | List campaigns |
| updateAdCampaign | PUT /v1/ads/campaigns/{campaignId} | Update a campaign (budget and/or bid strategy) |
| updateAdCampaignWithHttpInfo | PUT /v1/ads/campaigns/{campaignId} | Update a campaign (budget and/or bid strategy) |
| updateAdCampaignStatus | PUT /v1/ads/campaigns/{campaignId}/status | Pause or resume a campaign |
| updateAdCampaignStatusWithHttpInfo | PUT /v1/ads/campaigns/{campaignId}/status | Pause or resume a campaign |
| updateAdSet | PUT /v1/ads/ad-sets/{adSetId} | Update an ad set (budget, status, and/or bid strategy) |
| updateAdSetWithHttpInfo | PUT /v1/ads/ad-sets/{adSetId} | Update an ad set (budget, status, and/or bid strategy) |
| updateAdSetStatus | PUT /v1/ads/ad-sets/{adSetId}/status | Pause or resume a single ad set |
| updateAdSetStatusWithHttpInfo | PUT /v1/ads/ad-sets/{adSetId}/status | Pause or resume a single ad set |
BulkUpdateAdCampaignStatus200Response bulkUpdateAdCampaignStatus(bulkUpdateAdCampaignStatusRequest)
Pause or resume many campaigns
Process up to 50 campaigns in one call. Each campaign is updated concurrently and the response contains a per-campaign result so a single bad row does not fail the whole batch.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AdCampaignsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AdCampaignsApi apiInstance = new AdCampaignsApi(defaultClient);
BulkUpdateAdCampaignStatusRequest bulkUpdateAdCampaignStatusRequest = new BulkUpdateAdCampaignStatusRequest(); // BulkUpdateAdCampaignStatusRequest |
try {
BulkUpdateAdCampaignStatus200Response result = apiInstance.bulkUpdateAdCampaignStatus(bulkUpdateAdCampaignStatusRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AdCampaignsApi#bulkUpdateAdCampaignStatus");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| bulkUpdateAdCampaignStatusRequest | BulkUpdateAdCampaignStatusRequest |
BulkUpdateAdCampaignStatus200Response
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Per-campaign results | - |
| 400 | Invalid input | - |
| 401 | Unauthorized | - |
ApiResponse bulkUpdateAdCampaignStatus bulkUpdateAdCampaignStatusWithHttpInfo(bulkUpdateAdCampaignStatusRequest)
Pause or resume many campaigns
Process up to 50 campaigns in one call. Each campaign is updated concurrently and the response contains a per-campaign result so a single bad row does not fail the whole batch.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.ApiResponse;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AdCampaignsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AdCampaignsApi apiInstance = new AdCampaignsApi(defaultClient);
BulkUpdateAdCampaignStatusRequest bulkUpdateAdCampaignStatusRequest = new BulkUpdateAdCampaignStatusRequest(); // BulkUpdateAdCampaignStatusRequest |
try {
ApiResponse<BulkUpdateAdCampaignStatus200Response> response = apiInstance.bulkUpdateAdCampaignStatusWithHttpInfo(bulkUpdateAdCampaignStatusRequest);
System.out.println("Status code: " + response.getStatusCode());
System.out.println("Response headers: " + response.getHeaders());
System.out.println("Response body: " + response.getData());
} catch (ApiException e) {
System.err.println("Exception when calling AdCampaignsApi#bulkUpdateAdCampaignStatus");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
System.err.println("Reason: " + e.getResponseBody());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| bulkUpdateAdCampaignStatusRequest | BulkUpdateAdCampaignStatusRequest |
ApiResponse<BulkUpdateAdCampaignStatus200Response>
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Per-campaign results | - |
| 400 | Invalid input | - |
| 401 | Unauthorized | - |
DeleteAdCampaign200Response deleteAdCampaign(campaignId, deleteAdCampaignRequest)
Delete a campaign
Deletes the whole campaign on the platform, cascading to its ad sets and ads. Locally, all Ad documents for this campaign are marked `status: cancelled`. Meta-only for now. Other platforms return 501 Not Implemented — fall back to DELETE /v1/ads/{adId} per ad in the meantime.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AdCampaignsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AdCampaignsApi apiInstance = new AdCampaignsApi(defaultClient);
String campaignId = "campaignId_example"; // String | Platform campaign ID
DeleteAdCampaignRequest deleteAdCampaignRequest = new DeleteAdCampaignRequest(); // DeleteAdCampaignRequest |
try {
DeleteAdCampaign200Response result = apiInstance.deleteAdCampaign(campaignId, deleteAdCampaignRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AdCampaignsApi#deleteAdCampaign");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| campaignId | String | Platform campaign ID | |
| deleteAdCampaignRequest | DeleteAdCampaignRequest |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Campaign deleted | - |
| 401 | Unauthorized | - |
| 404 | Campaign not found | - |
| 501 | Operation not supported on this platform | - |
ApiResponse deleteAdCampaign deleteAdCampaignWithHttpInfo(campaignId, deleteAdCampaignRequest)
Delete a campaign
Deletes the whole campaign on the platform, cascading to its ad sets and ads. Locally, all Ad documents for this campaign are marked `status: cancelled`. Meta-only for now. Other platforms return 501 Not Implemented — fall back to DELETE /v1/ads/{adId} per ad in the meantime.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.ApiResponse;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AdCampaignsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AdCampaignsApi apiInstance = new AdCampaignsApi(defaultClient);
String campaignId = "campaignId_example"; // String | Platform campaign ID
DeleteAdCampaignRequest deleteAdCampaignRequest = new DeleteAdCampaignRequest(); // DeleteAdCampaignRequest |
try {
ApiResponse<DeleteAdCampaign200Response> response = apiInstance.deleteAdCampaignWithHttpInfo(campaignId, deleteAdCampaignRequest);
System.out.println("Status code: " + response.getStatusCode());
System.out.println("Response headers: " + response.getHeaders());
System.out.println("Response body: " + response.getData());
} catch (ApiException e) {
System.err.println("Exception when calling AdCampaignsApi#deleteAdCampaign");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
System.err.println("Reason: " + e.getResponseBody());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| campaignId | String | Platform campaign ID | |
| deleteAdCampaignRequest | DeleteAdCampaignRequest |
ApiResponse<DeleteAdCampaign200Response>
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Campaign deleted | - |
| 401 | Unauthorized | - |
| 404 | Campaign not found | - |
| 501 | Operation not supported on this platform | - |
DuplicateAdCampaign200Response duplicateAdCampaign(campaignId, duplicateAdCampaignRequest)
Duplicate a campaign
Duplicates a campaign, including its ad sets, ads, creatives, and targeting by default (`deepCopy: true`). The copy is created paused so callers can review before launching. Per-platform implementation: - Meta uses the native `POST /{campaign-id}/copies` endpoint. - TikTok has no native copy primitive; Zernio walks the source graph (`/v2/campaign/get/`, `/v2/adgroup/get/`, `/v2/ad/get/`) and recreates each entity via the corresponding `/create/` endpoints, carrying over budget / targeting / bid_type / bid_price / deep_bid_type / creative fields. Spark Ad linkage (`tiktok_item_id`) is preserved. The new hierarchy is asynchronous to materialize in our DB — we trigger sync discovery automatically. Set `syncAfter: false` to skip and poll `/v1/ads/tree` on your own cadence. Other platforms return 501 Not Implemented.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AdCampaignsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AdCampaignsApi apiInstance = new AdCampaignsApi(defaultClient);
String campaignId = "campaignId_example"; // String | Source platform campaign ID
DuplicateAdCampaignRequest duplicateAdCampaignRequest = new DuplicateAdCampaignRequest(); // DuplicateAdCampaignRequest |
try {
DuplicateAdCampaign200Response result = apiInstance.duplicateAdCampaign(campaignId, duplicateAdCampaignRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AdCampaignsApi#duplicateAdCampaign");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| campaignId | String | Source platform campaign ID | |
| duplicateAdCampaignRequest | DuplicateAdCampaignRequest |
DuplicateAdCampaign200Response
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Campaign duplicated | - |
| 400 | Invalid input | - |
| 401 | Unauthorized | - |
| 404 | Source campaign not found | - |
| 501 | Operation not supported on this platform | - |
ApiResponse duplicateAdCampaign duplicateAdCampaignWithHttpInfo(campaignId, duplicateAdCampaignRequest)
Duplicate a campaign
Duplicates a campaign, including its ad sets, ads, creatives, and targeting by default (`deepCopy: true`). The copy is created paused so callers can review before launching. Per-platform implementation: - Meta uses the native `POST /{campaign-id}/copies` endpoint. - TikTok has no native copy primitive; Zernio walks the source graph (`/v2/campaign/get/`, `/v2/adgroup/get/`, `/v2/ad/get/`) and recreates each entity via the corresponding `/create/` endpoints, carrying over budget / targeting / bid_type / bid_price / deep_bid_type / creative fields. Spark Ad linkage (`tiktok_item_id`) is preserved. The new hierarchy is asynchronous to materialize in our DB — we trigger sync discovery automatically. Set `syncAfter: false` to skip and poll `/v1/ads/tree` on your own cadence. Other platforms return 501 Not Implemented.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.ApiResponse;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AdCampaignsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AdCampaignsApi apiInstance = new AdCampaignsApi(defaultClient);
String campaignId = "campaignId_example"; // String | Source platform campaign ID
DuplicateAdCampaignRequest duplicateAdCampaignRequest = new DuplicateAdCampaignRequest(); // DuplicateAdCampaignRequest |
try {
ApiResponse<DuplicateAdCampaign200Response> response = apiInstance.duplicateAdCampaignWithHttpInfo(campaignId, duplicateAdCampaignRequest);
System.out.println("Status code: " + response.getStatusCode());
System.out.println("Response headers: " + response.getHeaders());
System.out.println("Response body: " + response.getData());
} catch (ApiException e) {
System.err.println("Exception when calling AdCampaignsApi#duplicateAdCampaign");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
System.err.println("Reason: " + e.getResponseBody());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| campaignId | String | Source platform campaign ID | |
| duplicateAdCampaignRequest | DuplicateAdCampaignRequest |
ApiResponse<DuplicateAdCampaign200Response>
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Campaign duplicated | - |
| 400 | Invalid input | - |
| 401 | Unauthorized | - |
| 404 | Source campaign not found | - |
| 501 | Operation not supported on this platform | - |
GetAdTree200Response getAdTree(page, limit, source, platform, status, adAccountId, accountId, profileId, fromDate, toDate)
Get campaign tree
Returns a nested Campaign > Ad Set > Ad hierarchy with rolled-up metrics at each level. Uses a two-stage aggregation: ads are grouped into ad sets, then ad sets into campaigns. Metrics are computed over an optional date range, then rolled up from ad level to ad set and campaign levels. Pagination is at the campaign level. Ads without a campaign or ad set ID are grouped into synthetic "Ungrouped" buckets. If no date range is provided, defaults to the last 90 days. Date range is capped at 90 days max.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AdCampaignsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AdCampaignsApi apiInstance = new AdCampaignsApi(defaultClient);
Integer page = 1; // Integer | Page number (1-based)
Integer limit = 20; // Integer | Campaigns per page
String source = "zernio"; // String | `all` (default) returns both Zernio-created ads and those discovered from the platform's ad manager — matches the web UI's default view. Pass `zernio` to restrict to isExternal=false only. Status is NOT filtered by default — use the `status` param for that.
String platform = "facebook"; // String |
AdStatus status = AdStatus.fromValue("active"); // AdStatus | Filter by derived campaign status (post-aggregation)
String adAccountId = "adAccountId_example"; // String | Platform ad account ID
String accountId = "accountId_example"; // String | Social account ID
String profileId = "profileId_example"; // String | Profile ID
LocalDate fromDate = LocalDate.now(); // LocalDate | Start of metrics date range (YYYY-MM-DD). Defaults to 90 days ago.
LocalDate toDate = LocalDate.now(); // LocalDate | End of metrics date range (YYYY-MM-DD). Defaults to today. Max 90-day range.
try {
GetAdTree200Response result = apiInstance.getAdTree(page, limit, source, platform, status, adAccountId, accountId, profileId, fromDate, toDate);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AdCampaignsApi#getAdTree");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| page | Integer | Page number (1-based) | [optional] [default to 1] |
| limit | Integer | Campaigns per page | [optional] [default to 20] |
| source | String | `all` (default) returns both Zernio-created ads and those discovered from the platform's ad manager — matches the web UI's default view. Pass `zernio` to restrict to isExternal=false only. Status is NOT filtered by default — use the `status` param for that. | [optional] [default to all] [enum: zernio, all] |
| platform | String | [optional] [enum: facebook, instagram, tiktok, linkedin, pinterest, google, twitter] | |
| status | AdStatus | Filter by derived campaign status (post-aggregation) | [optional] [enum: active, paused, pending_review, rejected, completed, cancelled, error] |
| adAccountId | String | Platform ad account ID | [optional] |
| accountId | String | Social account ID | [optional] |
| profileId | String | Profile ID | [optional] |
| fromDate | LocalDate | Start of metrics date range (YYYY-MM-DD). Defaults to 90 days ago. | [optional] |
| toDate | LocalDate | End of metrics date range (YYYY-MM-DD). Defaults to today. Max 90-day range. | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Nested campaign tree with pagination | - |
| 401 | Unauthorized | - |
| 403 | Ads add-on required | - |
ApiResponse getAdTree getAdTreeWithHttpInfo(page, limit, source, platform, status, adAccountId, accountId, profileId, fromDate, toDate)
Get campaign tree
Returns a nested Campaign > Ad Set > Ad hierarchy with rolled-up metrics at each level. Uses a two-stage aggregation: ads are grouped into ad sets, then ad sets into campaigns. Metrics are computed over an optional date range, then rolled up from ad level to ad set and campaign levels. Pagination is at the campaign level. Ads without a campaign or ad set ID are grouped into synthetic "Ungrouped" buckets. If no date range is provided, defaults to the last 90 days. Date range is capped at 90 days max.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.ApiResponse;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AdCampaignsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AdCampaignsApi apiInstance = new AdCampaignsApi(defaultClient);
Integer page = 1; // Integer | Page number (1-based)
Integer limit = 20; // Integer | Campaigns per page
String source = "zernio"; // String | `all` (default) returns both Zernio-created ads and those discovered from the platform's ad manager — matches the web UI's default view. Pass `zernio` to restrict to isExternal=false only. Status is NOT filtered by default — use the `status` param for that.
String platform = "facebook"; // String |
AdStatus status = AdStatus.fromValue("active"); // AdStatus | Filter by derived campaign status (post-aggregation)
String adAccountId = "adAccountId_example"; // String | Platform ad account ID
String accountId = "accountId_example"; // String | Social account ID
String profileId = "profileId_example"; // String | Profile ID
LocalDate fromDate = LocalDate.now(); // LocalDate | Start of metrics date range (YYYY-MM-DD). Defaults to 90 days ago.
LocalDate toDate = LocalDate.now(); // LocalDate | End of metrics date range (YYYY-MM-DD). Defaults to today. Max 90-day range.
try {
ApiResponse<GetAdTree200Response> response = apiInstance.getAdTreeWithHttpInfo(page, limit, source, platform, status, adAccountId, accountId, profileId, fromDate, toDate);
System.out.println("Status code: " + response.getStatusCode());
System.out.println("Response headers: " + response.getHeaders());
System.out.println("Response body: " + response.getData());
} catch (ApiException e) {
System.err.println("Exception when calling AdCampaignsApi#getAdTree");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
System.err.println("Reason: " + e.getResponseBody());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| page | Integer | Page number (1-based) | [optional] [default to 1] |
| limit | Integer | Campaigns per page | [optional] [default to 20] |
| source | String | `all` (default) returns both Zernio-created ads and those discovered from the platform's ad manager — matches the web UI's default view. Pass `zernio` to restrict to isExternal=false only. Status is NOT filtered by default — use the `status` param for that. | [optional] [default to all] [enum: zernio, all] |
| platform | String | [optional] [enum: facebook, instagram, tiktok, linkedin, pinterest, google, twitter] | |
| status | AdStatus | Filter by derived campaign status (post-aggregation) | [optional] [enum: active, paused, pending_review, rejected, completed, cancelled, error] |
| adAccountId | String | Platform ad account ID | [optional] |
| accountId | String | Social account ID | [optional] |
| profileId | String | Profile ID | [optional] |
| fromDate | LocalDate | Start of metrics date range (YYYY-MM-DD). Defaults to 90 days ago. | [optional] |
| toDate | LocalDate | End of metrics date range (YYYY-MM-DD). Defaults to today. Max 90-day range. | [optional] |
ApiResponse<GetAdTree200Response>
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Nested campaign tree with pagination | - |
| 401 | Unauthorized | - |
| 403 | Ads add-on required | - |
ListAdCampaigns200Response listAdCampaigns(page, limit, source, platform, status, adAccountId, accountId, profileId)
List campaigns
Returns campaigns as virtual aggregations over ad documents grouped by platform campaign ID. Metrics (spend, impressions, clicks, etc.) are summed across all ads in each campaign. Campaign status is derived from child ad statuses (active > pending_review > paused > error > completed > cancelled > rejected).
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AdCampaignsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AdCampaignsApi apiInstance = new AdCampaignsApi(defaultClient);
Integer page = 1; // Integer | Page number (1-based)
Integer limit = 20; // Integer |
String source = "zernio"; // String | `all` (default) returns both Zernio-created ads and those discovered from the platform's ad manager — matches the web UI's default view. Pass `zernio` to restrict to isExternal=false only. Status is NOT filtered by default — use the `status` param for that.
String platform = "facebook"; // String |
AdStatus status = AdStatus.fromValue("active"); // AdStatus | Filter by derived campaign status (post-aggregation)
String adAccountId = "adAccountId_example"; // String | Platform ad account ID (e.g. act_123 for Meta)
String accountId = "accountId_example"; // String | Social account ID
String profileId = "profileId_example"; // String | Profile ID
try {
ListAdCampaigns200Response result = apiInstance.listAdCampaigns(page, limit, source, platform, status, adAccountId, accountId, profileId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AdCampaignsApi#listAdCampaigns");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| page | Integer | Page number (1-based) | [optional] [default to 1] |
| limit | Integer | [optional] [default to 20] | |
| source | String | `all` (default) returns both Zernio-created ads and those discovered from the platform's ad manager — matches the web UI's default view. Pass `zernio` to restrict to isExternal=false only. Status is NOT filtered by default — use the `status` param for that. | [optional] [default to all] [enum: zernio, all] |
| platform | String | [optional] [enum: facebook, instagram, tiktok, linkedin, pinterest, google, twitter] | |
| status | AdStatus | Filter by derived campaign status (post-aggregation) | [optional] [enum: active, paused, pending_review, rejected, completed, cancelled, error] |
| adAccountId | String | Platform ad account ID (e.g. act_123 for Meta) | [optional] |
| accountId | String | Social account ID | [optional] |
| profileId | String | Profile ID | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Paginated campaigns | - |
| 401 | Unauthorized | - |
| 403 | Ads add-on required | - |
ApiResponse listAdCampaigns listAdCampaignsWithHttpInfo(page, limit, source, platform, status, adAccountId, accountId, profileId)
List campaigns
Returns campaigns as virtual aggregations over ad documents grouped by platform campaign ID. Metrics (spend, impressions, clicks, etc.) are summed across all ads in each campaign. Campaign status is derived from child ad statuses (active > pending_review > paused > error > completed > cancelled > rejected).
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.ApiResponse;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AdCampaignsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AdCampaignsApi apiInstance = new AdCampaignsApi(defaultClient);
Integer page = 1; // Integer | Page number (1-based)
Integer limit = 20; // Integer |
String source = "zernio"; // String | `all` (default) returns both Zernio-created ads and those discovered from the platform's ad manager — matches the web UI's default view. Pass `zernio` to restrict to isExternal=false only. Status is NOT filtered by default — use the `status` param for that.
String platform = "facebook"; // String |
AdStatus status = AdStatus.fromValue("active"); // AdStatus | Filter by derived campaign status (post-aggregation)
String adAccountId = "adAccountId_example"; // String | Platform ad account ID (e.g. act_123 for Meta)
String accountId = "accountId_example"; // String | Social account ID
String profileId = "profileId_example"; // String | Profile ID
try {
ApiResponse<ListAdCampaigns200Response> response = apiInstance.listAdCampaignsWithHttpInfo(page, limit, source, platform, status, adAccountId, accountId, profileId);
System.out.println("Status code: " + response.getStatusCode());
System.out.println("Response headers: " + response.getHeaders());
System.out.println("Response body: " + response.getData());
} catch (ApiException e) {
System.err.println("Exception when calling AdCampaignsApi#listAdCampaigns");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
System.err.println("Reason: " + e.getResponseBody());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| page | Integer | Page number (1-based) | [optional] [default to 1] |
| limit | Integer | [optional] [default to 20] | |
| source | String | `all` (default) returns both Zernio-created ads and those discovered from the platform's ad manager — matches the web UI's default view. Pass `zernio` to restrict to isExternal=false only. Status is NOT filtered by default — use the `status` param for that. | [optional] [default to all] [enum: zernio, all] |
| platform | String | [optional] [enum: facebook, instagram, tiktok, linkedin, pinterest, google, twitter] | |
| status | AdStatus | Filter by derived campaign status (post-aggregation) | [optional] [enum: active, paused, pending_review, rejected, completed, cancelled, error] |
| adAccountId | String | Platform ad account ID (e.g. act_123 for Meta) | [optional] |
| accountId | String | Social account ID | [optional] |
| profileId | String | Profile ID | [optional] |
ApiResponse<ListAdCampaigns200Response>
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Paginated campaigns | - |
| 401 | Unauthorized | - |
| 403 | Ads add-on required | - |
UpdateAdCampaign200Response updateAdCampaign(campaignId, updateAdCampaignRequest)
Update a campaign (budget and/or bid strategy)
Campaign-level edits. At least one of `budget` or `bidStrategy` is required. - `budget` updates the CBO (Campaign Budget Optimization) budget. For ABO campaigns (where the budget lives on the ad set), use PUT /v1/ads/ad-sets/{adSetId} instead — this endpoint will return 409 with code BUDGET_LEVEL_MISMATCH. - `bidStrategy` sets the campaign-level default bid strategy. Per Meta's spec, `bid_amount` and `bid_constraints` do NOT exist at the campaign level — pass them via PUT /v1/ads/ad-sets/{adSetId}. Meta-only for now. Other platforms return 501 Not Implemented.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AdCampaignsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AdCampaignsApi apiInstance = new AdCampaignsApi(defaultClient);
String campaignId = "campaignId_example"; // String | Platform campaign ID
UpdateAdCampaignRequest updateAdCampaignRequest = new UpdateAdCampaignRequest(); // UpdateAdCampaignRequest |
try {
UpdateAdCampaign200Response result = apiInstance.updateAdCampaign(campaignId, updateAdCampaignRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AdCampaignsApi#updateAdCampaign");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| campaignId | String | Platform campaign ID | |
| updateAdCampaignRequest | UpdateAdCampaignRequest |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Campaign updated | - |
| 400 | Invalid input | - |
| 401 | Unauthorized | - |
| 404 | Campaign not found | - |
| 409 | Campaign is ABO — route to /v1/ads/ad-sets/{adSetId} instead | - |
| 501 | Operation not supported on this platform | - |
ApiResponse updateAdCampaign updateAdCampaignWithHttpInfo(campaignId, updateAdCampaignRequest)
Update a campaign (budget and/or bid strategy)
Campaign-level edits. At least one of `budget` or `bidStrategy` is required. - `budget` updates the CBO (Campaign Budget Optimization) budget. For ABO campaigns (where the budget lives on the ad set), use PUT /v1/ads/ad-sets/{adSetId} instead — this endpoint will return 409 with code BUDGET_LEVEL_MISMATCH. - `bidStrategy` sets the campaign-level default bid strategy. Per Meta's spec, `bid_amount` and `bid_constraints` do NOT exist at the campaign level — pass them via PUT /v1/ads/ad-sets/{adSetId}. Meta-only for now. Other platforms return 501 Not Implemented.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.ApiResponse;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AdCampaignsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AdCampaignsApi apiInstance = new AdCampaignsApi(defaultClient);
String campaignId = "campaignId_example"; // String | Platform campaign ID
UpdateAdCampaignRequest updateAdCampaignRequest = new UpdateAdCampaignRequest(); // UpdateAdCampaignRequest |
try {
ApiResponse<UpdateAdCampaign200Response> response = apiInstance.updateAdCampaignWithHttpInfo(campaignId, updateAdCampaignRequest);
System.out.println("Status code: " + response.getStatusCode());
System.out.println("Response headers: " + response.getHeaders());
System.out.println("Response body: " + response.getData());
} catch (ApiException e) {
System.err.println("Exception when calling AdCampaignsApi#updateAdCampaign");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
System.err.println("Reason: " + e.getResponseBody());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| campaignId | String | Platform campaign ID | |
| updateAdCampaignRequest | UpdateAdCampaignRequest |
ApiResponse<UpdateAdCampaign200Response>
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Campaign updated | - |
| 400 | Invalid input | - |
| 401 | Unauthorized | - |
| 404 | Campaign not found | - |
| 409 | Campaign is ABO — route to /v1/ads/ad-sets/{adSetId} instead | - |
| 501 | Operation not supported on this platform | - |
UpdateAdCampaignStatus200Response updateAdCampaignStatus(campaignId, updateAdCampaignStatusRequest)
Pause or resume a campaign
Updates the status of all ads in a campaign. Makes one platform API call (not per-ad) since status cascades through the campaign hierarchy. Ads in terminal statuses (rejected, completed, cancelled) are automatically skipped.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AdCampaignsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AdCampaignsApi apiInstance = new AdCampaignsApi(defaultClient);
String campaignId = "campaignId_example"; // String | Platform campaign ID
UpdateAdCampaignStatusRequest updateAdCampaignStatusRequest = new UpdateAdCampaignStatusRequest(); // UpdateAdCampaignStatusRequest |
try {
UpdateAdCampaignStatus200Response result = apiInstance.updateAdCampaignStatus(campaignId, updateAdCampaignStatusRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AdCampaignsApi#updateAdCampaignStatus");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| campaignId | String | Platform campaign ID | |
| updateAdCampaignStatusRequest | UpdateAdCampaignStatusRequest |
UpdateAdCampaignStatus200Response
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Campaign status updated | - |
| 400 | Invalid input or campaign spans multiple social accounts | - |
| 401 | Unauthorized | - |
| 404 | No ads found for this campaign | - |
ApiResponse updateAdCampaignStatus updateAdCampaignStatusWithHttpInfo(campaignId, updateAdCampaignStatusRequest)
Pause or resume a campaign
Updates the status of all ads in a campaign. Makes one platform API call (not per-ad) since status cascades through the campaign hierarchy. Ads in terminal statuses (rejected, completed, cancelled) are automatically skipped.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.ApiResponse;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AdCampaignsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AdCampaignsApi apiInstance = new AdCampaignsApi(defaultClient);
String campaignId = "campaignId_example"; // String | Platform campaign ID
UpdateAdCampaignStatusRequest updateAdCampaignStatusRequest = new UpdateAdCampaignStatusRequest(); // UpdateAdCampaignStatusRequest |
try {
ApiResponse<UpdateAdCampaignStatus200Response> response = apiInstance.updateAdCampaignStatusWithHttpInfo(campaignId, updateAdCampaignStatusRequest);
System.out.println("Status code: " + response.getStatusCode());
System.out.println("Response headers: " + response.getHeaders());
System.out.println("Response body: " + response.getData());
} catch (ApiException e) {
System.err.println("Exception when calling AdCampaignsApi#updateAdCampaignStatus");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
System.err.println("Reason: " + e.getResponseBody());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| campaignId | String | Platform campaign ID | |
| updateAdCampaignStatusRequest | UpdateAdCampaignStatusRequest |
ApiResponse<UpdateAdCampaignStatus200Response>
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Campaign status updated | - |
| 400 | Invalid input or campaign spans multiple social accounts | - |
| 401 | Unauthorized | - |
| 404 | No ads found for this campaign | - |
UpdateAdSet200Response updateAdSet(adSetId, updateAdSetRequest)
Update an ad set (budget, status, and/or bid strategy)
Ad-set-level writes. Use this for ABO budget updates, ad-set-scoped pause/resume, and bid-strategy edits. At least one of `budget`, `status`, or `bidStrategy` is required. Bid strategy compatibility (per Meta's spec): - `LOWEST_COST_WITHOUT_CAP`: no `bidAmount`, no `roasAverageFloor`. - `LOWEST_COST_WITH_BID_CAP` / `COST_CAP`: `bidAmount` REQUIRED (whole currency units). - `LOWEST_COST_WITH_MIN_ROAS`: `roasAverageFloor` REQUIRED (decimal multiplier, e.g. 2.0 = 2.0x ROAS). When updating `budget` on an ABO campaign: if the parent campaign is CBO, the response is 409 with code BUDGET_LEVEL_MISMATCH — route to PUT /v1/ads/campaigns/{campaignId} instead.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AdCampaignsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AdCampaignsApi apiInstance = new AdCampaignsApi(defaultClient);
String adSetId = "adSetId_example"; // String | Platform ad set ID
UpdateAdSetRequest updateAdSetRequest = new UpdateAdSetRequest(); // UpdateAdSetRequest |
try {
UpdateAdSet200Response result = apiInstance.updateAdSet(adSetId, updateAdSetRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AdCampaignsApi#updateAdSet");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| adSetId | String | Platform ad set ID | |
| updateAdSetRequest | UpdateAdSetRequest |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Ad set updated | - |
| 400 | Invalid input | - |
| 401 | Unauthorized | - |
| 404 | Ad set not found | - |
| 409 | Campaign is CBO — route to /v1/ads/campaigns/{campaignId} instead | - |
| 501 | bidStrategy not supported on the platform (Meta + TikTok only) | - |
ApiResponse updateAdSet updateAdSetWithHttpInfo(adSetId, updateAdSetRequest)
Update an ad set (budget, status, and/or bid strategy)
Ad-set-level writes. Use this for ABO budget updates, ad-set-scoped pause/resume, and bid-strategy edits. At least one of `budget`, `status`, or `bidStrategy` is required. Bid strategy compatibility (per Meta's spec): - `LOWEST_COST_WITHOUT_CAP`: no `bidAmount`, no `roasAverageFloor`. - `LOWEST_COST_WITH_BID_CAP` / `COST_CAP`: `bidAmount` REQUIRED (whole currency units). - `LOWEST_COST_WITH_MIN_ROAS`: `roasAverageFloor` REQUIRED (decimal multiplier, e.g. 2.0 = 2.0x ROAS). When updating `budget` on an ABO campaign: if the parent campaign is CBO, the response is 409 with code BUDGET_LEVEL_MISMATCH — route to PUT /v1/ads/campaigns/{campaignId} instead.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.ApiResponse;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AdCampaignsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AdCampaignsApi apiInstance = new AdCampaignsApi(defaultClient);
String adSetId = "adSetId_example"; // String | Platform ad set ID
UpdateAdSetRequest updateAdSetRequest = new UpdateAdSetRequest(); // UpdateAdSetRequest |
try {
ApiResponse<UpdateAdSet200Response> response = apiInstance.updateAdSetWithHttpInfo(adSetId, updateAdSetRequest);
System.out.println("Status code: " + response.getStatusCode());
System.out.println("Response headers: " + response.getHeaders());
System.out.println("Response body: " + response.getData());
} catch (ApiException e) {
System.err.println("Exception when calling AdCampaignsApi#updateAdSet");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
System.err.println("Reason: " + e.getResponseBody());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| adSetId | String | Platform ad set ID | |
| updateAdSetRequest | UpdateAdSetRequest |
ApiResponse<UpdateAdSet200Response>
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Ad set updated | - |
| 400 | Invalid input | - |
| 401 | Unauthorized | - |
| 404 | Ad set not found | - |
| 409 | Campaign is CBO — route to /v1/ads/campaigns/{campaignId} instead | - |
| 501 | bidStrategy not supported on the platform (Meta + TikTok only) | - |
UpdateAdSetStatus200Response updateAdSetStatus(adSetId, updateAdCampaignStatusRequest)
Pause or resume a single ad set
Ad-set-scoped pause/resume (doesn't touch sibling ad sets). Thin wrapper over PUT /v1/ads/ad-sets/{adSetId} for callers that only want the status toggle and prefer a symmetric URL to /v1/ads/campaigns/{campaignId}/status.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AdCampaignsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AdCampaignsApi apiInstance = new AdCampaignsApi(defaultClient);
String adSetId = "adSetId_example"; // String | Platform ad set ID
UpdateAdCampaignStatusRequest updateAdCampaignStatusRequest = new UpdateAdCampaignStatusRequest(); // UpdateAdCampaignStatusRequest |
try {
UpdateAdSetStatus200Response result = apiInstance.updateAdSetStatus(adSetId, updateAdCampaignStatusRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AdCampaignsApi#updateAdSetStatus");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| adSetId | String | Platform ad set ID | |
| updateAdCampaignStatusRequest | UpdateAdCampaignStatusRequest |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Ad set status updated | - |
| 400 | Invalid input | - |
| 401 | Unauthorized | - |
| 404 | Ad set not found | - |
ApiResponse updateAdSetStatus updateAdSetStatusWithHttpInfo(adSetId, updateAdCampaignStatusRequest)
Pause or resume a single ad set
Ad-set-scoped pause/resume (doesn't touch sibling ad sets). Thin wrapper over PUT /v1/ads/ad-sets/{adSetId} for callers that only want the status toggle and prefer a symmetric URL to /v1/ads/campaigns/{campaignId}/status.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.ApiResponse;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AdCampaignsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AdCampaignsApi apiInstance = new AdCampaignsApi(defaultClient);
String adSetId = "adSetId_example"; // String | Platform ad set ID
UpdateAdCampaignStatusRequest updateAdCampaignStatusRequest = new UpdateAdCampaignStatusRequest(); // UpdateAdCampaignStatusRequest |
try {
ApiResponse<UpdateAdSetStatus200Response> response = apiInstance.updateAdSetStatusWithHttpInfo(adSetId, updateAdCampaignStatusRequest);
System.out.println("Status code: " + response.getStatusCode());
System.out.println("Response headers: " + response.getHeaders());
System.out.println("Response body: " + response.getData());
} catch (ApiException e) {
System.err.println("Exception when calling AdCampaignsApi#updateAdSetStatus");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
System.err.println("Reason: " + e.getResponseBody());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| adSetId | String | Platform ad set ID | |
| updateAdCampaignStatusRequest | UpdateAdCampaignStatusRequest |
ApiResponse<UpdateAdSetStatus200Response>
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Ad set status updated | - |
| 400 | Invalid input | - |
| 401 | Unauthorized | - |
| 404 | Ad set not found | - |