Skip to main content
These endpoints and fields still work for current integrations, but each has a newer replacement. Use the replacement in new integrations.
Ad units are the legacy creative model. They continue to work for current integrations. For new integrations, use ad groups and ads. A campaign contains ad groups, and an ad group contains ads.

Legacy fields

Legacy ad unit endpoints

The endpoints below create and link ad units.

POST /advertiser-dashboard/ad-units

Create an ad unit in your advertiser account. The response is 201.
string
required
The ad unit name, at most 500 characters.
string
The headline, at most 80 characters.
string
required
The description.
string
required
The landing page URL.
string
required
The ad text, at most 500 characters.
string
required
The call to action, at most 80 characters.
string
The favicon URL.
string
The image URL.
string
The brand that you advertise. Users see it. Send the product or company that you advertise. Do not send an internal account, workspace, or person label. Gravity uses it as the title of the ad when there is no headline.
array
UTM parameters as { "key": "...", "value": "..." } pairs.
If description, landing_page, static_ad_text, or static_cta is empty, the response is 422 with the names of the empty fields. The body rejects fields that it does not know with 422. This includes ad_text_mode and the fields that the server manages: source, status, review_status, review_reason, metadata, and generate_static_text.
Request
Response 201

POST /advertiser-dashboard/campaigns/{campaign_id}/ad-units/generate

Make draft ad units from a landing page URL.
string
required
The campaign ID.
string
required
The landing page URL that Gravity reads. It must be an http or https URL. If it is not valid, the response is 400.
integer
default:"3"
The number of draft ad units to make, from 1 to 5.
If Gravity cannot make ad units from the page (for example, the page blocks automated access), the response is 422.
Request
Response

POST /advertiser-dashboard/campaigns/{campaign_id}/ad-units

Add ad units to a campaign. The ad units that are already linked stay linked.
string
required
The campaign ID.
array
required
One or more ad unit IDs. Gravity removes duplicate IDs before it writes.
The response lists all the ad units that are now linked to the campaign. Gravity marks the linked units for review when necessary. If an approved campaign now has ad units with no review, Gravity sends the campaign to review again. Then Gravity starts the ad unit sync for the campaign in the background. If an ad unit is not in your account, the response is 404.
Request
Response

PUT /advertiser-dashboard/campaigns/{campaign_id}/ad-units

Replace the set of ad units on a campaign.
This call removes each linked ad unit that is not in ad_unit_ids. An empty list removes all the ad units from the campaign. To add ad units and keep the current ones, use the POST endpoint above.
string
required
The campaign ID.
array
required
The new ad unit IDs. Gravity removes duplicate IDs before it writes.
This endpoint has the same ownership checks and the same review and sync behavior as the POST endpoint.
Request
Response

PATCH /advertiser-dashboard/ad-units/{ad_unit_id}/archive

Archive an ad unit, or restore an archived ad unit. Each call changes the archived state.
string
required
The ad unit ID.
When you restore an ad unit, its status changes to "draft".
Request
Response